@twin.org/data-json-ld 0.0.2-next.4 → 0.0.3-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.
Files changed (122) hide show
  1. package/dist/es/dataTypes/jsonLdDataTypes.js +171 -0
  2. package/dist/es/dataTypes/jsonLdDataTypes.js.map +1 -0
  3. package/dist/es/index.js +33 -0
  4. package/dist/es/index.js.map +1 -0
  5. package/dist/es/models/IJsonLdContainerType.js +4 -0
  6. package/dist/es/models/IJsonLdContainerType.js.map +1 -0
  7. package/dist/es/models/IJsonLdContainerTypeArray.js +2 -0
  8. package/dist/es/models/IJsonLdContainerTypeArray.js.map +1 -0
  9. package/dist/es/models/IJsonLdContextDefinition.js +2 -0
  10. package/dist/es/models/IJsonLdContextDefinition.js.map +1 -0
  11. package/dist/es/models/IJsonLdContextDefinitionElement.js +2 -0
  12. package/dist/es/models/IJsonLdContextDefinitionElement.js.map +1 -0
  13. package/dist/es/models/IJsonLdContextDefinitionRoot.js +2 -0
  14. package/dist/es/models/IJsonLdContextDefinitionRoot.js.map +1 -0
  15. package/dist/es/models/IJsonLdDocument.js +2 -0
  16. package/dist/es/models/IJsonLdDocument.js.map +1 -0
  17. package/dist/es/models/IJsonLdExpandedTermDefinition.js +2 -0
  18. package/dist/es/models/IJsonLdExpandedTermDefinition.js.map +1 -0
  19. package/dist/es/models/IJsonLdGraphObject.js +2 -0
  20. package/dist/es/models/IJsonLdGraphObject.js.map +1 -0
  21. package/dist/es/models/IJsonLdIdMap.js +2 -0
  22. package/dist/es/models/IJsonLdIdMap.js.map +1 -0
  23. package/dist/es/models/IJsonLdIncludedBlock.js +2 -0
  24. package/dist/es/models/IJsonLdIncludedBlock.js.map +1 -0
  25. package/dist/es/models/IJsonLdIndexMap.js +2 -0
  26. package/dist/es/models/IJsonLdIndexMap.js.map +1 -0
  27. package/dist/es/models/IJsonLdIndexMapItem.js +2 -0
  28. package/dist/es/models/IJsonLdIndexMapItem.js.map +1 -0
  29. package/dist/es/models/IJsonLdJsonArray.js +2 -0
  30. package/dist/es/models/IJsonLdJsonArray.js.map +1 -0
  31. package/dist/es/models/IJsonLdJsonObject.js +2 -0
  32. package/dist/es/models/IJsonLdJsonObject.js.map +1 -0
  33. package/dist/es/models/IJsonLdJsonPrimitive.js +4 -0
  34. package/dist/es/models/IJsonLdJsonPrimitive.js.map +1 -0
  35. package/dist/es/models/IJsonLdJsonValue.js +2 -0
  36. package/dist/es/models/IJsonLdJsonValue.js.map +1 -0
  37. package/dist/es/models/IJsonLdLanguageMap.js +4 -0
  38. package/dist/es/models/IJsonLdLanguageMap.js.map +1 -0
  39. package/dist/es/models/IJsonLdListObject.js +2 -0
  40. package/dist/es/models/IJsonLdListObject.js.map +1 -0
  41. package/dist/es/models/IJsonLdListOrSetItem.js +2 -0
  42. package/dist/es/models/IJsonLdListOrSetItem.js.map +1 -0
  43. package/dist/es/models/IJsonLdNodeObject.js +2 -0
  44. package/dist/es/models/IJsonLdNodeObject.js.map +1 -0
  45. package/dist/es/models/IJsonLdNodePrimitive.js +2 -0
  46. package/dist/es/models/IJsonLdNodePrimitive.js.map +1 -0
  47. package/dist/es/models/IJsonLdObject.js +2 -0
  48. package/dist/es/models/IJsonLdObject.js.map +1 -0
  49. package/dist/es/models/IJsonLdSetObject.js +2 -0
  50. package/dist/es/models/IJsonLdSetObject.js.map +1 -0
  51. package/dist/es/models/IJsonLdTypeMap.js +2 -0
  52. package/dist/es/models/IJsonLdTypeMap.js.map +1 -0
  53. package/dist/es/models/IJsonLdValueObject.js +2 -0
  54. package/dist/es/models/IJsonLdValueObject.js.map +1 -0
  55. package/dist/es/models/jsonLdContexts.js +13 -0
  56. package/dist/es/models/jsonLdContexts.js.map +1 -0
  57. package/dist/es/models/jsonLdTypes.js +113 -0
  58. package/dist/es/models/jsonLdTypes.js.map +1 -0
  59. package/dist/es/schemas/JsonLdContainerType.json +13 -0
  60. package/dist/es/schemas/JsonLdContainerTypeArray.json +179 -0
  61. package/dist/es/schemas/JsonLdContextDefinition.json +76 -0
  62. package/dist/es/schemas/JsonLdContextDefinitionElement.json +16 -0
  63. package/dist/es/schemas/JsonLdContextDefinitionRoot.json +16 -0
  64. package/dist/es/schemas/JsonLdDocument.json +48 -0
  65. package/dist/es/schemas/JsonLdExpandedTermDefinition.json +136 -0
  66. package/dist/es/schemas/JsonLdGraphObject.json +44 -0
  67. package/dist/es/schemas/JsonLdIdMap.json +9 -0
  68. package/dist/es/schemas/JsonLdIncludedBlock.json +16 -0
  69. package/dist/es/schemas/JsonLdIndexMap.json +19 -0
  70. package/dist/es/schemas/JsonLdIndexMapItem.json +31 -0
  71. package/dist/es/schemas/JsonLdJsonArray.json +9 -0
  72. package/dist/es/schemas/JsonLdJsonObject.json +16 -0
  73. package/dist/es/schemas/JsonLdJsonPrimitive.json +11 -0
  74. package/dist/es/schemas/JsonLdJsonValue.json +16 -0
  75. package/dist/es/schemas/JsonLdLanguageMap.json +22 -0
  76. package/dist/es/schemas/JsonLdListObject.json +28 -0
  77. package/dist/es/schemas/JsonLdListOrSetItem.json +25 -0
  78. package/dist/es/schemas/JsonLdNodeObject.json +100 -0
  79. package/dist/es/schemas/JsonLdNodePrimitive.json +34 -0
  80. package/dist/es/schemas/JsonLdObject.json +76 -0
  81. package/dist/es/schemas/JsonLdSetObject.json +28 -0
  82. package/dist/es/schemas/JsonLdTypeMap.json +16 -0
  83. package/dist/es/schemas/JsonLdValueObject.json +113 -0
  84. package/dist/es/utils/jsonLdHelper.js +79 -0
  85. package/dist/es/utils/jsonLdHelper.js.map +1 -0
  86. package/dist/es/utils/jsonLdProcessor.js +375 -0
  87. package/dist/es/utils/jsonLdProcessor.js.map +1 -0
  88. package/dist/types/index.d.ts +30 -30
  89. package/dist/types/models/IJsonLdContainerTypeArray.d.ts +1 -1
  90. package/dist/types/models/IJsonLdContextDefinition.d.ts +1 -1
  91. package/dist/types/models/IJsonLdContextDefinitionElement.d.ts +1 -1
  92. package/dist/types/models/IJsonLdContextDefinitionRoot.d.ts +1 -1
  93. package/dist/types/models/IJsonLdDocument.d.ts +3 -3
  94. package/dist/types/models/IJsonLdExpandedTermDefinition.d.ts +3 -3
  95. package/dist/types/models/IJsonLdGraphObject.d.ts +2 -2
  96. package/dist/types/models/IJsonLdIdMap.d.ts +1 -1
  97. package/dist/types/models/IJsonLdIncludedBlock.d.ts +1 -1
  98. package/dist/types/models/IJsonLdIndexMap.d.ts +1 -1
  99. package/dist/types/models/IJsonLdIndexMapItem.d.ts +4 -4
  100. package/dist/types/models/IJsonLdJsonArray.d.ts +1 -1
  101. package/dist/types/models/IJsonLdJsonObject.d.ts +1 -1
  102. package/dist/types/models/IJsonLdJsonValue.d.ts +3 -3
  103. package/dist/types/models/IJsonLdListObject.d.ts +1 -1
  104. package/dist/types/models/IJsonLdListOrSetItem.d.ts +2 -2
  105. package/dist/types/models/IJsonLdNodeObject.d.ts +7 -7
  106. package/dist/types/models/IJsonLdNodePrimitive.d.ts +5 -5
  107. package/dist/types/models/IJsonLdObject.d.ts +4 -4
  108. package/dist/types/models/IJsonLdSetObject.d.ts +1 -1
  109. package/dist/types/models/IJsonLdTypeMap.d.ts +1 -1
  110. package/dist/types/models/IJsonLdValueObject.d.ts +3 -3
  111. package/dist/types/utils/jsonLdHelper.d.ts +8 -1
  112. package/dist/types/utils/jsonLdProcessor.d.ts +4 -4
  113. package/docs/changelog.md +31 -0
  114. package/docs/reference/classes/JsonLdHelper.md +28 -0
  115. package/docs/reference/classes/JsonLdProcessor.md +9 -9
  116. package/docs/reference/interfaces/IJsonLdContextDefinition.md +4 -4
  117. package/docs/reference/interfaces/IJsonLdJsonObject.md +1 -1
  118. package/docs/reference/interfaces/IJsonLdLanguageMap.md +1 -1
  119. package/docs/reference/interfaces/IJsonLdNodeObject.md +1 -1
  120. package/package.json +6 -8
  121. package/dist/cjs/index.cjs +0 -2018
  122. package/dist/esm/index.mjs +0 -2012
@@ -0,0 +1,113 @@
1
+ // Copyright 2024 IOTA Stiftung.
2
+ // SPDX-License-Identifier: Apache-2.0.
3
+ /**
4
+ * The types of JSON-LD data.
5
+ */
6
+ // eslint-disable-next-line @typescript-eslint/naming-convention
7
+ export const JsonLdTypes = {
8
+ /**
9
+ * Represents JSON-LD Document.
10
+ */
11
+ Document: "JsonLdDocument",
12
+ /**
13
+ * Represents JSON-LD Object.
14
+ */
15
+ Object: "JsonLdObject",
16
+ /**
17
+ * Represents JSON-LD Node Object.
18
+ */
19
+ NodeObject: "JsonLdNodeObject",
20
+ /**
21
+ * Represents JSON-LD Node Primitive.
22
+ */
23
+ NodePrimitive: "JsonLdNodePrimitive",
24
+ /**
25
+ * Represents JSON-LD Graph Object.
26
+ */
27
+ GraphObject: "JsonLdGraphObject",
28
+ /**
29
+ * Represents JSON-LD Value Object.
30
+ */
31
+ ValueObject: "JsonLdValueObject",
32
+ /**
33
+ * Represents JSON-LD List Object.
34
+ */
35
+ ListObject: "JsonLdListObject",
36
+ /**
37
+ * Represents JSON-LD Set Object.
38
+ */
39
+ SetObject: "JsonLdSetObject",
40
+ /**
41
+ * Represents JSON-LD Language Map.
42
+ */
43
+ LanguageMap: "JsonLdLanguageMap",
44
+ /**
45
+ * Represents JSON-LD Index Map.
46
+ */
47
+ IndexMap: "JsonLdIndexMap",
48
+ /**
49
+ * Represents JSON-LD Index Map Item.
50
+ */
51
+ IndexMapItem: "JsonLdIndexMapItem",
52
+ /**
53
+ * Represents JSON-LD Id Map.
54
+ */
55
+ IdMap: "JsonLdIdMap",
56
+ /**
57
+ * Represents JSON-LD Type Map.
58
+ */
59
+ TypeMap: "JsonLdTypeMap",
60
+ /**
61
+ * Represents JSON-LD Included block.
62
+ */
63
+ IncludedBlock: "JsonLdIncludedBlock",
64
+ /**
65
+ * Represents JSON-LD Context Definition.
66
+ */
67
+ ContextDefinition: "JsonLdContextDefinition",
68
+ /**
69
+ * Represents JSON-LD Context Definition Element.
70
+ */
71
+ ContextDefinitionElement: "JsonLdContextDefinitionElement",
72
+ /**
73
+ * Represents JSON-LD Context Definition Root.
74
+ */
75
+ ContextDefinitionRoot: "JsonLdContextDefinitionRoot",
76
+ /**
77
+ * Represents JSON-LD Expanded Term Definition.
78
+ */
79
+ ExpandedTermDefinition: "JsonLdExpandedTermDefinition",
80
+ /**
81
+ * Represents JSON-LD Keyword.
82
+ */
83
+ Keyword: "JsonLdKeyword",
84
+ /**
85
+ * Represents JSON-LD List or Set Item.
86
+ */
87
+ ListOrSetItem: "JsonLdListOrSetItem",
88
+ /**
89
+ * Represents JSON-LD Container Type.
90
+ */
91
+ ContainerType: "JsonLdContainerType",
92
+ /**
93
+ * Represents JSON-LD Container Type Array.
94
+ */
95
+ ContainerTypeArray: "JsonLdContainerTypeArray",
96
+ /**
97
+ * Represents JSON-LD JSON Primitive.
98
+ */
99
+ JsonPrimitive: "JsonLdJsonPrimitive",
100
+ /**
101
+ * Represents JSON-LD JSON Array.
102
+ */
103
+ JsonArray: "JsonLdJsonArray",
104
+ /**
105
+ * Represents JSON-LD JSON Object.
106
+ */
107
+ JsonObject: "JsonLdJsonObject",
108
+ /**
109
+ * Represents JSON-LD JSON Value.
110
+ */
111
+ JsonValue: "JsonLdJsonValue"
112
+ };
113
+ //# sourceMappingURL=jsonLdTypes.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"jsonLdTypes.js","sourceRoot":"","sources":["../../../src/models/jsonLdTypes.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAChC,uCAAuC;AAEvC;;GAEG;AACH,gEAAgE;AAChE,MAAM,CAAC,MAAM,WAAW,GAAG;IAC1B;;OAEG;IACH,QAAQ,EAAE,gBAAgB;IAE1B;;OAEG;IACH,MAAM,EAAE,cAAc;IAEtB;;OAEG;IACH,UAAU,EAAE,kBAAkB;IAE9B;;OAEG;IACH,aAAa,EAAE,qBAAqB;IAEpC;;OAEG;IACH,WAAW,EAAE,mBAAmB;IAEhC;;OAEG;IACH,WAAW,EAAE,mBAAmB;IAEhC;;OAEG;IACH,UAAU,EAAE,kBAAkB;IAE9B;;OAEG;IACH,SAAS,EAAE,iBAAiB;IAE5B;;OAEG;IACH,WAAW,EAAE,mBAAmB;IAEhC;;OAEG;IACH,QAAQ,EAAE,gBAAgB;IAE1B;;OAEG;IACH,YAAY,EAAE,oBAAoB;IAElC;;OAEG;IACH,KAAK,EAAE,aAAa;IAEpB;;OAEG;IACH,OAAO,EAAE,eAAe;IAExB;;OAEG;IACH,aAAa,EAAE,qBAAqB;IAEpC;;OAEG;IACH,iBAAiB,EAAE,yBAAyB;IAE5C;;OAEG;IACH,wBAAwB,EAAE,gCAAgC;IAE1D;;OAEG;IACH,qBAAqB,EAAE,6BAA6B;IAEpD;;OAEG;IACH,sBAAsB,EAAE,8BAA8B;IAEtD;;OAEG;IACH,OAAO,EAAE,eAAe;IAExB;;OAEG;IACH,aAAa,EAAE,qBAAqB;IAEpC;;OAEG;IACH,aAAa,EAAE,qBAAqB;IAEpC;;OAEG;IACH,kBAAkB,EAAE,0BAA0B;IAE9C;;OAEG;IACH,aAAa,EAAE,qBAAqB;IAEpC;;OAEG;IACH,SAAS,EAAE,iBAAiB;IAE5B;;OAEG;IACH,UAAU,EAAE,kBAAkB;IAE9B;;OAEG;IACH,SAAS,EAAE,iBAAiB;CACnB,CAAC","sourcesContent":["// Copyright 2024 IOTA Stiftung.\n// SPDX-License-Identifier: Apache-2.0.\n\n/**\n * The types of JSON-LD data.\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nexport const JsonLdTypes = {\n\t/**\n\t * Represents JSON-LD Document.\n\t */\n\tDocument: \"JsonLdDocument\",\n\n\t/**\n\t * Represents JSON-LD Object.\n\t */\n\tObject: \"JsonLdObject\",\n\n\t/**\n\t * Represents JSON-LD Node Object.\n\t */\n\tNodeObject: \"JsonLdNodeObject\",\n\n\t/**\n\t * Represents JSON-LD Node Primitive.\n\t */\n\tNodePrimitive: \"JsonLdNodePrimitive\",\n\n\t/**\n\t * Represents JSON-LD Graph Object.\n\t */\n\tGraphObject: \"JsonLdGraphObject\",\n\n\t/**\n\t * Represents JSON-LD Value Object.\n\t */\n\tValueObject: \"JsonLdValueObject\",\n\n\t/**\n\t * Represents JSON-LD List Object.\n\t */\n\tListObject: \"JsonLdListObject\",\n\n\t/**\n\t * Represents JSON-LD Set Object.\n\t */\n\tSetObject: \"JsonLdSetObject\",\n\n\t/**\n\t * Represents JSON-LD Language Map.\n\t */\n\tLanguageMap: \"JsonLdLanguageMap\",\n\n\t/**\n\t * Represents JSON-LD Index Map.\n\t */\n\tIndexMap: \"JsonLdIndexMap\",\n\n\t/**\n\t * Represents JSON-LD Index Map Item.\n\t */\n\tIndexMapItem: \"JsonLdIndexMapItem\",\n\n\t/**\n\t * Represents JSON-LD Id Map.\n\t */\n\tIdMap: \"JsonLdIdMap\",\n\n\t/**\n\t * Represents JSON-LD Type Map.\n\t */\n\tTypeMap: \"JsonLdTypeMap\",\n\n\t/**\n\t * Represents JSON-LD Included block.\n\t */\n\tIncludedBlock: \"JsonLdIncludedBlock\",\n\n\t/**\n\t * Represents JSON-LD Context Definition.\n\t */\n\tContextDefinition: \"JsonLdContextDefinition\",\n\n\t/**\n\t * Represents JSON-LD Context Definition Element.\n\t */\n\tContextDefinitionElement: \"JsonLdContextDefinitionElement\",\n\n\t/**\n\t * Represents JSON-LD Context Definition Root.\n\t */\n\tContextDefinitionRoot: \"JsonLdContextDefinitionRoot\",\n\n\t/**\n\t * Represents JSON-LD Expanded Term Definition.\n\t */\n\tExpandedTermDefinition: \"JsonLdExpandedTermDefinition\",\n\n\t/**\n\t * Represents JSON-LD Keyword.\n\t */\n\tKeyword: \"JsonLdKeyword\",\n\n\t/**\n\t * Represents JSON-LD List or Set Item.\n\t */\n\tListOrSetItem: \"JsonLdListOrSetItem\",\n\n\t/**\n\t * Represents JSON-LD Container Type.\n\t */\n\tContainerType: \"JsonLdContainerType\",\n\n\t/**\n\t * Represents JSON-LD Container Type Array.\n\t */\n\tContainerTypeArray: \"JsonLdContainerTypeArray\",\n\n\t/**\n\t * Represents JSON-LD JSON Primitive.\n\t */\n\tJsonPrimitive: \"JsonLdJsonPrimitive\",\n\n\t/**\n\t * Represents JSON-LD JSON Array.\n\t */\n\tJsonArray: \"JsonLdJsonArray\",\n\n\t/**\n\t * Represents JSON-LD JSON Object.\n\t */\n\tJsonObject: \"JsonLdJsonObject\",\n\n\t/**\n\t * Represents JSON-LD JSON Value.\n\t */\n\tJsonValue: \"JsonLdJsonValue\"\n} as const;\n\n/**\n * The types of JSON-LD data.\n */\nexport type JsonLdTypes = (typeof JsonLdTypes)[keyof typeof JsonLdTypes];\n"]}
@@ -0,0 +1,13 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/json-ld/JsonLdContainerType",
4
+ "description": "JSON-LD container types.",
5
+ "type": "string",
6
+ "enum": [
7
+ "@language",
8
+ "@index",
9
+ "@id",
10
+ "@graph",
11
+ "@type"
12
+ ]
13
+ }
@@ -0,0 +1,179 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/json-ld/JsonLdContainerTypeArray",
4
+ "description": "JSON-LD container type array.",
5
+ "anyOf": [
6
+ {
7
+ "type": "array",
8
+ "items": {
9
+ "allOf": [
10
+ {
11
+ "type": "string",
12
+ "const": "@graph"
13
+ },
14
+ {
15
+ "type": "string",
16
+ "const": "@id"
17
+ }
18
+ ]
19
+ }
20
+ },
21
+ {
22
+ "type": "array",
23
+ "items": {
24
+ "allOf": [
25
+ {
26
+ "type": "string",
27
+ "const": "@id"
28
+ },
29
+ {
30
+ "type": "string",
31
+ "const": "@graph"
32
+ }
33
+ ]
34
+ }
35
+ },
36
+ {
37
+ "type": "array",
38
+ "items": {
39
+ "allOf": [
40
+ {
41
+ "type": "string",
42
+ "const": "@set"
43
+ },
44
+ {
45
+ "type": "string",
46
+ "const": "@graph"
47
+ },
48
+ {
49
+ "type": "string",
50
+ "const": "@id"
51
+ }
52
+ ]
53
+ }
54
+ },
55
+ {
56
+ "type": "array",
57
+ "items": {
58
+ "allOf": [
59
+ {
60
+ "type": "string",
61
+ "const": "@set"
62
+ },
63
+ {
64
+ "type": "string",
65
+ "const": "@id"
66
+ },
67
+ {
68
+ "type": "string",
69
+ "const": "@graph"
70
+ }
71
+ ]
72
+ }
73
+ },
74
+ {
75
+ "type": "array",
76
+ "items": {
77
+ "allOf": [
78
+ {
79
+ "type": "string",
80
+ "const": "@graph"
81
+ },
82
+ {
83
+ "type": "string",
84
+ "const": "@set"
85
+ },
86
+ {
87
+ "type": "string",
88
+ "const": "@id"
89
+ }
90
+ ]
91
+ }
92
+ },
93
+ {
94
+ "type": "array",
95
+ "items": {
96
+ "allOf": [
97
+ {
98
+ "type": "string",
99
+ "const": "@id"
100
+ },
101
+ {
102
+ "type": "string",
103
+ "const": "@set"
104
+ },
105
+ {
106
+ "type": "string",
107
+ "const": "@graph"
108
+ }
109
+ ]
110
+ }
111
+ },
112
+ {
113
+ "type": "array",
114
+ "items": {
115
+ "allOf": [
116
+ {
117
+ "type": "string",
118
+ "const": "@graph"
119
+ },
120
+ {
121
+ "type": "string",
122
+ "const": "@id"
123
+ },
124
+ {
125
+ "type": "string",
126
+ "const": "@set"
127
+ }
128
+ ]
129
+ }
130
+ },
131
+ {
132
+ "type": "array",
133
+ "items": {
134
+ "allOf": [
135
+ {
136
+ "type": "string",
137
+ "const": "@id"
138
+ },
139
+ {
140
+ "type": "string",
141
+ "const": "@graph"
142
+ },
143
+ {
144
+ "type": "string",
145
+ "const": "@set"
146
+ }
147
+ ]
148
+ }
149
+ },
150
+ {
151
+ "type": "array",
152
+ "items": {
153
+ "allOf": [
154
+ {
155
+ "type": "string",
156
+ "const": "@set"
157
+ },
158
+ {
159
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContainerType"
160
+ }
161
+ ]
162
+ }
163
+ },
164
+ {
165
+ "type": "array",
166
+ "items": {
167
+ "allOf": [
168
+ {
169
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContainerType"
170
+ },
171
+ {
172
+ "type": "string",
173
+ "const": "@set"
174
+ }
175
+ ]
176
+ }
177
+ }
178
+ ]
179
+ }
@@ -0,0 +1,76 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/json-ld/JsonLdContextDefinition",
4
+ "description": "A context definition defines a local context in a node object.",
5
+ "type": "object",
6
+ "properties": {
7
+ "@base": {
8
+ "type": [
9
+ "string",
10
+ "null"
11
+ ]
12
+ },
13
+ "@direction": {
14
+ "type": [
15
+ "string",
16
+ "null"
17
+ ],
18
+ "enum": [
19
+ "ltr",
20
+ "rtl",
21
+ null
22
+ ]
23
+ },
24
+ "@import": {
25
+ "type": "string"
26
+ },
27
+ "@language": {
28
+ "type": "string"
29
+ },
30
+ "@propagate": {
31
+ "type": "boolean"
32
+ },
33
+ "@protected": {
34
+ "type": "boolean"
35
+ },
36
+ "@type": {
37
+ "type": "object",
38
+ "properties": {
39
+ "@container": {
40
+ "type": "string",
41
+ "const": "@set"
42
+ },
43
+ "@protected": {
44
+ "type": "boolean"
45
+ }
46
+ },
47
+ "required": [
48
+ "@container"
49
+ ],
50
+ "additionalProperties": false
51
+ },
52
+ "@version": {
53
+ "type": "string",
54
+ "const": "1.1"
55
+ },
56
+ "@vocab": {
57
+ "type": [
58
+ "string",
59
+ "null"
60
+ ]
61
+ }
62
+ },
63
+ "additionalProperties": {
64
+ "anyOf": [
65
+ {
66
+ "type": "null"
67
+ },
68
+ {
69
+ "type": "string"
70
+ },
71
+ {
72
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdExpandedTermDefinition"
73
+ }
74
+ ]
75
+ }
76
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement",
4
+ "description": "A context definition element is used to define the types of a context definition.",
5
+ "anyOf": [
6
+ {
7
+ "type": "null"
8
+ },
9
+ {
10
+ "type": "string"
11
+ },
12
+ {
13
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinition"
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionRoot",
4
+ "description": "A context definition root is used to define the root of a context definition.",
5
+ "anyOf": [
6
+ {
7
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
8
+ },
9
+ {
10
+ "type": "array",
11
+ "items": {
12
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionElement"
13
+ }
14
+ }
15
+ ]
16
+ }
@@ -0,0 +1,48 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/json-ld/JsonLdDocument",
4
+ "description": "A JSON-LD document MUST be valid JSON text as described in [RFC8259], or some format that can be represented in the JSON-LD internal representation that is equivalent to valid JSON text.",
5
+ "anyOf": [
6
+ {
7
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
8
+ },
9
+ {
10
+ "type": "array",
11
+ "items": {
12
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
13
+ }
14
+ },
15
+ {
16
+ "type": "object",
17
+ "properties": {
18
+ "@context": {
19
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionRoot"
20
+ },
21
+ "@graph": {
22
+ "anyOf": [
23
+ {
24
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdValueObject"
25
+ },
26
+ {
27
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
28
+ },
29
+ {
30
+ "type": "array",
31
+ "items": {
32
+ "anyOf": [
33
+ {
34
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdValueObject"
35
+ },
36
+ {
37
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
38
+ }
39
+ ]
40
+ }
41
+ }
42
+ ]
43
+ }
44
+ },
45
+ "additionalProperties": false
46
+ }
47
+ ]
48
+ }
@@ -0,0 +1,136 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/json-ld/JsonLdExpandedTermDefinition",
4
+ "description": "An expanded term definition is used to describe the mapping between a term and its expanded identifier, as well as other properties of the value associated with the term when it is used as key in a node object.",
5
+ "anyOf": [
6
+ {
7
+ "type": "object",
8
+ "additionalProperties": false,
9
+ "properties": {
10
+ "@id": {
11
+ "anyOf": [
12
+ {
13
+ "type": "string"
14
+ },
15
+ {
16
+ "type": "array",
17
+ "items": {
18
+ "type": "string"
19
+ }
20
+ },
21
+ {
22
+ "type": "null"
23
+ }
24
+ ]
25
+ },
26
+ "@nest": {
27
+ "type": "string"
28
+ },
29
+ "@container": {
30
+ "anyOf": [
31
+ {
32
+ "type": "string",
33
+ "const": "@list"
34
+ },
35
+ {
36
+ "type": "string",
37
+ "const": "@set"
38
+ },
39
+ {
40
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContainerType"
41
+ },
42
+ {
43
+ "type": "array",
44
+ "items": {
45
+ "anyOf": [
46
+ {
47
+ "type": "string",
48
+ "const": "@list"
49
+ },
50
+ {
51
+ "type": "string",
52
+ "const": "@set"
53
+ },
54
+ {
55
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContainerType"
56
+ }
57
+ ]
58
+ }
59
+ },
60
+ {
61
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContainerTypeArray"
62
+ },
63
+ {
64
+ "type": "null"
65
+ }
66
+ ]
67
+ },
68
+ "@type": {
69
+ "type": "string"
70
+ },
71
+ "@language": {
72
+ "type": "string"
73
+ },
74
+ "@index": {
75
+ "type": "string"
76
+ },
77
+ "@context": {
78
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinition"
79
+ },
80
+ "@prefix": {
81
+ "type": "boolean"
82
+ },
83
+ "@propagate": {
84
+ "type": "boolean"
85
+ },
86
+ "@protected": {
87
+ "type": "boolean"
88
+ }
89
+ }
90
+ },
91
+ {
92
+ "type": "object",
93
+ "additionalProperties": false,
94
+ "properties": {
95
+ "@reverse": {
96
+ "type": "string"
97
+ },
98
+ "@container": {
99
+ "type": [
100
+ "string",
101
+ "null"
102
+ ],
103
+ "enum": [
104
+ "@set",
105
+ "@index",
106
+ null
107
+ ]
108
+ },
109
+ "@type": {
110
+ "type": "string"
111
+ },
112
+ "@language": {
113
+ "type": "string"
114
+ },
115
+ "@index": {
116
+ "type": "string"
117
+ },
118
+ "@context": {
119
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinition"
120
+ },
121
+ "@prefix": {
122
+ "type": "boolean"
123
+ },
124
+ "@propagate": {
125
+ "type": "boolean"
126
+ },
127
+ "@protected": {
128
+ "type": "boolean"
129
+ }
130
+ },
131
+ "required": [
132
+ "@reverse"
133
+ ]
134
+ }
135
+ ]
136
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/json-ld/JsonLdGraphObject",
4
+ "description": "A graph object represents a named graph, which MAY include an explicit graph name.",
5
+ "type": "object",
6
+ "properties": {
7
+ "@graph": {
8
+ "anyOf": [
9
+ {
10
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
11
+ },
12
+ {
13
+ "type": "array",
14
+ "items": {
15
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
16
+ }
17
+ }
18
+ ]
19
+ },
20
+ "@index": {
21
+ "type": "string"
22
+ },
23
+ "@id": {
24
+ "anyOf": [
25
+ {
26
+ "type": "string"
27
+ },
28
+ {
29
+ "type": "array",
30
+ "items": {
31
+ "type": "string"
32
+ }
33
+ }
34
+ ]
35
+ },
36
+ "@context": {
37
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdContextDefinitionRoot"
38
+ }
39
+ },
40
+ "required": [
41
+ "@graph"
42
+ ],
43
+ "additionalProperties": false
44
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/json-ld/JsonLdIdMap",
4
+ "description": "An id map is used to associate an IRI with a value that allows easy programmatic access.",
5
+ "type": "object",
6
+ "additionalProperties": {
7
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
8
+ }
9
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://schema.twindev.org/json-ld/JsonLdIncludedBlock",
4
+ "description": "An included block is used to provide a set of node objects.",
5
+ "anyOf": [
6
+ {
7
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
8
+ },
9
+ {
10
+ "type": "array",
11
+ "items": {
12
+ "$ref": "https://schema.twindev.org/json-ld/JsonLdNodeObject"
13
+ }
14
+ }
15
+ ]
16
+ }