-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Is it possible to create a serialized SPDX data (JSON-LD format) that doesn't use an SPDX Document? #932
Comments
It is definitely possible to create serialized SPDX data that does not use an SPDXDocument.
While this may be desired in some cases it is explicitly and by design NOT required in all cases. This is exemplified not only in the core topic of this Issue (SPDXDocument is NOT required for all serializations of SPDX content) but also in the fact that even IF you chose to express an SPDXDocument or any ElementCollection it is still optional whether or not to include a 'root' property (it is only an optional hint if desired).
I would disagree with this. The 'root' property is the preferred way of pointing to the root of a serialized graph of SPDX Elements IF it is desired to convey the graph as a collection of Elements and such a 'starting place' 'hint'. This is true for ANY ElementCollection. SpdxDocument is not explicitly preferred over Bundle. One or the other could be preferential based on the context.
A given user MAY want to record information about the external element but it is very explicitly NOT required and cannot be presumed. This is why ExternalMap is optional.
This is true IF you wish to provide further contextal information beyond the ID of the external Elements but doing so is optional. |
@sbarnum - I also recall the discussions and agree we reached an agreement to allow non-document exchanges. The reason I wrote the above is from practical experience attempted to implement what we agreed to and finding it not feasible for the situation of individual licenses. From reading the above, it looks like the only situation where you would not need to wrap an element with an SPDX document is if you are communicating a single Can you think of another example which would work if I had a requirement to validate the external element reference? In terms of streaming, you could stream an SPDX document or a series of SPDX documents even if they only contain a single element. |
In the development of the SPDX version 3 spec, there were some use cases where they wanted to publish an SPDX
Element
without wrapping it in an SPDX document.I just attempted to do this for the listed licenses in the LicenseListPublisher utility.
It turned out to be somewhat impractical due to the following facts:
Element
requires acreationInfo
propertyCreationInfo
requires one or moreAgents
which are a type ofElement
SpdxDocument
is the preferred method of pointing to the root of the serialized graph (although there are other methods such as aBundle
)Agent
, but to do so you would want to record information about the external elementSpdxDocument
is currently the only method of recording information about the external elementIn the case of the LicenseListPublisher, this led me to wrapping the individual license along with the creator Agent in a single SPDX document.
Question: are there any cases where you would not take this approach? If not, should we simplify the spec by requiring an SPDX document on serializations?
The text was updated successfully, but these errors were encountered: