@twin.org/data-json-ld 0.0.3-next.4 → 0.0.3-next.5

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.
@@ -1,6 +1,6 @@
1
1
  // Copyright 2024 IOTA Stiftung.
2
2
  // SPDX-License-Identifier: Apache-2.0.
3
- import { DataTypeHandlerFactory } from "@twin.org/data-core";
3
+ import { DataTypeHelper } from "@twin.org/data-core";
4
4
  import { JsonLdContexts } from "../models/jsonLdContexts.js";
5
5
  import { JsonLdTypes } from "../models/jsonLdTypes.js";
6
6
  import JsonLdContainerTypeSchema from "../schemas/JsonLdContainerType.json" with { type: "json" };
@@ -36,136 +36,109 @@ export class JsonLdDataTypes {
36
36
  * Register all the data types.
37
37
  */
38
38
  static registerTypes() {
39
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.Document}`, () => ({
40
- context: JsonLdContexts.ContextRoot,
41
- type: JsonLdTypes.Document,
42
- jsonSchema: async () => JsonLdDocumentSchema
43
- }));
44
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.Object}`, () => ({
45
- context: JsonLdContexts.ContextRoot,
46
- type: JsonLdTypes.Object,
47
- jsonSchema: async () => JsonLdObjectSchema
48
- }));
49
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.NodeObject}`, () => ({
50
- context: JsonLdContexts.ContextRoot,
51
- type: JsonLdTypes.NodeObject,
52
- jsonSchema: async () => JsonLdNodeObjectSchema
53
- }));
54
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.NodePrimitive}`, () => ({
55
- context: JsonLdContexts.ContextRoot,
56
- type: JsonLdTypes.NodePrimitive,
57
- jsonSchema: async () => JsonLdNodePrimitiveSchema
58
- }));
59
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.GraphObject}`, () => ({
60
- context: JsonLdContexts.ContextRoot,
61
- type: JsonLdTypes.GraphObject,
62
- jsonSchema: async () => JsonLdGraphObjectSchema
63
- }));
64
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.ValueObject}`, () => ({
65
- context: JsonLdContexts.ContextRoot,
66
- type: JsonLdTypes.ValueObject,
67
- jsonSchema: async () => JsonLdValueObjectSchema
68
- }));
69
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.ListObject}`, () => ({
70
- context: JsonLdContexts.ContextRoot,
71
- type: JsonLdTypes.ListObject,
72
- jsonSchema: async () => JsonLdListObjectSchema
73
- }));
74
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.ListObject}`, () => ({
75
- context: JsonLdContexts.ContextRoot,
76
- type: JsonLdTypes.ListObject,
77
- jsonSchema: async () => JsonLdListObjectSchema
78
- }));
79
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.SetObject}`, () => ({
80
- context: JsonLdContexts.ContextRoot,
81
- type: JsonLdTypes.SetObject,
82
- jsonSchema: async () => JsonLdSetObjectSchema
83
- }));
84
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.LanguageMap}`, () => ({
85
- context: JsonLdContexts.ContextRoot,
86
- type: JsonLdTypes.LanguageMap,
87
- jsonSchema: async () => JsonLdLanguageMapSchema
88
- }));
89
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.IndexMap}`, () => ({
90
- context: JsonLdContexts.ContextRoot,
91
- type: JsonLdTypes.IndexMap,
92
- jsonSchema: async () => JsonLdIndexMapSchema
93
- }));
94
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.IndexMapItem}`, () => ({
95
- context: JsonLdContexts.ContextRoot,
96
- type: JsonLdTypes.IndexMapItem,
97
- jsonSchema: async () => JsonLdIndexMapItemSchema
98
- }));
99
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.IdMap}`, () => ({
100
- context: JsonLdContexts.ContextRoot,
101
- type: JsonLdTypes.IdMap,
102
- jsonSchema: async () => JsonLdIdMapSchema
103
- }));
104
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.TypeMap}`, () => ({
105
- context: JsonLdContexts.ContextRoot,
106
- type: JsonLdTypes.TypeMap,
107
- jsonSchema: async () => JsonLdTypeMapSchema
108
- }));
109
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.IncludedBlock}`, () => ({
110
- context: JsonLdContexts.ContextRoot,
111
- type: JsonLdTypes.IncludedBlock,
112
- jsonSchema: async () => JsonLdIncludedBlockSchema
113
- }));
114
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.ContextDefinition}`, () => ({
115
- context: JsonLdContexts.ContextRoot,
116
- type: JsonLdTypes.ContextDefinition,
117
- jsonSchema: async () => JsonLdContextDefinitionSchema
118
- }));
119
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.ContextDefinitionElement}`, () => ({
120
- context: JsonLdContexts.ContextRoot,
121
- type: JsonLdTypes.ContextDefinitionElement,
122
- jsonSchema: async () => JsonLdContextDefinitionElementSchema
123
- }));
124
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.ContextDefinitionRoot}`, () => ({
125
- context: JsonLdContexts.ContextRoot,
126
- type: JsonLdTypes.ContextDefinitionRoot,
127
- jsonSchema: async () => JsonLdContextDefinitionRootSchema
128
- }));
129
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.ExpandedTermDefinition}`, () => ({
130
- context: JsonLdContexts.ContextRoot,
131
- type: JsonLdTypes.ExpandedTermDefinition,
132
- jsonSchema: async () => JsonLdExpandedTermDefinitionSchema
133
- }));
134
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.ListOrSetItem}`, () => ({
135
- context: JsonLdContexts.ContextRoot,
136
- type: JsonLdTypes.ListOrSetItem,
137
- jsonSchema: async () => JsonLdListOrSetItemSchema
138
- }));
139
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.ContainerType}`, () => ({
140
- context: JsonLdContexts.ContextRoot,
141
- type: JsonLdTypes.ContainerType,
142
- jsonSchema: async () => JsonLdContainerTypeSchema
143
- }));
144
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.ContainerTypeArray}`, () => ({
145
- context: JsonLdContexts.ContextRoot,
146
- type: JsonLdTypes.ContainerTypeArray,
147
- jsonSchema: async () => JsonLdContainerTypeArraySchema
148
- }));
149
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.JsonPrimitive}`, () => ({
150
- context: JsonLdContexts.ContextRoot,
151
- type: JsonLdTypes.JsonPrimitive,
152
- jsonSchema: async () => JsonLdJsonPrimitiveSchema
153
- }));
154
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.JsonArray}`, () => ({
155
- context: JsonLdContexts.ContextRoot,
156
- type: JsonLdTypes.JsonArray,
157
- jsonSchema: async () => JsonLdJsonArraySchema
158
- }));
159
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.JsonObject}`, () => ({
160
- context: JsonLdContexts.ContextRoot,
161
- type: JsonLdTypes.JsonObject,
162
- jsonSchema: async () => JsonLdJsonObjectSchema
163
- }));
164
- DataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.JsonValue}`, () => ({
165
- context: JsonLdContexts.ContextRoot,
166
- type: JsonLdTypes.JsonValue,
167
- jsonSchema: async () => JsonLdJsonValueSchema
168
- }));
39
+ const types = [
40
+ {
41
+ type: JsonLdTypes.Document,
42
+ schema: JsonLdDocumentSchema
43
+ },
44
+ {
45
+ type: JsonLdTypes.Object,
46
+ schema: JsonLdObjectSchema
47
+ },
48
+ {
49
+ type: JsonLdTypes.NodeObject,
50
+ schema: JsonLdNodeObjectSchema
51
+ },
52
+ {
53
+ type: JsonLdTypes.NodePrimitive,
54
+ schema: JsonLdNodePrimitiveSchema
55
+ },
56
+ {
57
+ type: JsonLdTypes.GraphObject,
58
+ schema: JsonLdGraphObjectSchema
59
+ },
60
+ {
61
+ type: JsonLdTypes.ValueObject,
62
+ schema: JsonLdValueObjectSchema
63
+ },
64
+ {
65
+ type: JsonLdTypes.ListObject,
66
+ schema: JsonLdListObjectSchema
67
+ },
68
+ {
69
+ type: JsonLdTypes.SetObject,
70
+ schema: JsonLdSetObjectSchema
71
+ },
72
+ {
73
+ type: JsonLdTypes.LanguageMap,
74
+ schema: JsonLdLanguageMapSchema
75
+ },
76
+ {
77
+ type: JsonLdTypes.IndexMap,
78
+ schema: JsonLdIndexMapSchema
79
+ },
80
+ {
81
+ type: JsonLdTypes.IndexMapItem,
82
+ schema: JsonLdIndexMapItemSchema
83
+ },
84
+ {
85
+ type: JsonLdTypes.IdMap,
86
+ schema: JsonLdIdMapSchema
87
+ },
88
+ {
89
+ type: JsonLdTypes.TypeMap,
90
+ schema: JsonLdTypeMapSchema
91
+ },
92
+ {
93
+ type: JsonLdTypes.IncludedBlock,
94
+ schema: JsonLdIncludedBlockSchema
95
+ },
96
+ {
97
+ type: JsonLdTypes.ContextDefinition,
98
+ schema: JsonLdContextDefinitionSchema
99
+ },
100
+ {
101
+ type: JsonLdTypes.ContextDefinitionElement,
102
+ schema: JsonLdContextDefinitionElementSchema
103
+ },
104
+ {
105
+ type: JsonLdTypes.ContextDefinitionRoot,
106
+ schema: JsonLdContextDefinitionRootSchema
107
+ },
108
+ {
109
+ type: JsonLdTypes.ExpandedTermDefinition,
110
+ schema: JsonLdExpandedTermDefinitionSchema
111
+ },
112
+ {
113
+ type: JsonLdTypes.ListOrSetItem,
114
+ schema: JsonLdListOrSetItemSchema
115
+ },
116
+ {
117
+ type: JsonLdTypes.ContainerType,
118
+ schema: JsonLdContainerTypeSchema
119
+ },
120
+ {
121
+ type: JsonLdTypes.ContainerTypeArray,
122
+ schema: JsonLdContainerTypeArraySchema
123
+ },
124
+ {
125
+ type: JsonLdTypes.JsonPrimitive,
126
+ schema: JsonLdJsonPrimitiveSchema
127
+ },
128
+ {
129
+ type: JsonLdTypes.JsonArray,
130
+ schema: JsonLdJsonArraySchema
131
+ },
132
+ {
133
+ type: JsonLdTypes.JsonObject,
134
+ schema: JsonLdJsonObjectSchema
135
+ },
136
+ {
137
+ type: JsonLdTypes.JsonValue,
138
+ schema: JsonLdJsonValueSchema
139
+ }
140
+ ];
141
+ DataTypeHelper.registerTypes(JsonLdContexts.Namespace, undefined, types);
169
142
  }
