@twin.org/standards-ld-contexts 0.0.3-next.9 → 0.9.0-next.1

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.
@@ -0,0 +1,113 @@
1
+ {
2
+ "@context": {
3
+ "@protected": true,
4
+ "id": "@id",
5
+ "type": "@type",
6
+ "alsoKnownAs": {
7
+ "@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
8
+ "@type": "@id"
9
+ },
10
+ "assertionMethod": {
11
+ "@id": "https://w3id.org/security#assertionMethod",
12
+ "@type": "@id",
13
+ "@container": "@set"
14
+ },
15
+ "authentication": {
16
+ "@id": "https://w3id.org/security#authenticationMethod",
17
+ "@type": "@id",
18
+ "@container": "@set"
19
+ },
20
+ "capabilityDelegation": {
21
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
22
+ "@type": "@id",
23
+ "@container": "@set"
24
+ },
25
+ "capabilityInvocation": {
26
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
27
+ "@type": "@id",
28
+ "@container": "@set"
29
+ },
30
+ "controller": {
31
+ "@id": "https://w3id.org/security#controller",
32
+ "@type": "@id"
33
+ },
34
+ "keyAgreement": {
35
+ "@id": "https://w3id.org/security#keyAgreementMethod",
36
+ "@type": "@id",
37
+ "@container": "@set"
38
+ },
39
+ "service": {
40
+ "@id": "https://www.w3.org/ns/did#service",
41
+ "@type": "@id",
42
+ "@context": {
43
+ "@protected": true,
44
+ "id": "@id",
45
+ "type": "@type",
46
+ "serviceEndpoint": {
47
+ "@id": "https://www.w3.org/ns/did#serviceEndpoint",
48
+ "@type": "@id"
49
+ }
50
+ }
51
+ },
52
+ "verificationMethod": {
53
+ "@id": "https://w3id.org/security#verificationMethod",
54
+ "@type": "@id"
55
+ },
56
+ "Multikey": {
57
+ "@id": "https://w3id.org/security#Multikey",
58
+ "@context": {
59
+ "@protected": true,
60
+ "id": "@id",
61
+ "type": "@type",
62
+ "controller": {
63
+ "@id": "https://w3id.org/security#controller",
64
+ "@type": "@id"
65
+ },
66
+ "revoked": {
67
+ "@id": "https://w3id.org/security#revoked",
68
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
69
+ },
70
+ "expires": {
71
+ "@id": "https://w3id.org/security#expiration",
72
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
73
+ },
74
+ "publicKeyMultibase": {
75
+ "@id": "https://w3id.org/security#publicKeyMultibase",
76
+ "@type": "https://w3id.org/security#multibase"
77
+ },
78
+ "secretKeyMultibase": {
79
+ "@id": "https://w3id.org/security#secretKeyMultibase",
80
+ "@type": "https://w3id.org/security#multibase"
81
+ }
82
+ }
83
+ },
84
+ "JsonWebKey": {
85
+ "@id": "https://w3id.org/security#JsonWebKey",
86
+ "@context": {
87
+ "@protected": true,
88
+ "id": "@id",
89
+ "type": "@type",
90
+ "controller": {
91
+ "@id": "https://w3id.org/security#controller",
92
+ "@type": "@id"
93
+ },
94
+ "revoked": {
95
+ "@id": "https://w3id.org/security#revoked",
96
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
97
+ },
98
+ "expires": {
99
+ "@id": "https://w3id.org/security#expiration",
100
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
101
+ },
102
+ "publicKeyJwk": {
103
+ "@id": "https://w3id.org/security#publicKeyJwk",
104
+ "@type": "@json"
105
+ },
106
+ "secretKeyJwk": {
107
+ "@id": "https://w3id.org/security#secretKeyJwk",
108
+ "@type": "@json"
109
+ }
110
+ }
111
+ }
112
+ }
113
+ }
@@ -0,0 +1,57 @@
1
+ {
2
+ "@context": {
3
+ "@protected": true,
4
+ "id": "@id",
5
+ "type": "@type",
6
+ "alsoKnownAs": {
7
+ "@id": "https://www.w3.org/ns/activitystreams#alsoKnownAs",
8
+ "@type": "@id"
9
+ },
10
+ "assertionMethod": {
11
+ "@id": "https://w3id.org/security#assertionMethod",
12
+ "@type": "@id",
13
+ "@container": "@set"
14
+ },
15
+ "authentication": {
16
+ "@id": "https://w3id.org/security#authenticationMethod",
17
+ "@type": "@id",
18
+ "@container": "@set"
19
+ },
20
+ "capabilityDelegation": {
21
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
22
+ "@type": "@id",
23
+ "@container": "@set"
24
+ },
25
+ "capabilityInvocation": {
26
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
27
+ "@type": "@id",
28
+ "@container": "@set"
29
+ },
30
+ "controller": {
31
+ "@id": "https://w3id.org/security#controller",
32
+ "@type": "@id"
33
+ },
34
+ "keyAgreement": {
35
+ "@id": "https://w3id.org/security#keyAgreementMethod",
36
+ "@type": "@id",
37
+ "@container": "@set"
38
+ },
39
+ "service": {
40
+ "@id": "https://www.w3.org/ns/did#service",
41
+ "@type": "@id",
42
+ "@context": {
43
+ "@protected": true,
44
+ "id": "@id",
45
+ "type": "@type",
46
+ "serviceEndpoint": {
47
+ "@id": "https://www.w3.org/ns/did#serviceEndpoint",
48
+ "@type": "@id"
49
+ }
50
+ }
51
+ },
52
+ "verificationMethod": {
53
+ "@id": "https://w3id.org/security#verificationMethod",
54
+ "@type": "@id"
55
+ }
56
+ }
57
+ }
@@ -0,0 +1,93 @@
1
+ {
2
+ "@context": {
3
+ "id": "@id",
4
+ "type": "@type",
5
+ "@protected": true,
6
+ "proof": {
7
+ "@id": "https://w3id.org/security#proof",
8
+ "@type": "@id",
9
+ "@container": "@graph"
10
+ },
11
+ "Ed25519VerificationKey2020": {
12
+ "@id": "https://w3id.org/security#Ed25519VerificationKey2020",
13
+ "@context": {
14
+ "@protected": true,
15
+ "id": "@id",
16
+ "type": "@type",
17
+ "controller": {
18
+ "@id": "https://w3id.org/security#controller",
19
+ "@type": "@id"
20
+ },
21
+ "revoked": {
22
+ "@id": "https://w3id.org/security#revoked",
23
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
24
+ },
25
+ "publicKeyMultibase": {
26
+ "@id": "https://w3id.org/security#publicKeyMultibase",
27
+ "@type": "https://w3id.org/security#multibase"
28
+ }
29
+ }
30
+ },
31
+ "Ed25519Signature2020": {
32
+ "@id": "https://w3id.org/security#Ed25519Signature2020",
33
+ "@context": {
34
+ "@protected": true,
35
+ "id": "@id",
36
+ "type": "@type",
37
+ "challenge": "https://w3id.org/security#challenge",
38
+ "created": {
39
+ "@id": "http://purl.org/dc/terms/created",
40
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
41
+ },
42
+ "domain": "https://w3id.org/security#domain",
43
+ "expires": {
44
+ "@id": "https://w3id.org/security#expiration",
45
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
46
+ },
47
+ "nonce": "https://w3id.org/security#nonce",
48
+ "proofPurpose": {
49
+ "@id": "https://w3id.org/security#proofPurpose",
50
+ "@type": "@vocab",
51
+ "@context": {
52
+ "@protected": true,
53
+ "id": "@id",
54
+ "type": "@type",
55
+ "assertionMethod": {
56
+ "@id": "https://w3id.org/security#assertionMethod",
57
+ "@type": "@id",
58
+ "@container": "@set"
59
+ },
60
+ "authentication": {
61
+ "@id": "https://w3id.org/security#authenticationMethod",
62
+ "@type": "@id",
63
+ "@container": "@set"
64
+ },
65
+ "capabilityInvocation": {
66
+ "@id": "https://w3id.org/security#capabilityInvocationMethod",
67
+ "@type": "@id",
68
+ "@container": "@set"
69
+ },
70
+ "capabilityDelegation": {
71
+ "@id": "https://w3id.org/security#capabilityDelegationMethod",
72
+ "@type": "@id",
73
+ "@container": "@set"
74
+ },
75
+ "keyAgreement": {
76
+ "@id": "https://w3id.org/security#keyAgreementMethod",
77
+ "@type": "@id",
78
+ "@container": "@set"
79
+ }
80
+ }
81
+ },
82
+ "proofValue": {
83
+ "@id": "https://w3id.org/security#proofValue",
84
+ "@type": "https://w3id.org/security#multibase"
85
+ },
86
+ "verificationMethod": {
87
+ "@id": "https://w3id.org/security#verificationMethod",
88
+ "@type": "@id"
89
+ }
90
+ }
91
+ }
92
+ }
93
+ }
@@ -0,0 +1,35 @@
1
+ {
2
+ "@context": {
3
+ "id": "@id",
4
+ "type": "@type",
5
+ "@protected": true,
6
+ "Multikey": {
7
+ "@id": "https://w3id.org/security#Multikey",
8
+ "@context": {
9
+ "@protected": true,
10
+ "id": "@id",
11
+ "type": "@type",
12
+ "controller": {
13
+ "@id": "https://w3id.org/security#controller",
14
+ "@type": "@id"
15
+ },
16
+ "revoked": {
17
+ "@id": "https://w3id.org/security#revoked",
18
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
19
+ },
20
+ "expires": {
21
+ "@id": "https://w3id.org/security#expiration",
22
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
23
+ },
24
+ "publicKeyMultibase": {
25
+ "@id": "https://w3id.org/security#publicKeyMultibase",
26
+ "@type": "https://w3id.org/security#multibase"
27
+ },
28
+ "secretKeyMultibase": {
29
+ "@id": "https://w3id.org/security#secretKeyMultibase",
30
+ "@type": "https://w3id.org/security#multibase"
31
+ }
32
+ }
33
+ }
34
+ }
35
+ }
@@ -2,62 +2,89 @@
2
2
  // SPDX-License-Identifier: Apache-2.0.
