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

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 (43) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +21 -0
  3. package/dist/cjs/index.cjs +1602 -0
  4. package/dist/esm/index.mjs +1597 -0
  5. package/dist/types/dataTypes/jsonLdDataTypes.d.ts +9 -0
  6. package/dist/types/index.d.ts +5 -0
  7. package/dist/types/models/IJsonLdDocument.d.ts +207 -0
  8. package/dist/types/models/jsonLdTypes.d.ts +101 -0
  9. package/dist/types/utils/jsonLdHelper.d.ts +16 -0
  10. package/dist/types/utils/jsonLdProcessor.d.ts +34 -0
  11. package/docs/changelog.md +5 -0
  12. package/docs/examples.md +1 -0
  13. package/docs/reference/classes/JsonLdDataTypes.md +25 -0
  14. package/docs/reference/classes/JsonLdHelper.md +45 -0
  15. package/docs/reference/classes/JsonLdProcessor.md +95 -0
  16. package/docs/reference/index.md +41 -0
  17. package/docs/reference/interfaces/IJsonLdContextDefinition.md +73 -0
  18. package/docs/reference/interfaces/IJsonLdGraphObject.md +31 -0
  19. package/docs/reference/interfaces/IJsonLdIdMap.md +11 -0
  20. package/docs/reference/interfaces/IJsonLdIndexMap.md +12 -0
  21. package/docs/reference/interfaces/IJsonLdJsonObject.md +5 -0
  22. package/docs/reference/interfaces/IJsonLdLanguageMap.md +11 -0
  23. package/docs/reference/interfaces/IJsonLdListObject.md +19 -0
  24. package/docs/reference/interfaces/IJsonLdNodeObject.md +64 -0
  25. package/docs/reference/interfaces/IJsonLdSetObject.md +19 -0
  26. package/docs/reference/interfaces/IJsonLdTypeMap.md +11 -0
  27. package/docs/reference/type-aliases/IJsonLdContainerType.md +3 -0
  28. package/docs/reference/type-aliases/IJsonLdContainerTypeArray.md +3 -0
  29. package/docs/reference/type-aliases/IJsonLdDocument.md +11 -0
  30. package/docs/reference/type-aliases/IJsonLdExpandedTermDefinition.md +41 -0
  31. package/docs/reference/type-aliases/IJsonLdIncludedBlock.md +9 -0
  32. package/docs/reference/type-aliases/IJsonLdIndexMapItem.md +5 -0
  33. package/docs/reference/type-aliases/IJsonLdJsonArray.md +3 -0
  34. package/docs/reference/type-aliases/IJsonLdJsonPrimitive.md +3 -0
  35. package/docs/reference/type-aliases/IJsonLdJsonValue.md +3 -0
  36. package/docs/reference/type-aliases/IJsonLdKeyword.md +105 -0
  37. package/docs/reference/type-aliases/IJsonLdListOrSetItem.md +5 -0
  38. package/docs/reference/type-aliases/IJsonLdNodePrimitive.md +5 -0
  39. package/docs/reference/type-aliases/IJsonLdValueObject.md +20 -0
  40. package/docs/reference/type-aliases/JsonLdTypes.md +5 -0
  41. package/docs/reference/variables/JsonLdTypes.md +145 -0
  42. package/locales/en.json +6 -0
  43. package/package.json +74 -0
@@ -0,0 +1,31 @@
1
+ # Interface: IJsonLdGraphObject
2
+
3
+ A graph object represents a named graph, which MAY include an explicit graph name.
4
+
5
+ ## See
6
+
7
+ https://www.w3.org/TR/json-ld11/#graph-objects
8
+
9
+ ## Properties
10
+
11
+ ### @graph
12
+
13
+ > **@graph**: [`IJsonLdNodeObject`](IJsonLdNodeObject.md) \| [`IJsonLdNodeObject`](IJsonLdNodeObject.md)[]
14
+
15
+ ***
16
+
17
+ ### @index?
18
+
19
+ > `optional` **@index**: `string`
20
+
21
+ ***
22
+
23
+ ### @id?
24
+
25
+ > `optional` **@id**: `string` \| `string`[]
26
+
27
+ ***
28
+
29
+ ### @context?
30
+
31
+ > `optional` **@context**: `null` \| `string` \| [`IJsonLdContextDefinition`](IJsonLdContextDefinition.md) \| (`null` \| `string` \| [`IJsonLdContextDefinition`](IJsonLdContextDefinition.md))[]
@@ -0,0 +1,11 @@
1
+ # Interface: IJsonLdIdMap
2
+
3
+ An id map is used to associate an IRI with a value that allows easy programmatic access.
4
+
5
+ ## See
6
+
7
+ https://www.w3.org/TR/json-ld11/#id-maps
8
+
9
+ ## Indexable
10
+
11
+ \[`key`: `string`\]: [`IJsonLdNodeObject`](IJsonLdNodeObject.md)
@@ -0,0 +1,12 @@
1
+ # Interface: IJsonLdIndexMap
2
+
3
+ An index map allows keys that have no semantic meaning, but should be preserved regardless,
4
+ to be used in JSON-LD documents.
5
+
6
+ ## See
7
+
8
+ https://www.w3.org/TR/json-ld11/#index-maps
9
+
10
+ ## Indexable
11
+
12
+ \[`key`: `string`\]: [`IJsonLdIndexMapItem`](../type-aliases/IJsonLdIndexMapItem.md) \| [`IJsonLdIndexMapItem`](../type-aliases/IJsonLdIndexMapItem.md)[]
@@ -0,0 +1,5 @@
1
+ # Interface: IJsonLdJsonObject
2
+
3
+ ## Indexable
4
+
5
+ \[`key`: `string`\]: [`IJsonLdJsonValue`](../type-aliases/IJsonLdJsonValue.md) \| `undefined`
@@ -0,0 +1,11 @@
1
+ # Interface: IJsonLdLanguageMap
2
+
3
+ A language map is used to associate a language with a value in a way that allows easy programmatic access.
4
+
5
+ ## See
6
+
7
+ https://www.w3.org/TR/json-ld11/#language-maps
8
+
9
+ ## Indexable
10
+
11
+ \[`key`: `string`\]: `null` \| `string` \| `string`[]
@@ -0,0 +1,19 @@
1
+ # Interface: IJsonLdListObject
2
+
3
+ A list represents an ordered set of values.
4
+
5
+ ## See
6
+
7
+ https://www.w3.org/TR/json-ld11/#lists-and-sets
8
+
9
+ ## Properties
10
+
11
+ ### @list
12
+
13
+ > **@list**: [`IJsonLdListOrSetItem`](../type-aliases/IJsonLdListOrSetItem.md) \| [`IJsonLdListOrSetItem`](../type-aliases/IJsonLdListOrSetItem.md)[]
14
+
15
+ ***
16
+
17
+ ### @index?
18
+
19
+ > `optional` **@index**: `string`
@@ -0,0 +1,64 @@
1
+ # Interface: IJsonLdNodeObject
2
+
3
+ A node object represents zero or more properties of a node
4
+ in the graph serialized by the JSON-LD document.
5
+
6
+ ## See
7
+
8
+ https://www.w3.org/TR/json-ld11/#node-objects
9
+
10
+ ## Indexable
11
+
12
+ \[`key`: `string`\]: [`IJsonLdNodePrimitive`](../type-aliases/IJsonLdNodePrimitive.md) \| [`IJsonLdNodePrimitive`](../type-aliases/IJsonLdNodePrimitive.md)[] \| [`IJsonLdLanguageMap`](IJsonLdLanguageMap.md) \| [`IJsonLdIndexMap`](IJsonLdIndexMap.md) \| [`IJsonLdIncludedBlock`](../type-aliases/IJsonLdIncludedBlock.md) \| [`IJsonLdIdMap`](IJsonLdIdMap.md) \| [`IJsonLdTypeMap`](IJsonLdTypeMap.md) \| [`IJsonLdNodeObject`](IJsonLdNodeObject.md)\[keyof [`IJsonLdNodeObject`](IJsonLdNodeObject.md)\]
13
+
14
+ ## Properties
15
+
16
+ ### @context?
17
+
18
+ > `optional` **@context**: `null` \| `string` \| [`IJsonLdContextDefinition`](IJsonLdContextDefinition.md) \| (`null` \| `string` \| [`IJsonLdContextDefinition`](IJsonLdContextDefinition.md))[]
19
+
20
+ ***
21
+
22
+ ### @id?
23
+
24
+ > `optional` **@id**: `string` \| `string`[]
25
+
26
+ ***
27
+
28
+ ### @included?
29
+
30
+ > `optional` **@included**: [`IJsonLdIncludedBlock`](../type-aliases/IJsonLdIncludedBlock.md)
31
+
32
+ ***
33
+
34
+ ### @graph?
35
+
36
+ > `optional` **@graph**: [`IJsonLdNodeObject`](IJsonLdNodeObject.md) \| [`IJsonLdNodeObject`](IJsonLdNodeObject.md)[]
37
+
38
+ ***
39
+
40
+ ### @nest?
41
+
42
+ > `optional` **@nest**: [`IJsonLdJsonObject`](IJsonLdJsonObject.md) \| [`IJsonLdJsonObject`](IJsonLdJsonObject.md)[]
43
+
44
+ ***
45
+
46
+ ### @type?
47
+
48
+ > `optional` **@type**: `string` \| `string`[]
49
+
50
+ ***
51
+
52
+ ### @reverse?
53
+
54
+ > `optional` **@reverse**: `object`
55
+
56
+ #### Index Signature
57
+
58
+ \[`key`: `string`\]: [`IJsonLdKeyword`](../type-aliases/IJsonLdKeyword.md)\[`"@reverse"`\]
59
+
60
+ ***
61
+
62
+ ### @index?
63
+
64
+ > `optional` **@index**: `string`
@@ -0,0 +1,19 @@
1
+ # Interface: IJsonLdSetObject
2
+
3
+ A set represents an unordered set of values.
4
+
5
+ ## See
6
+
7
+ https://www.w3.org/TR/json-ld11/#lists-and-sets
8
+
9
+ ## Properties
10
+
11
+ ### @set
12
+
13
+ > **@set**: [`IJsonLdListOrSetItem`](../type-aliases/IJsonLdListOrSetItem.md) \| [`IJsonLdListOrSetItem`](../type-aliases/IJsonLdListOrSetItem.md)[]
14
+
15
+ ***
16
+
17
+ ### @index?
18
+
19
+ > `optional` **@index**: `string`
@@ -0,0 +1,11 @@
1
+ # Interface: IJsonLdTypeMap
2
+
3
+ A type map is used to associate an IRI with a value that allows easy programmatic access.
4
+
5
+ ## See
6
+
7
+ https://www.w3.org/TR/json-ld11/#type-maps
8
+
9
+ ## Indexable
10
+
11
+ \[`key`: `string`\]: `string` \| [`IJsonLdNodeObject`](IJsonLdNodeObject.md)
@@ -0,0 +1,3 @@
1
+ # Type Alias: IJsonLdContainerType
2
+
3
+ > **IJsonLdContainerType**: `"@language"` \| `"@index"` \| `"@id"` \| `"@graph"` \| `"@type"`
@@ -0,0 +1,3 @@
1
+ # Type Alias: IJsonLdContainerTypeArray
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"`]
@@ -0,0 +1,11 @@
1
+ # Type Alias: IJsonLdDocument
2
+
3
+ > **IJsonLdDocument**: [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)[] \| `object`
4
+
5
+ A JSON-LD document MUST be valid JSON text as described in [RFC8259],
6
+ or some format that can be represented in the JSON-LD internal representation
7
+ that is equivalent to valid JSON text.
8
+
9
+ ## See
10
+
11
+ https://www.w3.org/TR/json-ld11/#json-ld-grammar
@@ -0,0 +1,41 @@
1
+ # Type Alias: IJsonLdExpandedTermDefinition
2
+
3
+ > **IJsonLdExpandedTermDefinition**: `object` & `object` \| `object`
4
+
5
+ An expanded term definition is used to describe the mapping between a term
6
+ and its expanded identifier, as well as other properties of the value
7
+ associated with the term when it is used as key in a node object.
8
+
9
+ ## Type declaration
10
+
11
+ ### @type?
12
+
13
+ > `optional` **@type**: `"@id"` \| `"@json"` \| `"@none"` \| `"@vocab"` \| `string`
14
+
15
+ ### @language?
16
+
17
+ > `optional` **@language**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@language"`\]
18
+
19
+ ### @index?
20
+
21
+ > `optional` **@index**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@index"`\]
22
+
23
+ ### @context?
24
+
25
+ > `optional` **@context**: [`IJsonLdContextDefinition`](../interfaces/IJsonLdContextDefinition.md)
26
+
27
+ ### @prefix?
28
+
29
+ > `optional` **@prefix**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@prefix"`\]
30
+
31
+ ### @propagate?
32
+
33
+ > `optional` **@propagate**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@propagate"`\]
34
+
35
+ ### @protected?
36
+
37
+ > `optional` **@protected**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@protected"`\]
38
+
39
+ ## See
40
+
41
+ https://www.w3.org/TR/json-ld11/#expanded-term-definition
@@ -0,0 +1,9 @@
1
+ # Type Alias: IJsonLdIncludedBlock
2
+
3
+ > **IJsonLdIncludedBlock**: [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)[]
4
+
5
+ An included block is used to provide a set of node objects.
6
+
7
+ ## See
8
+
9
+ https://www.w3.org/TR/json-ld11/#included-blocks
@@ -0,0 +1,5 @@
1
+ # Type Alias: IJsonLdIndexMapItem
2
+
3
+ > **IJsonLdIndexMapItem**: `null` \| `boolean` \| `number` \| `string` \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdValueObject`](IJsonLdValueObject.md) \| [`IJsonLdListObject`](../interfaces/IJsonLdListObject.md) \| [`IJsonLdSetObject`](../interfaces/IJsonLdSetObject.md)
4
+
5
+ The items that can be stored in an index map.
@@ -0,0 +1,3 @@
1
+ # Type Alias: IJsonLdJsonArray
2
+
3
+ > **IJsonLdJsonArray**: [`IJsonLdJsonValue`](IJsonLdJsonValue.md)[]
@@ -0,0 +1,3 @@
1
+ # Type Alias: IJsonLdJsonPrimitive
2
+
3
+ > **IJsonLdJsonPrimitive**: `string` \| `number` \| `boolean` \| `null`
@@ -0,0 +1,3 @@
1
+ # Type Alias: IJsonLdJsonValue
2
+
3
+ > **IJsonLdJsonValue**: [`IJsonLdJsonPrimitive`](IJsonLdJsonPrimitive.md) \| [`IJsonLdJsonArray`](IJsonLdJsonArray.md) \| [`IJsonLdJsonObject`](../interfaces/IJsonLdJsonObject.md)
@@ -0,0 +1,105 @@
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**: `null` \| `string` \| [`IJsonLdContextDefinition`](../interfaces/IJsonLdContextDefinition.md) \| (`null` \| `string` \| [`IJsonLdContextDefinition`](../interfaces/IJsonLdContextDefinition.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
@@ -0,0 +1,5 @@
1
+ # Type Alias: IJsonLdListOrSetItem
2
+
3
+ > **IJsonLdListOrSetItem**: `null` \| `boolean` \| `number` \| `string` \| [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md) \| [`IJsonLdValueObject`](IJsonLdValueObject.md)
4
+
5
+ A list or set item can be a null, boolean, number, string, node object, or value object.
@@ -0,0 +1,5 @@
1
+ # Type Alias: IJsonLdNodePrimitive
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)
4
+
5
+ A node primitive is a JSON-LD value which is not one of the defined NodeObject properties.
@@ -0,0 +1,20 @@
1
+ # Type Alias: IJsonLdValueObject
2
+
3
+ > **IJsonLdValueObject**: `object` & `object` \| `object` \| `object`
4
+
5
+ A value object is used to explicitly associate a type or a language with a value
6
+ to create a typed value or a language-tagged string and possibly associate a base direction.
7
+
8
+ ## Type declaration
9
+
10
+ ### @index?
11
+
12
+ > `optional` **@index**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@index"`\]
13
+
14
+ ### @context?
15
+
16
+ > `optional` **@context**: [`IJsonLdKeyword`](IJsonLdKeyword.md)\[`"@context"`\]
17
+
18
+ ## See
19
+
20
+ https://www.w3.org/TR/json-ld11/#value-objects
@@ -0,0 +1,5 @@
1
+ # Type Alias: JsonLdTypes
2
+
3
+ > **JsonLdTypes**: *typeof* [`JsonLdTypes`](../variables/JsonLdTypes.md)\[keyof *typeof* [`JsonLdTypes`](../variables/JsonLdTypes.md)\]
4
+
5
+ The types of JSON-LD data.
@@ -0,0 +1,145 @@
1
+ # Variable: JsonLdTypes
2
+
3
+ > `const` **JsonLdTypes**: `object`
4
+
5
+ The types of JSON-LD data.
6
+
7
+ ## Type declaration
8
+
9
+ ### Document
10
+
11
+ > `readonly` **Document**: `"https://schema.twindev.org/json-ld/JsonLdDocument"` = `"https://schema.twindev.org/json-ld/JsonLdDocument"`
12
+
13
+ Represents JSON-LD Document.
14
+
15
+ ### NodeObject
16
+
17
+ > `readonly` **NodeObject**: `"https://schema.twindev.org/json-ld/JsonLdNodeObject"` = `"https://schema.twindev.org/json-ld/JsonLdNodeObject"`
18
+
19
+ Represents JSON-LD Node Object.
20
+
21
+ ### NodePrimitive
22
+
23
+ > `readonly` **NodePrimitive**: `"https://schema.twindev.org/json-ld/JsonLdNodePrimitive"` = `"https://schema.twindev.org/json-ld/JsonLdNodePrimitive"`
24
+
25
+ Represents JSON-LD Node Primitive.
26
+
27
+ ### GraphObject
28
+
29
+ > `readonly` **GraphObject**: `"https://schema.twindev.org/json-ld/JsonLdGraphObject"` = `"https://schema.twindev.org/json-ld/JsonLdGraphObject"`
30
+
31
+ Represents JSON-LD Graph Object.
32
+
33
+ ### ValueObject
34
+
35
+ > `readonly` **ValueObject**: `"https://schema.twindev.org/json-ld/JsonLdValueObject"` = `"https://schema.twindev.org/json-ld/JsonLdValueObject"`
36
+
37
+ Represents JSON-LD Value Object.
38
+
39
+ ### ListObject
40
+
41
+ > `readonly` **ListObject**: `"https://schema.twindev.org/json-ld/JsonLdListObject"` = `"https://schema.twindev.org/json-ld/JsonLdListObject"`
42
+
43
+ Represents JSON-LD List Object.
44
+
45
+ ### SetObject
46
+
47
+ > `readonly` **SetObject**: `"https://schema.twindev.org/json-ld/JsonLdSetObject"` = `"https://schema.twindev.org/json-ld/JsonLdSetObject"`
48
+
49
+ Represents JSON-LD Set Object.
50
+
51
+ ### LanguageMap
52
+
53
+ > `readonly` **LanguageMap**: `"https://schema.twindev.org/json-ld/JsonLdLanguageMap"` = `"https://schema.twindev.org/json-ld/JsonLdLanguageMap"`
54
+
55
+ Represents JSON-LD Language Map.
56
+
57
+ ### IndexMap
58
+
59
+ > `readonly` **IndexMap**: `"https://schema.twindev.org/json-ld/JsonLdIndexMap"` = `"https://schema.twindev.org/json-ld/JsonLdIndexMap"`
60
+
61
+ Represents JSON-LD Index Map.
62
+
63
+ ### IndexMapItem
64
+
65
+ > `readonly` **IndexMapItem**: `"https://schema.twindev.org/json-ld/JsonLdIndexMapItem"` = `"https://schema.twindev.org/json-ld/JsonLdIndexMapItem"`
66
+
67
+ Represents JSON-LD Index Map Item.
68
+
69
+ ### IdMap
70
+
71
+ > `readonly` **IdMap**: `"https://schema.twindev.org/json-ld/JsonLdIdMap"` = `"https://schema.twindev.org/json-ld/JsonLdIdMap"`
72
+
73
+ Represents JSON-LD Id Map.
74
+
75
+ ### TypeMap
76
+
77
+ > `readonly` **TypeMap**: `"https://schema.twindev.org/json-ld/JsonLdTypeMap"` = `"https://schema.twindev.org/json-ld/JsonLdTypeMap"`
78
+
79
+ Represents JSON-LD Type Map.
80
+
81
+ ### IncludedBlock
82
+
83
+ > `readonly` **IncludedBlock**: `"https://schema.twindev.org/json-ld/JsonLdIncludedBlock"` = `"https://schema.twindev.org/json-ld/JsonLdIncludedBlock"`
84
+
85
+ Represents JSON-LD Included block.
86
+
87
+ ### ContextDefinition
88
+
89
+ > `readonly` **ContextDefinition**: `"https://schema.twindev.org/json-ld/JsonLdContextDefinition"` = `"https://schema.twindev.org/json-ld/JsonLdContextDefinition"`
90
+
91
+ Represents JSON-LD Context Definition.
92
+
93
+ ### ExpandedTermDefinition
94
+
95
+ > `readonly` **ExpandedTermDefinition**: `"https://schema.twindev.org/json-ld/JsonLdExpandedTermDefinition"` = `"https://schema.twindev.org/json-ld/JsonLdExpandedTermDefinition"`
96
+
97
+ Represents JSON-LD Expanded Term Definition.
98
+
99
+ ### Keyword
100
+
101
+ > `readonly` **Keyword**: `"https://schema.twindev.org/json-ld/JsonLdKeyword"` = `"https://schema.twindev.org/json-ld/JsonLdKeyword"`
102
+
103
+ Represents JSON-LD Keyword.
104
+
105
+ ### ListOrSetItem
106
+
107
+ > `readonly` **ListOrSetItem**: `"https://schema.twindev.org/json-ld/JsonLdListOrSetItem"` = `"https://schema.twindev.org/json-ld/JsonLdListOrSetItem"`
108
+
109
+ Represents JSON-LD List or Set Item.
110
+
111
+ ### ContainerType
112
+
113
+ > `readonly` **ContainerType**: `"https://schema.twindev.org/json-ld/JsonLdContainerType"` = `"https://schema.twindev.org/json-ld/JsonLdContainerType"`
114
+
115
+ Represents JSON-LD Container Type.
116
+
117
+ ### ContainerTypeArray
118
+
119
+ > `readonly` **ContainerTypeArray**: `"https://schema.twindev.org/json-ld/JsonLdContainerTypeArray"` = `"https://schema.twindev.org/json-ld/JsonLdContainerTypeArray"`
120
+
121
+ Represents JSON-LD Container Type Array.
122
+
123
+ ### JsonPrimitive
124
+
125
+ > `readonly` **JsonPrimitive**: `"https://schema.twindev.org/json-ld/JsonLdJsonPrimitive"` = `"https://schema.twindev.org/json-ld/JsonLdJsonPrimitive"`
126
+
127
+ Represents JSON-LD JSON Primitive.
128
+
129
+ ### JsonArray
130
+
131
+ > `readonly` **JsonArray**: `"https://schema.twindev.org/json-ld/JsonLdJsonArray"` = `"https://schema.twindev.org/json-ld/JsonLdJsonArray"`
132
+
133
+ Represents JSON-LD JSON Array.
134
+
135
+ ### JsonObject
136
+
137
+ > `readonly` **JsonObject**: `"https://schema.twindev.org/json-ld/JsonLdJsonObject"` = `"https://schema.twindev.org/json-ld/JsonLdJsonObject"`
138
+
139
+ Represents JSON-LD JSON Object.
140
+
141
+ ### JsonValue
142
+
143
+ > `readonly` **JsonValue**: `"https://schema.twindev.org/json-ld/JsonLdJsonValue"` = `"https://schema.twindev.org/json-ld/JsonLdJsonValue"`
144
+
145
+ Represents JSON-LD JSON Value.
@@ -0,0 +1,6 @@
1
+ {
2
+ "jsonLdHelper": {
3
+ "compact": "The JSON-LD compaction failed",
4
+ "expand": "The JSON-LD expansion failed"
5
+ }
6
+ }
package/package.json ADDED
@@ -0,0 +1,74 @@
1
+ {
2
+ "name": "@twin.org/data-json-ld",
3
+ "version": "0.0.1-next.3",
4
+ "description": "Models which define the structure of JSON LD",
5
+ "repository": {
6
+ "type": "git",
7
+ "url": "git+https://github.com/twinfoundation/data.git",
8
+ "directory": "packages/data-json-ld"
9
+ },
10
+ "author": "martyn.janes@iota.org",
11
+ "license": "Apache-2.0",
12
+ "type": "module",
13
+ "engines": {
14
+ "node": ">=20.0.0"
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
+ "dependencies": {
32
+ "@twin.org/core": "next",
33
+ "@twin.org/data-core": "0.0.1-next.3",
34
+ "@twin.org/entity": "next",
35
+ "@twin.org/nameof": "next",
36
+ "@twin.org/web": "next",
37
+ "@types/jsonld": "1.5.15",
38
+ "@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"
55
+ },
56
+ "main": "./dist/cjs/index.cjs",
57
+ "module": "./dist/esm/index.mjs",
58
+ "types": "./dist/types/index.d.ts",
59
+ "exports": {
60
+ ".": {
61
+ "require": "./dist/cjs/index.cjs",
62
+ "import": "./dist/esm/index.mjs",
63
+ "types": "./dist/types/index.d.ts"
64
+ },
65
+ "./locales": "./locales"
66
+ },
67
+ "files": [
68
+ "dist/cjs",
69
+ "dist/esm",
70
+ "dist/types",
71
+ "locales",
72
+ "docs"
73
+ ]
74
+ }