170
143
  }
171
144
  //# sourceMappingURL=jsonLdDataTypes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsonLdDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/jsonLdDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,sBAAsB,EAAoB,MAAM,qBAAqB,CAAC;AAC/E,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,yBAAyB,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAClG,OAAO,8BAA8B,MAAM,0CAA0C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC5G,OAAO,6BAA6B,MAAM,yCAAyC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1G,OAAO,oCAAoC,MAAM,gDAAgD,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACxH,OAAO,iCAAiC,MAAM,6CAA6C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAClH,OAAO,oBAAoB,MAAM,gCAAgC,CAAC,OAAO,IA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AE,CAAC,8BAA6C;SACrE,CAAC,CACF,CAAC;QACF,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,cAAc,CAAC,WAAW,GAAG,WAAW,CAAC,aAAa,EAAE,EAC3D,GAAG,EAAE,CAAC,CAAC;YACN,OAAO,EAAE,cAAc,CAAC,WAAW;YACnC,IAAI,EAAE,WAAW,CAAC,aAAa;YAC/B,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,yBAAwC;SAChE,CAAC,CACF,CAAC;QACF,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,cAAc,CAAC,WAAW,GAAG,WAAW,CAAC,SAAS,EAAE,EACvD,GAAG,EAAE,CAAC,CAAC;YACN,OAAO,EAAE,cAAc,CAAC,WAAW;YACnC,IAAI,EAAE,WAAW,CAAC,SAAS;YAC3B,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,qBAAoC;SAC5D,CAAC,CACF,CAAC;QACF,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,cAAc,CAAC,WAAW,GAAG,WAAW,CAAC,UAAU,EAAE,EACxD,GAAG,EAAE,CAAC,CAAC;YACN,OAAO,EAAE,cAAc,CAAC,WAAW;YACnC,IAAI,EAAE,WAAW,CAAC,UAAU;YAC5B,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,sBAAqC;SAC7D,CAAC,CACF,CAAC;QACF,sBAAsB,CAAC,QAAQ,CAC9B,GAAG,cAAc,CAAC,WAAW,GAAG,WAAW,CAAC,SAAS,EAAE,EACvD,GAAG,EAAE,CAAC,CAAC;YACN,OAAO,EAAE,cAAc,CAAC,WAAW;YACnC,IAAI,EAAE,WAAW,CAAC,SAAS;YAC3B,UAAU,EAAE,KAAK,IAAI,EAAE,CAAC,qBAAoC;SAC5D,CAAC,CACF,CAAC;IACH,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHandlerFactory, type IJsonSchema } from \"@twin.org/data-core\";\nimport { JsonLdContexts } from \"../models/jsonLdContexts.js\";\nimport { JsonLdTypes } from \"../models/jsonLdTypes.js\";\nimport JsonLdContainerTypeSchema from \"../schemas/JsonLdContainerType.json\" with { type: \"json\" };\nimport JsonLdContainerTypeArraySchema from \"../schemas/JsonLdContainerTypeArray.json\" with { type: \"json\" };\nimport JsonLdContextDefinitionSchema from \"../schemas/JsonLdContextDefinition.json\" with { type: \"json\" };\nimport JsonLdContextDefinitionElementSchema from \"../schemas/JsonLdContextDefinitionElement.json\" with { type: \"json\" };\nimport JsonLdContextDefinitionRootSchema from \"../schemas/JsonLdContextDefinitionRoot.json\" with { type: \"json\" };\nimport JsonLdDocumentSchema from \"../schemas/JsonLdDocument.json\" with { type: \"json\" };\nimport JsonLdExpandedTermDefinitionSchema from \"../schemas/JsonLdExpandedTermDefinition.json\" with { type: \"json\" };\nimport JsonLdGraphObjectSchema from \"../schemas/JsonLdGraphObject.json\" with { type: \"json\" };\nimport JsonLdIdMapSchema from \"../schemas/JsonLdIdMap.json\" with { type: \"json\" };\nimport JsonLdIncludedBlockSchema from \"../schemas/JsonLdIncludedBlock.json\" with { type: \"json\" };\nimport JsonLdIndexMapSchema from \"../schemas/JsonLdIndexMap.json\" with { type: \"json\" };\nimport JsonLdIndexMapItemSchema from \"../schemas/JsonLdIndexMapItem.json\" with { type: \"json\" };\nimport JsonLdJsonArraySchema from \"../schemas/JsonLdJsonArray.json\" with { type: \"json\" };\nimport JsonLdJsonObjectSchema from \"../schemas/JsonLdJsonObject.json\" with { type: \"json\" };\nimport JsonLdJsonPrimitiveSchema from \"../schemas/JsonLdJsonPrimitive.json\" with { type: \"json\" };\nimport JsonLdJsonValueSchema from \"../schemas/JsonLdJsonValue.json\" with { type: \"json\" };\nimport JsonLdLanguageMapSchema from \"../schemas/JsonLdLanguageMap.json\" with { type: \"json\" };\nimport JsonLdListObjectSchema from \"../schemas/JsonLdListObject.json\" with { type: \"json\" };\nimport JsonLdListOrSetItemSchema from \"../schemas/JsonLdListOrSetItem.json\" with { type: \"json\" };\nimport JsonLdNodeObjectSchema from \"../schemas/JsonLdNodeObject.json\" with { type: \"json\" };\nimport JsonLdNodePrimitiveSchema from \"../schemas/JsonLdNodePrimitive.json\" with { type: \"json\" };\nimport JsonLdObjectSchema from \"../schemas/JsonLdObject.json\" with { type: \"json\" };\nimport JsonLdSetObjectSchema from \"../schemas/JsonLdSetObject.json\" with { type: \"json\" };\nimport JsonLdTypeMapSchema from \"../schemas/JsonLdTypeMap.json\" with { type: \"json\" };\nimport JsonLdValueObjectSchema from \"../schemas/JsonLdValueObject.json\" with { type: \"json\" };\n\n/**\n * Handle all the data types for JSON-LD.\n */\nexport class JsonLdDataTypes {\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tDataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.Document}`, () => ({\n\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\ttype: JsonLdTypes.Document,\n\t\t\tjsonSchema: async () => JsonLdDocumentSchema as IJsonSchema\n\t\t}));\n\t\tDataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.Object}`, () => ({\n\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\ttype: JsonLdTypes.Object,\n\t\t\tjsonSchema: async () => JsonLdObjectSchema as IJsonSchema\n\t\t}));\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.NodeObject}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.NodeObject,\n\t\t\t\tjsonSchema: async () => JsonLdNodeObjectSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.NodePrimitive}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.NodePrimitive,\n\t\t\t\tjsonSchema: async () => JsonLdNodePrimitiveSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.GraphObject}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.GraphObject,\n\t\t\t\tjsonSchema: async () => JsonLdGraphObjectSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.ValueObject}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.ValueObject,\n\t\t\t\tjsonSchema: async () => JsonLdValueObjectSchema as unknown as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.ListObject}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.ListObject,\n\t\t\t\tjsonSchema: async () => JsonLdListObjectSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.ListObject}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.ListObject,\n\t\t\t\tjsonSchema: async () => JsonLdListObjectSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.SetObject}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.SetObject,\n\t\t\t\tjsonSchema: async () => JsonLdSetObjectSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.LanguageMap}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.LanguageMap,\n\t\t\t\tjsonSchema: async () => JsonLdLanguageMapSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.IndexMap}`, () => ({\n\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\ttype: JsonLdTypes.IndexMap,\n\t\t\tjsonSchema: async () => JsonLdIndexMapSchema as IJsonSchema\n\t\t}));\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.IndexMapItem}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.IndexMapItem,\n\t\t\t\tjsonSchema: async () => JsonLdIndexMapItemSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.IdMap}`, () => ({\n\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\ttype: JsonLdTypes.IdMap,\n\t\t\tjsonSchema: async () => JsonLdIdMapSchema as IJsonSchema\n\t\t}));\n\t\tDataTypeHandlerFactory.register(`${JsonLdContexts.ContextRoot}${JsonLdTypes.TypeMap}`, () => ({\n\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\ttype: JsonLdTypes.TypeMap,\n\t\t\tjsonSchema: async () => JsonLdTypeMapSchema as IJsonSchema\n\t\t}));\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.IncludedBlock}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.IncludedBlock,\n\t\t\t\tjsonSchema: async () => JsonLdIncludedBlockSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.ContextDefinition}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.ContextDefinition,\n\t\t\t\tjsonSchema: async () => JsonLdContextDefinitionSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.ContextDefinitionElement}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.ContextDefinitionElement,\n\t\t\t\tjsonSchema: async () => JsonLdContextDefinitionElementSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.ContextDefinitionRoot}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.ContextDefinitionRoot,\n\t\t\t\tjsonSchema: async () => JsonLdContextDefinitionRootSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.ExpandedTermDefinition}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.ExpandedTermDefinition,\n\t\t\t\tjsonSchema: async () => JsonLdExpandedTermDefinitionSchema as unknown as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.ListOrSetItem}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.ListOrSetItem,\n\t\t\t\tjsonSchema: async () => JsonLdListOrSetItemSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.ContainerType}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.ContainerType,\n\t\t\t\tjsonSchema: async () => JsonLdContainerTypeSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.ContainerTypeArray}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.ContainerTypeArray,\n\t\t\t\tjsonSchema: async () => JsonLdContainerTypeArraySchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.JsonPrimitive}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.JsonPrimitive,\n\t\t\t\tjsonSchema: async () => JsonLdJsonPrimitiveSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.JsonArray}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.JsonArray,\n\t\t\t\tjsonSchema: async () => JsonLdJsonArraySchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.JsonObject}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.JsonObject,\n\t\t\t\tjsonSchema: async () => JsonLdJsonObjectSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t\tDataTypeHandlerFactory.register(\n\t\t\t`${JsonLdContexts.ContextRoot}${JsonLdTypes.JsonValue}`,\n\t\t\t() => ({\n\t\t\t\tcontext: JsonLdContexts.ContextRoot,\n\t\t\t\ttype: JsonLdTypes.JsonValue,\n\t\t\t\tjsonSchema: async () => JsonLdJsonValueSchema as IJsonSchema\n\t\t\t})\n\t\t);\n\t}\n}\n"]}
