spdx / tools

SPDX Tools
Apache License 2.0
127 stars 69 forks source link

Incorrect RDF for NOASSERTION related SPDX element #234

Open goneall opened 4 years ago

goneall commented 4 years ago

Related SPDX elements which have a value of no-assertion is currently generated as:

<spdx:relatedSpdxElement>
         <spdx:noassertion rdf:about="http://spdx.org/rdf/terms#noassertion"/>
   </spdx:relatedSpdxElement>

It should be represented as:

   <spdx:relatedSpdxElement rdf:resource="http://spdx.org/rdf/terms#noassertion"/>
Gautime commented 4 years ago

@goneall Can you please point to the files that need to be changed or looked into?

goneall commented 4 years ago

@Gautime This one is bit complex. The starting point would be the SpdxNoAssertionElement class and the SpdxNoneElement class.

goneall commented 4 years ago

The same issue occurs for the SpdxNoneElement.

Related SPDX elements which have a value of none is currently generated as:

<spdx:relatedSpdxElement>
         <spdx:none rdf:about="http://spdx.org/rdf/terms#none"/>
   </spdx:relatedSpdxElement>

It should be represented as:

   <spdx:relatedSpdxElement rdf:resource="http://spdx.org/rdf/terms#none"/>
Gautime commented 4 years ago

@goneall How can I reproduce the output? It seems we dont have No assertion related elements in example rdf file.

goneall commented 4 years ago

How can I reproduce the output? It seems we don't have No assertion related elements in example rdf file.

You can run the utility tag to RDF on the 2.2.1 tag/value example file

Note that the 2.2.1 rdf example is correct. The RDF generated by the tool will be incorrect.

Gautime commented 4 years ago

@goneall Just to clarify, printRelationship is the function being used to print all the relationships (including noassertions), and we need to change the output for relationships with id noassertion, correct?

goneall commented 4 years ago

@Gautime The problem is just a bit deeper in the design. The SpdxNoAssertionElement class and the SpdxNoneElement would need to be changed (most likely). printRelationship isn't used to produce the RDF files. The code to produce the RDF serialization is in the Jena library (see the Tag to RDF code for an example).