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.
As per elisa-tech/Safety_Architecture_WG#18 - Gap 1: Duplicate/Redundant Relationships
Current: For each snippet-to-requirement mapping, there is a
containsrelationship (API file → snippet) AND a separatehasRequirementrelationship (snippet → requirement). When a snippet maps to multiple requirements, thecontainsrelationship is repeated identically. For example,spdx:relationship:2,4,6,8,10are all identicalcontainsfromspdx:file:basil:api:352tospdx:snippet:api:352:1.SPDX 3.0.1 best practice: The
containsrelationship should appear once per snippet, andhasRequirementshould reference multiple targets in itstoarray 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
containsrelationships (one per snippet) and consolidatehasRequirementtargets into a single relationship per snippet with multiple entries in thetoarray.