@twin.org/data-json-ld 0.0.1-next.3 → 0.0.1-next.31

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 (67) hide show
  1. package/dist/cjs/index.cjs +631 -351
  2. package/dist/esm/index.mjs +633 -354
  3. package/dist/types/index.d.ts +26 -0
  4. package/dist/types/models/IJsonLdContainerType.d.ts +8 -0
  5. package/dist/types/models/IJsonLdContainerTypeArray.d.ts +9 -0
  6. package/dist/types/models/IJsonLdContextDefinition.d.ts +25 -0
  7. package/dist/types/models/IJsonLdContextDefinitionElement.d.ts +9 -0
  8. package/dist/types/models/IJsonLdContextDefinitionRoot.d.ts +9 -0
  9. package/dist/types/models/IJsonLdDocument.d.ts +2 -189
  10. package/dist/types/models/IJsonLdExpandedTermDefinition.d.ts +28 -0
  11. package/dist/types/models/IJsonLdGraphObject.d.ts +16 -0
  12. package/dist/types/models/IJsonLdIdMap.d.ts +12 -0
  13. package/dist/types/models/IJsonLdIncludedBlock.d.ts +10 -0
  14. package/dist/types/models/IJsonLdIndexMap.d.ts +13 -0
  15. package/dist/types/models/IJsonLdIndexMapItem.d.ts +12 -0
  16. package/dist/types/models/IJsonLdJsonArray.d.ts +9 -0
  17. package/dist/types/models/IJsonLdJsonObject.d.ts +11 -0
  18. package/dist/types/models/IJsonLdJsonPrimitive.d.ts +8 -0
  19. package/dist/types/models/IJsonLdJsonValue.d.ts +11 -0
  20. package/dist/types/models/IJsonLdKeyword.d.ts +42 -0
  21. package/dist/types/models/IJsonLdLanguageMap.d.ts +11 -0
  22. package/dist/types/models/IJsonLdListObject.d.ts +13 -0
  23. package/dist/types/models/IJsonLdListOrSetItem.d.ts +10 -0
  24. package/dist/types/models/IJsonLdNodeObject.d.ts +19 -0
  25. package/dist/types/models/IJsonLdNodePrimitive.d.ts +13 -0
  26. package/dist/types/models/IJsonLdObject.d.ts +24 -0
  27. package/dist/types/models/IJsonLdSetObject.d.ts +13 -0
  28. package/dist/types/models/IJsonLdTypeMap.d.ts +12 -0
  29. package/dist/types/models/IJsonLdValueObject.d.ts +26 -0
  30. package/dist/types/models/jsonLdContexts.d.ts +13 -0
  31. package/dist/types/models/jsonLdTypes.d.ts +27 -23
  32. package/dist/types/utils/jsonLdProcessor.d.ts +86 -8
  33. package/docs/changelog.md +43 -1
  34. package/docs/reference/classes/JsonLdDataTypes.md +3 -3
  35. package/docs/reference/classes/JsonLdHelper.md +16 -8
  36. package/docs/reference/classes/JsonLdProcessor.md +322 -16
  37. package/docs/reference/index.md +20 -15
  38. package/docs/reference/interfaces/IJsonLdContextDefinition.md +1 -1
  39. package/docs/reference/interfaces/IJsonLdGraphObject.md +1 -1
  40. package/docs/reference/interfaces/IJsonLdIdMap.md +1 -1
  41. package/docs/reference/interfaces/IJsonLdIndexMap.md +1 -1
  42. package/docs/reference/interfaces/IJsonLdJsonObject.md +3 -1
  43. package/docs/reference/interfaces/IJsonLdLanguageMap.md +1 -1
  44. package/docs/reference/interfaces/IJsonLdNodeObject.md +40 -4
  45. package/docs/reference/interfaces/IJsonLdObject.md +64 -0
  46. package/docs/reference/interfaces/IJsonLdTypeMap.md +1 -1
  47. package/docs/reference/type-aliases/IJsonLdContainerType.md +3 -1
  48. package/docs/reference/type-aliases/IJsonLdContainerTypeArray.md +3 -1
  49. package/docs/reference/type-aliases/IJsonLdContextDefinitionElement.md +5 -0
  50. package/docs/reference/type-aliases/IJsonLdContextDefinitionRoot.md +5 -0
  51. package/docs/reference/type-aliases/IJsonLdDocument.md +1 -1
  52. package/docs/reference/type-aliases/IJsonLdExpandedTermDefinition.md +1 -1
  53. package/docs/reference/type-aliases/IJsonLdIncludedBlock.md +1 -1
  54. package/docs/reference/type-aliases/IJsonLdIndexMapItem.md +1 -1
  55. package/docs/reference/type-aliases/IJsonLdJsonArray.md +3 -1
  56. package/docs/reference/type-aliases/IJsonLdJsonPrimitive.md +3 -1
  57. package/docs/reference/type-aliases/IJsonLdJsonValue.md +3 -1
  58. package/docs/reference/type-aliases/IJsonLdKeyword.md +51 -7
  59. package/docs/reference/type-aliases/IJsonLdListOrSetItem.md +1 -1
  60. package/docs/reference/type-aliases/IJsonLdNodePrimitive.md +1 -1
  61. package/docs/reference/type-aliases/IJsonLdValueObject.md +1 -1
  62. package/docs/reference/type-aliases/JsonLdContexts.md +5 -0
  63. package/docs/reference/type-aliases/JsonLdTypes.md +1 -1
  64. package/docs/reference/variables/JsonLdContexts.md +13 -0
  65. package/docs/reference/variables/JsonLdTypes.md +29 -23
  66. package/locales/en.json +8 -3
  67. package/package.json +7 -37
@@ -1,3 +1,5 @@
1
1
  # Type Alias: IJsonLdContainerTypeArray
2
2
 
3
- > **IJsonLdContainerTypeArray**: [`"@graph"`, `"@id"`] \| [`"@id"`, `"@graph"`] \| [`"@set"`, `"@graph"`, `"@id"`] \| [`"@set"`, `"@id"`, `"@graph"`] \| [`"@graph"`, `"@set"`, `"@id"`] \| [`"@id"`, `"@set"`, `"@graph"`] \| [`"@graph"`, `"@id"`, `"@set"`] \| [`"@id"`, `"@graph"`, `"@set"`] \| [`"@set"`, [`IJsonLdContainerType`](IJsonLdContainerType.md)] \| [[`IJsonLdContainerType`](IJsonLdContainerType.md), `"@set"`]
3
+ > **IJsonLdContainerTypeArray** = \[`"@graph"`, `"@id"`\] \| \[`"@id"`, `"@graph"`\] \| \[`"@set"`, `"@graph"`, `"@id"`\] \| \[`"@set"`, `"@id"`, `"@graph"`\] \| \[`"@graph"`, `"@set"`, `"@id"`\] \| \[`"@id"`, `"@set"`, `"@graph"`\] \| \[`"@graph"`, `"@id"`, `"@set"`\] \| \[`"@id"`, `"@graph"`, `"@set"`\] \| \[`"@set"`, [`IJsonLdContainerType`](IJsonLdContainerType.md)\] \| \[[`IJsonLdContainerType`](IJsonLdContainerType.md), `"@set"`\]
4
+
5
+ Helper Types.
@@ -0,0 +1,5 @@
1
+ # Type Alias: IJsonLdContextDefinitionElement
2
+
3
+ > **IJsonLdContextDefinitionElement** = `null` \| `string` \| [`IJsonLdContextDefinition`](../interfaces/IJsonLdContextDefinition.md)
4
+
5
+ A context definition element is used to define the types of a context definition.
@@ -0,0 +1,5 @@
1
+ # Type Alias: IJsonLdContextDefinitionRoot
2
+
3
+ > **IJsonLdContextDefinitionRoot** = [`IJsonLdContextDefinitionElement`](IJsonLdContextDefinitionElement.md) \| [`IJsonLdContextDefinitionElement`](IJsonLdContextDefinitionElement.md)[]
4
+
5
+ A context definition root is used to define the root of a context definition.
@@ -1,6 +1,6 @@
1
1
  # Type Alias: IJsonLdDocument
2
2
 
