Skip to content

Conversation

@JPEWdev
Copy link
Contributor

@JPEWdev JPEWdev commented Feb 12, 2025

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.

@bact bact added Profile:Core Core profile and related matters Profile:Licensing Licensing profiles, including SimpleLicensing and ExpandedLicensing, and related matters labels Feb 12, 2025
@goneall
Copy link
Member

goneall commented Feb 13, 2025

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).

@JPEWdev
Copy link
Contributor Author

JPEWdev commented Feb 13, 2025

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.

@kestewart kestewart added this to the 3.1 milestone Feb 18, 2025
@kestewart
Copy link
Contributor

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.

Copy link
Member

@goneall goneall left a 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.

@bact
Copy link
Collaborator

bact commented Feb 20, 2025

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.

@bact bact requested review from goneall and zvr March 9, 2025 01:59
@goneall
Copy link
Member

goneall commented Oct 10, 2025

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>
@JPEWdev JPEWdev force-pushed the license-id-map-fix branch from 60c0763 to 58c15cd Compare October 10, 2025 22:17
@JPEWdev JPEWdev requested a review from bact October 10, 2025 22:18
Copy link
Member

@goneall goneall left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@goneall goneall requested a review from kestewart October 11, 2025 02:41
Copy link
Collaborator

@bact bact left a 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
Copy link
Member

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- maxCount: 1
- minCount: 1
- maxCount: 1

From @zvr's comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Profile:Core Core profile and related matters Profile:Licensing Licensing profiles, including SimpleLicensing and ExpandedLicensing, and related matters

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants