@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.
Files changed (66) hide show
  1. package/dist/cjs/index.cjs +958 -607
  2. package/dist/esm/index.mjs +960 -610
  3. package/dist/types/index.d.ts +25 -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 +24 -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 +5 -199
  10. package/dist/types/models/IJsonLdExpandedTermDefinition.d.ts +29 -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/IJsonLdLanguageMap.d.ts +11 -0
  21. package/dist/types/models/IJsonLdListObject.d.ts +13 -0
  22. package/dist/types/models/IJsonLdListOrSetItem.d.ts +10 -0
  23. package/dist/types/models/IJsonLdNodeObject.d.ts +19 -0
  24. package/dist/types/models/IJsonLdNodePrimitive.d.ts +13 -0
  25. package/dist/types/models/IJsonLdObject.d.ts +25 -0
  26. package/dist/types/models/IJsonLdSetObject.d.ts +13 -0
  27. package/dist/types/models/IJsonLdTypeMap.d.ts +12 -0
  28. package/dist/types/models/IJsonLdValueObject.d.ts +26 -0
  29. package/dist/types/models/jsonLdContexts.d.ts +13 -0
  30. package/dist/types/models/jsonLdTypes.d.ts +34 -26
  31. package/dist/types/utils/jsonLdHelper.d.ts +7 -2
  32. package/dist/types/utils/jsonLdProcessor.d.ts +66 -19
  33. package/docs/changelog.md +146 -1
  34. package/docs/reference/classes/JsonLdDataTypes.md +3 -3
  35. package/docs/reference/classes/JsonLdHelper.md +26 -8
  36. package/docs/reference/classes/JsonLdProcessor.md +248 -46
  37. package/docs/reference/index.md +18 -16
  38. package/docs/reference/interfaces/IJsonLdContextDefinition.md +1 -1
  39. package/docs/reference/interfaces/IJsonLdIdMap.md +1 -1
  40. package/docs/reference/interfaces/IJsonLdIndexMap.md +1 -1
  41. package/docs/reference/interfaces/IJsonLdJsonObject.md +3 -1
  42. package/docs/reference/interfaces/IJsonLdLanguageMap.md +1 -1
  43. package/docs/reference/interfaces/IJsonLdNodeObject.md +39 -3
  44. package/docs/reference/interfaces/IJsonLdObject.md +64 -0
  45. package/docs/reference/interfaces/IJsonLdTypeMap.md +1 -1
  46. package/docs/reference/type-aliases/IJsonLdContainerType.md +3 -1
  47. package/docs/reference/type-aliases/IJsonLdContainerTypeArray.md +3 -1
  48. package/docs/reference/type-aliases/IJsonLdContextDefinitionElement.md +1 -1
  49. package/docs/reference/type-aliases/IJsonLdContextDefinitionRoot.md +1 -1
  50. package/docs/reference/type-aliases/IJsonLdDocument.md +1 -1
  51. package/docs/reference/type-aliases/IJsonLdExpandedTermDefinition.md +6 -6
  52. package/docs/reference/type-aliases/IJsonLdIncludedBlock.md +1 -1
  53. package/docs/reference/type-aliases/IJsonLdIndexMapItem.md +1 -1
  54. package/docs/reference/type-aliases/IJsonLdJsonArray.md +3 -1
  55. package/docs/reference/type-aliases/IJsonLdJsonPrimitive.md +3 -1
  56. package/docs/reference/type-aliases/IJsonLdJsonValue.md +3 -1
  57. package/docs/reference/type-aliases/IJsonLdListOrSetItem.md +1 -1
  58. package/docs/reference/type-aliases/IJsonLdNodePrimitive.md +1 -1
  59. package/docs/reference/type-aliases/IJsonLdValueObject.md +3 -3
  60. package/docs/reference/type-aliases/JsonLdContexts.md +5 -0
  61. package/docs/reference/type-aliases/JsonLdTypes.md +1 -1
  62. package/docs/reference/variables/JsonLdContexts.md +13 -0
  63. package/docs/reference/variables/JsonLdTypes.md +40 -28
  64. package/locales/en.json +8 -4
  65. package/package.json +10 -11
  66. package/docs/reference/type-aliases/IJsonLdKeyword.md +0 -105
@@ -1,3 +1,5 @@
1
1
  # Type Alias: IJsonLdContainerType
2
2
 
3
- > **IJsonLdContainerType**: `"@language"` \| `"@index"` \| `"@id"` \| `"@graph"` \| `"@type"`
3
+ > **IJsonLdContainerType** = `"@language"` \| `"@index"` \| `"@id"` \| `"@graph"` \| `"@type"`
4
+
5
+ JSON-LD container types.
@@ -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
+ JSON-LD container type array.
@@ -1,5 +1,5 @@
1
1
  # Type Alias: IJsonLdContextDefinitionElement
2
2
 
3
- > **IJsonLdContextDefinitionElement**: `null` \| `string` \| [`IJsonLdContextDefinition`](../interfaces/IJsonLdContextDefinition.md)
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**: [`IJsonLdContextDefinitionElement`](IJsonLdContextDefinitionElement.md) \| [`IJsonLdContextDefinitionElement`](IJsonLdContextDefinitionElement.md)[]
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**: [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)[] \| `object`
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**: `object` & `object` \| `object`
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**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@language"`\]
17
+ > `optional` **@language**: `string`
18
18
 
19
19
  ### @index?
20
20
 
21
- > `optional` **@index**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@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**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@prefix"`\]
29
+ > `optional` **@prefix**: `boolean`
30
30
 
31
31
  ### @propagate?
32
32
 
33
- > `optional` **@propagate**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@propagate"`\]
33
+ > `optional` **@propagate**: `boolean`
34
34
 
35
35
  ### @protected?
36
36
 
37
- > `optional` **@protected**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@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**: [`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,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`: `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**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@index"`\]
12
+ > `optional` **@index**: `string`
13
13
 
14
14
  ### @context?
15
15
 
16
- > `optional` **@context**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@context"`\]
16
+ > `optional` **@context**: [`IJsonLdContextDefinitionRoot`](IJsonLdContextDefinitionRoot.md)
17
17
 
18
18
  ## See
19
19
 
@@ -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.
@@ -6,146 +6,158 @@ The types of JSON-LD data.
6
6
 
7
7
  ## Type declaration
8
8
 
9
- ### ContextRoot
9
+ ### Document
10
10
 
11
- > `readonly` **ContextRoot**: `"https://schema.twindev.org/json-ld/"` = `"https://schema.twindev.org/json-ld/"`
11
+ > `readonly` **Document**: `"JsonLdDocument"` = `"JsonLdDocument"`
12
12
 
13
- Context Root.
13
+ Represents JSON-LD Document.
14
14
 
15
- ### Document
15
+ ### Object
16
16
 
17
- > `readonly` **Document**: `"https://schema.twindev.org/json-ld/JsonLdDocument"` = `"https://schema.twindev.org/json-ld/JsonLdDocument"`
17
+ > `readonly` **Object**: `"JsonLdObject"` = `"JsonLdObject"`
18
18
 
19
- Represents JSON-LD Document.
19
+ Represents JSON-LD Object.
20
20
 
21
21
  ### NodeObject
22
22
 
23
- > `readonly` **NodeObject**: `"https://schema.twindev.org/json-ld/JsonLdNodeObject"` = `"https://schema.twindev.org/json-ld/JsonLdNodeObject"`
23
+ > `readonly` **NodeObject**: `"JsonLdNodeObject"` = `"JsonLdNodeObject"`
24
24
 
25
25
  Represents JSON-LD Node Object.
26
26
 
27
27
  ### NodePrimitive
28
28
 
29
- > `readonly` **NodePrimitive**: `"https://schema.twindev.org/json-ld/JsonLdNodePrimitive"` = `"https://schema.twindev.org/json-ld/JsonLdNodePrimitive"`
29
+ > `readonly` **NodePrimitive**: `"JsonLdNodePrimitive"` = `"JsonLdNodePrimitive"`
30
30
 
31
31
  Represents JSON-LD Node Primitive.
32
32
 
33
33
  ### GraphObject
34
34
 
35
- > `readonly` **GraphObject**: `"https://schema.twindev.org/json-ld/JsonLdGraphObject"` = `"https://schema.twindev.org/json-ld/JsonLdGraphObject"`
35
+ > `readonly` **GraphObject**: `"JsonLdGraphObject"` = `"JsonLdGraphObject"`
36
36
 
37
37
  Represents JSON-LD Graph Object.
38
38
 
39
39
  ### ValueObject
40
40
 
41
- > `readonly` **ValueObject**: `"https://schema.twindev.org/json-ld/JsonLdValueObject"` = `"https://schema.twindev.org/json-ld/JsonLdValueObject"`
41
+ > `readonly` **ValueObject**: `"JsonLdValueObject"` = `"JsonLdValueObject"`
42
42
 
43
43
  Represents JSON-LD Value Object.
44
44
 
45
45
  ### ListObject
46
46
 
47
- > `readonly` **ListObject**: `"https://schema.twindev.org/json-ld/JsonLdListObject"` = `"https://schema.twindev.org/json-ld/JsonLdListObject"`
47
+ > `readonly` **ListObject**: `"JsonLdListObject"` = `"JsonLdListObject"`
48
48
 
49
49
  Represents JSON-LD List Object.
50
50
 
51
51
  ### SetObject
52
52
 
53
- > `readonly` **SetObject**: `"https://schema.twindev.org/json-ld/JsonLdSetObject"` = `"https://schema.twindev.org/json-ld/JsonLdSetObject"`
53
+ > `readonly` **SetObject**: `"JsonLdSetObject"` = `"JsonLdSetObject"`
54
54
 
55
55
  Represents JSON-LD Set Object.
56
56
 
57
57
  ### LanguageMap
58
58
 
59
- > `readonly` **LanguageMap**: `"https://schema.twindev.org/json-ld/JsonLdLanguageMap"` = `"https://schema.twindev.org/json-ld/JsonLdLanguageMap"`
59
+ > `readonly` **LanguageMap**: `"JsonLdLanguageMap"` = `"JsonLdLanguageMap"`
60
60
 
61
61
  Represents JSON-LD Language Map.
62
62
 
63
63
  ### IndexMap
64
64
 
65
- > `readonly` **IndexMap**: `"https://schema.twindev.org/json-ld/JsonLdIndexMap"` = `"https://schema.twindev.org/json-ld/JsonLdIndexMap"`
65
+ > `readonly` **IndexMap**: `"JsonLdIndexMap"` = `"JsonLdIndexMap"`
66
66
 
67
67
  Represents JSON-LD Index Map.
68
68
 
69
69
  ### IndexMapItem
70
70
 
71
- > `readonly` **IndexMapItem**: `"https://schema.twindev.org/json-ld/JsonLdIndexMapItem"` = `"https://schema.twindev.org/json-ld/JsonLdIndexMapItem"`
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**: `"https://schema.twindev.org/json-ld/JsonLdIdMap"` = `"https://schema.twindev.org/json-ld/JsonLdIdMap"`
77
+ > `readonly` **IdMap**: `"JsonLdIdMap"` = `"JsonLdIdMap"`
78
78
 
79
79
  Represents JSON-LD Id Map.
80
80
 
81
81
  ### TypeMap
82
82
 
83
- > `readonly` **TypeMap**: `"https://schema.twindev.org/json-ld/JsonLdTypeMap"` = `"https://schema.twindev.org/json-ld/JsonLdTypeMap"`
83
+ > `readonly` **TypeMap**: `"JsonLdTypeMap"` = `"JsonLdTypeMap"`
84
84
 
85
85
  Represents JSON-LD Type Map.
86
86
 
87
87
  ### IncludedBlock
88
88
 
89
- > `readonly` **IncludedBlock**: `"https://schema.twindev.org/json-ld/JsonLdIncludedBlock"` = `"https://schema.twindev.org/json-ld/JsonLdIncludedBlock"`
89
+ > `readonly` **IncludedBlock**: `"JsonLdIncludedBlock"` = `"JsonLdIncludedBlock"`
90
90
 
91
91
  Represents JSON-LD Included block.
92
92
 
93
93
  ### ContextDefinition
94
94
 
95
- > `readonly` **ContextDefinition**: `"https://schema.twindev.org/json-ld/JsonLdContextDefinition"` = `"https://schema.twindev.org/json-ld/JsonLdContextDefinition"`
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**: `"https://schema.twindev.org/json-ld/JsonLdExpandedTermDefinition"` = `"https://schema.twindev.org/json-ld/JsonLdExpandedTermDefinition"`
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**: `"https://schema.twindev.org/json-ld/JsonLdKeyword"` = `"https://schema.twindev.org/json-ld/JsonLdKeyword"`
119
+ > `readonly` **Keyword**: `"JsonLdKeyword"` = `"JsonLdKeyword"`
108
120
 
109
121
  Represents JSON-LD Keyword.
110
122
 
111
123
  ### ListOrSetItem
112
124
 
113
- > `readonly` **ListOrSetItem**: `"https://schema.twindev.org/json-ld/JsonLdListOrSetItem"` = `"https://schema.twindev.org/json-ld/JsonLdListOrSetItem"`
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**: `"https://schema.twindev.org/json-ld/JsonLdContainerType"` = `"https://schema.twindev.org/json-ld/JsonLdContainerType"`
131
+ > `readonly` **ContainerType**: `"JsonLdContainerType"` = `"JsonLdContainerType"`
120
132
 
121
133
  Represents JSON-LD Container Type.
122
134
 
123
135
  ### ContainerTypeArray
124
136
 
125
- > `readonly` **ContainerTypeArray**: `"https://schema.twindev.org/json-ld/JsonLdContainerTypeArray"` = `"https://schema.twindev.org/json-ld/JsonLdContainerTypeArray"`
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**: `"https://schema.twindev.org/json-ld/JsonLdJsonPrimitive"` = `"https://schema.twindev.org/json-ld/JsonLdJsonPrimitive"`
143
+ > `readonly` **JsonPrimitive**: `"JsonLdJsonPrimitive"` = `"JsonLdJsonPrimitive"`
132
144
 
133
145
  Represents JSON-LD JSON Primitive.
134
146
 
135
147
  ### JsonArray
136
148
 
137
- > `readonly` **JsonArray**: `"https://schema.twindev.org/json-ld/JsonLdJsonArray"` = `"https://schema.twindev.org/json-ld/JsonLdJsonArray"`
149
+ > `readonly` **JsonArray**: `"JsonLdJsonArray"` = `"JsonLdJsonArray"`
138
150
 
139
151
  Represents JSON-LD JSON Array.
140
152
 
141
153
  ### JsonObject
142
154
 
143
- > `readonly` **JsonObject**: `"https://schema.twindev.org/json-ld/JsonLdJsonObject"` = `"https://schema.twindev.org/json-ld/JsonLdJsonObject"`
155
+ > `readonly` **JsonObject**: `"JsonLdJsonObject"` = `"JsonLdJsonObject"`
144
156
 
145
157
  Represents JSON-LD JSON Object.
146
158
 
147
159
  ### JsonValue
148
160
 
149
- > `readonly` **JsonValue**: `"https://schema.twindev.org/json-ld/JsonLdJsonValue"` = `"https://schema.twindev.org/json-ld/JsonLdJsonValue"`
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
- "jsonLdProcessor": {
3
- "compact": "The JSON-LD compaction failed",
4
- "expand": "The JSON-LD expansion failed",
5
- "invalidUrl": "The JSON-LD processing failed to retrieve from the following url \"{url}\""
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-next.8",
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": "next",
18
- "@twin.org/data-core": "0.0.1-next.8",
19
- "@twin.org/entity": "next",
20
- "@twin.org/nameof": "next",
21
- "@twin.org/web": "next",
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.2"
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