@twin.org/standards-ld-contexts 0.0.2-next.9 → 0.0.3-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/index.js +4 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/ldContexts/dataspace-protocol.json +451 -0
- package/dist/es/ldContexts/dublin-core-dcmitype.json +19 -0
- package/dist/es/ldContexts/dublin-core-terms.json +226 -0
- package/dist/es/ldContexts/federated-catalogue-terms.json +51 -0
- package/dist/es/ldContexts/gaia-x-v24.11.json +2397 -0
- package/dist/es/ldContexts/schema.org.json +9029 -0
- package/dist/es/ldContexts/un-cefact-vocab.json +195775 -0
- package/dist/es/ldContexts/w3c-activity-streams.json +379 -0
- package/dist/es/ldContexts/w3c-odrl.json +178 -0
- package/dist/es/ldContexts/w3c-vc-data-model-v2.json +301 -0
- package/dist/es/ldContexts/w3id-jws-2020-v1.json +78 -0
- package/dist/es/ldContexts.js +68 -0
- package/dist/es/ldContexts.js.map +1 -0
- package/dist/types/index.d.ts +1 -1
- package/docs/changelog.md +82 -0
- package/package.json +20 -8
- package/dist/cjs/index.cjs +0 -217747
- package/dist/esm/index.mjs +0 -217743
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": {
|
|
3
|
+
"@protected": true,
|
|
4
|
+
"id": "@id",
|
|
5
|
+
"type": "@type",
|
|
6
|
+
"description": "https://schema.org/description",
|
|
7
|
+
"digestMultibase": {
|
|
8
|
+
"@id": "https://w3id.org/security#digestMultibase",
|
|
9
|
+
"@type": "https://w3id.org/security#multibase"
|
|
10
|
+
},
|
|
11
|
+
"digestSRI": {
|
|
12
|
+
"@id": "https://www.w3.org/2018/credentials#digestSRI",
|
|
13
|
+
"@type": "https://www.w3.org/2018/credentials#sriString"
|
|
14
|
+
},
|
|
15
|
+
"mediaType": {
|
|
16
|
+
"@id": "https://schema.org/encodingFormat"
|
|
17
|
+
},
|
|
18
|
+
"name": "https://schema.org/name",
|
|
19
|
+
"VerifiableCredential": {
|
|
20
|
+
"@id": "https://www.w3.org/2018/credentials#VerifiableCredential",
|
|
21
|
+
"@context": {
|
|
22
|
+
"@protected": true,
|
|
23
|
+
"id": "@id",
|
|
24
|
+
"type": "@type",
|
|
25
|
+
"confidenceMethod": {
|
|
26
|
+
"@id": "https://www.w3.org/2018/credentials#confidenceMethod",
|
|
27
|
+
"@type": "@id"
|
|
28
|
+
},
|
|
29
|
+
"credentialSchema": {
|
|
30
|
+
"@id": "https://www.w3.org/2018/credentials#credentialSchema",
|
|
31
|
+
"@type": "@id"
|
|
32
|
+
},
|
|
33
|
+
"credentialStatus": {
|
|
34
|
+
"@id": "https://www.w3.org/2018/credentials#credentialStatus",
|
|
35
|
+
"@type": "@id"
|
|
36
|
+
},
|
|
37
|
+
"credentialSubject": {
|
|
38
|
+
"@id": "https://www.w3.org/2018/credentials#credentialSubject",
|
|
39
|
+
"@type": "@id"
|
|
40
|
+
},
|
|
41
|
+
"description": "https://schema.org/description",
|
|
42
|
+
"evidence": {
|
|
43
|
+
"@id": "https://www.w3.org/2018/credentials#evidence",
|
|
44
|
+
"@type": "@id"
|
|
45
|
+
},
|
|
46
|
+
"issuer": {
|
|
47
|
+
"@id": "https://www.w3.org/2018/credentials#issuer",
|
|
48
|
+
"@type": "@id"
|
|
49
|
+
},
|
|
50
|
+
"name": "https://schema.org/name",
|
|
51
|
+
"proof": {
|
|
52
|
+
"@id": "https://w3id.org/security#proof",
|
|
53
|
+
"@type": "@id",
|
|
54
|
+
"@container": "@graph"
|
|
55
|
+
},
|
|
56
|
+
"refreshService": {
|
|
57
|
+
"@id": "https://www.w3.org/2018/credentials#refreshService",
|
|
58
|
+
"@type": "@id"
|
|
59
|
+
},
|
|
60
|
+
"relatedResource": {
|
|
61
|
+
"@id": "https://www.w3.org/2018/credentials#relatedResource",
|
|
62
|
+
"@type": "@id"
|
|
63
|
+
},
|
|
64
|
+
"renderMethod": {
|
|
65
|
+
"@id": "https://www.w3.org/2018/credentials#renderMethod",
|
|
66
|
+
"@type": "@id"
|
|
67
|
+
},
|
|
68
|
+
"termsOfUse": {
|
|
69
|
+
"@id": "https://www.w3.org/2018/credentials#termsOfUse",
|
|
70
|
+
"@type": "@id"
|
|
71
|
+
},
|
|
72
|
+
"validFrom": {
|
|
73
|
+
"@id": "https://www.w3.org/2018/credentials#validFrom",
|
|
74
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
75
|
+
},
|
|
76
|
+
"validUntil": {
|
|
77
|
+
"@id": "https://www.w3.org/2018/credentials#validUntil",
|
|
78
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"EnvelopedVerifiableCredential": "https://www.w3.org/2018/credentials#EnvelopedVerifiableCredential",
|
|
83
|
+
"VerifiablePresentation": {
|
|
84
|
+
"@id": "https://www.w3.org/2018/credentials#VerifiablePresentation",
|
|
85
|
+
"@context": {
|
|
86
|
+
"@protected": true,
|
|
87
|
+
"id": "@id",
|
|
88
|
+
"type": "@type",
|
|
89
|
+
"holder": {
|
|
90
|
+
"@id": "https://www.w3.org/2018/credentials#holder",
|
|
91
|
+
"@type": "@id"
|
|
92
|
+
},
|
|
93
|
+
"proof": {
|
|
94
|
+
"@id": "https://w3id.org/security#proof",
|
|
95
|
+
"@type": "@id",
|
|
96
|
+
"@container": "@graph"
|
|
97
|
+
},
|
|
98
|
+
"termsOfUse": {
|
|
99
|
+
"@id": "https://www.w3.org/2018/credentials#termsOfUse",
|
|
100
|
+
"@type": "@id"
|
|
101
|
+
},
|
|
102
|
+
"verifiableCredential": {
|
|
103
|
+
"@id": "https://www.w3.org/2018/credentials#verifiableCredential",
|
|
104
|
+
"@type": "@id",
|
|
105
|
+
"@container": "@graph",
|
|
106
|
+
"@context": null
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
"EnvelopedVerifiablePresentation": "https://www.w3.org/2018/credentials#EnvelopedVerifiablePresentation",
|
|
111
|
+
"JsonSchemaCredential": "https://www.w3.org/2018/credentials#JsonSchemaCredential",
|
|
112
|
+
"JsonSchema": {
|
|
113
|
+
"@id": "https://www.w3.org/2018/credentials#JsonSchema",
|
|
114
|
+
"@context": {
|
|
115
|
+
"@protected": true,
|
|
116
|
+
"id": "@id",
|
|
117
|
+
"type": "@type",
|
|
118
|
+
"jsonSchema": {
|
|
119
|
+
"@id": "https://www.w3.org/2018/credentials#jsonSchema",
|
|
120
|
+
"@type": "@json"
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
"BitstringStatusListCredential": "https://www.w3.org/ns/credentials/status#BitstringStatusListCredential",
|
|
125
|
+
"BitstringStatusList": {
|
|
126
|
+
"@id": "https://www.w3.org/ns/credentials/status#BitstringStatusList",
|
|
127
|
+
"@context": {
|
|
128
|
+
"@protected": true,
|
|
129
|
+
"id": "@id",
|
|
130
|
+
"type": "@type",
|
|
131
|
+
"encodedList": {
|
|
132
|
+
"@id": "https://www.w3.org/ns/credentials/status#encodedList",
|
|
133
|
+
"@type": "https://w3id.org/security#multibase"
|
|
134
|
+
},
|
|
135
|
+
"statusPurpose": "https://www.w3.org/ns/credentials/status#statusPurpose",
|
|
136
|
+
"ttl": "https://www.w3.org/ns/credentials/status#ttl"
|
|
137
|
+
}
|
|
138
|
+
},
|
|
139
|
+
"BitstringStatusListEntry": {
|
|
140
|
+
"@id": "https://www.w3.org/ns/credentials/status#BitstringStatusListEntry",
|
|
141
|
+
"@context": {
|
|
142
|
+
"@protected": true,
|
|
143
|
+
"id": "@id",
|
|
144
|
+
"type": "@type",
|
|
145
|
+
"statusListCredential": {
|
|
146
|
+
"@id": "https://www.w3.org/ns/credentials/status#statusListCredential",
|
|
147
|
+
"@type": "@id"
|
|
148
|
+
},
|
|
149
|
+
"statusListIndex": "https://www.w3.org/ns/credentials/status#statusListIndex",
|
|
150
|
+
"statusPurpose": "https://www.w3.org/ns/credentials/status#statusPurpose",
|
|
151
|
+
"statusMessage": {
|
|
152
|
+
"@id": "https://www.w3.org/ns/credentials/status#statusMessage",
|
|
153
|
+
"@context": {
|
|
154
|
+
"@protected": true,
|
|
155
|
+
"id": "@id",
|
|
156
|
+
"type": "@type",
|
|
157
|
+
"message": "https://www.w3.org/ns/credentials/status#message",
|
|
158
|
+
"status": "https://www.w3.org/ns/credentials/status#status"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
"statusReference": {
|
|
162
|
+
"@id": "https://www.w3.org/ns/credentials/status#statusReference",
|
|
163
|
+
"@type": "@id"
|
|
164
|
+
},
|
|
165
|
+
"statusSize": {
|
|
166
|
+
"@id": "https://www.w3.org/ns/credentials/status#statusSize",
|
|
167
|
+
"@type": "https://www.w3.org/2001/XMLSchema#integer"
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
},
|
|
171
|
+
"DataIntegrityProof": {
|
|
172
|
+
"@id": "https://w3id.org/security#DataIntegrityProof",
|
|
173
|
+
"@context": {
|
|
174
|
+
"@protected": true,
|
|
175
|
+
"id": "@id",
|
|
176
|
+
"type": "@type",
|
|
177
|
+
"challenge": "https://w3id.org/security#challenge",
|
|
178
|
+
"created": {
|
|
179
|
+
"@id": "http://purl.org/dc/terms/created",
|
|
180
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
181
|
+
},
|
|
182
|
+
"cryptosuite": {
|
|
183
|
+
"@id": "https://w3id.org/security#cryptosuite",
|
|
184
|
+
"@type": "https://w3id.org/security#cryptosuiteString"
|
|
185
|
+
},
|
|
186
|
+
"domain": "https://w3id.org/security#domain",
|
|
187
|
+
"expires": {
|
|
188
|
+
"@id": "https://w3id.org/security#expiration",
|
|
189
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
190
|
+
},
|
|
191
|
+
"nonce": "https://w3id.org/security#nonce",
|
|
192
|
+
"previousProof": {
|
|
193
|
+
"@id": "https://w3id.org/security#previousProof",
|
|
194
|
+
"@type": "@id"
|
|
195
|
+
},
|
|
196
|
+
"proofPurpose": {
|
|
197
|
+
"@id": "https://w3id.org/security#proofPurpose",
|
|
198
|
+
"@type": "@vocab",
|
|
199
|
+
"@context": {
|
|
200
|
+
"@protected": true,
|
|
201
|
+
"id": "@id",
|
|
202
|
+
"type": "@type",
|
|
203
|
+
"assertionMethod": {
|
|
204
|
+
"@id": "https://w3id.org/security#assertionMethod",
|
|
205
|
+
"@type": "@id",
|
|
206
|
+
"@container": "@set"
|
|
207
|
+
},
|
|
208
|
+
"authentication": {
|
|
209
|
+
"@id": "https://w3id.org/security#authenticationMethod",
|
|
210
|
+
"@type": "@id",
|
|
211
|
+
"@container": "@set"
|
|
212
|
+
},
|
|
213
|
+
"capabilityDelegation": {
|
|
214
|
+
"@id": "https://w3id.org/security#capabilityDelegationMethod",
|
|
215
|
+
"@type": "@id",
|
|
216
|
+
"@container": "@set"
|
|
217
|
+
},
|
|
218
|
+
"capabilityInvocation": {
|
|
219
|
+
"@id": "https://w3id.org/security#capabilityInvocationMethod",
|
|
220
|
+
"@type": "@id",
|
|
221
|
+
"@container": "@set"
|
|
222
|
+
},
|
|
223
|
+
"keyAgreement": {
|
|
224
|
+
"@id": "https://w3id.org/security#keyAgreementMethod",
|
|
225
|
+
"@type": "@id",
|
|
226
|
+
"@container": "@set"
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
},
|
|
230
|
+
"proofValue": {
|
|
231
|
+
"@id": "https://w3id.org/security#proofValue",
|
|
232
|
+
"@type": "https://w3id.org/security#multibase"
|
|
233
|
+
},
|
|
234
|
+
"verificationMethod": {
|
|
235
|
+
"@id": "https://w3id.org/security#verificationMethod",
|
|
236
|
+
"@type": "@id"
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
"...": {
|
|
241
|
+
"@id": "https://www.iana.org/assignments/jwt#..."
|
|
242
|
+
},
|
|
243
|
+
"_sd": {
|
|
244
|
+
"@id": "https://www.iana.org/assignments/jwt#_sd",
|
|
245
|
+
"@type": "@json"
|
|
246
|
+
},
|
|
247
|
+
"_sd_alg": {
|
|
248
|
+
"@id": "https://www.iana.org/assignments/jwt#_sd_alg"
|
|
249
|
+
},
|
|
250
|
+
"aud": {
|
|
251
|
+
"@id": "https://www.iana.org/assignments/jwt#aud",
|
|
252
|
+
"@type": "@id"
|
|
253
|
+
},
|
|
254
|
+
"cnf": {
|
|
255
|
+
"@id": "https://www.iana.org/assignments/jwt#cnf",
|
|
256
|
+
"@context": {
|
|
257
|
+
"@protected": true,
|
|
258
|
+
"kid": {
|
|
259
|
+
"@id": "https://www.iana.org/assignments/jwt#kid",
|
|
260
|
+
"@type": "@id"
|
|
261
|
+
},
|
|
262
|
+
"jwk": {
|
|
263
|
+
"@id": "https://www.iana.org/assignments/jwt#jwk",
|
|
264
|
+
"@type": "@json"
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
"exp": {
|
|
269
|
+
"@id": "https://www.iana.org/assignments/jwt#exp",
|
|
270
|
+
"@type": "https://www.w3.org/2001/XMLSchema#nonNegativeInteger"
|
|
271
|
+
},
|
|
272
|
+
"iat": {
|
|
273
|
+
"@id": "https://www.iana.org/assignments/jwt#iat",
|
|
274
|
+
"@type": "https://www.w3.org/2001/XMLSchema#nonNegativeInteger"
|
|
275
|
+
},
|
|
276
|
+
"iss": {
|
|
277
|
+
"@id": "https://www.iana.org/assignments/jose#iss",
|
|
278
|
+
"@type": "@id"
|
|
279
|
+
},
|
|
280
|
+
"jku": {
|
|
281
|
+
"@id": "https://www.iana.org/assignments/jose#jku",
|
|
282
|
+
"@type": "@id"
|
|
283
|
+
},
|
|
284
|
+
"kid": {
|
|
285
|
+
"@id": "https://www.iana.org/assignments/jose#kid",
|
|
286
|
+
"@type": "@id"
|
|
287
|
+
},
|
|
288
|
+
"nbf": {
|
|
289
|
+
"@id": "https://www.iana.org/assignments/jwt#nbf",
|
|
290
|
+
"@type": "https://www.w3.org/2001/XMLSchema#nonNegativeInteger"
|
|
291
|
+
},
|
|
292
|
+
"sub": {
|
|
293
|
+
"@id": "https://www.iana.org/assignments/jose#sub",
|
|
294
|
+
"@type": "@id"
|
|
295
|
+
},
|
|
296
|
+
"x5u": {
|
|
297
|
+
"@id": "https://www.iana.org/assignments/jose#x5u",
|
|
298
|
+
"@type": "@id"
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
{
|
|
2
|
+
"@context": {
|
|
3
|
+
"privateKeyJwk": {
|
|
4
|
+
"@id": "https://w3id.org/security#privateKeyJwk",
|
|
5
|
+
"@type": "@json"
|
|
6
|
+
},
|
|
7
|
+
"JsonWebKey2020": {
|
|
8
|
+
"@id": "https://w3id.org/security#JsonWebKey2020",
|
|
9
|
+
"@context": {
|
|
10
|
+
"@protected": true,
|
|
11
|
+
"id": "@id",
|
|
12
|
+
"type": "@type",
|
|
13
|
+
"publicKeyJwk": {
|
|
14
|
+
"@id": "https://w3id.org/security#publicKeyJwk",
|
|
15
|
+
"@type": "@json"
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"JsonWebSignature2020": {
|
|
20
|
+
"@id": "https://w3id.org/security#JsonWebSignature2020",
|
|
21
|
+
"@context": {
|
|
22
|
+
"@protected": true,
|
|
23
|
+
"id": "@id",
|
|
24
|
+
"type": "@type",
|
|
25
|
+
"challenge": "https://w3id.org/security#challenge",
|
|
26
|
+
"created": {
|
|
27
|
+
"@id": "http://purl.org/dc/terms/created",
|
|
28
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
29
|
+
},
|
|
30
|
+
"domain": "https://w3id.org/security#domain",
|
|
31
|
+
"expires": {
|
|
32
|
+
"@id": "https://w3id.org/security#expiration",
|
|
33
|
+
"@type": "http://www.w3.org/2001/XMLSchema#dateTime"
|
|
34
|
+
},
|
|
35
|
+
"jws": "https://w3id.org/security#jws",
|
|
36
|
+
"nonce": "https://w3id.org/security#nonce",
|
|
37
|
+
"proofPurpose": {
|
|
38
|
+
"@id": "https://w3id.org/security#proofPurpose",
|
|
39
|
+
"@type": "@vocab",
|
|
40
|
+
"@context": {
|
|
41
|
+
"@protected": true,
|
|
42
|
+
"id": "@id",
|
|
43
|
+
"type": "@type",
|
|
44
|
+
"assertionMethod": {
|
|
45
|
+
"@id": "https://w3id.org/security#assertionMethod",
|
|
46
|
+
"@type": "@id",
|
|
47
|
+
"@container": "@set"
|
|
48
|
+
},
|
|
49
|
+
"authentication": {
|
|
50
|
+
"@id": "https://w3id.org/security#authenticationMethod",
|
|
51
|
+
"@type": "@id",
|
|
52
|
+
"@container": "@set"
|
|
53
|
+
},
|
|
54
|
+
"capabilityInvocation": {
|
|
55
|
+
"@id": "https://w3id.org/security#capabilityInvocationMethod",
|
|
56
|
+
"@type": "@id",
|
|
57
|
+
"@container": "@set"
|
|
58
|
+
},
|
|
59
|
+
"capabilityDelegation": {
|
|
60
|
+
"@id": "https://w3id.org/security#capabilityDelegationMethod",
|
|
61
|
+
"@type": "@id",
|
|
62
|
+
"@container": "@set"
|
|
63
|
+
},
|
|
64
|
+
"keyAgreement": {
|
|
65
|
+
"@id": "https://w3id.org/security#keyAgreementMethod",
|
|
66
|
+
"@type": "@id",
|
|
67
|
+
"@container": "@set"
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"verificationMethod": {
|
|
72
|
+
"@id": "https://w3id.org/security#verificationMethod",
|
|
73
|
+
"@type": "@id"
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// Copyright 2024 IOTA Stiftung.
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0.
|
|
3
|
+
import { GeneralError, Is } from "@twin.org/core";
|
|
4
|
+
import { JsonLdProcessor } from "@twin.org/data-json-ld";
|
|
5
|
+
import dataspaceProtocol from "./ldContexts/dataspace-protocol.json" with { type: "json" };
|
|
6
|
+
import dcmitype from "./ldContexts/dublin-core-dcmitype.json" with { type: "json" };
|
|
7
|
+
import dcTerms from "./ldContexts/dublin-core-terms.json" with { type: "json" };
|
|
8
|
+
import federatedCatalogueTerms from "./ldContexts/federated-catalogue-terms.json" with { type: "json" };
|
|
9
|
+
import gaiaX2411 from "./ldContexts/gaia-x-v24.11.json" with { type: "json" };
|
|
10
|
+
import schemaOrg from "./ldContexts/schema.org.json" with { type: "json" };
|
|
11
|
+
import unCefact from "./ldContexts/un-cefact-vocab.json" with { type: "json" };
|
|
12
|
+
import w3cActivityStreams from "./ldContexts/w3c-activity-streams.json" with { type: "json" };
|
|
13
|
+
import w3cOdrl from "./ldContexts/w3c-odrl.json" with { type: "json" };
|
|
14
|
+
import w3cVc from "./ldContexts/w3c-vc-data-model-v2.json" with { type: "json" };
|
|
15
|
+
import w3IdJws from "./ldContexts/w3id-jws-2020-v1.json" with { type: "json" };
|
|
16
|
+
/**
|
|
17
|
+
* Map of all the ld contexts by their URL.
|
|
18
|
+
*/
|
|
19
|
+
export const LD_CONTEXTS = {
|
|
20
|
+
// schema.org
|
|
21
|
+
"https://schema.org": schemaOrg,
|
|
22
|
+
"http://schema.org": schemaOrg,
|
|
23
|
+
"https://schema.org/docs/jsonldcontext.jsonld": schemaOrg,
|
|
24
|
+
// Gaia-X
|
|
25
|
+
"https://w3id.org/gaia-x/2411": gaiaX2411,
|
|
26
|
+
"https://w3id.org/gaia-x/2411#": gaiaX2411,
|
|
27
|
+
"https://schema.twindev.org/gaia-x-loire/": gaiaX2411,
|
|
28
|
+
"https://schema.twindev.org/gaia-x-loire/types.jsonld": gaiaX2411,
|
|
29
|
+
// W3C ODRL
|
|
30
|
+
"http://www.w3.org/ns/odrl.jsonld": w3cOdrl,
|
|
31
|
+
// W3C Activity Streams
|
|
32
|
+
"https://www.w3.org/ns/activitystreams#": w3cActivityStreams,
|
|
33
|
+
// W3C Credentials
|
|
34
|
+
"https://www.w3.org/ns/credentials/v2": w3cVc,
|
|
35
|
+
"https://w3id.org/security/suites/jws-2020/v1": w3IdJws,
|
|
36
|
+
// UN/CEFACT
|
|
37
|
+
"https://vocabulary.uncefact.org": unCefact,
|
|
38
|
+
// Dublin Core
|
|
39
|
+
"http://purl.org/dc/terms/": dcTerms,
|
|
40
|
+
"http://purl.org/dc/dcmitype/": dcmitype,
|
|
41
|
+
"https://schema.twindev.org/dublin-core/terms.jsonld": dcTerms,
|
|
42
|
+
"https://schema.twindev.org/dublin-core/dcmitype.jsonld": dcmitype,
|
|
43
|
+
// IDS Contract Negotiation
|
|
44
|
+
"https://w3id.org/dspace/2024/1/context.json": dataspaceProtocol,
|
|
45
|
+
"https://w3id.org/dspace/2025/1/context.jsonld": dataspaceProtocol,
|
|
46
|
+
// Federated Catalogue
|
|
47
|
+
"https://schema.twindev.org/federated-catalogue/": federatedCatalogueTerms,
|
|
48
|
+
"https://schema.twindev.org/federated-catalogue/types.jsonld": federatedCatalogueTerms
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Add all the contexts to the document cache.
|
|
52
|
+
*/
|
|
53
|
+
export async function addAllContextsToDocumentCache() {
|
|
54
|
+
for (const url in LD_CONTEXTS) {
|
|
55
|
+
await JsonLdProcessor.documentCacheAdd(url, LD_CONTEXTS[url]);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Add a context to the document cache.
|
|
60
|
+
* @param url The URL of the context to add to the cache.
|
|
61
|
+
*/
|
|
62
|
+
export async function addContextToDocumentCache(url) {
|
|
63
|
+
if (Is.empty(LD_CONTEXTS[url])) {
|
|
64
|
+
throw new GeneralError("ldContext", "missing", { url });
|
|
65
|
+
}
|
|
66
|
+
await JsonLdProcessor.documentCacheAdd(url, LD_CONTEXTS[url]);
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=ldContexts.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ldContexts.js","sourceRoot":"","sources":["../../src/ldContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,YAAY,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,iBAAiB,MAAM,sCAAsC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC3F,OAAO,QAAQ,MAAM,wCAAwC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpF,OAAO,OAAO,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChF,OAAO,uBAAuB,MAAM,6CAA6C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACxG,OAAO,SAAS,MAAM,iCAAiC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9E,OAAO,SAAS,MAAM,8BAA8B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC3E,OAAO,QAAQ,MAAM,mCAAmC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC/E,OAAO,kBAAkB,MAAM,wCAAwC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9F,OAAO,OAAO,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACvE,OAAO,KAAK,MAAM,wCAAwC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACjF,OAAO,OAAO,MAAM,oCAAoC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAE/E;;GAEG;AACH,MAAM,CAAC,MAAM,WAAW,GAA8B;IACrD,aAAa;IACb,oBAAoB,EAAE,SAAS;IAC/B,mBAAmB,EAAE,SAAS;IAC9B,8CAA8C,EAAE,SAAS;IAEzD,SAAS;IACT,8BAA8B,EAAE,SAAS;IACzC,+BAA+B,EAAE,SAAS;IAE1C,0CAA0C,EAAE,SAAS;IACrD,sDAAsD,EAAE,SAAS;IAEjE,WAAW;IACX,kCAAkC,EAAE,OAAO;IAE3C,uBAAuB;IACvB,wCAAwC,EAAE,kBAAkB;IAE5D,kBAAkB;IAClB,sCAAsC,EAAE,KAAK;IAC7C,8CAA8C,EAAE,OAAO;IAEvD,YAAY;IACZ,iCAAiC,EAAE,QAAQ;IAE3C,cAAc;IACd,2BAA2B,EAAE,OAAO;IACpC,8BAA8B,EAAE,QAAQ;IACxC,qDAAqD,EAAE,OAAO;IAC9D,wDAAwD,EAAE,QAAQ;IAElE,2BAA2B;IAC3B,6CAA6C,EAAE,iBAAiB;IAChE,+CAA+C,EAAE,iBAAiB;IAElE,sBAAsB;IACtB,iDAAiD,EAAE,uBAAuB;IAC1E,6DAA6D,EAAE,uBAAuB;CACtF,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,6BAA6B;IAClD,KAAK,MAAM,GAAG,IAAI,WAAW,EAAE,CAAC;QAC/B,MAAM,eAAe,CAAC,gBAAgB,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;IAC/D,CAAC;AACF,CAAC;AAED;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,GAAW;IAC1D,IAAI,EAAE,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;QAChC,MAAM,IAAI,YAAY,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;IACzD,CAAC;IACD,MAAM,eAAe,CAAC,gBAAgB,CAAC,GAAG,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { GeneralError, Is } from \"@twin.org/core\";\nimport { JsonLdProcessor } from \"@twin.org/data-json-ld\";\nimport dataspaceProtocol from \"./ldContexts/dataspace-protocol.json\" with { type: \"json\" };\nimport dcmitype from \"./ldContexts/dublin-core-dcmitype.json\" with { type: \"json\" };\nimport dcTerms from \"./ldContexts/dublin-core-terms.json\" with { type: \"json\" };\nimport federatedCatalogueTerms from \"./ldContexts/federated-catalogue-terms.json\" with { type: \"json\" };\nimport gaiaX2411 from \"./ldContexts/gaia-x-v24.11.json\" with { type: \"json\" };\nimport schemaOrg from \"./ldContexts/schema.org.json\" with { type: \"json\" };\nimport unCefact from \"./ldContexts/un-cefact-vocab.json\" with { type: \"json\" };\nimport w3cActivityStreams from \"./ldContexts/w3c-activity-streams.json\" with { type: \"json\" };\nimport w3cOdrl from \"./ldContexts/w3c-odrl.json\" with { type: \"json\" };\nimport w3cVc from \"./ldContexts/w3c-vc-data-model-v2.json\" with { type: \"json\" };\nimport w3IdJws from \"./ldContexts/w3id-jws-2020-v1.json\" with { type: \"json\" };\n\n/**\n * Map of all the ld contexts by their URL.\n */\nexport const LD_CONTEXTS: { [id: string]: unknown } = {\n\t// schema.org\n\t\"https://schema.org\": schemaOrg,\n\t\"http://schema.org\": schemaOrg,\n\t\"https://schema.org/docs/jsonldcontext.jsonld\": schemaOrg,\n\n\t// Gaia-X\n\t\"https://w3id.org/gaia-x/2411\": gaiaX2411,\n\t\"https://w3id.org/gaia-x/2411#\": gaiaX2411,\n\n\t\"https://schema.twindev.org/gaia-x-loire/\": gaiaX2411,\n\t\"https://schema.twindev.org/gaia-x-loire/types.jsonld\": gaiaX2411,\n\n\t// W3C ODRL\n\t\"http://www.w3.org/ns/odrl.jsonld\": w3cOdrl,\n\n\t// W3C Activity Streams\n\t\"https://www.w3.org/ns/activitystreams#\": w3cActivityStreams,\n\n\t// W3C Credentials\n\t\"https://www.w3.org/ns/credentials/v2\": w3cVc,\n\t\"https://w3id.org/security/suites/jws-2020/v1\": w3IdJws,\n\n\t// UN/CEFACT\n\t\"https://vocabulary.uncefact.org\": unCefact,\n\n\t// Dublin Core\n\t\"http://purl.org/dc/terms/\": dcTerms,\n\t\"http://purl.org/dc/dcmitype/\": dcmitype,\n\t\"https://schema.twindev.org/dublin-core/terms.jsonld\": dcTerms,\n\t\"https://schema.twindev.org/dublin-core/dcmitype.jsonld\": dcmitype,\n\n\t// IDS Contract Negotiation\n\t\"https://w3id.org/dspace/2024/1/context.json\": dataspaceProtocol,\n\t\"https://w3id.org/dspace/2025/1/context.jsonld\": dataspaceProtocol,\n\n\t// Federated Catalogue\n\t\"https://schema.twindev.org/federated-catalogue/\": federatedCatalogueTerms,\n\t\"https://schema.twindev.org/federated-catalogue/types.jsonld\": federatedCatalogueTerms\n};\n\n/**\n * Add all the contexts to the document cache.\n */\nexport async function addAllContextsToDocumentCache(): Promise<void> {\n\tfor (const url in LD_CONTEXTS) {\n\t\tawait JsonLdProcessor.documentCacheAdd(url, LD_CONTEXTS[url]);\n\t}\n}\n\n/**\n * Add a context to the document cache.\n * @param url The URL of the context to add to the cache.\n */\nexport async function addContextToDocumentCache(url: string): Promise<void> {\n\tif (Is.empty(LD_CONTEXTS[url])) {\n\t\tthrow new GeneralError(\"ldContext\", \"missing\", { url });\n\t}\n\tawait JsonLdProcessor.documentCacheAdd(url, LD_CONTEXTS[url]);\n}\n"]}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./ldContexts";
|
|
1
|
+
export * from "./ldContexts.js";
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,87 @@
|
|
|
1
1
|
# @twin.org/standards-ld-contexts - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.2](https://github.com/twinfoundation/standards/compare/standards-ld-contexts-v0.0.3-next.1...standards-ld-contexts-v0.0.3-next.2) (2025-11-11)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Miscellaneous Chores
|
|
7
|
+
|
|
8
|
+
* **standards-ld-contexts:** Synchronize repo versions
|
|
9
|
+
|
|
10
|
+
## [0.0.3-next.1](https://github.com/twinfoundation/standards/compare/standards-ld-contexts-v0.0.3-next.0...standards-ld-contexts-v0.0.3-next.1) (2025-11-10)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
* add context id features ([#64](https://github.com/twinfoundation/standards/issues/64)) ([e68bb87](https://github.com/twinfoundation/standards/commit/e68bb87a215f3c3956cfd6400a5e1e2a16256085))
|
|
16
|
+
* add extra ld contexts needed ([#17](https://github.com/twinfoundation/standards/issues/17)) ([d9f1be2](https://github.com/twinfoundation/standards/commit/d9f1be2a852f776cb3a8f00bb4dd631da0fe848e))
|
|
17
|
+
* add ids contract negotiation types ([6225dde](https://github.com/twinfoundation/standards/commit/6225ddec9e845e3782e2944f30c771911855f165))
|
|
18
|
+
* add ld-contexts package ([c361354](https://github.com/twinfoundation/standards/commit/c3613542c3dab5c37cc3d9869ea72eef86bc1ba1))
|
|
19
|
+
* add validate-locales ([838389c](https://github.com/twinfoundation/standards/commit/838389c1daf62ed42397d5758d267c3d1a37fa4d))
|
|
20
|
+
* eslint migration to flat config ([648c1a1](https://github.com/twinfoundation/standards/commit/648c1a1e69d99b6b0cf69358ec6bdeecdbe3a5ea))
|
|
21
|
+
* normalise type outputs ([0b3aed7](https://github.com/twinfoundation/standards/commit/0b3aed7df0802cd609423bbd7fda6bde601d3ceb))
|
|
22
|
+
* update framework core ([58c0c3d](https://github.com/twinfoundation/standards/commit/58c0c3dd6cea0e4c2393dc0e3e1eb33a6d06f617))
|
|
23
|
+
* update to latest JSON schema spec ([7a23930](https://github.com/twinfoundation/standards/commit/7a2393032d7f48bfb20d3a484f981fb6dd83a92c))
|
|
24
|
+
* use shared store mechanism ([#11](https://github.com/twinfoundation/standards/issues/11)) ([96fa237](https://github.com/twinfoundation/standards/commit/96fa23735f69c1fc7e3d0019b527634fa0a042d9))
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
### Bug Fixes
|
|
28
|
+
|
|
29
|
+
* add extra ld contexts associated to URLs. cache ([#21](https://github.com/twinfoundation/standards/issues/21)) ([05f7bba](https://github.com/twinfoundation/standards/commit/05f7bbafd0efbff445b878ccc2709975e50a7773))
|
|
30
|
+
* federated catalogue terms ld context last version copied ([#26](https://github.com/twinfoundation/standards/issues/26)) ([37f4ff0](https://github.com/twinfoundation/standards/commit/37f4ff00664e8b5efc7d24f1e2417061fd2bda56))
|
|
31
|
+
* gaia-x loire LD Context ([#62](https://github.com/twinfoundation/standards/issues/62)) ([072c4e7](https://github.com/twinfoundation/standards/commit/072c4e789158b3f989fa0fdd23df2532f7626dad))
|
|
32
|
+
* gaia-x pinned LD Context ([#59](https://github.com/twinfoundation/standards/issues/59)) ([7572616](https://github.com/twinfoundation/standards/commit/7572616a2e853e8f6f6234763e675edb96e54005))
|
|
33
|
+
* pin to 24.11 Gaia-X LD Context ([#58](https://github.com/twinfoundation/standards/issues/58)) ([4d3b9cc](https://github.com/twinfoundation/standards/commit/4d3b9cc365af276f5d4fc111a1744768746daa28))
|
|
34
|
+
|
|
35
|
+
## [0.0.2-next.16](https://github.com/twinfoundation/standards/compare/standards-ld-contexts-v0.0.2-next.15...standards-ld-contexts-v0.0.2-next.16) (2025-10-09)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### Bug Fixes
|
|
39
|
+
|
|
40
|
+
* gaia-x loire LD Context ([#62](https://github.com/twinfoundation/standards/issues/62)) ([072c4e7](https://github.com/twinfoundation/standards/commit/072c4e789158b3f989fa0fdd23df2532f7626dad))
|
|
41
|
+
|
|
42
|
+
## [0.0.2-next.15](https://github.com/twinfoundation/standards/compare/standards-ld-contexts-v0.0.2-next.14...standards-ld-contexts-v0.0.2-next.15) (2025-10-09)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
### Features
|
|
46
|
+
|
|
47
|
+
* add validate-locales ([838389c](https://github.com/twinfoundation/standards/commit/838389c1daf62ed42397d5758d267c3d1a37fa4d))
|
|
48
|
+
|
|
49
|
+
## [0.0.2-next.14](https://github.com/twinfoundation/standards/compare/standards-ld-contexts-v0.0.2-next.13...standards-ld-contexts-v0.0.2-next.14) (2025-10-02)
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
### Bug Fixes
|
|
53
|
+
|
|
54
|
+
* gaia-x pinned LD Context ([#59](https://github.com/twinfoundation/standards/issues/59)) ([7572616](https://github.com/twinfoundation/standards/commit/7572616a2e853e8f6f6234763e675edb96e54005))
|
|
55
|
+
* pin to 24.11 Gaia-X LD Context ([#58](https://github.com/twinfoundation/standards/issues/58)) ([4d3b9cc](https://github.com/twinfoundation/standards/commit/4d3b9cc365af276f5d4fc111a1744768746daa28))
|
|
56
|
+
|
|
57
|
+
## [0.0.2-next.13](https://github.com/twinfoundation/standards/compare/standards-ld-contexts-v0.0.2-next.12...standards-ld-contexts-v0.0.2-next.13) (2025-09-22)
|
|
58
|
+
|
|
59
|
+
|
|
60
|
+
### Miscellaneous Chores
|
|
61
|
+
|
|
62
|
+
* **standards-ld-contexts:** Synchronize repo versions
|
|
63
|
+
|
|
64
|
+
## [0.0.2-next.12](https://github.com/twinfoundation/standards/compare/standards-ld-contexts-v0.0.2-next.11...standards-ld-contexts-v0.0.2-next.12) (2025-09-16)
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
### Miscellaneous Chores
|
|
68
|
+
|
|
69
|
+
* **standards-ld-contexts:** Synchronize repo versions
|
|
70
|
+
|
|
71
|
+
## [0.0.2-next.11](https://github.com/twinfoundation/standards/compare/standards-ld-contexts-v0.0.2-next.10...standards-ld-contexts-v0.0.2-next.11) (2025-09-16)
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
### Miscellaneous Chores
|
|
75
|
+
|
|
76
|
+
* **standards-ld-contexts:** Synchronize repo versions
|
|
77
|
+
|
|
78
|
+
## [0.0.2-next.10](https://github.com/twinfoundation/standards/compare/standards-ld-contexts-v0.0.2-next.9...standards-ld-contexts-v0.0.2-next.10) (2025-09-16)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
### Miscellaneous Chores
|
|
82
|
+
|
|
83
|
+
* **standards-ld-contexts:** Synchronize repo versions
|
|
84
|
+
|
|
3
85
|
## [0.0.2-next.9](https://github.com/twinfoundation/standards/compare/standards-ld-contexts-v0.0.2-next.8...standards-ld-contexts-v0.0.2-next.9) (2025-09-15)
|
|
4
86
|
|
|
5
87
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/standards-ld-contexts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3-next.2",
|
|
4
4
|
"description": "Local copies of standard LD contexts which can be used for offline development",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,22 +17,34 @@
|
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
18
|
"@twin.org/data-json-ld": "next"
|
|
19
19
|
},
|
|
20
|
-
"main": "./dist/
|
|
21
|
-
"module": "./dist/esm/index.mjs",
|
|
20
|
+
"main": "./dist/es/index.js",
|
|
22
21
|
"types": "./dist/types/index.d.ts",
|
|
23
22
|
"exports": {
|
|
24
23
|
".": {
|
|
25
24
|
"types": "./dist/types/index.d.ts",
|
|
26
|
-
"
|
|
27
|
-
"
|
|
25
|
+
"import": "./dist/es/index.js",
|
|
26
|
+
"default": "./dist/es/index.js"
|
|
28
27
|
},
|
|
29
28
|
"./locales/*.json": "./locales/*.json"
|
|
30
29
|
},
|
|
31
30
|
"files": [
|
|
32
|
-
"dist/
|
|
33
|
-
"dist/esm",
|
|
31
|
+
"dist/es",
|
|
34
32
|
"dist/types",
|
|
35
33
|
"locales",
|
|
36
34
|
"docs"
|
|
37
|
-
]
|
|
35
|
+
],
|
|
36
|
+
"keywords": [
|
|
37
|
+
"twin",
|
|
38
|
+
"trade",
|
|
39
|
+
"iota",
|
|
40
|
+
"framework",
|
|
41
|
+
"blockchain",
|
|
42
|
+
"standards",
|
|
43
|
+
"schema",
|
|
44
|
+
"specification"
|
|
45
|
+
],
|
|
46
|
+
"bugs": {
|
|
47
|
+
"url": "git+https://github.com/twinfoundation/standards/issues"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://twindev.org"
|
|
38
50
|
}
|