@twin.org/data-json-ld 0.0.1-next.19 → 0.0.1-next.21
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 +136 -117
- package/dist/esm/index.mjs +137 -118
- 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 +25 -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 +2 -204
- package/dist/types/models/IJsonLdExpandedTermDefinition.d.ts +28 -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/IJsonLdKeyword.d.ts +42 -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 +24 -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/utils/jsonLdProcessor.d.ts +6 -6
- package/docs/changelog.md +1 -1
- package/docs/reference/classes/JsonLdProcessor.md +21 -7
- package/docs/reference/index.md +17 -17
- package/docs/reference/interfaces/IJsonLdJsonObject.md +2 -0
- package/docs/reference/interfaces/IJsonLdNodeObject.md +1 -1
- package/docs/reference/type-aliases/IJsonLdContainerType.md +2 -0
- package/docs/reference/type-aliases/IJsonLdContainerTypeArray.md +2 -0
- package/docs/reference/type-aliases/IJsonLdJsonArray.md +2 -0
- package/docs/reference/type-aliases/IJsonLdJsonPrimitive.md +2 -0
- package/docs/reference/type-aliases/IJsonLdJsonValue.md +2 -0
- package/package.json +2 -2
|
@@ -34,15 +34,19 @@ The document loader to use.
|
|
|
34
34
|
|
|
35
35
|
### compact()
|
|
36
36
|
|
|
37
|
-
> `static` **compact
|
|
37
|
+
> `static` **compact**\<`T`\>(`document`, `context`?): `Promise`\<`T`\>
|
|
38
38
|
|
|
39
39
|
Compact a document according to a particular context.
|
|
40
40
|
|
|
41
|
+
#### Type Parameters
|
|
42
|
+
|
|
43
|
+
• **T** *extends* [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)
|
|
44
|
+
|
|
41
45
|
#### Parameters
|
|
42
46
|
|
|
43
47
|
##### document
|
|
44
48
|
|
|
45
|
-
|
|
49
|
+
`T`
|
|
46
50
|
|
|
47
51
|
The JSON-LD document to compact.
|
|
48
52
|
|
|
@@ -54,7 +58,7 @@ The context to compact the document to, if not provided will try and gather from
|
|
|
54
58
|
|
|
55
59
|
#### Returns
|
|
56
60
|
|
|
57
|
-
`Promise
|
|
61
|
+
`Promise`\<`T`\>
|
|
58
62
|
|
|
59
63
|
The compacted JSON-LD document.
|
|
60
64
|
|
|
@@ -62,21 +66,25 @@ The compacted JSON-LD document.
|
|
|
62
66
|
|
|
63
67
|
### expand()
|
|
64
68
|
|
|
65
|
-
> `static` **expand
|
|
69
|
+
> `static` **expand**\<`T`\>(`compacted`): `Promise`\<[`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)[]\>
|
|
66
70
|
|
|
67
71
|
Expand a document, removing its context.
|
|
68
72
|
|
|
73
|
+
#### Type Parameters
|
|
74
|
+
|
|
75
|
+
• **T** *extends* [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)
|
|
76
|
+
|
|
69
77
|
#### Parameters
|
|
70
78
|
|
|
71
79
|
##### compacted
|
|
72
80
|
|
|
73
|
-
|
|
81
|
+
`T`
|
|
74
82
|
|
|
75
83
|
The compacted JSON-LD document to expand.
|
|
76
84
|
|
|
77
85
|
#### Returns
|
|
78
86
|
|
|
79
|
-
`Promise`\<[`
|
|
87
|
+
`Promise`\<[`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)[]\>
|
|
80
88
|
|
|
81
89
|
The expanded JSON-LD document.
|
|
82
90
|
|
|
@@ -138,14 +146,20 @@ The combined context.
|
|
|
138
146
|
|
|
139
147
|
### gatherContexts()
|
|
140
148
|
|
|
141
|
-
> `static` **gatherContexts
|
|
149
|
+
> `static` **gatherContexts**\<`T`\>(`element`, `initial`?): `undefined` \| [`IJsonLdContextDefinitionRoot`](../type-aliases/IJsonLdContextDefinitionRoot.md)
|
|
142
150
|
|
|
143
151
|
Gather all the contexts from the element and it's children.
|
|
144
152
|
|
|
153
|
+
#### Type Parameters
|
|
154
|
+
|
|
155
|
+
• **T** *extends* [`IJsonLdNodeObject`](../interfaces/IJsonLdNodeObject.md)
|
|
156
|
+
|
|
145
157
|
#### Parameters
|
|
146
158
|
|
|
147
159
|
##### element
|
|
148
160
|
|
|
161
|
+
`T`
|
|
162
|
+
|
|
149
163
|
The element to gather the contexts from.
|
|
150
164
|
|
|
151
165
|
##### initial?
|
package/docs/reference/index.md
CHANGED
|
@@ -8,35 +8,35 @@
|
|
|
8
8
|
|
|
9
9
|
## Interfaces
|
|
10
10
|
|
|
11
|
-
- [
|
|
12
|
-
- [IJsonLdObject](interfaces/IJsonLdObject.md)
|
|
11
|
+
- [IJsonLdContextDefinition](interfaces/IJsonLdContextDefinition.md)
|
|
13
12
|
- [IJsonLdGraphObject](interfaces/IJsonLdGraphObject.md)
|
|
13
|
+
- [IJsonLdIdMap](interfaces/IJsonLdIdMap.md)
|
|
14
|
+
- [IJsonLdIndexMap](interfaces/IJsonLdIndexMap.md)
|
|
15
|
+
- [IJsonLdJsonObject](interfaces/IJsonLdJsonObject.md)
|
|
16
|
+
- [IJsonLdLanguageMap](interfaces/IJsonLdLanguageMap.md)
|
|
14
17
|
- [IJsonLdListObject](interfaces/IJsonLdListObject.md)
|
|
18
|
+
- [IJsonLdNodeObject](interfaces/IJsonLdNodeObject.md)
|
|
19
|
+
- [IJsonLdObject](interfaces/IJsonLdObject.md)
|
|
15
20
|
- [IJsonLdSetObject](interfaces/IJsonLdSetObject.md)
|
|
16
|
-
- [IJsonLdLanguageMap](interfaces/IJsonLdLanguageMap.md)
|
|
17
|
-
- [IJsonLdIndexMap](interfaces/IJsonLdIndexMap.md)
|
|
18
|
-
- [IJsonLdIdMap](interfaces/IJsonLdIdMap.md)
|
|
19
21
|
- [IJsonLdTypeMap](interfaces/IJsonLdTypeMap.md)
|
|
20
|
-
- [IJsonLdContextDefinition](interfaces/IJsonLdContextDefinition.md)
|
|
21
|
-
- [IJsonLdJsonObject](interfaces/IJsonLdJsonObject.md)
|
|
22
22
|
|
|
23
23
|
## Type Aliases
|
|
24
24
|
|
|
25
|
-
- [
|
|
26
|
-
- [
|
|
27
|
-
- [IJsonLdValueObject](type-aliases/IJsonLdValueObject.md)
|
|
28
|
-
- [IJsonLdIndexMapItem](type-aliases/IJsonLdIndexMapItem.md)
|
|
29
|
-
- [IJsonLdIncludedBlock](type-aliases/IJsonLdIncludedBlock.md)
|
|
25
|
+
- [IJsonLdContainerType](type-aliases/IJsonLdContainerType.md)
|
|
26
|
+
- [IJsonLdContainerTypeArray](type-aliases/IJsonLdContainerTypeArray.md)
|
|
30
27
|
- [IJsonLdContextDefinitionElement](type-aliases/IJsonLdContextDefinitionElement.md)
|
|
31
28
|
- [IJsonLdContextDefinitionRoot](type-aliases/IJsonLdContextDefinitionRoot.md)
|
|
29
|
+
- [IJsonLdDocument](type-aliases/IJsonLdDocument.md)
|
|
32
30
|
- [IJsonLdExpandedTermDefinition](type-aliases/IJsonLdExpandedTermDefinition.md)
|
|
33
|
-
- [
|
|
34
|
-
- [
|
|
35
|
-
- [IJsonLdContainerType](type-aliases/IJsonLdContainerType.md)
|
|
36
|
-
- [IJsonLdContainerTypeArray](type-aliases/IJsonLdContainerTypeArray.md)
|
|
37
|
-
- [IJsonLdJsonPrimitive](type-aliases/IJsonLdJsonPrimitive.md)
|
|
31
|
+
- [IJsonLdIncludedBlock](type-aliases/IJsonLdIncludedBlock.md)
|
|
32
|
+
- [IJsonLdIndexMapItem](type-aliases/IJsonLdIndexMapItem.md)
|
|
38
33
|
- [IJsonLdJsonArray](type-aliases/IJsonLdJsonArray.md)
|
|
34
|
+
- [IJsonLdJsonPrimitive](type-aliases/IJsonLdJsonPrimitive.md)
|
|
39
35
|
- [IJsonLdJsonValue](type-aliases/IJsonLdJsonValue.md)
|
|
36
|
+
- [IJsonLdKeyword](type-aliases/IJsonLdKeyword.md)
|
|
37
|
+
- [IJsonLdListOrSetItem](type-aliases/IJsonLdListOrSetItem.md)
|
|
38
|
+
- [IJsonLdNodePrimitive](type-aliases/IJsonLdNodePrimitive.md)
|
|
39
|
+
- [IJsonLdValueObject](type-aliases/IJsonLdValueObject.md)
|
|
40
40
|
- [JsonLdTypes](type-aliases/JsonLdTypes.md)
|
|
41
41
|
|
|
42
42
|
## Variables
|
|
@@ -13,7 +13,7 @@ https://www.w3.org/TR/json-ld11/#node-objects
|
|
|
13
13
|
|
|
14
14
|
## Indexable
|
|
15
15
|
|
|
16
|
-
\[`key`: `string`\]: `undefined` \| `null` \| `string` \| `number` \| `boolean` \| `string`[] \| [`
|
|
16
|
+
\[`key`: `string`\]: `undefined` \| `null` \| `string` \| `number` \| `boolean` \| `string`[] \| [`IJsonLdContextDefinition`](IJsonLdContextDefinition.md) \| [`IJsonLdContextDefinitionElement`](../type-aliases/IJsonLdContextDefinitionElement.md)[] \| [`IJsonLdIdMap`](IJsonLdIdMap.md) \| [`IJsonLdNodeObject`](IJsonLdNodeObject.md) \| [`IJsonLdListObject`](IJsonLdListObject.md) \| `object` & `object` \| `object` & `object` \| `object` & `object` \| [`IJsonLdSetObject`](IJsonLdSetObject.md) \| [`IJsonLdJsonObject`](IJsonLdJsonObject.md) \| [`IJsonLdIndexMap`](IJsonLdIndexMap.md) \| [`IJsonLdLanguageMap`](IJsonLdLanguageMap.md) \| [`IJsonLdGraphObject`](IJsonLdGraphObject.md) \| [`IJsonLdNodeObject`](IJsonLdNodeObject.md)[] \| [`IJsonLdJsonObject`](IJsonLdJsonObject.md)[] \| \{\} \| [`IJsonLdTypeMap`](IJsonLdTypeMap.md) \| [`IJsonLdNodePrimitive`](../type-aliases/IJsonLdNodePrimitive.md)[]
|
|
17
17
|
|
|
18
18
|
## Properties
|
|
19
19
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
# Type Alias: IJsonLdContainerTypeArray
|
|
2
2
|
|
|
3
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.
|
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
|
+
"version": "0.0.1-next.21",
|
|
4
4
|
"description": "Models which define the structure of JSON LD",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
|
-
"@twin.org/data-core": "0.0.1-next.
|
|
18
|
+
"@twin.org/data-core": "0.0.1-next.21",
|
|
19
19
|
"@twin.org/entity": "next",
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
21
|
"@twin.org/web": "next",
|