@twin.org/data-json-ld 0.0.1-next.8 → 0.0.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.
- package/dist/cjs/index.cjs +958 -607
- package/dist/esm/index.mjs +960 -610
- package/dist/types/index.d.ts +25 -0
- package/dist/types/models/IJsonLdContainerType.d.ts +8 -0
- package/dist/types/models/IJsonLdContainerTypeArray.d.ts +9 -0
- package/dist/types/models/IJsonLdContextDefinition.d.ts +24 -0
- package/dist/types/models/IJsonLdContextDefinitionElement.d.ts +9 -0
- package/dist/types/models/IJsonLdContextDefinitionRoot.d.ts +9 -0
- package/dist/types/models/IJsonLdDocument.d.ts +5 -199
- package/dist/types/models/IJsonLdExpandedTermDefinition.d.ts +29 -0
- package/dist/types/models/IJsonLdGraphObject.d.ts +16 -0
- package/dist/types/models/IJsonLdIdMap.d.ts +12 -0
- package/dist/types/models/IJsonLdIncludedBlock.d.ts +10 -0
- package/dist/types/models/IJsonLdIndexMap.d.ts +13 -0
- package/dist/types/models/IJsonLdIndexMapItem.d.ts +12 -0
- package/dist/types/models/IJsonLdJsonArray.d.ts +9 -0
- package/dist/types/models/IJsonLdJsonObject.d.ts +11 -0
- package/dist/types/models/IJsonLdJsonPrimitive.d.ts +8 -0
- package/dist/types/models/IJsonLdJsonValue.d.ts +11 -0
- package/dist/types/models/IJsonLdLanguageMap.d.ts +11 -0
- package/dist/types/models/IJsonLdListObject.d.ts +13 -0
- package/dist/types/models/IJsonLdListOrSetItem.d.ts +10 -0
- package/dist/types/models/IJsonLdNodeObject.d.ts +19 -0
- package/dist/types/models/IJsonLdNodePrimitive.d.ts +13 -0
- package/dist/types/models/IJsonLdObject.d.ts +25 -0
- package/dist/types/models/IJsonLdSetObject.d.ts +13 -0
- package/dist/types/models/IJsonLdTypeMap.d.ts +12 -0
- package/dist/types/models/IJsonLdValueObject.d.ts +26 -0
- package/dist/types/models/jsonLdContexts.d.ts +13 -0
- package/dist/types/models/jsonLdTypes.d.ts +34 -26
- package/dist/types/utils/jsonLdHelper.d.ts +7 -2
- package/dist/types/utils/jsonLdProcessor.d.ts +66 -19
- package/docs/changelog.md +146 -1
- package/docs/reference/classes/JsonLdDataTypes.md +3 -3
- package/docs/reference/classes/JsonLdHelper.md +26 -8
- package/docs/reference/classes/JsonLdProcessor.md +248 -46
- package/docs/reference/index.md +18 -16
- package/docs/reference/interfaces/IJsonLdContextDefinition.md +1 -1
- package/docs/reference/interfaces/IJsonLdIdMap.md +1 -1
- package/docs/reference/interfaces/IJsonLdIndexMap.md +1 -1
- package/docs/reference/interfaces/IJsonLdJsonObject.md +3 -1
- package/docs/reference/interfaces/IJsonLdLanguageMap.md +1 -1
- package/docs/reference/interfaces/IJsonLdNodeObject.md +39 -3
- package/docs/reference/interfaces/IJsonLdObject.md +64 -0
- package/docs/reference/interfaces/IJsonLdTypeMap.md +1 -1
- package/docs/reference/type-aliases/IJsonLdContainerType.md +3 -1
- package/docs/reference/type-aliases/IJsonLdContainerTypeArray.md +3 -1
- package/docs/reference/type-aliases/IJsonLdContextDefinitionElement.md +1 -1
- package/docs/reference/type-aliases/IJsonLdContextDefinitionRoot.md +1 -1
- package/docs/reference/type-aliases/IJsonLdDocument.md +1 -1
- package/docs/reference/type-aliases/IJsonLdExpandedTermDefinition.md +6 -6
- package/docs/reference/type-aliases/IJsonLdIncludedBlock.md +1 -1
- package/docs/reference/type-aliases/IJsonLdIndexMapItem.md +1 -1
- package/docs/reference/type-aliases/IJsonLdJsonArray.md +3 -1
- package/docs/reference/type-aliases/IJsonLdJsonPrimitive.md +3 -1
- package/docs/reference/type-aliases/IJsonLdJsonValue.md +3 -1
- package/docs/reference/type-aliases/IJsonLdListOrSetItem.md +1 -1
- package/docs/reference/type-aliases/IJsonLdNodePrimitive.md +1 -1
- package/docs/reference/type-aliases/IJsonLdValueObject.md +3 -3
- package/docs/reference/type-aliases/JsonLdContexts.md +5 -0
- package/docs/reference/type-aliases/JsonLdTypes.md +1 -1
- package/docs/reference/variables/JsonLdContexts.md +13 -0
- package/docs/reference/variables/JsonLdTypes.md +40 -28
- package/locales/en.json +8 -4
- package/package.json +10 -11
- package/docs/reference/type-aliases/IJsonLdKeyword.md +0 -105
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
# Type Alias: IJsonLdContainerTypeArray
|
|
2
2
|
|
|
3
|
-
> **IJsonLdContainerTypeArray
|
|
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
|
+
JSON-LD container type array.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: IJsonLdContextDefinitionElement
|
|
2
2
|
|
|
3
|
-
> **IJsonLdContextDefinitionElement
|
|
3
|
+
> **IJsonLdContextDefinitionElement** = `null` \| `string` \| [`IJsonLdContextDefinition`](../interfaces/IJsonLdContextDefinition.md)
|
|
4
4
|
|
|
5
5
|
A context definition element is used to define the types of a context definition.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: IJsonLdContextDefinitionRoot
|
|
2
2
|
|
|
3
|
-
> **IJsonLdContextDefinitionRoot
|
|
3
|
+
> **IJsonLdContextDefinitionRoot** = [`IJsonLdContextDefinitionElement`](IJsonLdContextDefinitionElement.md) \| [`IJsonLdContextDefinitionElement`](IJsonLdContextDefinitionElement.md)[]
|
|
4
4
|
|
|
5
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
|
|
3
|
+
> **IJsonLdDocument** = [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)[] \| \{ `@context?`: [`IJsonLdContextDefinitionRoot`](IJsonLdContextDefinitionRoot.md); `@graph?`: [`IJsonLdValueObject`](IJsonLdValueObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| ([`IJsonLdValueObject`](IJsonLdValueObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md))[]; \}
|
|
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
|
|
3
|
+
> **IJsonLdExpandedTermDefinition** = `object` & \{ `@id?`: `string` \| `string`[] \| `null`; `@nest?`: `"@nest"` \| `string`; `@container?`: `"@list"` \| `"@set"` \| [`IJsonLdContainerType`](IJsonLdContainerType.md) \| (`"@list"` \| `"@set"` \| [`IJsonLdContainerType`](IJsonLdContainerType.md))[] \| [`IJsonLdContainerTypeArray`](IJsonLdContainerTypeArray.md) \| `null`; \} \| \{ `@reverse`: `string`; `@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
|
|
@@ -14,11 +14,11 @@ associated with the term when it is used as key in a node object.
|
|
|
14
14
|
|
|
15
15
|
### @language?
|
|
16
16
|
|
|
17
|
-
> `optional` **@language**:
|
|
17
|
+
> `optional` **@language**: `string`
|
|
18
18
|
|
|
19
19
|
### @index?
|
|
20
20
|
|
|
21
|
-
> `optional` **@index**:
|
|
21
|
+
> `optional` **@index**: `string`
|
|
22
22
|
|
|
23
23
|
### @context?
|
|
24
24
|
|
|
@@ -26,15 +26,15 @@ associated with the term when it is used as key in a node object.
|
|
|
26
26
|
|
|
27
27
|
### @prefix?
|
|
28
28
|
|
|
29
|
-
> `optional` **@prefix**:
|
|
29
|
+
> `optional` **@prefix**: `boolean`
|
|
30
30
|
|
|
31
31
|
### @propagate?
|
|
32
32
|
|
|
33
|
-
> `optional` **@propagate**:
|
|
33
|
+
> `optional` **@propagate**: `boolean`
|
|
34
34
|
|
|
35
35
|
### @protected?
|
|
36
36
|
|
|
37
|
-
> `optional` **@protected**:
|
|
37
|
+
> `optional` **@protected**: `boolean`
|
|
38
38
|
|
|
39
39
|
## See
|
|
40
40
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Type Alias: IJsonLdIncludedBlock
|
|
2
2
|
|
|
3
|
-
> **IJsonLdIncludedBlock
|
|
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
|
|
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: IJsonLdJsonValue
|
|
2
2
|
|
|
3
|
-
> **IJsonLdJsonValue
|
|
3
|
+
> **IJsonLdJsonValue** = [`IJsonLdJsonPrimitive`](IJsonLdJsonPrimitive.md) \| [`IJsonLdJsonArray`](IJsonLdJsonArray.md) \| [`IJsonLdJsonObject`](../interfaces/IJsonLdJsonObject.md)
|
|
4
|
+
|
|
5
|
+
JSON Value.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: IJsonLdListOrSetItem
|
|
2
2
|
|
|
3
|
-
> **IJsonLdListOrSetItem
|
|
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
|
|
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
|
|
3
|
+
> **IJsonLdValueObject** = `object` & \{ `@value`: `null` \| `boolean` \| `number` \| `string`; `@language?`: `string`; `@direction?`: `"ltr"` \| `"rtl"` \| `null`; \} \| \{ `@value`: `null` \| `boolean` \| `number` \| `string`; `@type`: `string`; \} \| \{ `@value`: `null` \| `boolean` \| `number` \| `string` \| [`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.
|
|
@@ -9,11 +9,11 @@ to create a typed value or a language-tagged string and possibly associate a bas
|
|
|
9
9
|
|
|
10
10
|
### @index?
|
|
11
11
|
|
|
12
|
-
> `optional` **@index**:
|
|
12
|
+
> `optional` **@index**: `string`
|
|
13
13
|
|
|
14
14
|
### @context?
|
|
15
15
|
|
|
16
|
-
> `optional` **@context**: [`
|
|
16
|
+
> `optional` **@context**: [`IJsonLdContextDefinitionRoot`](IJsonLdContextDefinitionRoot.md)
|
|
17
17
|
|
|
18
18
|
## See
|
|
19
19
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# Type Alias: JsonLdTypes
|
|
2
2
|
|
|
3
|
-
> **JsonLdTypes
|
|
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.
|
|
@@ -6,146 +6,158 @@ The types of JSON-LD data.
|
|
|
6
6
|
|
|
7
7
|
## Type declaration
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### Document
|
|
10
10
|
|
|
11
|
-
> `readonly` **
|
|
11
|
+
> `readonly` **Document**: `"JsonLdDocument"` = `"JsonLdDocument"`
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
Represents JSON-LD Document.
|
|
14
14
|
|
|
15
|
-
###
|
|
15
|
+
### Object
|
|
16
16
|
|
|
17
|
-
> `readonly` **
|
|
17
|
+
> `readonly` **Object**: `"JsonLdObject"` = `"JsonLdObject"`
|
|
18
18
|
|
|
19
|
-
Represents JSON-LD
|
|
19
|
+
Represents JSON-LD Object.
|
|
20
20
|
|
|
21
21
|
### NodeObject
|
|
22
22
|
|
|
23
|
-
> `readonly` **NodeObject**: `"
|
|
23
|
+
> `readonly` **NodeObject**: `"JsonLdNodeObject"` = `"JsonLdNodeObject"`
|
|
24
24
|
|
|
25
25
|
Represents JSON-LD Node Object.
|
|
26
26
|
|
|
27
27
|
### NodePrimitive
|
|
28
28
|
|
|
29
|
-
> `readonly` **NodePrimitive**: `"
|
|
29
|
+
> `readonly` **NodePrimitive**: `"JsonLdNodePrimitive"` = `"JsonLdNodePrimitive"`
|
|
30
30
|
|
|
31
31
|
Represents JSON-LD Node Primitive.
|
|
32
32
|
|
|
33
33
|
### GraphObject
|
|
34
34
|
|
|
35
|
-
> `readonly` **GraphObject**: `"
|
|
35
|
+
> `readonly` **GraphObject**: `"JsonLdGraphObject"` = `"JsonLdGraphObject"`
|
|
36
36
|
|
|
37
37
|
Represents JSON-LD Graph Object.
|
|
38
38
|
|
|
39
39
|
### ValueObject
|
|
40
40
|
|
|
41
|
-
> `readonly` **ValueObject**: `"
|
|
41
|
+
> `readonly` **ValueObject**: `"JsonLdValueObject"` = `"JsonLdValueObject"`
|
|
42
42
|
|
|
43
43
|
Represents JSON-LD Value Object.
|
|
44
44
|
|
|
45
45
|
### ListObject
|
|
46
46
|
|
|
47
|
-
> `readonly` **ListObject**: `"
|
|
47
|
+
> `readonly` **ListObject**: `"JsonLdListObject"` = `"JsonLdListObject"`
|
|
48
48
|
|
|
49
49
|
Represents JSON-LD List Object.
|
|
50
50
|
|
|
51
51
|
### SetObject
|
|
52
52
|
|
|
53
|
-
> `readonly` **SetObject**: `"
|
|
53
|
+
> `readonly` **SetObject**: `"JsonLdSetObject"` = `"JsonLdSetObject"`
|
|
54
54
|
|
|
55
55
|
Represents JSON-LD Set Object.
|
|
56
56
|
|
|
57
57
|
### LanguageMap
|
|
58
58
|
|
|
59
|
-
> `readonly` **LanguageMap**: `"
|
|
59
|
+
> `readonly` **LanguageMap**: `"JsonLdLanguageMap"` = `"JsonLdLanguageMap"`
|
|
60
60
|
|
|
61
61
|
Represents JSON-LD Language Map.
|
|
62
62
|
|
|
63
63
|
### IndexMap
|
|
64
64
|
|
|
65
|
-
> `readonly` **IndexMap**: `"
|
|
65
|
+
> `readonly` **IndexMap**: `"JsonLdIndexMap"` = `"JsonLdIndexMap"`
|
|
66
66
|
|
|
67
67
|
Represents JSON-LD Index Map.
|
|
68
68
|
|
|
69
69
|
### IndexMapItem
|
|
70
70
|
|
|
71
|
-
> `readonly` **IndexMapItem**: `"
|
|
71
|
+
> `readonly` **IndexMapItem**: `"JsonLdIndexMapItem"` = `"JsonLdIndexMapItem"`
|
|
72
72
|
|
|
73
73
|
Represents JSON-LD Index Map Item.
|
|
74
74
|
|
|
75
75
|
### IdMap
|
|
76
76
|
|
|
77
|
-
> `readonly` **IdMap**: `"
|
|
77
|
+
> `readonly` **IdMap**: `"JsonLdIdMap"` = `"JsonLdIdMap"`
|
|
78
78
|
|
|
79
79
|
Represents JSON-LD Id Map.
|
|
80
80
|
|
|
81
81
|
### TypeMap
|
|
82
82
|
|
|
83
|
-
> `readonly` **TypeMap**: `"
|
|
83
|
+
> `readonly` **TypeMap**: `"JsonLdTypeMap"` = `"JsonLdTypeMap"`
|
|
84
84
|
|
|
85
85
|
Represents JSON-LD Type Map.
|
|
86
86
|
|
|
87
87
|
### IncludedBlock
|
|
88
88
|
|
|
89
|
-
> `readonly` **IncludedBlock**: `"
|
|
89
|
+
> `readonly` **IncludedBlock**: `"JsonLdIncludedBlock"` = `"JsonLdIncludedBlock"`
|
|
90
90
|
|
|
91
91
|
Represents JSON-LD Included block.
|
|
92
92
|
|
|
93
93
|
### ContextDefinition
|
|
94
94
|
|
|
95
|
-
> `readonly` **ContextDefinition**: `"
|
|
95
|
+
> `readonly` **ContextDefinition**: `"JsonLdContextDefinition"` = `"JsonLdContextDefinition"`
|
|
96
96
|
|
|
97
97
|
Represents JSON-LD Context Definition.
|
|
98
98
|
|
|
99
|
+
### ContextDefinitionElement
|
|
100
|
+
|
|
101
|
+
> `readonly` **ContextDefinitionElement**: `"JsonLdContextDefinitionElement"` = `"JsonLdContextDefinitionElement"`
|
|
102
|
+
|
|
103
|
+
Represents JSON-LD Context Definition Element.
|
|
104
|
+
|
|
105
|
+
### ContextDefinitionRoot
|
|
106
|
+
|
|
107
|
+
> `readonly` **ContextDefinitionRoot**: `"JsonLdContextDefinitionRoot"` = `"JsonLdContextDefinitionRoot"`
|
|
108
|
+
|
|
109
|
+
Represents JSON-LD Context Definition Root.
|
|
110
|
+
|
|
99
111
|
### ExpandedTermDefinition
|
|
100
112
|
|
|
101
|
-
> `readonly` **ExpandedTermDefinition**: `"
|
|
113
|
+
> `readonly` **ExpandedTermDefinition**: `"JsonLdExpandedTermDefinition"` = `"JsonLdExpandedTermDefinition"`
|
|
102
114
|
|
|
103
115
|
Represents JSON-LD Expanded Term Definition.
|
|
104
116
|
|
|
105
117
|
### Keyword
|
|
106
118
|
|
|
107
|
-
> `readonly` **Keyword**: `"
|
|
119
|
+
> `readonly` **Keyword**: `"JsonLdKeyword"` = `"JsonLdKeyword"`
|
|
108
120
|
|
|
109
121
|
Represents JSON-LD Keyword.
|
|
110
122
|
|
|
111
123
|
### ListOrSetItem
|
|
112
124
|
|
|
113
|
-
> `readonly` **ListOrSetItem**: `"
|
|
125
|
+
> `readonly` **ListOrSetItem**: `"JsonLdListOrSetItem"` = `"JsonLdListOrSetItem"`
|
|
114
126
|
|
|
115
127
|
Represents JSON-LD List or Set Item.
|
|
116
128
|
|
|
117
129
|
### ContainerType
|
|
118
130
|
|
|
119
|
-
> `readonly` **ContainerType**: `"
|
|
131
|
+
> `readonly` **ContainerType**: `"JsonLdContainerType"` = `"JsonLdContainerType"`
|
|
120
132
|
|
|
121
133
|
Represents JSON-LD Container Type.
|
|
122
134
|
|
|
123
135
|
### ContainerTypeArray
|
|
124
136
|
|
|
125
|
-
> `readonly` **ContainerTypeArray**: `"
|
|
137
|
+
> `readonly` **ContainerTypeArray**: `"JsonLdContainerTypeArray"` = `"JsonLdContainerTypeArray"`
|
|
126
138
|
|
|
127
139
|
Represents JSON-LD Container Type Array.
|
|
128
140
|
|
|
129
141
|
### JsonPrimitive
|
|
130
142
|
|
|
131
|
-
> `readonly` **JsonPrimitive**: `"
|
|
143
|
+
> `readonly` **JsonPrimitive**: `"JsonLdJsonPrimitive"` = `"JsonLdJsonPrimitive"`
|
|
132
144
|
|
|
133
145
|
Represents JSON-LD JSON Primitive.
|
|
134
146
|
|
|
135
147
|
### JsonArray
|
|
136
148
|
|
|
137
|
-
> `readonly` **JsonArray**: `"
|
|
149
|
+
> `readonly` **JsonArray**: `"JsonLdJsonArray"` = `"JsonLdJsonArray"`
|
|
138
150
|
|
|
139
151
|
Represents JSON-LD JSON Array.
|
|
140
152
|
|
|
141
153
|
### JsonObject
|
|
142
154
|
|
|
143
|
-
> `readonly` **JsonObject**: `"
|
|
155
|
+
> `readonly` **JsonObject**: `"JsonLdJsonObject"` = `"JsonLdJsonObject"`
|
|
144
156
|
|
|
145
157
|
Represents JSON-LD JSON Object.
|
|
146
158
|
|
|
147
159
|
### JsonValue
|
|
148
160
|
|
|
149
|
-
> `readonly` **JsonValue**: `"
|
|
161
|
+
> `readonly` **JsonValue**: `"JsonLdJsonValue"` = `"JsonLdJsonValue"`
|
|
150
162
|
|
|
151
163
|
Represents JSON-LD JSON Value.
|
package/locales/en.json
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
3
|
-
"
|
|
4
|
-
|
|
5
|
-
|
|
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
|
+
}
|
|
6
10
|
}
|
|
7
11
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/data-json-ld",
|
|
3
|
-
"version": "0.0.1
|
|
3
|
+
"version": "0.0.1",
|
|
4
4
|
"description": "Models which define the structure of JSON LD",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -14,25 +14,24 @@
|
|
|
14
14
|
"node": ">=20.0.0"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@twin.org/core": "
|
|
18
|
-
"@twin.org/data-core": "0.0.1
|
|
19
|
-
"@twin.org/entity": "
|
|
20
|
-
"@twin.org/nameof": "
|
|
21
|
-
"@twin.org/web": "
|
|
22
|
-
"@types/json-schema": "7.0.15",
|
|
17
|
+
"@twin.org/core": "^0.0.1",
|
|
18
|
+
"@twin.org/data-core": "^0.0.1",
|
|
19
|
+
"@twin.org/entity": "^0.0.1",
|
|
20
|
+
"@twin.org/nameof": "^0.0.1",
|
|
21
|
+
"@twin.org/web": "^0.0.1",
|
|
23
22
|
"@types/jsonld": "1.5.15",
|
|
24
|
-
"jsonld": "8.3.
|
|
23
|
+
"jsonld": "8.3.3"
|
|
25
24
|
},
|
|
26
25
|
"main": "./dist/cjs/index.cjs",
|
|
27
26
|
"module": "./dist/esm/index.mjs",
|
|
28
27
|
"types": "./dist/types/index.d.ts",
|
|
29
28
|
"exports": {
|
|
30
29
|
".": {
|
|
30
|
+
"types": "./dist/types/index.d.ts",
|
|
31
31
|
"require": "./dist/cjs/index.cjs",
|
|
32
|
-
"import": "./dist/esm/index.mjs"
|
|
33
|
-
"types": "./dist/types/index.d.ts"
|
|
32
|
+
"import": "./dist/esm/index.mjs"
|
|
34
33
|
},
|
|
35
|
-
"./locales": "./locales"
|
|
34
|
+
"./locales/*.json": "./locales/*.json"
|
|
36
35
|
},
|
|
37
36
|
"files": [
|
|
38
37
|
"dist/cjs",
|
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
# Type Alias: IJsonLdKeyword
|
|
2
|
-
|
|
3
|
-
> **IJsonLdKeyword**: `object`
|
|
4
|
-
|
|
5
|
-
A list of keywords and their types.
|
|
6
|
-
Only used for internal reference; not an actual interface.
|
|
7
|
-
Not for export.
|
|
8
|
-
|
|
9
|
-
## Type declaration
|
|
10
|
-
|
|
11
|
-
### @base
|
|
12
|
-
|
|
13
|
-
> **@base**: `string` \| `null`
|
|
14
|
-
|
|
15
|
-
### @container
|
|
16
|
-
|
|
17
|
-
> **@container**: `"@list"` \| `"@set"` \| [`IJsonLdContainerType`](IJsonLdContainerType.md) \| (`"@list"` \| `"@set"` \| [`IJsonLdContainerType`](IJsonLdContainerType.md))[] \| [`IJsonLdContainerTypeArray`](IJsonLdContainerTypeArray.md) \| `null`
|
|
18
|
-
|
|
19
|
-
### @context
|
|
20
|
-
|
|
21
|
-
> **@context**: [`IJsonLdContextDefinitionRoot`](IJsonLdContextDefinitionRoot.md)
|
|
22
|
-
|
|
23
|
-
### @direction
|
|
24
|
-
|
|
25
|
-
> **@direction**: `"ltr"` \| `"rtl"` \| `null`
|
|
26
|
-
|
|
27
|
-
### @graph
|
|
28
|
-
|
|
29
|
-
> **@graph**: [`IJsonLdValueObject`](IJsonLdValueObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| ([`IJsonLdValueObject`](IJsonLdValueObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md))[]
|
|
30
|
-
|
|
31
|
-
### @id
|
|
32
|
-
|
|
33
|
-
> **@id**: `string` \| `string`[]
|
|
34
|
-
|
|
35
|
-
### @import
|
|
36
|
-
|
|
37
|
-
> **@import**: `string`
|
|
38
|
-
|
|
39
|
-
### @included
|
|
40
|
-
|
|
41
|
-
> **@included**: [`IJsonLdIncludedBlock`](IJsonLdIncludedBlock.md)
|
|
42
|
-
|
|
43
|
-
### @index
|
|
44
|
-
|
|
45
|
-
> **@index**: `string`
|
|
46
|
-
|
|
47
|
-
### @json
|
|
48
|
-
|
|
49
|
-
> **@json**: `"@json"`
|
|
50
|
-
|
|
51
|
-
### @language
|
|
52
|
-
|
|
53
|
-
> **@language**: `string`
|
|
54
|
-
|
|
55
|
-
### @list
|
|
56
|
-
|
|
57
|
-
> **@list**: [`IJsonLdListOrSetItem`](IJsonLdListOrSetItem.md) \| [`IJsonLdListOrSetItem`](IJsonLdListOrSetItem.md)[]
|
|
58
|
-
|
|
59
|
-
### @nest
|
|
60
|
-
|
|
61
|
-
> **@nest**: `object`
|
|
62
|
-
|
|
63
|
-
### @none
|
|
64
|
-
|
|
65
|
-
> **@none**: `"@none"`
|
|
66
|
-
|
|
67
|
-
### @prefix
|
|
68
|
-
|
|
69
|
-
> **@prefix**: `boolean`
|
|
70
|
-
|
|
71
|
-
### @propagate
|
|
72
|
-
|
|
73
|
-
> **@propagate**: `boolean`
|
|
74
|
-
|
|
75
|
-
### @protected
|
|
76
|
-
|
|
77
|
-
> **@protected**: `boolean`
|
|
78
|
-
|
|
79
|
-
### @reverse
|
|
80
|
-
|
|
81
|
-
> **@reverse**: `string`
|
|
82
|
-
|
|
83
|
-
### @set
|
|
84
|
-
|
|
85
|
-
> **@set**: [`IJsonLdListOrSetItem`](IJsonLdListOrSetItem.md) \| [`IJsonLdListOrSetItem`](IJsonLdListOrSetItem.md)[]
|
|
86
|
-
|
|
87
|
-
### @type
|
|
88
|
-
|
|
89
|
-
> **@type**: `string`
|
|
90
|
-
|
|
91
|
-
### @value
|
|
92
|
-
|
|
93
|
-
> **@value**: `null` \| `boolean` \| `number` \| `string`
|
|
94
|
-
|
|
95
|
-
### @version
|
|
96
|
-
|
|
97
|
-
> **@version**: `"1.1"`
|
|
98
|
-
|
|
99
|
-
### @vocab
|
|
100
|
-
|
|
101
|
-
> **@vocab**: `string` \| `null`
|
|
102
|
-
|
|
103
|
-
## See
|
|
104
|
-
|
|
105
|
-
https://www.w3.org/TR/json-ld/#keywords
|