3
- > **IJsonLdDocument**: [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)[] \| `object`
3
+ > **IJsonLdDocument** = [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)[] \| \{ `@context`: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@context"`\]; `@graph`: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@graph"`\]; \}
4
4
 
5
5
  A JSON-LD document MUST be valid JSON text as described in [RFC8259],
6
6
  or some format that can be represented in the JSON-LD internal representation
@@ -1,6 +1,6 @@
1
1
  # Type Alias: IJsonLdExpandedTermDefinition
2
2
 
3
- > **IJsonLdExpandedTermDefinition**: `object` & `object` \| `object`
3
+ > **IJsonLdExpandedTermDefinition** = `object` & \{ `@id`: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@id"`\] \| `null`; `@nest`: `"@nest"` \| `string`; `@container`: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@container"`\]; \} \| \{ `@reverse`: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@reverse"`\]; `@container`: `"@set"` \| `"@index"` \| `null`; \}
4
4
 
5
5
  An expanded term definition is used to describe the mapping between a term
6
6
  and its expanded identifier, as well as other properties of the value
@@ -1,6 +1,6 @@
1
1
  # Type Alias: IJsonLdIncludedBlock
2
2
 
3
- > **IJsonLdIncludedBlock**: [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)[]
3
+ > **IJsonLdIncludedBlock** = [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)[]
4
4
 
5
5
  An included block is used to provide a set of node objects.
6
6
 
@@ -1,5 +1,5 @@
1
1
  # Type Alias: IJsonLdIndexMapItem
2
2
 
3
- > **IJsonLdIndexMapItem**: `null` \| `boolean` \| `number` \| `string` \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdValueObject`](IJsonLdValueObject.md) \| [`IJsonLdListObject`](../interfaces/IJsonLdListObject.md) \| [`IJsonLdSetObject`](../interfaces/IJsonLdSetObject.md)
3
+ > **IJsonLdIndexMapItem** = `null` \| `boolean` \| `number` \| `string` \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdValueObject`](IJsonLdValueObject.md) \| [`IJsonLdListObject`](../interfaces/IJsonLdListObject.md) \| [`IJsonLdSetObject`](../interfaces/IJsonLdSetObject.md)
4
4
 
5
5
  The items that can be stored in an index map.
@@ -1,3 +1,5 @@
1
1
  # Type Alias: IJsonLdJsonArray
2
2
 
3
- > **IJsonLdJsonArray**: [`IJsonLdJsonValue`](IJsonLdJsonValue.md)[]
3
+ > **IJsonLdJsonArray** = [`IJsonLdJsonValue`](IJsonLdJsonValue.md)[]
4
+
5
+ JSON Type for array.
@@ -1,3 +1,5 @@
1
1
  # Type Alias: IJsonLdJsonPrimitive
2
2
 
3
- > **IJsonLdJsonPrimitive**: `string` \| `number` \| `boolean` \| `null`
3
+ > **IJsonLdJsonPrimitive** = `string` \| `number` \| `boolean` \| `null`
4
+
5
+ JSON Primitive.
@@ -1,3 +1,5 @@
1
1
  # Type Alias: IJsonLdJsonValue
2
2
 
3
- > **IJsonLdJsonValue**: [`IJsonLdJsonPrimitive`](IJsonLdJsonPrimitive.md) \| [`IJsonLdJsonArray`](IJsonLdJsonArray.md) \| [`IJsonLdJsonObject`](../interfaces/IJsonLdJsonObject.md)
3
+ > **IJsonLdJsonValue** = [`IJsonLdJsonPrimitive`](IJsonLdJsonPrimitive.md) \| [`IJsonLdJsonArray`](IJsonLdJsonArray.md) \| [`IJsonLdJsonObject`](../interfaces/IJsonLdJsonObject.md)
4
+
5
+ JSON Value.
@@ -1,105 +1,149 @@
1
1
  # Type Alias: IJsonLdKeyword
2
2
 
3
- > **IJsonLdKeyword**: `object`
3
+ > **IJsonLdKeyword** = `object`
4
4
 
5
5
  A list of keywords and their types.
6
6
  Only used for internal reference; not an actual interface.
7
7
  Not for export.
8
8
 
9
- ## Type declaration
9
+ ## See
10
+
11
+ https://www.w3.org/TR/json-ld/#keywords
12
+
13
+ ## Properties
10
14
 
11
15
  ### @base
12
16
 
13
17
  > **@base**: `string` \| `null`
14
18
 
19
+ ***
20
+
15
21
  ### @container
16
22
 
17
23
  > **@container**: `"@list"` \| `"@set"` \| [`IJsonLdContainerType`](IJsonLdContainerType.md) \| (`"@list"` \| `"@set"` \| [`IJsonLdContainerType`](IJsonLdContainerType.md))[] \| [`IJsonLdContainerTypeArray`](IJsonLdContainerTypeArray.md) \| `null`
18
24
 
25
+ ***
26
+
19
27
  ### @context
20
28
 
21
- > **@context**: `null` \| `string` \| [`IJsonLdContextDefinition`](../interfaces/IJsonLdContextDefinition.md) \| (`null` \| `string` \| [`IJsonLdContextDefinition`](../interfaces/IJsonLdContextDefinition.md))[]
29
+ > **@context**: [`IJsonLdContextDefinitionRoot`](IJsonLdContextDefinitionRoot.md)
30
+
31
+ ***
22
32
 
23
33
  ### @direction
24
34
 
25
35
  > **@direction**: `"ltr"` \| `"rtl"` \| `null`
26
36
 
37
+ ***
38
+
27
39
  ### @graph
28
40
 
29
41
  > **@graph**: [`IJsonLdValueObject`](IJsonLdValueObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| ([`IJsonLdValueObject`](IJsonLdValueObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md))[]
30
42
 
43
+ ***
44
+
31
45
  ### @id
32
46
 
33
47
  > **@id**: `string` \| `string`[]
34
48
 
49
+ ***
50
+
35
51
  ### @import
36
52
 
37
53
  > **@import**: `string`
38
54
 
55
+ ***
56
+
39
57
  ### @included
40
58
 
41
59
  > **@included**: [`IJsonLdIncludedBlock`](IJsonLdIncludedBlock.md)
42
60
 
61
+ ***
62
+
43
63
  ### @index
44
64
 
45
65
  > **@index**: `string`
46
66
 
67
+ ***
68
+
47
69
  ### @json
48
70
 
49
71
  > **@json**: `"@json"`
50
72
 
73
+ ***
74
+
51
75
  ### @language
52
76
 
53
77
  > **@language**: `string`
54
78
 
79
+ ***
80
+
55
81
  ### @list
56
82
 
57
83
  > **@list**: [`IJsonLdListOrSetItem`](IJsonLdListOrSetItem.md) \| [`IJsonLdListOrSetItem`](IJsonLdListOrSetItem.md)[]
58
84
 
85
+ ***
86
+
59
87
  ### @nest
60
88
 
61
89
  > **@nest**: `object`
62
90
 
91
+ ***
92
+
63
93
  ### @none
64
94
 
65
95
  > **@none**: `"@none"`
66
96
 
97
+ ***
98
+
67
99
  ### @prefix
68
100
 
69
101
  > **@prefix**: `boolean`
70
102
 
103
+ ***
104
+
71
105
  ### @propagate
72
106
 
73
107
  > **@propagate**: `boolean`
74
108
 
109
+ ***
110
+
75
111
  ### @protected
76
112
 
77
113
  > **@protected**: `boolean`
78
114
 
115
+ ***
116
+
79
117
  ### @reverse
80
118
 
81
119
  > **@reverse**: `string`
82
120
 
121
+ ***
122
+
83
123
  ### @set
84
124
 
85
125
  > **@set**: [`IJsonLdListOrSetItem`](IJsonLdListOrSetItem.md) \| [`IJsonLdListOrSetItem`](IJsonLdListOrSetItem.md)[]
86
126
 
127
+ ***
128
+
87
129
  ### @type
88
130
 
89
131
  > **@type**: `string`
90
132
 
133
+ ***
134
+
91
135
  ### @value
92
136
 
93
137
  > **@value**: `null` \| `boolean` \| `number` \| `string`
94
138
 
139
+ ***
140
+
95
141
  ### @version
96
142
 
97
143
  > **@version**: `"1.1"`
98
144
 
145
+ ***
146
+
99
147
  ### @vocab
100
148
 
101
149
  > **@vocab**: `string` \| `null`
102
-
103
- ## See
104
-
105
- https://www.w3.org/TR/json-ld/#keywords
@@ -1,5 +1,5 @@
1
1
  # Type Alias: IJsonLdListOrSetItem
2
2
 
3
- > **IJsonLdListOrSetItem**: `null` \| `boolean` \| `number` \| `string` \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdValueObject`](IJsonLdValueObject.md)
3
+ > **IJsonLdListOrSetItem** = `null` \| `boolean` \| `number` \| `string` \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdValueObject`](IJsonLdValueObject.md)
4
4
 
5
5
  A list or set item can be a null, boolean, number, string, node object, or value object.
@@ -1,5 +1,5 @@
1
1
  # Type Alias: IJsonLdNodePrimitive
2
2
 
3
- > **IJsonLdNodePrimitive**: `null` \| `boolean` \| `number` \| `string` \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdGraphObject`](../interfaces/IJsonLdGraphObject.md) \| [`IJsonLdValueObject`](IJsonLdValueObject.md) \| [`IJsonLdListObject`](../interfaces/IJsonLdListObject.md) \| [`IJsonLdSetObject`](../interfaces/IJsonLdSetObject.md)
3
+ > **IJsonLdNodePrimitive** = `null` \| `boolean` \| `number` \| `string` \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdGraphObject`](../interfaces/IJsonLdGraphObject.md) \| [`IJsonLdValueObject`](IJsonLdValueObject.md) \| [`IJsonLdListObject`](../interfaces/IJsonLdListObject.md) \| [`IJsonLdSetObject`](../interfaces/IJsonLdSetObject.md)
4
4
 
5
5
  A node primitive is a JSON-LD value which is not one of the defined NodeObject properties.
@@ -1,6 +1,6 @@
1
1
  # Type Alias: IJsonLdValueObject
2
2
 
3
- > **IJsonLdValueObject**: `object` & `object` \| `object` \| `object`
3
+ > **IJsonLdValueObject** = `object` & \{ `@value`: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@value"`\]; `@language`: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@language"`\]; `@direction`: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@direction"`\]; \} \| \{ `@value`: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@value"`\]; `@type`: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@type"`\]; \} \| \{ `@value`: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@value"`\] \| [`IJsonLdJsonObject`](../interfaces/IJsonLdJsonObject.md) \| [`IJsonLdJsonArray`](IJsonLdJsonArray.md); `@type`: `"@json"`; \}
4
4
 
5
5
  A value object is used to explicitly associate a type or a language with a value
6
6
  to create a typed value or a language-tagged string and possibly associate a base direction.
@@ -0,0 +1,5 @@
1
+ # Type Alias: JsonLdContexts
2
+
3
+ > **JsonLdContexts** = *typeof* [`JsonLdContexts`](../variables/JsonLdContexts.md)\[keyof *typeof* [`JsonLdContexts`](../variables/JsonLdContexts.md)\]
4
+
5
+ The contexts of JSON-LD data.
@@ -1,5 +1,5 @@
1
1
  # Type Alias: JsonLdTypes
2
2
 
3
- > **JsonLdTypes**: *typeof* [`JsonLdTypes`](../variables/JsonLdTypes.md)\[keyof *typeof* [`JsonLdTypes`](../variables/JsonLdTypes.md)\]
3
+ > **JsonLdTypes** = *typeof* [`JsonLdTypes`](../variables/JsonLdTypes.md)\[keyof *typeof* [`JsonLdTypes`](../variables/JsonLdTypes.md)\]
4
4
 
5
5
  The types of JSON-LD data.
@@ -0,0 +1,13 @@
1
+ # Variable: JsonLdContexts
2
+
3
+ > `const` **JsonLdContexts**: `object`
4
+
5
+ The contexts of JSON-LD data.
6
+
7
+ ## Type declaration
8
+
9
+ ### ContextRoot
10
+
11
+ > `readonly` **ContextRoot**: `"https://schema.twindev.org/json-ld/"` = `"https://schema.twindev.org/json-ld/"`
12
+
13
+ Context Root.
@@ -8,138 +8,144 @@ The types of JSON-LD data.
8
8
 
9
9
  ### Document
10
10
 
11
- > `readonly` **Document**: `"https://schema.twindev.org/json-ld/JsonLdDocument"` = `"https://schema.twindev.org/json-ld/JsonLdDocument"`
11
+ > `readonly` **Document**: `"JsonLdDocument"` = `"JsonLdDocument"`
12
12
 
13
13
  Represents JSON-LD Document.
14
14
 
15
+ ### Object
16
+
17
+ > `readonly` **Object**: `"JsonLdObject"` = `"JsonLdObject"`
18
+
19
+ Represents JSON-LD Object.
20
+
15
21
  ### NodeObject
16
22
 
17
- > `readonly` **NodeObject**: `"https://schema.twindev.org/json-ld/JsonLdNodeObject"` = `"https://schema.twindev.org/json-ld/JsonLdNodeObject"`
23
+ > `readonly` **NodeObject**: `"JsonLdNodeObject"` = `"JsonLdNodeObject"`
18
24
 
19
25
  Represents JSON-LD Node Object.
20
26
 
21
27
  ### NodePrimitive
22
28
 
23
- > `readonly` **NodePrimitive**: `"https://schema.twindev.org/json-ld/JsonLdNodePrimitive"` = `"https://schema.twindev.org/json-ld/JsonLdNodePrimitive"`
29
+ > `readonly` **NodePrimitive**: `"JsonLdNodePrimitive"` = `"JsonLdNodePrimitive"`
24
30
 
25
31
  Represents JSON-LD Node Primitive.
26
32
 
27
33
  ### GraphObject
28
34
 
29
- > `readonly` **GraphObject**: `"https://schema.twindev.org/json-ld/JsonLdGraphObject"` = `"https://schema.twindev.org/json-ld/JsonLdGraphObject"`
35
+ > `readonly` **GraphObject**: `"JsonLdGraphObject"` = `"JsonLdGraphObject"`
30
36
 
31
37
  Represents JSON-LD Graph Object.
32
38
 
33
39
  ### ValueObject
34
40
 
35
- > `readonly` **ValueObject**: `"https://schema.twindev.org/json-ld/JsonLdValueObject"` = `"https://schema.twindev.org/json-ld/JsonLdValueObject"`
41
+ > `readonly` **ValueObject**: `"JsonLdValueObject"` = `"JsonLdValueObject"`
36
42
 
37
43
  Represents JSON-LD Value Object.
38
44
 
39
45
  ### ListObject
40
46
 
41
- > `readonly` **ListObject**: `"https://schema.twindev.org/json-ld/JsonLdListObject"` = `"https://schema.twindev.org/json-ld/JsonLdListObject"`
47
+ > `readonly` **ListObject**: `"JsonLdListObject"` = `"JsonLdListObject"`
42
48
 
43
49
  Represents JSON-LD List Object.
44
50
 
45
51
  ### SetObject
46
52
 
47
- > `readonly` **SetObject**: `"https://schema.twindev.org/json-ld/JsonLdSetObject"` = `"https://schema.twindev.org/json-ld/JsonLdSetObject"`
53
+ > `readonly` **SetObject**: `"JsonLdSetObject"` = `"JsonLdSetObject"`
48
54
 
49
55
  Represents JSON-LD Set Object.
50
56
 
51
57
  ### LanguageMap
52
58
 
53
- > `readonly` **LanguageMap**: `"https://schema.twindev.org/json-ld/JsonLdLanguageMap"` = `"https://schema.twindev.org/json-ld/JsonLdLanguageMap"`
59
+ > `readonly` **LanguageMap**: `"JsonLdLanguageMap"` = `"JsonLdLanguageMap"`
54
60
 
55
61
  Represents JSON-LD Language Map.
56
62
 
57
63
  ### IndexMap
58
64
 
59
- > `readonly` **IndexMap**: `"https://schema.twindev.org/json-ld/JsonLdIndexMap"` = `"https://schema.twindev.org/json-ld/JsonLdIndexMap"`
65
+ > `readonly` **IndexMap**: `"JsonLdIndexMap"` = `"JsonLdIndexMap"`
60
66
 
61
67
  Represents JSON-LD Index Map.
62
68
 
63
69
  ### IndexMapItem
64
70
 
65
- > `readonly` **IndexMapItem**: `"https://schema.twindev.org/json-ld/JsonLdIndexMapItem"` = `"https://schema.twindev.org/json-ld/JsonLdIndexMapItem"`
71
+ > `readonly` **IndexMapItem**: `"JsonLdIndexMapItem"` = `"JsonLdIndexMapItem"`
66
72
 
67
73
  Represents JSON-LD Index Map Item.
68
74
 
69
75
  ### IdMap
70
76
 
71
- > `readonly` **IdMap**: `"https://schema.twindev.org/json-ld/JsonLdIdMap"` = `"https://schema.twindev.org/json-ld/JsonLdIdMap"`
77
+ > `readonly` **IdMap**: `"JsonLdIdMap"` = `"JsonLdIdMap"`
72
78
 
73
79
  Represents JSON-LD Id Map.
74
80
 
75
81
  ### TypeMap
76
82
 
77
- > `readonly` **TypeMap**: `"https://schema.twindev.org/json-ld/JsonLdTypeMap"` = `"https://schema.twindev.org/json-ld/JsonLdTypeMap"`
83
+ > `readonly` **TypeMap**: `"JsonLdTypeMap"` = `"JsonLdTypeMap"`
78
84
 
79
85
  Represents JSON-LD Type Map.
80
86
 
81
87
  ### IncludedBlock
82
88
 
83
- > `readonly` **IncludedBlock**: `"https://schema.twindev.org/json-ld/JsonLdIncludedBlock"` = `"https://schema.twindev.org/json-ld/JsonLdIncludedBlock"`
89
+ > `readonly` **IncludedBlock**: `"JsonLdIncludedBlock"` = `"JsonLdIncludedBlock"`
84
90
 
85
91
  Represents JSON-LD Included block.
86
92
 
87
93
  ### ContextDefinition
88
94
 
89
- > `readonly` **ContextDefinition**: `"https://schema.twindev.org/json-ld/JsonLdContextDefinition"` = `"https://schema.twindev.org/json-ld/JsonLdContextDefinition"`
95
+ > `readonly` **ContextDefinition**: `"JsonLdContextDefinition"` = `"JsonLdContextDefinition"`
90
96
 
91
97
  Represents JSON-LD Context Definition.
92
98
 
93
99
  ### ExpandedTermDefinition
94
100
 
95
- > `readonly` **ExpandedTermDefinition**: `"https://schema.twindev.org/json-ld/JsonLdExpandedTermDefinition"` = `"https://schema.twindev.org/json-ld/JsonLdExpandedTermDefinition"`
101
+ > `readonly` **ExpandedTermDefinition**: `"JsonLdExpandedTermDefinition"` = `"JsonLdExpandedTermDefinition"`
96
102
 
97
103
  Represents JSON-LD Expanded Term Definition.
98
104
 
99
105
  ### Keyword
100
106
 
101
- > `readonly` **Keyword**: `"https://schema.twindev.org/json-ld/JsonLdKeyword"` = `"https://schema.twindev.org/json-ld/JsonLdKeyword"`
107
+ > `readonly` **Keyword**: `"JsonLdKeyword"` = `"JsonLdKeyword"`
102
108
 
103
109
  Represents JSON-LD Keyword.
104
110
 
105
111
  ### ListOrSetItem
106
112
 
107
- > `readonly` **ListOrSetItem**: `"https://schema.twindev.org/json-ld/JsonLdListOrSetItem"` = `"https://schema.twindev.org/json-ld/JsonLdListOrSetItem"`
113
+ > `readonly` **ListOrSetItem**: `"JsonLdListOrSetItem"` = `"JsonLdListOrSetItem"`
108
114
 
109
115
  Represents JSON-LD List or Set Item.
110
116
 
111
117
  ### ContainerType
112
118
 
113
- > `readonly` **ContainerType**: `"https://schema.twindev.org/json-ld/JsonLdContainerType"` = `"https://schema.twindev.org/json-ld/JsonLdContainerType"`
119
+ > `readonly` **ContainerType**: `"JsonLdContainerType"` = `"JsonLdContainerType"`
114
120
 
115
121
  Represents JSON-LD Container Type.
116
122
 
117
123
  ### ContainerTypeArray
118
124
 
119
- > `readonly` **ContainerTypeArray**: `"https://schema.twindev.org/json-ld/JsonLdContainerTypeArray"` = `"https://schema.twindev.org/json-ld/JsonLdContainerTypeArray"`
125
+ > `readonly` **ContainerTypeArray**: `"JsonLdContainerTypeArray"` = `"JsonLdContainerTypeArray"`
120
126
 
121
127
  Represents JSON-LD Container Type Array.
122
128
 
123
129
  ### JsonPrimitive
124
130
 
125
- > `readonly` **JsonPrimitive**: `"https://schema.twindev.org/json-ld/JsonLdJsonPrimitive"` = `"https://schema.twindev.org/json-ld/JsonLdJsonPrimitive"`
131
+ > `readonly` **JsonPrimitive**: `"JsonLdJsonPrimitive"` = `"JsonLdJsonPrimitive"`
126
132
 
127
133
  Represents JSON-LD JSON Primitive.
128
134
 
129
135
  ### JsonArray
130
136
 
131
- > `readonly` **JsonArray**: `"https://schema.twindev.org/json-ld/JsonLdJsonArray"` = `"https://schema.twindev.org/json-ld/JsonLdJsonArray"`
137
+ > `readonly` **JsonArray**: `"JsonLdJsonArray"` = `"JsonLdJsonArray"`
132
138
 
133
139
  Represents JSON-LD JSON Array.
134
140
 
135
141
  ### JsonObject
136
142
 
137
- > `readonly` **JsonObject**: `"https://schema.twindev.org/json-ld/JsonLdJsonObject"` = `"https://schema.twindev.org/json-ld/JsonLdJsonObject"`
143
+ > `readonly` **JsonObject**: `"JsonLdJsonObject"` = `"JsonLdJsonObject"`
138
144
 
139
145
  Represents JSON-LD JSON Object.
140
146
 
141
147
  ### JsonValue
142
148
 
143
- > `readonly` **JsonValue**: `"https://schema.twindev.org/json-ld/JsonLdJsonValue"` = `"https://schema.twindev.org/json-ld/JsonLdJsonValue"`
149
+ > `readonly` **JsonValue**: `"JsonLdJsonValue"` = `"JsonLdJsonValue"`
144
150
 
145
151
  Represents JSON-LD JSON Value.
package/locales/en.json CHANGED
@@ -1,6 +1,11 @@
1
1
  {
2
- "jsonLdHelper": {
3
- "compact": "The JSON-LD compaction failed",
4
- "expand": "The JSON-LD expansion failed"
2
+ "error": {
3
+ "jsonLdProcessor": {
4
+ "compact": "The JSON-LD compaction failed",
5
+ "expand": "The JSON-LD expansion failed",
6
+ "canonize": "The JSON-LD canonization failed",
7
+ "invalidUrl": "The JSON-LD processing failed to retrieve from the following url \"{url}\"",
8
+ "jsonLdError": "The JSON-LD processing failed due to the following error: \"{code}\""
9
+ }
5
10
  }
6
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@twin.org/data-json-ld",
3
- "version": "0.0.1-next.3",
3
+ "version": "0.0.1-next.31",
4
4
  "description": "Models which define the structure of JSON LD",
5
5
  "repository": {
6
6
  "type": "git",
@@ -13,56 +13,26 @@
13
13
  "engines": {
14
14
  "node": ">=20.0.0"
15
15
  },
16
- "scripts": {
17
- "clean": "rimraf dist coverage docs/reference src/schemas",
18
- "build:schema": "ts-to-schema ./ts-to-schema.json ./src/schemas",
19
- "build:compile": "tspc",
20
- "build": "npm run build:schema && npm run build:compile",
21
- "test": "vitest --run --config ./vitest.config.ts --no-cache",
22
- "coverage": "vitest --run --coverage --config ./vitest.config.ts --no-cache",
23
- "bundle:esm": "rollup --config rollup.config.mjs --environment MODULE:esm",
24
- "bundle:cjs": "rollup --config rollup.config.mjs --environment MODULE:cjs",
25
- "bundle": "npm run bundle:esm && npm run bundle:cjs",
26
- "docs:clean": "rimraf docs/reference",
27
- "docs:generate": "typedoc",
28
- "docs": "npm run docs:clean && npm run docs:generate",
29
- "dist": "npm run clean && npm run build && npm run test && npm run bundle && npm run docs"
30
- },
31
16
  "dependencies": {
32
17
  "@twin.org/core": "next",
33
- "@twin.org/data-core": "0.0.1-next.3",
18
+ "@twin.org/data-core": "0.0.1-next.31",
34
19
  "@twin.org/entity": "next",
35
20
  "@twin.org/nameof": "next",
36
21
  "@twin.org/web": "next",
37
- "@types/jsonld": "1.5.15",
38
22
  "@types/json-schema": "7.0.15",
39
- "jsonld": "8.3.2"
40
- },
41
- "devDependencies": {
42
- "@twin.org/nameof-transformer": "next",
43
- "@twin.org/ts-to-schema": "next",
44
- "@rollup/plugin-json": "6.1.0",
45
- "@vitest/coverage-v8": "2.1.1",
46
- "copyfiles": "2.4.1",
47
- "rimraf": "6.0.1",
48
- "rollup": "4.22.0",
49
- "rollup-plugin-typescript2": "0.36.0",
50
- "ts-patch": "3.2.1",
51
- "typedoc": "0.26.7",
52
- "typedoc-plugin-markdown": "4.2.7",
53
- "typescript": "5.6.2",
54
- "vitest": "2.1.1"
23
+ "@types/jsonld": "1.5.15",
24
+ "jsonld": "8.3.3"
55
25
  },
56
26
  "main": "./dist/cjs/index.cjs",
57
27
  "module": "./dist/esm/index.mjs",
58
28
  "types": "./dist/types/index.d.ts",
59
29
  "exports": {
60
30
  ".": {
31
+ "types": "./dist/types/index.d.ts",
61
32
  "require": "./dist/cjs/index.cjs",
62
- "import": "./dist/esm/index.mjs",
63
- "types": "./dist/types/index.d.ts"
33
+ "import": "./dist/esm/index.mjs"
64
34
  },
65
- "./locales": "./locales"
35
+ "./locales/*.json": "./locales/*.json"
66
36
  },
67
37
  "files": [
68
38
  "dist/cjs",