tools icon indicating copy to clipboard operation
tools copied to clipboard

Incorrect RDF for NOASSERTION related SPDX element

Open goneall opened this issue 4 years ago • 7 comments

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"/>

goneall avatar Jun 11 '20 21:06 goneall

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

Gautime avatar Jun 16 '20 18:06 Gautime

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

goneall avatar Jun 16 '20 19:06 goneall

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"/>

goneall avatar Jun 16 '20 19:06 goneall

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

Gautime avatar Jun 17 '20 18:06 Gautime

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.

goneall avatar Jun 17 '20 23:06 goneall

@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?

Gautime avatar Jun 18 '20 01:06 Gautime

@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).

goneall avatar Jun 18 '20 01:06 goneall