3
3
  import { GeneralError, Is } from "@twin.org/core";
4
4
  import { JsonLdProcessor } from "@twin.org/data-json-ld";
5
- import dataspaceProtocol from "./ldContexts/dataspace-protocol.json" with { type: "json" };
5
+ import dataspaceProtocol2024 from "./ldContexts/dataspace-protocol-2024.json" with { type: "json" };
6
+ import dataspaceProtocol2025 from "./ldContexts/dataspace-protocol-2025.json" with { type: "json" };
6
7
  import dcmitype from "./ldContexts/dublin-core-dcmitype.json" with { type: "json" };
7
8
  import dcTerms from "./ldContexts/dublin-core-terms.json" with { type: "json" };
8
9
  import foaf from "./ldContexts/foaf.json" with { type: "json" };
9
- import gaiaX2411 from "./ldContexts/gaia-x-v24.11.json" with { type: "json" };
10
+ import gs1epcis from "./ldContexts/gs1-epcis.json" with { type: "json" };
11
+ import gs1vocab from "./ldContexts/gs1-vocab.json" with { type: "json" };
10
12
  import odrlDataspaceProtocol from "./ldContexts/odrl-dataspace-protocol.json" with { type: "json" };
11
13
  import schemaOrg from "./ldContexts/schema.org.json" with { type: "json" };
12
- import unCefact from "./ldContexts/un-cefact-vocab.json" with { type: "json" };
14
+ import unCefactD23B from "./ldContexts/un-cefact-d23b.json" with { type: "json" };
13
15
  import w3cActivityStreams from "./ldContexts/w3c-activity-streams.json" with { type: "json" };
16
+ import w3cDataIntegrityV2 from "./ldContexts/w3c-data-integrity-v2.json" with { type: "json" };
14
17
  import w3cDcat from "./ldContexts/w3c-dcat.json" with { type: "json" };
15
18
  import w3cOdrl from "./ldContexts/w3c-odrl.json" with { type: "json" };
16
19
  import w3cRdf from "./ldContexts/w3c-rdf.json" with { type: "json" };
17
- import w3cVc from "./ldContexts/w3c-vc-data-model-v2.json" with { type: "json" };
18
- import w3IdJws from "./ldContexts/w3id-jws-2020-v1.json" with { type: "json" };
20
+ import w3cVcV1 from "./ldContexts/w3c-vc-data-model-v1.json" with { type: "json" };
21
+ import w3cVcV2 from "./ldContexts/w3c-vc-data-model-v2.json" with { type: "json" };
22
+ import w3idCidV1 from "./ldContexts/w3id-cid-v1.json" with { type: "json" };
23
+ import w3idDidV1 from "./ldContexts/w3id-did-v1.json" with { type: "json" };
24
+ import w3idEd25519V1 from "./ldContexts/w3id-ed25519-v1.json" with { type: "json" };
25
+ import w3idJwsV1 from "./ldContexts/w3id-jws-2020-v1.json" with { type: "json" };
26
+ import w3idMultiKeyV1 from "./ldContexts/w3id-multikey-v1.json" with { type: "json" };
19
27
  /**
20
28
  * Map of all the ld contexts by their URL.
21
29
  */