1
+ {"version":3,"file":"jsonLdDataTypes.js","sourceRoot":"","sources":["../../../src/dataTypes/jsonLdDataTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACvD,OAAO,yBAAyB,MAAM,qCAAqC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAClG,OAAO,8BAA8B,MAAM,0CAA0C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC5G,OAAO,6BAA6B,MAAM,yCAAyC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC1G,OAAO,oCAAoC,MAAM,gDAAgD,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACxH,OAAO,iCAAiC,MAAM,6CAA6C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAClH,OAAO,oBAAoB,MAAM,gCAAgC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACxF,OAAO,kCAAkC,MAAM,8CAA8C,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AACpH,OAAO,uBAAuB,MAAM,mCAAmC,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CAAC;AAC9F,OAAO,iBAAiB,MAAM,6BAA6B,CAAC,OAAO,IAAI,EAAE,MAAM,EAAE,CA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C,MAAM,EAAE,6BAA6B;aACrC;YACD;gBACC,IAAI,EAAE,WAAW,CAAC,wBAAwB;gBAC1C,MAAM,EAAE,oCAAoC;aAC5C;YACD;gBACC,IAAI,EAAE,WAAW,CAAC,qBAAqB;gBACvC,MAAM,EAAE,iCAAiC;aACzC;YACD;gBACC,IAAI,EAAE,WAAW,CAAC,sBAAsB;gBACxC,MAAM,EAAE,kCAAkC;aAC1C;YACD;gBACC,IAAI,EAAE,WAAW,CAAC,aAAa;gBAC/B,MAAM,EAAE,yBAAyB;aACjC;YACD;gBACC,IAAI,EAAE,WAAW,CAAC,aAAa;gBAC/B,MAAM,EAAE,yBAAyB;aACjC;YACD;gBACC,IAAI,EAAE,WAAW,CAAC,kBAAkB;gBACpC,MAAM,EAAE,8BAA8B;aACtC;YACD;gBACC,IAAI,EAAE,WAAW,CAAC,aAAa;gBAC/B,MAAM,EAAE,yBAAyB;aACjC;YACD;gBACC,IAAI,EAAE,WAAW,CAAC,SAAS;gBAC3B,MAAM,EAAE,qBAAqB;aAC7B;YACD;gBACC,IAAI,EAAE,WAAW,CAAC,UAAU;gBAC5B,MAAM,EAAE,sBAAsB;aAC9B;YACD;gBACC,IAAI,EAAE,WAAW,CAAC,SAAS;gBAC3B,MAAM,EAAE,qBAAqB;aAC7B;SACD,CAAC;QAEF,cAAc,CAAC,aAAa,CAAC,cAAc,CAAC,SAAS,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC;IAC1E,CAAC;CACD","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\nimport { DataTypeHelper } from \"@twin.org/data-core\";\nimport { JsonLdContexts } from \"../models/jsonLdContexts.js\";\nimport { JsonLdTypes } from \"../models/jsonLdTypes.js\";\nimport JsonLdContainerTypeSchema from \"../schemas/JsonLdContainerType.json\" with { type: \"json\" };\nimport JsonLdContainerTypeArraySchema from \"../schemas/JsonLdContainerTypeArray.json\" with { type: \"json\" };\nimport JsonLdContextDefinitionSchema from \"../schemas/JsonLdContextDefinition.json\" with { type: \"json\" };\nimport JsonLdContextDefinitionElementSchema from \"../schemas/JsonLdContextDefinitionElement.json\" with { type: \"json\" };\nimport JsonLdContextDefinitionRootSchema from \"../schemas/JsonLdContextDefinitionRoot.json\" with { type: \"json\" };\nimport JsonLdDocumentSchema from \"../schemas/JsonLdDocument.json\" with { type: \"json\" };\nimport JsonLdExpandedTermDefinitionSchema from \"../schemas/JsonLdExpandedTermDefinition.json\" with { type: \"json\" };\nimport JsonLdGraphObjectSchema from \"../schemas/JsonLdGraphObject.json\" with { type: \"json\" };\nimport JsonLdIdMapSchema from \"../schemas/JsonLdIdMap.json\" with { type: \"json\" };\nimport JsonLdIncludedBlockSchema from \"../schemas/JsonLdIncludedBlock.json\" with { type: \"json\" };\nimport JsonLdIndexMapSchema from \"../schemas/JsonLdIndexMap.json\" with { type: \"json\" };\nimport JsonLdIndexMapItemSchema from \"../schemas/JsonLdIndexMapItem.json\" with { type: \"json\" };\nimport JsonLdJsonArraySchema from \"../schemas/JsonLdJsonArray.json\" with { type: \"json\" };\nimport JsonLdJsonObjectSchema from \"../schemas/JsonLdJsonObject.json\" with { type: \"json\" };\nimport JsonLdJsonPrimitiveSchema from \"../schemas/JsonLdJsonPrimitive.json\" with { type: \"json\" };\nimport JsonLdJsonValueSchema from \"../schemas/JsonLdJsonValue.json\" with { type: \"json\" };\nimport JsonLdLanguageMapSchema from \"../schemas/JsonLdLanguageMap.json\" with { type: \"json\" };\nimport JsonLdListObjectSchema from \"../schemas/JsonLdListObject.json\" with { type: \"json\" };\nimport JsonLdListOrSetItemSchema from \"../schemas/JsonLdListOrSetItem.json\" with { type: \"json\" };\nimport JsonLdNodeObjectSchema from \"../schemas/JsonLdNodeObject.json\" with { type: \"json\" };\nimport JsonLdNodePrimitiveSchema from \"../schemas/JsonLdNodePrimitive.json\" with { type: \"json\" };\nimport JsonLdObjectSchema from \"../schemas/JsonLdObject.json\" with { type: \"json\" };\nimport JsonLdSetObjectSchema from \"../schemas/JsonLdSetObject.json\" with { type: \"json\" };\nimport JsonLdTypeMapSchema from \"../schemas/JsonLdTypeMap.json\" with { type: \"json\" };\nimport JsonLdValueObjectSchema from \"../schemas/JsonLdValueObject.json\" with { type: \"json\" };\n\n/**\n * Handle all the data types for JSON-LD.\n */\nexport class JsonLdDataTypes {\n\t/**\n\t * Register all the data types.\n\t */\n\tpublic static registerTypes(): void {\n\t\tconst types = [\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.Document,\n\t\t\t\tschema: JsonLdDocumentSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.Object,\n\t\t\t\tschema: JsonLdObjectSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.NodeObject,\n\t\t\t\tschema: JsonLdNodeObjectSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.NodePrimitive,\n\t\t\t\tschema: JsonLdNodePrimitiveSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.GraphObject,\n\t\t\t\tschema: JsonLdGraphObjectSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.ValueObject,\n\t\t\t\tschema: JsonLdValueObjectSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.ListObject,\n\t\t\t\tschema: JsonLdListObjectSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.SetObject,\n\t\t\t\tschema: JsonLdSetObjectSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.LanguageMap,\n\t\t\t\tschema: JsonLdLanguageMapSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.IndexMap,\n\t\t\t\tschema: JsonLdIndexMapSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.IndexMapItem,\n\t\t\t\tschema: JsonLdIndexMapItemSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.IdMap,\n\t\t\t\tschema: JsonLdIdMapSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.TypeMap,\n\t\t\t\tschema: JsonLdTypeMapSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.IncludedBlock,\n\t\t\t\tschema: JsonLdIncludedBlockSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.ContextDefinition,\n\t\t\t\tschema: JsonLdContextDefinitionSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.ContextDefinitionElement,\n\t\t\t\tschema: JsonLdContextDefinitionElementSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.ContextDefinitionRoot,\n\t\t\t\tschema: JsonLdContextDefinitionRootSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.ExpandedTermDefinition,\n\t\t\t\tschema: JsonLdExpandedTermDefinitionSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.ListOrSetItem,\n\t\t\t\tschema: JsonLdListOrSetItemSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.ContainerType,\n\t\t\t\tschema: JsonLdContainerTypeSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.ContainerTypeArray,\n\t\t\t\tschema: JsonLdContainerTypeArraySchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.JsonPrimitive,\n\t\t\t\tschema: JsonLdJsonPrimitiveSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.JsonArray,\n\t\t\t\tschema: JsonLdJsonArraySchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.JsonObject,\n\t\t\t\tschema: JsonLdJsonObjectSchema\n\t\t\t},\n\t\t\t{\n\t\t\t\ttype: JsonLdTypes.JsonValue,\n\t\t\t\tschema: JsonLdJsonValueSchema\n\t\t\t}\n\t\t];\n\n\t\tDataTypeHelper.registerTypes(JsonLdContexts.Namespace, undefined, types);\n\t}\n}\n"]}
@@ -6,8 +6,8 @@
6
6
  // eslint-disable-next-line @typescript-eslint/naming-convention
