spdx-3-model icon indicating copy to clipboard operation
spdx-3-model copied to clipboard

Namespaces and serialization

Open davaya opened this issue 2 years ago • 4 comments

While we are discussing namespace and creation info compression, we should keep in mind that every Element must have a unique SpdxId.

I propose that as we develop serialization examples, we use a few namespaces that reflect that reality. The first could be the one used in the 2.3 example:

"spdx-example": "http://spdx.org/spdxdocs/spdx-example-444504E0-4F89-41D3-9A0C-0305E82C3301#"

I proposed another that satisfies the same uniqueness requirement as the 2.3 GUID, but a little more compactly using a timestamp:

"spdxId": "http://spdx.acme.org/3FA9CB25#person2",

A non-unique SpdxId will not work:

"spdxId": "https://some.namespace#john_smith",

The GUID or some other uniqueness qualifier must appear in either the namespace or the local-part in all of our examples.

davaya avatar Jul 20 '23 13:07 davaya

The GUID or some other uniqueness qualifier must appear in either the namespace or the local-part in all of our examples.

I like using the GUID for uniqueness - it is a best practice we've recommended in the past for making the URI's unique.

goneall avatar Jul 20 '23 18:07 goneall

I agree that using a GUID for uniqueness is the right approach. I strongly believe the GUID should be part of the local-part of the ID rather than in the namespace. This is cleaner especially when aggregating/integrating content across BOMs, is easier for a human eye to follow, and is much cleaner for the potential possibility of deterministic (UUIDv5) GUIDs sometime in the future.

sbarnum avatar Aug 08 '23 15:08 sbarnum

I strongly believe the GUID should be part of the local-part of the ID rather than in the namespace.

I strongly believe it could be either local or namespace - we should not specify this. Having it in the local part greatly expands the size of the serialized data.

goneall avatar Aug 08 '23 17:08 goneall

Still a good idea - but no time to implement in 3.0, moving to 3.1

goneall avatar Apr 03 '24 20:04 goneall