Skip to content

Commit 58c15cd

Browse files
committed
simplelicensing: Change custom license additions to link to an Element
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>
1 parent 1986c81 commit 58c15cd

File tree

5 files changed

+92
-0
lines changed

5 files changed

+92
-0
lines changed

model/Core/Classes/ElementMap.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
SPDX-License-Identifier: Community-Spec-1.0
2+
3+
# ElementMap
4+
5+
## Summary
6+
7+
A key with an Element.
8+
9+
## Description
10+
11+
The class used for implementing mapping a string key to an Element.
12+
13+
Each ElementMap contains a key-value pair which maps the key to its
14+
associated Element.
15+
16+
To implement a dictionary, this class is to be used in a collection with
17+
unique keys.
18+
19+
## Metadata
20+
21+
- name: ElementMap
22+
- Instantiability: Concrete
23+
24+
## Properties
25+
26+
- key
27+
- type: xsd:string
28+
- minCount: 1
29+
- maxCount: 1
30+
- elementValue
31+
- type: Element
32+
- maxCount: 1
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
SPDX-License-Identifier: Community-Spec-1.0
2+
3+
# elementValue
4+
5+
## Summary
6+
7+
A value used in a key-value pair with a generic key that refers to an Element
8+
9+
## Description
10+
11+
A value used in a key-value pair with a generic key that refers to an Element.
12+
13+
A key-value pair can be used to implement a dictionary which associates a key
14+
with an Element.
15+
16+
## Metadata
17+
18+
- name: elementValue
19+
- Nature: ObjectProperty
20+
- Range: Element

model/SimpleLicensing/Classes/LicenseExpression.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ set forth in that Annex.
2121
The ExpandedLicensing profile can be used to represent the complete parsed
2222
license expression as a combination of license objects.
2323

24+
`customIdToUri` is deprecated. Migrate to `customIdToLicense`. `customIdToUri`
25+
will be removed in a future release.
26+
2427
## Metadata
2528

2629
- name: LicenseExpression
@@ -39,3 +42,6 @@ license expression as a combination of license objects.
3942
- customIdToUri
4043
- type: /Core/DictionaryEntry
4144
- minCount: 0
45+
- customIdToLicense
46+
- type: /Core/ElementMap
47+
- minCount: 0
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
SPDX-License-Identifier: Community-Spec-1.0
2+
3+
# customIdToLicense
4+
5+
## Summary
6+
7+
Maps a "LicenseRef-" string for a custom license or a "AdditionRef-" string for
8+
a custom license addition to a `CustomLicense`, a `CustomLicenseAddition`, or a
9+
`SimpleLicensingText`.
10+
11+
## Description
12+
13+
Within a license expression, references can be made to a custom license or a
14+
custom license addition.
15+
16+
The [License Expression syntax](../../../annexes/spdx-license-expressions.md)
17+
dictates any reference starting with a
18+
"LicenseRef-" or "AdditionRef-" refers to license or addition text not found in
19+
the official [SPDX License List](https://spdx.org/licenses/).
20+
21+
The key for the DictionaryEntry is the string used in the license expression
22+
and the value is target Element, which must be a CustomLicense,
23+
CustomLicenseAddition, or SimpleLicensingText.
24+
25+
## Metadata
26+
27+
- name: customIdToLicense
28+
- Nature: ObjectProperty
29+
- Range: /Core/ElementMap

model/SimpleLicensing/Properties/customIdToUri.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,16 @@ SPDX-License-Identifier: Community-Spec-1.0
44

55
## Summary
66

7+
**DEPRECATED**
8+
79
Maps a LicenseRef or AdditionRef string for a Custom License or a Custom
810
License Addition to its URI ID.
911

1012
## Description
1113

14+
**NOTE** This field is deprecated and only included for backward compatibility.
15+
New documents should use customIdToLicense instead.
16+
1217
Within a License Expression, references can be made to a Custom License or a
1318
Custom License Addition.
1419

0 commit comments

Comments
 (0)