Skip to content

SPDX 3.0.1 Gap - Duplicate/Redundant Relationships #296

Description

@pellecchialuigi

As per elisa-tech/Safety_Architecture_WG#18 - Gap 1: Duplicate/Redundant Relationships

Current: For each snippet-to-requirement mapping, there is a contains relationship (API file → snippet) AND a separate hasRequirement relationship (snippet → requirement). When a snippet maps to multiple requirements, the contains relationship is repeated identically. For example, spdx:relationship:2, 4, 6, 8, 10 are all identical contains from spdx:file:basil:api:352 to spdx:snippet:api:352:1.

SPDX 3.0.1 best practice: The contains relationship should appear once per snippet, and hasRequirement should reference multiple targets in its to array rather than creating separate relationships per requirement.

Impact: The export produces inflated, redundant JSON-LD that obscures the actual traceability structure. Any SPDX-aware tooling processing the output must deduplicate relationships to build an accurate graph.

Fix: Deduplicate contains relationships (one per snippet) and consolidate hasRequirement targets into a single relationship per snippet with multiple entries in the to array.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions