@twin.org/standards-w3c-odrl 0.0.3-next.5 → 0.0.3-next.7
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/dataTypes/odrlDataTypes.js +15 -15
- package/dist/es/dataTypes/odrlDataTypes.js.map +1 -1
- package/dist/es/models/odrlContextType.js.map +1 -1
- package/dist/es/models/odrlContexts.js +6 -2
- package/dist/es/models/odrlContexts.js.map +1 -1
- package/dist/es/schemas/OdrlAgreement.json +12 -3
- package/dist/es/schemas/OdrlOffer.json +12 -3
- package/dist/es/schemas/OdrlPolicy.json +12 -3
- package/dist/es/schemas/OdrlSet.json +12 -3
- package/dist/types/models/odrlContextType.d.ts +1 -1
- package/dist/types/models/odrlContexts.d.ts +6 -2
- package/docs/changelog.md +30 -0
- package/docs/reference/type-aliases/OdrlContextType.md +1 -1
- package/docs/reference/variables/OdrlContexts.md +8 -2
- package/package.json +3 -3
|
@@ -33,77 +33,77 @@ export class OdrlDataTypes {
|
|
|
33
33
|
* Register all the data types.
|
|
34
34
|
*/
|
|
35
35
|
static registerTypes() {
|
|
36
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
36
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Policy}`, () => ({
|
|
37
37
|
context: OdrlContexts.ContextRoot,
|
|
38
38
|
type: OdrlTypes.Policy,
|
|
39
39
|
jsonSchema: async () => OdrlPolicySchema
|
|
40
40
|
}));
|
|
41
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
41
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Asset}`, () => ({
|
|
42
42
|
context: OdrlContexts.ContextRoot,
|
|
43
43
|
type: OdrlTypes.Asset,
|
|
44
44
|
jsonSchema: async () => OdrlAssetSchema
|
|
45
45
|
}));
|
|
46
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
46
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.AssetCollection}`, () => ({
|
|
47
47
|
context: OdrlContexts.ContextRoot,
|
|
48
48
|
type: OdrlTypes.AssetCollection,
|
|
49
49
|
jsonSchema: async () => OdrlAssetCollectionSchema
|
|
50
50
|
}));
|
|
51
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
51
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Party}`, () => ({
|
|
52
52
|
context: OdrlContexts.ContextRoot,
|
|
53
53
|
type: OdrlTypes.Party,
|
|
54
54
|
jsonSchema: async () => OdrlPartySchema
|
|
55
55
|
}));
|
|
56
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
56
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.PartyCollection}`, () => ({
|
|
57
57
|
context: OdrlContexts.ContextRoot,
|
|
58
58
|
type: OdrlTypes.PartyCollection,
|
|
59
59
|
jsonSchema: async () => OdrlPartyCollectionSchema
|
|
60
60
|
}));
|
|
61
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
61
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Action}`, () => ({
|
|
62
62
|
context: OdrlContexts.ContextRoot,
|
|
63
63
|
type: OdrlTypes.Action,
|
|
64
64
|
jsonSchema: async () => OdrlActionSchema
|
|
65
65
|
}));
|
|
66
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
66
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Permission}`, () => ({
|
|
67
67
|
context: OdrlContexts.ContextRoot,
|
|
68
68
|
type: OdrlTypes.Permission,
|
|
69
69
|
jsonSchema: async () => OdrlPermissionSchema
|
|
70
70
|
}));
|
|
71
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
71
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Prohibition}`, () => ({
|
|
72
72
|
context: OdrlContexts.ContextRoot,
|
|
73
73
|
type: OdrlTypes.Prohibition,
|
|
74
74
|
jsonSchema: async () => OdrlProhibitionSchema
|
|
75
75
|
}));
|
|
76
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
76
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Duty}`, () => ({
|
|
77
77
|
context: OdrlContexts.ContextRoot,
|
|
78
78
|
type: OdrlTypes.Duty,
|
|
79
79
|
jsonSchema: async () => OdrlDutySchema
|
|
80
80
|
}));
|
|
81
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
81
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Constraint}`, () => ({
|
|
82
82
|
context: OdrlContexts.ContextRoot,
|
|
83
83
|
type: OdrlTypes.Constraint,
|
|
84
84
|
jsonSchema: async () => OdrlConstraintSchema
|
|
85
85
|
}));
|
|
86
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
86
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.LogicalConstraint}`, () => ({
|
|
87
87
|
context: OdrlContexts.ContextRoot,
|
|
88
88
|
type: OdrlTypes.LogicalConstraint,
|
|
89
89
|
jsonSchema: async () => OdrlLogicalConstraintSchema
|
|
90
90
|
}));
|
|
91
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
91
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Set}`, () => ({
|
|
92
92
|
context: OdrlContexts.ContextRoot,
|
|
93
93
|
type: OdrlTypes.Set,
|
|
94
94
|
jsonSchema: async () => OdrlSetSchema
|
|
95
95
|
}));
|
|
96
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
96
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Offer}`, () => ({
|
|
97
97
|
context: OdrlContexts.ContextRoot,
|
|
98
98
|
type: OdrlTypes.Offer,
|
|
99
99
|
jsonSchema: async () => OdrlOfferSchema
|
|
100
100
|
}));
|
|
101
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
101
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Agreement}`, () => ({
|
|
102
102
|
context: OdrlContexts.ContextRoot,
|
|
103
103
|
type: OdrlTypes.Agreement,
|
|
104
104
|
jsonSchema: async () => OdrlAgreementSchema
|
|
105
105
|
}));
|
|
106
|
-
DataTypeHandlerFactory.register(`${OdrlContexts.
|
|
106
|
+
DataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Rule}`, () => ({
|
|
107
107
|
context: OdrlContexts.ContextRoot,
|
|
108
108
|
type: OdrlTypes.Rule,
|
|
109
109
|
jsonSchema: async () => OdrlRuleSchema
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odrlDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/odrlDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,gBAAgB,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChF,OAAO,mBAAmB,MAAM,+BAA+B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtF,OAAO,eAAe,MAAM,2BAA2B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9E,OAAO,yBAAyB,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,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AAC,WAAW;YACjC,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,cAA6B;SACrD,CAAC,CAAC,CAAC;IACL,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHandlerFactory } from \"@twin.org/data-core\";\nimport type { IJsonSchema } from \"@twin.org/data-core\";\nimport { JsonLdProcessor } from \"@twin.org/data-json-ld\";\nimport { OdrlContexts } from \"../models/odrlContexts.js\";\nimport { OdrlTypes } from \"../models/types/odrlTypes.js\";\nimport OdrlActionSchema from \"../schemas/OdrlAction.json\" with { type: \"json\" };\nimport OdrlAgreementSchema from \"../schemas/OdrlAgreement.json\" with { type: \"json\" };\nimport OdrlAssetSchema from \"../schemas/OdrlAsset.json\" with { type: \"json\" };\nimport OdrlAssetCollectionSchema from \"../schemas/OdrlAssetCollection.json\" with { type: \"json\" };\nimport OdrlConstraintSchema from \"../schemas/OdrlConstraint.json\" with { type: \"json\" };\nimport OdrlDutySchema from \"../schemas/OdrlDuty.json\" with { type: \"json\" };\nimport OdrlLogicalConstraintSchema from \"../schemas/OdrlLogicalConstraint.json\" with { type: \"json\" };\nimport OdrlOfferSchema from \"../schemas/OdrlOffer.json\" with { type: \"json\" };\nimport OdrlPartySchema from \"../schemas/OdrlParty.json\" with { type: \"json\" };\nimport OdrlPartyCollectionSchema from \"../schemas/OdrlPartyCollection.json\" with { type: \"json\" };\nimport OdrlPermissionSchema from \"../schemas/OdrlPermission.json\" with { type: \"json\" };\nimport OdrlPolicySchema from \"../schemas/OdrlPolicy.json\" with { type: \"json\" };\nimport OdrlProhibitionSchema from \"../schemas/OdrlProhibition.json\" with { type: \"json\" };\nimport OdrlRuleSchema from \"../schemas/OdrlRule.json\" with { type: \"json\" };\nimport OdrlSetSchema from \"../schemas/OdrlSet.json\" with { type: \"json\" };\n\n/**\n * Handle all the data types for ODRL.\n */\nexport class OdrlDataTypes {\n\t/**\n\t * Register the JSON-LD Redirects.\n\t */\n\tpublic static registerRedirects(): void {\n\t\tJsonLdProcessor.addRedirect(\n\t\t\t/https?:\\/\\/www\\.w3\\.org\\/ns\\/odrl\\/?/,\n\t\t\tOdrlContexts.ContextRedirect\n\t\t);\n\t}\n\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Policy}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Policy,\n\t\t\tjsonSchema: async () => OdrlPolicySchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Asset}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Asset,\n\t\t\tjsonSchema: async () => OdrlAssetSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${OdrlContexts.ContextRoot}${OdrlTypes.AssetCollection}`,\n\t\t\t() => ({\n\t\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\t\ttype: OdrlTypes.AssetCollection,\n\t\t\t\tjsonSchema: async () => OdrlAssetCollectionSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Party}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Party,\n\t\t\tjsonSchema: async () => OdrlPartySchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${OdrlContexts.ContextRoot}${OdrlTypes.PartyCollection}`,\n\t\t\t() => ({\n\t\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\t\ttype: OdrlTypes.PartyCollection,\n\t\t\t\tjsonSchema: async () => OdrlPartyCollectionSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Action}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Action,\n\t\t\tjsonSchema: async () => OdrlActionSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Permission}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Permission,\n\t\t\tjsonSchema: async () => OdrlPermissionSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Prohibition}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Prohibition,\n\t\t\tjsonSchema: async () => OdrlProhibitionSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Duty}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Duty,\n\t\t\tjsonSchema: async () => OdrlDutySchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Constraint}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Constraint,\n\t\t\tjsonSchema: async () => OdrlConstraintSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${OdrlContexts.ContextRoot}${OdrlTypes.LogicalConstraint}`,\n\t\t\t() => ({\n\t\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\t\ttype: OdrlTypes.LogicalConstraint,\n\t\t\t\tjsonSchema: async () => OdrlLogicalConstraintSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Set}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Set,\n\t\t\tjsonSchema: async () => OdrlSetSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Offer}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Offer,\n\t\t\tjsonSchema: async () => OdrlOfferSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Agreement}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Agreement,\n\t\t\tjsonSchema: async () => OdrlAgreementSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.ContextRoot}${OdrlTypes.Rule}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Rule,\n\t\t\tjsonSchema: async () => OdrlRuleSchema as IJsonSchema\n\t\t}));\n\t}\n}\n"]}
|
|
1
|
+
{"version":3,"file":"odrlDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/odrlDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAE7D,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACzD,OAAO,EAAE,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACzD,OAAO,gBAAgB,MAAM,4BAA4B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAChF,OAAO,mBAAmB,MAAM,+BAA+B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACtF,OAAO,eAAe,MAAM,2BAA2B,CAAC,OAAO,IAAI,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aAAa,GAAG,SAAS,CAAC,IAAI,EAAE,EAAE,GAAG,EAAE,CAAC,CAAC;YACxF,OAAO,EAAE,YAAY,CAAC,WAAW;YACjC,IAAI,EAAE,SAAS,CAAC,IAAI;YACpB,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,cAA6B;SACrD,CAAC,CAAC,CAAC;IACL,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHandlerFactory } from \"@twin.org/data-core\";\nimport type { IJsonSchema } from \"@twin.org/data-core\";\nimport { JsonLdProcessor } from \"@twin.org/data-json-ld\";\nimport { OdrlContexts } from \"../models/odrlContexts.js\";\nimport { OdrlTypes } from \"../models/types/odrlTypes.js\";\nimport OdrlActionSchema from \"../schemas/OdrlAction.json\" with { type: \"json\" };\nimport OdrlAgreementSchema from \"../schemas/OdrlAgreement.json\" with { type: \"json\" };\nimport OdrlAssetSchema from \"../schemas/OdrlAsset.json\" with { type: \"json\" };\nimport OdrlAssetCollectionSchema from \"../schemas/OdrlAssetCollection.json\" with { type: \"json\" };\nimport OdrlConstraintSchema from \"../schemas/OdrlConstraint.json\" with { type: \"json\" };\nimport OdrlDutySchema from \"../schemas/OdrlDuty.json\" with { type: \"json\" };\nimport OdrlLogicalConstraintSchema from \"../schemas/OdrlLogicalConstraint.json\" with { type: \"json\" };\nimport OdrlOfferSchema from \"../schemas/OdrlOffer.json\" with { type: \"json\" };\nimport OdrlPartySchema from \"../schemas/OdrlParty.json\" with { type: \"json\" };\nimport OdrlPartyCollectionSchema from \"../schemas/OdrlPartyCollection.json\" with { type: \"json\" };\nimport OdrlPermissionSchema from \"../schemas/OdrlPermission.json\" with { type: \"json\" };\nimport OdrlPolicySchema from \"../schemas/OdrlPolicy.json\" with { type: \"json\" };\nimport OdrlProhibitionSchema from \"../schemas/OdrlProhibition.json\" with { type: \"json\" };\nimport OdrlRuleSchema from \"../schemas/OdrlRule.json\" with { type: \"json\" };\nimport OdrlSetSchema from \"../schemas/OdrlSet.json\" with { type: \"json\" };\n\n/**\n * Handle all the data types for ODRL.\n */\nexport class OdrlDataTypes {\n\t/**\n\t * Register the JSON-LD Redirects.\n\t */\n\tpublic static registerRedirects(): void {\n\t\tJsonLdProcessor.addRedirect(\n\t\t\t/https?:\\/\\/www\\.w3\\.org\\/ns\\/odrl\\/?/,\n\t\t\tOdrlContexts.ContextRedirect\n\t\t);\n\t}\n\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Policy}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Policy,\n\t\t\tjsonSchema: async () => OdrlPolicySchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Asset}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Asset,\n\t\t\tjsonSchema: async () => OdrlAssetSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${OdrlContexts.OdrlNamespace}${OdrlTypes.AssetCollection}`,\n\t\t\t() => ({\n\t\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\t\ttype: OdrlTypes.AssetCollection,\n\t\t\t\tjsonSchema: async () => OdrlAssetCollectionSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Party}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Party,\n\t\t\tjsonSchema: async () => OdrlPartySchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${OdrlContexts.OdrlNamespace}${OdrlTypes.PartyCollection}`,\n\t\t\t() => ({\n\t\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\t\ttype: OdrlTypes.PartyCollection,\n\t\t\t\tjsonSchema: async () => OdrlPartyCollectionSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Action}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Action,\n\t\t\tjsonSchema: async () => OdrlActionSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Permission}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Permission,\n\t\t\tjsonSchema: async () => OdrlPermissionSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${OdrlContexts.OdrlNamespace}${OdrlTypes.Prohibition}`,\n\t\t\t() => ({\n\t\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\t\ttype: OdrlTypes.Prohibition,\n\t\t\t\tjsonSchema: async () => OdrlProhibitionSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Duty}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Duty,\n\t\t\tjsonSchema: async () => OdrlDutySchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Constraint}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Constraint,\n\t\t\tjsonSchema: async () => OdrlConstraintSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${OdrlContexts.OdrlNamespace}${OdrlTypes.LogicalConstraint}`,\n\t\t\t() => ({\n\t\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\t\ttype: OdrlTypes.LogicalConstraint,\n\t\t\t\tjsonSchema: async () => OdrlLogicalConstraintSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Set}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Set,\n\t\t\tjsonSchema: async () => OdrlSetSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Offer}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Offer,\n\t\t\tjsonSchema: async () => OdrlOfferSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Agreement}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Agreement,\n\t\t\tjsonSchema: async () => OdrlAgreementSchema as IJsonSchema\n\t\t}));\n\n\t\tDataTypeHandlerFactory.register(`${OdrlContexts.OdrlNamespace}${OdrlTypes.Rule}`, () => ({\n\t\t\tcontext: OdrlContexts.ContextRoot,\n\t\t\ttype: OdrlTypes.Rule,\n\t\t\tjsonSchema: async () => OdrlRuleSchema as IJsonSchema\n\t\t}));\n\t}\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odrlContextType.js","sourceRoot":"","sources":["../../../src/models/odrlContextType.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { OdrlContexts } from \"./odrlContexts.js\";\n\n/**\n * The ODRL JSON-LD context type.\n */\nexport type OdrlContextType =\n\t| typeof OdrlContexts.ContextRoot\n\t| [\n\t\t\t...IJsonLdContextDefinitionElement[],\n\t\t\ttypeof OdrlContexts.ContextRoot,\n\t\t\tIJsonLdContextDefinitionElement\n\t ]\n\t| [\n\t\t\tIJsonLdContextDefinitionElement,\n\t\t\ttypeof OdrlContexts.ContextRoot,\n\t\t\t...IJsonLdContextDefinitionElement[]\n\t ];\n"]}
|
|
1
|
+
{"version":3,"file":"odrlContextType.js","sourceRoot":"","sources":["../../../src/models/odrlContextType.ts"],"names":[],"mappings":"","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport type { IJsonLdContextDefinitionElement } from \"@twin.org/data-json-ld\";\nimport type { OdrlContexts } from \"./odrlContexts.js\";\n\n/**\n * The ODRL JSON-LD context type.\n */\nexport type OdrlContextType =\n\t| typeof OdrlContexts.ContextRoot\n\t| [typeof OdrlContexts.ContextRoot]\n\t| [\n\t\t\t...IJsonLdContextDefinitionElement[],\n\t\t\ttypeof OdrlContexts.ContextRoot,\n\t\t\tIJsonLdContextDefinitionElement\n\t ]\n\t| [\n\t\t\tIJsonLdContextDefinitionElement,\n\t\t\ttypeof OdrlContexts.ContextRoot,\n\t\t\t...IJsonLdContextDefinitionElement[]\n\t ];\n"]}
|
|
@@ -6,9 +6,13 @@
|
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
7
7
|
export const OdrlContexts = {
|
|
8
8
|
/**
|
|
9
|
-
* The
|
|
9
|
+
* The LD Context URL
|
|
10
10
|
*/
|
|
11
|
-
ContextRoot: "http://www.w3.org/ns/odrl
|
|
11
|
+
ContextRoot: "http://www.w3.org/ns/odrl.jsonld",
|
|
12
|
+
/**
|
|
13
|
+
* The namespace prefix for all terms in ODRL.
|
|
14
|
+
*/
|
|
15
|
+
OdrlNamespace: "http://www.w3.org/ns/odrl/2/",
|
|
12
16
|
/**
|
|
13
17
|
* The context root for ODRL.
|
|
14
18
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"odrlContexts.js","sourceRoot":"","sources":["../../../src/models/odrlContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B;;OAEG;IACH,WAAW,EAAE,8BAA8B;
|
|
1
|
+
{"version":3,"file":"odrlContexts.js","sourceRoot":"","sources":["../../../src/models/odrlContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC3B;;OAEG;IACH,WAAW,EAAE,kCAAkC;IAE/C;;OAEG;IACH,aAAa,EAAE,8BAA8B;IAE7C;;OAEG;IACH,eAAe,EAAE,mCAAmC;CAC3C,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts for ODRL.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const OdrlContexts = {\n\t/**\n\t * The LD Context URL\n\t */\n\tContextRoot: \"http://www.w3.org/ns/odrl.jsonld\",\n\n\t/**\n\t * The namespace prefix for all terms in ODRL.\n\t */\n\tOdrlNamespace: \"http://www.w3.org/ns/odrl/2/\",\n\n\t/**\n\t * The context root for ODRL.\n\t */\n\tContextRedirect: \"https://www.w3.org/ns/odrl.jsonld\"\n} as const;\n\n/**\n * The contexts for ODRL.\n */\nexport type OdrlContexts = (typeof OdrlContexts)[keyof typeof OdrlContexts];\n"]}
|
|
@@ -9,7 +9,16 @@
|
|
|
9
9
|
"anyOf": [
|
|
10
10
|
{
|
|
11
11
|
"type": "string",
|
|
12
|
-
"const": "http://www.w3.org/ns/odrl
|
|
12
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
19
|
+
},
|
|
20
|
+
"minItems": 1,
|
|
21
|
+
"maxItems": 1
|
|
13
22
|
},
|
|
14
23
|
{
|
|
15
24
|
"type": "array",
|
|
@@ -17,7 +26,7 @@
|
|
|
17
26
|
"prefixItems": [
|
|
18
27
|
{
|
|
19
28
|
"type": "string",
|
|
20
|
-
"const": "http://www.w3.org/ns/odrl
|
|
29
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
21
30
|
},
|
|
22
31
|
{
|
|
23
32
|
"$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
@@ -36,7 +45,7 @@
|
|
|
36
45
|
},
|
|
37
46
|
{
|
|
38
47
|
"type": "string",
|
|
39
|
-
"const": "http://www.w3.org/ns/odrl
|
|
48
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
40
49
|
}
|
|
41
50
|
],
|
|
42
51
|
"items": {
|
|
@@ -9,7 +9,16 @@
|
|
|
9
9
|
"anyOf": [
|
|
10
10
|
{
|
|
11
11
|
"type": "string",
|
|
12
|
-
"const": "http://www.w3.org/ns/odrl
|
|
12
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
19
|
+
},
|
|
20
|
+
"minItems": 1,
|
|
21
|
+
"maxItems": 1
|
|
13
22
|
},
|
|
14
23
|
{
|
|
15
24
|
"type": "array",
|
|
@@ -17,7 +26,7 @@
|
|
|
17
26
|
"prefixItems": [
|
|
18
27
|
{
|
|
19
28
|
"type": "string",
|
|
20
|
-
"const": "http://www.w3.org/ns/odrl
|
|
29
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
21
30
|
},
|
|
22
31
|
{
|
|
23
32
|
"$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
@@ -36,7 +45,7 @@
|
|
|
36
45
|
},
|
|
37
46
|
{
|
|
38
47
|
"type": "string",
|
|
39
|
-
"const": "http://www.w3.org/ns/odrl
|
|
48
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
40
49
|
}
|
|
41
50
|
],
|
|
42
51
|
"items": {
|
|
@@ -9,7 +9,16 @@
|
|
|
9
9
|
"anyOf": [
|
|
10
10
|
{
|
|
11
11
|
"type": "string",
|
|
12
|
-
"const": "http://www.w3.org/ns/odrl
|
|
12
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
19
|
+
},
|
|
20
|
+
"minItems": 1,
|
|
21
|
+
"maxItems": 1
|
|
13
22
|
},
|
|
14
23
|
{
|
|
15
24
|
"type": "array",
|
|
@@ -17,7 +26,7 @@
|
|
|
17
26
|
"prefixItems": [
|
|
18
27
|
{
|
|
19
28
|
"type": "string",
|
|
20
|
-
"const": "http://www.w3.org/ns/odrl
|
|
29
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
21
30
|
},
|
|
22
31
|
{
|
|
23
32
|
"$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
@@ -36,7 +45,7 @@
|
|
|
36
45
|
},
|
|
37
46
|
{
|
|
38
47
|
"type": "string",
|
|
39
|
-
"const": "http://www.w3.org/ns/odrl
|
|
48
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
40
49
|
}
|
|
41
50
|
],
|
|
42
51
|
"items": {
|
|
@@ -9,7 +9,16 @@
|
|
|
9
9
|
"anyOf": [
|
|
10
10
|
{
|
|
11
11
|
"type": "string",
|
|
12
|
-
"const": "http://www.w3.org/ns/odrl
|
|
12
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
13
|
+
},
|
|
14
|
+
{
|
|
15
|
+
"type": "array",
|
|
16
|
+
"items": {
|
|
17
|
+
"type": "string",
|
|
18
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
19
|
+
},
|
|
20
|
+
"minItems": 1,
|
|
21
|
+
"maxItems": 1
|
|
13
22
|
},
|
|
14
23
|
{
|
|
15
24
|
"type": "array",
|
|
@@ -17,7 +26,7 @@
|
|
|
17
26
|
"prefixItems": [
|
|
18
27
|
{
|
|
19
28
|
"type": "string",
|
|
20
|
-
"const": "http://www.w3.org/ns/odrl
|
|
29
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
21
30
|
},
|
|
22
31
|
{
|
|
23
32
|
"$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
|
|
@@ -36,7 +45,7 @@
|
|
|
36
45
|
},
|
|
37
46
|
{
|
|
38
47
|
"type": "string",
|
|
39
|
-
"const": "http://www.w3.org/ns/odrl
|
|
48
|
+
"const": "http://www.w3.org/ns/odrl.jsonld"
|
|
40
49
|
}
|
|
41
50
|
],
|
|
42
51
|
"items": {
|
|
@@ -3,7 +3,7 @@ import type { OdrlContexts } from "./odrlContexts.js";
|
|
|
3
3
|
/**
|
|
4
4
|
* The ODRL JSON-LD context type.
|
|
5
5
|
*/
|
|
6
|
-
export type OdrlContextType = typeof OdrlContexts.ContextRoot | [
|
|
6
|
+
export type OdrlContextType = typeof OdrlContexts.ContextRoot | [typeof OdrlContexts.ContextRoot] | [
|
|
7
7
|
...IJsonLdContextDefinitionElement[],
|
|
8
8
|
typeof OdrlContexts.ContextRoot,
|
|
9
9
|
IJsonLdContextDefinitionElement
|
|
@@ -3,9 +3,13 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export declare const OdrlContexts: {
|
|
5
5
|
/**
|
|
6
|
-
* The
|
|
6
|
+
* The LD Context URL
|
|
7
7
|
*/
|
|
8
|
-
readonly ContextRoot: "http://www.w3.org/ns/odrl
|
|
8
|
+
readonly ContextRoot: "http://www.w3.org/ns/odrl.jsonld";
|
|
9
|
+
/**
|
|
10
|
+
* The namespace prefix for all terms in ODRL.
|
|
11
|
+
*/
|
|
12
|
+
readonly OdrlNamespace: "http://www.w3.org/ns/odrl/2/";
|
|
9
13
|
/**
|
|
10
14
|
* The context root for ODRL.
|
|
11
15
|
*/
|
package/docs/changelog.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @twin.org/standards-w3c-odrl - Changelog
|
|
2
2
|
|
|
3
|
+
## [0.0.3-next.7](https://github.com/twinfoundation/standards/compare/standards-w3c-odrl-v0.0.3-next.6...standards-w3c-odrl-v0.0.3-next.7) (2026-01-06)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* odrl LD Context vs odrl namespace ([#83](https://github.com/twinfoundation/standards/issues/83)) ([d2c0c3c](https://github.com/twinfoundation/standards/commit/d2c0c3ca71b4a38f15d46070118fb4d6ac00fc02))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @twin.org/standards-w3c-vcard bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
16
|
+
* @twin.org/standards-dublin-core bumped from 0.0.3-next.6 to 0.0.3-next.7
|
|
17
|
+
|
|
18
|
+
## [0.0.3-next.6](https://github.com/twinfoundation/standards/compare/standards-w3c-odrl-v0.0.3-next.5...standards-w3c-odrl-v0.0.3-next.6) (2025-12-03)
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
### Miscellaneous Chores
|
|
22
|
+
|
|
23
|
+
* **standards-w3c-odrl:** Synchronize repo versions
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Dependencies
|
|
27
|
+
|
|
28
|
+
* The following workspace dependencies were updated
|
|
29
|
+
* dependencies
|
|
30
|
+
* @twin.org/standards-w3c-vcard bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
31
|
+
* @twin.org/standards-dublin-core bumped from 0.0.3-next.5 to 0.0.3-next.6
|
|
32
|
+
|
|
3
33
|
## [0.0.3-next.5](https://github.com/twinfoundation/standards/compare/standards-w3c-odrl-v0.0.3-next.4...standards-w3c-odrl-v0.0.3-next.5) (2025-11-28)
|
|
4
34
|
|
|
5
35
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: OdrlContextType
|
|
2
2
|
|
|
3
|
-
> **OdrlContextType** = *typeof* [`ContextRoot`](../variables/OdrlContexts.md#contextroot) \| \[`...IJsonLdContextDefinitionElement[]`, *typeof* [`ContextRoot`](../variables/OdrlContexts.md#contextroot), `IJsonLdContextDefinitionElement`\] \| \[`IJsonLdContextDefinitionElement`, *typeof* [`ContextRoot`](../variables/OdrlContexts.md#contextroot), `...IJsonLdContextDefinitionElement[]`\]
|
|
3
|
+
> **OdrlContextType** = *typeof* [`ContextRoot`](../variables/OdrlContexts.md#contextroot) \| \[*typeof* [`ContextRoot`](../variables/OdrlContexts.md#contextroot)\] \| \[`...IJsonLdContextDefinitionElement[]`, *typeof* [`ContextRoot`](../variables/OdrlContexts.md#contextroot), `IJsonLdContextDefinitionElement`\] \| \[`IJsonLdContextDefinitionElement`, *typeof* [`ContextRoot`](../variables/OdrlContexts.md#contextroot), `...IJsonLdContextDefinitionElement[]`\]
|
|
4
4
|
|
|
5
5
|
The ODRL JSON-LD context type.
|
|
@@ -8,9 +8,15 @@ The contexts for ODRL.
|
|
|
8
8
|
|
|
9
9
|
### ContextRoot
|
|
10
10
|
|
|
11
|
-
> `readonly` **ContextRoot**: `"http://www.w3.org/ns/odrl
|
|
11
|
+
> `readonly` **ContextRoot**: `"http://www.w3.org/ns/odrl.jsonld"` = `"http://www.w3.org/ns/odrl.jsonld"`
|
|
12
12
|
|
|
13
|
-
The
|
|
13
|
+
The LD Context URL
|
|
14
|
+
|
|
15
|
+
### OdrlNamespace
|
|
16
|
+
|
|
17
|
+
> `readonly` **OdrlNamespace**: `"http://www.w3.org/ns/odrl/2/"` = `"http://www.w3.org/ns/odrl/2/"`
|
|
18
|
+
|
|
19
|
+
The namespace prefix for all terms in ODRL.
|
|
14
20
|
|
|
15
21
|
### ContextRedirect
|
|
16
22
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/standards-w3c-odrl",
|
|
3
|
-
"version": "0.0.3-next.
|
|
3
|
+
"version": "0.0.3-next.7",
|
|
4
4
|
"description": "Models which define the structure of W3C ODRL Standard",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -17,8 +17,8 @@
|
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
18
|
"@twin.org/data-core": "next",
|
|
19
19
|
"@twin.org/data-json-ld": "next",
|
|
20
|
-
"@twin.org/standards-dublin-core": "0.0.3-next.
|
|
21
|
-
"@twin.org/standards-w3c-vcard": "0.0.3-next.
|
|
20
|
+
"@twin.org/standards-dublin-core": "0.0.3-next.7",
|
|
21
|
+
"@twin.org/standards-w3c-vcard": "0.0.3-next.7",
|
|
22
22
|
"@twin.org/web": "next"
|
|
23
23
|
},
|
|
24
24
|
"main": "./dist/es/index.js",
|