22
30
  export const LD_CONTEXTS = {
31
+ // Data Space Protocol
32
+ "https://w3id.org/dspace/2024/1/": dataspaceProtocol2024,
33
+ "https://w3id.org/dspace/2024/1/context.json": dataspaceProtocol2024,
34
+ "https://w3id.org/dspace/2024/1/context.jsonld": dataspaceProtocol2024,
35
+ "https://w3id.org/dspace/2025/1/": dataspaceProtocol2025,
36
+ "https://w3id.org/dspace/2025/1/context.json": dataspaceProtocol2025,
37
+ "https://w3id.org/dspace/2025/1/context.jsonld": dataspaceProtocol2025,
38
+ "https://schema.twindev.org/dataspace-protocol/": dataspaceProtocol2025,
39
+ "https://w3id.org/dspace/2025/1/odrl-profile.jsonld": odrlDataspaceProtocol,
40
+ // DCSA does not have JSON-LD context definitions
41
+ // Dublin Core
42
+ "http://purl.org/dc/terms/": dcTerms,
43
+ "http://purl.org/dc/dcmitype/": dcmitype,
44
+ "https://schema.twindev.org/dublin-core/terms.jsonld": dcTerms,
45
+ "https://schema.twindev.org/dublin-core/dcmitype.jsonld": dcmitype,
46
+ // Foaf
47
+ "https://schema.twindev.org/foaf/": foaf,
48
+ "https://schema.twindev.org/foaf/types.jsonld": foaf,
49
+ "http://xmlns.com/foaf/0.1/": foaf,
50
+ // GS1 EPCIS
51
+ "https://ref.gs1.org/epcis/": gs1epcis,
52
+ "https://ref.gs1.org/epcis": gs1epcis,
53
+ "https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld": gs1epcis,
54
+ // GS1 Vocab
55
+ "https://gs1.org/voc/": gs1vocab,
56
+ "https://ref.gs1.org/voc/data/gs1Voc.jsonld": gs1vocab,
23
57
  // schema.org
24
58
  "https://schema.org": schemaOrg,
25
59
  "http://schema.org": schemaOrg,
60
+ "https://schema.org/": schemaOrg,
61
+ "http://schema.org/": schemaOrg,
26
62
  "https://schema.org/docs/jsonldcontext.jsonld": schemaOrg,
27
- // Gaia-X
28
- "https://w3id.org/gaia-x/2411": gaiaX2411,
29
- "https://w3id.org/gaia-x/2411#": gaiaX2411,
30
- "https://schema.twindev.org/gaia-x-loire/": gaiaX2411,
31
- "https://schema.twindev.org/gaia-x-loire/types.jsonld": gaiaX2411,
63
+ // UN/CEFACT
64
+ "https://vocabulary.uncefact.org": unCefactD23B,
65
+ "https://vocabulary.uncefact.org/": unCefactD23B,
66
+ "https://vocabulary.uncefact.org/unece-context.jsonld": unCefactD23B,
67
+ "https://vocabulary.uncefact.org/unece-context-D23B.jsonld": unCefactD23B,
68
+ // W3C Activity Streams
69
+ "https://www.w3.org/ns/activitystreams#": w3cActivityStreams,
70
+ "https://www.w3.org/ns/activitystreams": w3cActivityStreams,
71
+ "https://www.w3.org/ns/activitystreams.jsonld": w3cActivityStreams,
32
72
  // W3C DCAT
33
73
  "http://www.w3.org/ns/dcat#": w3cDcat,
34
74
  "https://www.w3.org/ns/dcat.jsonld": w3cDcat,
35
75
  "http://www.w3.org/ns/dcat.jsonld": w3cDcat,
76
+ // W3C DID
77
+ "https://www.w3.org/ns/did/v1": w3idDidV1,
78
+ "https://www.w3.org/2018/credentials/v1": w3cVcV1,
79
+ "https://www.w3.org/ns/credentials/v2": w3cVcV2,
80
+ "https://w3id.org/security/suites/jws-2020/v1": w3idJwsV1,
81
+ "https://w3id.org/security/suites/ed25519-2020/v1": w3idEd25519V1,
82
+ "https://w3id.org/security/data-integrity/v2": w3cDataIntegrityV2,
83
+ "https://www.w3.org/ns/cid/v1": w3idCidV1,
84
+ "https://w3id.org/security/multikey/v1": w3idMultiKeyV1,
36
85
  // W3C ODRL
86
+ "http://www.w3.org/ns/odrl/2/": w3cOdrl,
37
87
  "http://www.w3.org/ns/odrl.jsonld": w3cOdrl,
38
- // W3C Activity Streams
39
- "https://www.w3.org/ns/activitystreams#": w3cActivityStreams,
40
- "https://www.w3.org/ns/activitystreams": w3cActivityStreams,
41
- // W3C Credentials
42
- "https://www.w3.org/ns/credentials/v2": w3cVc,
43
- "https://w3id.org/security/suites/jws-2020/v1": w3IdJws,
44
- // UN/CEFACT
45
- "https://vocabulary.uncefact.org": unCefact,
46
- "https://vocabulary.uncefact.org/unece-context.jsonld": unCefact,
47
- "https://vocabulary.uncefact.org/unece-context-D23B.jsonld": unCefact,
48
- // Dublin Core
49
- "http://purl.org/dc/terms/": dcTerms,
50
- "http://purl.org/dc/dcmitype/": dcmitype,
51
- "https://schema.twindev.org/dublin-core/terms.jsonld": dcTerms,
52
- "https://schema.twindev.org/dublin-core/dcmitype.jsonld": dcmitype,
53
- // Data Space Protocol
54
- "https://w3id.org/dspace/2024/1/context.json": dataspaceProtocol,
55
- "https://w3id.org/dspace/2025/1/context.jsonld": dataspaceProtocol,
56
- "https://w3id.org/dspace/2025/1/odrl-profile.jsonld": odrlDataspaceProtocol,
57
- // Foaf
58
- "https://schema.twindev.org/foaf/": foaf,
59
- "https://schema.twindev.org/foaf/types.jsonld": foaf,
60
- "http://xmlns.com/foaf/0.1/": foaf,
61
88
  // W3C RDF
62
89
  "https://schema.twindev.org/w3c-rdf/": w3cRdf,
63
90
  "https://schema.twindev.org/w3c-rdf/types.jsonld": w3cRdf,
@@ -65,6 +92,7 @@ export const LD_CONTEXTS = {
65
92
  };
66
93
  /**
67
94
  * Add all the contexts to the document cache.
95
+ * @returns A promise that resolves when all contexts have been added to the cache.
68
96
  */
69
97
  export async function addAllContextsToDocumentCache() {
70
98
  for (const url in LD_CONTEXTS) {
@@ -74,6 +102,8 @@ export async function addAllContextsToDocumentCache() {
74
102
  /**
75
103
  * Add a context to the document cache.
76
104
  * @param url The URL of the context to add to the cache.
105
+ * @returns A promise that resolves when the context has been added to the cache.
106
+ * @throws GeneralError if the context URL is not found in the known contexts map.
77
107
  */
78
108
  export async function addContextToDocumentCache(url) {
79
109
  if (Is.empty(LD_CONTEXTS[url])) {
@@ -1 +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,IAAI,MAAM,wBAAwB,CAAC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ralError, 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 foaf from \"./ldContexts/foaf.json\" with { type: \"json\" };\nimport gaiaX2411 from \"./ldContexts/gaia-x-v24.11.json\" with { type: \"json\" };\nimport odrlDataspaceProtocol from \"./ldContexts/odrl-dataspace-protocol.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 w3cDcat from \"./ldContexts/w3c-dcat.json\" with { type: \"json\" };\nimport w3cOdrl from \"./ldContexts/w3c-odrl.json\" with { type: \"json\" };\nimport w3cRdf from \"./ldContexts/w3c-rdf.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 DCAT\n\t\"http://www.w3.org/ns/dcat#\": w3cDcat,\n\t\"https://www.w3.org/ns/dcat.jsonld\": w3cDcat,\n\t\"http://www.w3.org/ns/dcat.jsonld\": w3cDcat,\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\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\t\"https://vocabulary.uncefact.org/unece-context.jsonld\": unCefact,\n\t\"https://vocabulary.uncefact.org/unece-context-D23B.jsonld\": 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// Data Space Protocol\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\"https://w3id.org/dspace/2025/1/odrl-profile.jsonld\": odrlDataspaceProtocol,\n\n\t// Foaf\n\t\"https://schema.twindev.org/foaf/\": foaf,\n\t\"https://schema.twindev.org/foaf/types.jsonld\": foaf,\n\t\"http://xmlns.com/foaf/0.1/\": foaf,\n\n\t// W3C RDF\n\t\"https://schema.twindev.org/w3c-rdf/\": w3cRdf,\n\t\"https://schema.twindev.org/w3c-rdf/types.jsonld\": w3cRdf,\n\t\"http://www.w3.org/2000/01/rdf-schema#\": w3cRdf\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"]}
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,qBAAqB,MAAM,2CAA2C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpG,OAAO,qBAAqB,MAAM,2CAA2C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpG,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,IAAI,MAAM,wBAAwB,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChE,OAAO,QAAQ,MAAM,6BAA6B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACzE,OAAO,QAAQ,MAAM,6BAA6B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACzE,OAAO,qBAAqB,MAAM,2CAA2C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpG,OAAO,SAAS,MAAM,8BAA8B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC3E,OAAO,YAAY,MAAM,kCAAkC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAClF,OAAO,kBAAkB,MAAM,wCAA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U,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;;;;;GAKG;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 dataspaceProtocol2024 from \"./ldContexts/dataspace-protocol-2024.json\" with { type: \"json\" };\nimport dataspaceProtocol2025 from \"./ldContexts/dataspace-protocol-2025.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 foaf from \"./ldContexts/foaf.json\" with { type: \"json\" };\nimport gs1epcis from \"./ldContexts/gs1-epcis.json\" with { type: \"json\" };\nimport gs1vocab from \"./ldContexts/gs1-vocab.json\" with { type: \"json\" };\nimport odrlDataspaceProtocol from \"./ldContexts/odrl-dataspace-protocol.json\" with { type: \"json\" };\nimport schemaOrg from \"./ldContexts/schema.org.json\" with { type: \"json\" };\nimport unCefactD23B from \"./ldContexts/un-cefact-d23b.json\" with { type: \"json\" };\nimport w3cActivityStreams from \"./ldContexts/w3c-activity-streams.json\" with { type: \"json\" };\nimport w3cDataIntegrityV2 from \"./ldContexts/w3c-data-integrity-v2.json\" with { type: \"json\" };\nimport w3cDcat from \"./ldContexts/w3c-dcat.json\" with { type: \"json\" };\nimport w3cOdrl from \"./ldContexts/w3c-odrl.json\" with { type: \"json\" };\nimport w3cRdf from \"./ldContexts/w3c-rdf.json\" with { type: \"json\" };\nimport w3cVcV1 from \"./ldContexts/w3c-vc-data-model-v1.json\" with { type: \"json\" };\nimport w3cVcV2 from \"./ldContexts/w3c-vc-data-model-v2.json\" with { type: \"json\" };\nimport w3idCidV1 from \"./ldContexts/w3id-cid-v1.json\" with { type: \"json\" };\nimport w3idDidV1 from \"./ldContexts/w3id-did-v1.json\" with { type: \"json\" };\nimport w3idEd25519V1 from \"./ldContexts/w3id-ed25519-v1.json\" with { type: \"json\" };\nimport w3idJwsV1 from \"./ldContexts/w3id-jws-2020-v1.json\" with { type: \"json\" };\nimport w3idMultiKeyV1 from \"./ldContexts/w3id-multikey-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// Data Space Protocol\n\t\"https://w3id.org/dspace/2024/1/\": dataspaceProtocol2024,\n\t\"https://w3id.org/dspace/2024/1/context.json\": dataspaceProtocol2024,\n\t\"https://w3id.org/dspace/2024/1/context.jsonld\": dataspaceProtocol2024,\n\t\"https://w3id.org/dspace/2025/1/\": dataspaceProtocol2025,\n\t\"https://w3id.org/dspace/2025/1/context.json\": dataspaceProtocol2025,\n\t\"https://w3id.org/dspace/2025/1/context.jsonld\": dataspaceProtocol2025,\n\t\"https://schema.twindev.org/dataspace-protocol/\": dataspaceProtocol2025,\n\t\"https://w3id.org/dspace/2025/1/odrl-profile.jsonld\": odrlDataspaceProtocol,\n\n\t// DCSA does not have JSON-LD context definitions\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// Foaf\n\t\"https://schema.twindev.org/foaf/\": foaf,\n\t\"https://schema.twindev.org/foaf/types.jsonld\": foaf,\n\t\"http://xmlns.com/foaf/0.1/\": foaf,\n\n\t// GS1 EPCIS\n\t\"https://ref.gs1.org/epcis/\": gs1epcis,\n\t\"https://ref.gs1.org/epcis\": gs1epcis,\n\t\"https://ref.gs1.org/standards/epcis/2.0.0/epcis-context.jsonld\": gs1epcis,\n\n\t// GS1 Vocab\n\t\"https://gs1.org/voc/\": gs1vocab,\n\t\"https://ref.gs1.org/voc/data/gs1Voc.jsonld\": gs1vocab,\n\n\t// schema.org\n\t\"https://schema.org\": schemaOrg,\n\t\"http://schema.org\": schemaOrg,\n\t\"https://schema.org/\": schemaOrg,\n\t\"http://schema.org/\": schemaOrg,\n\t\"https://schema.org/docs/jsonldcontext.jsonld\": schemaOrg,\n\n\t// UN/CEFACT\n\t\"https://vocabulary.uncefact.org\": unCefactD23B,\n\t\"https://vocabulary.uncefact.org/\": unCefactD23B,\n\t\"https://vocabulary.uncefact.org/unece-context.jsonld\": unCefactD23B,\n\t\"https://vocabulary.uncefact.org/unece-context-D23B.jsonld\": unCefactD23B,\n\n\t// W3C Activity Streams\n\t\"https://www.w3.org/ns/activitystreams#\": w3cActivityStreams,\n\t\"https://www.w3.org/ns/activitystreams\": w3cActivityStreams,\n\t\"https://www.w3.org/ns/activitystreams.jsonld\": w3cActivityStreams,\n\n\t// W3C DCAT\n\t\"http://www.w3.org/ns/dcat#\": w3cDcat,\n\t\"https://www.w3.org/ns/dcat.jsonld\": w3cDcat,\n\t\"http://www.w3.org/ns/dcat.jsonld\": w3cDcat,\n\n\t// W3C DID\n\t\"https://www.w3.org/ns/did/v1\": w3idDidV1,\n\t\"https://www.w3.org/2018/credentials/v1\": w3cVcV1,\n\t\"https://www.w3.org/ns/credentials/v2\": w3cVcV2,\n\t\"https://w3id.org/security/suites/jws-2020/v1\": w3idJwsV1,\n\t\"https://w3id.org/security/suites/ed25519-2020/v1\": w3idEd25519V1,\n\t\"https://w3id.org/security/data-integrity/v2\": w3cDataIntegrityV2,\n\t\"https://www.w3.org/ns/cid/v1\": w3idCidV1,\n\t\"https://w3id.org/security/multikey/v1\": w3idMultiKeyV1,\n\n\t// W3C ODRL\n\t\"http://www.w3.org/ns/odrl/2/\": w3cOdrl,\n\t\"http://www.w3.org/ns/odrl.jsonld\": w3cOdrl,\n\n\t// W3C RDF\n\t\"https://schema.twindev.org/w3c-rdf/\": w3cRdf,\n\t\"https://schema.twindev.org/w3c-rdf/types.jsonld\": w3cRdf,\n\t\"http://www.w3.org/2000/01/rdf-schema#\": w3cRdf\n};\n\n/**\n * Add all the contexts to the document cache.\n * @returns A promise that resolves when all contexts have been added to the 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 * @returns A promise that resolves when the context has been added to the cache.\n * @throws GeneralError if the context URL is not found in the known contexts map.\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"]}
@@ -6,10 +6,13 @@ export declare const LD_CONTEXTS: {
6
6
  };
7
7
  /**
8
8
  * Add all the contexts to the document cache.
9
+ * @returns A promise that resolves when all contexts have been added to the cache.
9
10
  */
10
11
  export declare function addAllContextsToDocumentCache(): Promise<void>;
11
12
  /**
12
13
  * Add a context to the document cache.
13
14
  * @param url The URL of the context to add to the cache.
15
+ * @returns A promise that resolves when the context has been added to the cache.
16
+ * @throws GeneralError if the context URL is not found in the known contexts map.
14
17
  */
15
18
  export declare function addContextToDocumentCache(url: string): Promise<void>;