-
Notifications
You must be signed in to change notification settings - Fork 45
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
License Expression References to Custom Licenses #380
Comments
This issue was move from this comment in issue #372 |
If license expression strings are to be portable then the individual terms that appear in the string must be globally unique. So the challenge is to map full globally unique IRIs to short globally unique strings, and the shorter those strings are the less meaningful they can be. So is "L13Y4EK95c0si" an acceptable ID for use in expressions like "Apache-2.0 OR L13Y4EK95c0si"? The base64-encoded 64-bit unique ID can be mapped to 2^64 full IRIs if everyone agrees to a managed mapping and meaningless terms. The term could be shorter (e.g., 32 bits/6 characters, plus optionally a few mnemonic characters) and the mapping just be a truncated hash of the IRI to get started,, but the shorter the term is the sooner collisions occur and the greater the need for the Custom License Registry. |
Here's a proposed solution:
Since the mapping property is local to the Translating from SPDX 2.X to SPDX 3.0 would be straightforward. This allows license expression strings to be present in single elements. I believe it is lossless. |
Not sure if that results in a to complex structure. Not sure if that would be accepted. |
Is there a way to test this? BTW - I'm open to other proposals, but this is the only one I can think of that would work within the JSON-LD serialization. |
Isn't |
Example for the proposal above: Expression
|
I would think it would be part of the ID leaving the name open to a more human readable name. |
From the serialization call, there were no alternatives to this proposal, so I'll work on a pull request to implement. |
Fixes #380 Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
@goneall +1 -- I think "LicenseRef-" would be the prefix for the ID, whereas the name could be anything. I think that's in line with the existing "Other Licensing Information" structure for 2.3, which I'd think is the intent here. |
As far as I understood, this plan here contains no restrictions on the actual SPDXID of the Element representing the custom license ( @swinslow : as you just wrote |
Fixes #380 Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
@maxhbr - you are correct As far as I understand, this will have no effect on the actual expression string syntax and semantics. You still need to have an "ID" (not the SPDX URI ID, but an ID used to map to the full URI ID) that starts with "LicenseRef-". You have to create a unique URI for the custom license in any case. I don't see any way around it since we no longer have the SPDX document to lean on for providing a standard prefix. We could create a restriction on the URI ID for the custom license, but I don't see any benefit in the 3.0 model. |
Fixes #380 Signed-off-by: Gary O'Neall <gary@sourceauditor.com>
How do we represent
LicenseRef-
custom licenses in the string license expressions?In SPDX 2.X, the interpretation of the custom licenses is very dependent on the SPDX document containing the reference. We key off the specific string
LicenseRef-
to determine it is a custom license and know we can find the definition within the document itself. If it is defined outside the document we use a namespace technique ofExternalDocumentIdX:LicenseRef-xxx
.Since the license expressions an be created without an enclosing document, we need a way of identifying the local licenses and finding the license definitions. This could be done by requiring the fully expanded URI's - but that would make for some rather unwieldy expressions.
The text was updated successfully, but these errors were encountered: