Skip to content

Commit 60c0763

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 5ab1d6d commit 60c0763

File tree

5 files changed

+90
-0
lines changed

5 files changed

+90
-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 generic key-value pair that refers to an Element
8+
9+
## Description
10+
11+
A value used in a generic key-value pair 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: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,3 +39,6 @@ license expression as a combination of license objects.
3939
- customIdToUri
4040
- type: /Core/DictionaryEntry
4141
- minCount: 0
42+
- customIdToLicense
43+
- type: /Core/ElementMap
44+
- 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 or AdditionRef string for a Custom License or a Custom
8+
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: 6 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

@@ -24,6 +29,7 @@ The key for the DictionaryEntry is the string used in the license expression
2429
and the value is the URI for the corresponding CustomLicense,
2530
CustomLicenseAddition, or SimpleLicensingText.
2631

32+
2733
## Metadata
2834

2935
- name: customIdToUri

0 commit comments

Comments
 (0)