7
7
  export const JsonLdContexts = {
8
8
  /**
9
- * Context Root.
9
+ * Namespace.
10
10
  */
11
- ContextRoot: "https://schema.twindev.org/json-ld/"
11
+ Namespace: "https://schema.twindev.org/json-ld/"
12
12
  };
13
13
  //# sourceMappingURL=jsonLdContexts.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jsonLdContexts.js","sourceRoot":"","sources":["../../../src/models/jsonLdContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B;;OAEG;IACH,WAAW,EAAE,qCAAqC;CACzC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts of JSON-LD data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const JsonLdContexts = {\n\t/**\n\t * Context Root.\n\t */\n\tContextRoot: \"https://schema.twindev.org/json-ld/\"\n} as const;\n\n/**\n * The contexts of JSON-LD data.\n */\nexport type JsonLdContexts = (typeof JsonLdContexts)[keyof typeof JsonLdContexts];\n"]}
1
+ {"version":3,"file":"jsonLdContexts.js","sourceRoot":"","sources":["../../../src/models/jsonLdContexts.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,cAAc,GAAG;IAC7B;;OAEG;IACH,SAAS,EAAE,qCAAqC;CACvC,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The contexts of JSON-LD data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const JsonLdContexts = {\n\t/**\n\t * Namespace.\n\t */\n\tNamespace: \"https://schema.twindev.org/json-ld/\"\n} as const;\n\n/**\n * The contexts of JSON-LD data.\n */\nexport type JsonLdContexts = (typeof JsonLdContexts)[keyof typeof JsonLdContexts];\n"]}
@@ -3,9 +3,9 @@
3
3
  */
