Hi Armin,

 

> So, are external namespaces allowed there? And how about json?

 

Yes – more details below.

 

For RDF, the ID is always a URI Reference with the fragment (the text following 
the ‘#’) matching the SPDX ID.  The URI part preceding the ‘#’, also referred 
to as the Namespace in the SPDX documentation, is the namespace for the SPDX 
document containing the SPDX ID or the namespace for an external SPDX document. 
 An easy way to determine if it is internal or external is to compare the 
Namespace of the SPDX ID to the Namespace of the SPDX Document itself – if they 
match, it is internal to the SPDX document.  Since RDF serialization formats 
already have standards for how namespaces and URI’s are treated, there is 
nothing else special for SPDX ID’s used within an RDF document.

 

For an SPDX document within a single SPDX RDF serialization to be valid, all 
the required properties for elements in the SPDX Document’s namespace must be 
present.  Properties for ID’s in other namespaces do not need to be present in 
the same serialization.

 

For all other formats, references to SPDX elements use either just the SPDX ID 
or  Document-Ref-[idstring]:[spdx_id].

 

To translate from the other formats to RDF, the SPDX Document namespace 
<https://github.com/spdx/spdx-spec/blob/development/v2.3.1/chapters/document-creation-information.md#65-spdx-document-namespace-field->
  property is introduced.  This will be the Namespace (URI part preceding the 
‘#’) for any SPDX ID’s which don’t have a preceding Document-Ref.  For any 
Document-Ref ID’s, the namespace can be looked up in the External Document 
Reference fields 
<https://github.com/spdx/spdx-spec/blob/development/v2.3.1/chapters/document-creation-information.md#66-external-document-references-field->
  in the SPDX Document.

 

To translate from RDF to other formats, you can find the SPDX Document 
Namespace as the text preceding the SPDX Document URI ‘#SPDXRef-DOCUMENT’ and 
the URI to Document-Ref- can be looked up in the same External Document 
reference fields.

 

Best,

Gary

 

From: [email protected] <[email protected]> On Behalf Of 
armin.taenzer via lists.spdx.org
Sent: Thursday, December 8, 2022 7:44 AM
To: [email protected]
Subject: [spdx-tech] External document namespace before SPDX id?

 

Hello everyone,

I've got a question regarding the SPDX id of packages, files or snippets. 
According to spec 
<https://spdx.github.io/spdx-spec/v2.3-RC1/package-information/#72-package-spdx-identifier-field>
  the format must be "SPDXRef-[idstring]" for tag-value,
but rdf in addition has a namespace before it. It is not stated, though, that 
this must be the namespace of the enclosing document.
So, are external namespaces allowed there? And how about json?

I have to admit, it would not make much sense to me if the namespace there can 
actually be external because then two different documents contain the same 
element (and possibly contradict each others' properties).
Also, there already exists the concept of external document references 
("Document-Ref-[idstring]:[spdx_id]").

Thanks in advance :)
Armin Tänzer 





-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#4884): https://lists.spdx.org/g/Spdx-tech/message/4884
Mute This Topic: https://lists.spdx.org/mt/95540335/21656
Group Owner: [email protected]
Unsubscribe: https://lists.spdx.org/g/Spdx-tech/unsub [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to