-
Notifications
You must be signed in to change notification settings - Fork 60
simplelicensing: Change custom license additions to link to an Element #969
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
base: develop
Are you sure you want to change the base?
Conversation
a6779b7 to
60c0763
Compare
|
Since we have to write custom code to validate a license expression anyway, is there much incremental value in having the SHACL validation of the map? In general I'm OK with the change, just wanted to make sure the change is worth the effort (e.g. I have to go back and change my current validation code). |
|
It makes it easier to ensure that they aren't complete garbage values, and also if you are linking multiple documents together it's easier if the code bindings know it's an actual object that needs to be resolved instead of just a string, you can check if its missing an external reference, etc. |
|
Discussion on call that this should be added as a new property, and other marked as depricated in 3.1. Looking for detailed review from Gary, Alexios, and others. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor suggestion since Element map is quite as generic whereas the key is generic.
|
In CHANGELOG.md, we may like to add these as well: ## Post-3.0.1 (2025-02-20)
### Changes since 3.0.1
- **Added:** `/Core/ElementMap` class - [#969](https://github.com/spdx/spdx-3-model/pull/969)
- **Added:** `/Core/elementValue` property - [#969](https://github.com/spdx/spdx-3-model/pull/969)
- **Added:** `/SimpleLicensing/customIdToLicense` property - [#969](https://github.com/spdx/spdx-3-model/pull/969)
### Deprecations since 3.0.1
- `/SimpleLicensing/customIdToUri` property - [#969](https://github.com/spdx/spdx-3-model/pull/969)
- New documents should use `/SimpleLicensing/customIdToLicense` instead. |
|
Ping @JPEWdev - Please review the above comments and rebase to the latest |
Using a DictionaryEntry to map license additions in the `customIdToUri` field has the unfortunate side effect that the dictionary entry value will not be resolve to an actual object by either SHACL or code bindings, since they are unaware that the value is supposed to be an object IRI. As such, create a new `ElementMap` object which can be used to map string keys to Elements, and use this in a new `customIdToLicense` property. The original `customIdToUri` property is retained for backward compatibility, but marked as deprecated. Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
60c0763 to
58c15cd
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the language revision.
LGTM
| - type: xsd:string | ||
| - minCount: 1 | ||
| - maxCount: 1 | ||
| - elementValue |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't we need a minCount: 1 for elementValue ?
Otherwise, what does it mean to have a key without a value?
| - maxCount: 1 | ||
| - elementValue | ||
| - type: Element | ||
| - maxCount: 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| - maxCount: 1 | |
| - minCount: 1 | |
| - maxCount: 1 |
From @zvr's comment above.
Using a DictionaryEntry to map license additions in the
customIdToUrifield has the unfortunate side effect that the dictionary entry value will not be resolve to an actual object by either SHACL or code bindings, since they are unaware that the value is supposed to be an object IRI.As such, create a new
ElementMapobject which can be used to map string keys to Elements, and use this in a newcustomIdToLicenseproperty. The originalcustomIdToUriproperty is retained for backward compatibility, but marked as deprecated.