4
4
  export declare const JsonLdContexts: {
5
5
  /**
6
- * Context Root.
6
+ * Namespace.
7
7
  */
8
- readonly ContextRoot: "https://schema.twindev.org/json-ld/";
8
+ readonly Namespace: "https://schema.twindev.org/json-ld/";
9
9
  };
10
10
  /**
11
11
  * The contexts of JSON-LD data.
package/docs/changelog.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @twin.org/data-json-ld - Changelog
2
2
 
3
+ ## [0.0.3-next.5](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.3-next.4...data-json-ld-v0.0.3-next.5) (2026-01-14)
4
+
5
+
6
+ ### Features
7
+
8
+ * improve data type registration ([#34](https://github.com/twinfoundation/data/issues/34)) ([855d110](https://github.com/twinfoundation/data/commit/855d11046a4d85317b77a5c4e0f4a7b1b6d1a767))
9
+
10
+
11
+ ### Dependencies
12
+
13
+ * The following workspace dependencies were updated
14
+ * dependencies
15
+ * @twin.org/data-core bumped from 0.0.3-next.4 to 0.0.3-next.5
16
+
3
17
  ## [0.0.3-next.4](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.3-next.3...data-json-ld-v0.0.3-next.4) (2026-01-06)
4
18
 
5
19
 
@@ -6,8 +6,8 @@ The contexts of JSON-LD data.
6
6
 
7
7
  ## Type Declaration
8
8
 
9
- ### ContextRoot
9
+ ### Namespace
10
10
 
11
- > `readonly` **ContextRoot**: `"https://schema.twindev.org/json-ld/"` = `"https://schema.twindev.org/json-ld/"`
11
+ > `readonly` **Namespace**: `"https://schema.twindev.org/json-ld/"` = `"https://schema.twindev.org/json-ld/"`
12
12
 
13
- Context Root.
13
+ Namespace.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/data-json-ld",
3
- "version": "0.0.3-next.4",
3
+ "version": "0.0.3-next.5",
4
4
  "description": "Models which define the structure of JSON LD",
5
5
  "repository": {
6
6
  "type": "git",
@@ -15,7 +15,7 @@
15
15
  },
16
16
  "dependencies": {
17
17
  "@twin.org/core": "next",
18
- "@twin.org/data-core": "0.0.3-next.4",
18
+ "@twin.org/data-core": "0.0.3-next.5",
19
19
  "@twin.org/entity": "next",
20
20
  "@twin.org/nameof": "next",
21
21
  "@twin.org/web": "next",