@twin.org/data-json-ld 0.0.3-next.2 → 0.0.3-next.20
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/README.md +1 -1
- package/dist/es/dataTypes/jsonLdDataTypes.js +104 -131
- package/dist/es/dataTypes/jsonLdDataTypes.js.map +1 -1
- package/dist/es/helpers/jsonLdHelperTypes.js +2 -0
- package/dist/es/helpers/jsonLdHelperTypes.js.map +1 -0
- package/dist/es/index.js +1 -0
- package/dist/es/index.js.map +1 -1
- package/dist/es/models/jsonLdContexts.js +10 -2
- package/dist/es/models/jsonLdContexts.js.map +1 -1
- package/dist/es/schemas/JsonLdContainerType.json +17 -7
- package/dist/es/schemas/JsonLdContainerTypeArray.json +129 -142
- package/dist/es/schemas/JsonLdContextDefinition.json +76 -18
- package/dist/es/schemas/JsonLdContextDefinitionElement.json +1 -0
- package/dist/es/schemas/JsonLdContextDefinitionRoot.json +1 -0
- package/dist/es/schemas/JsonLdDocument.json +3 -3
- package/dist/es/schemas/JsonLdExpandedTermDefinition.json +101 -89
- package/dist/es/schemas/JsonLdGraphObject.json +2 -2
- package/dist/es/schemas/JsonLdIdMap.json +1 -0
- package/dist/es/schemas/JsonLdIncludedBlock.json +1 -0
- package/dist/es/schemas/JsonLdIndexMap.json +2 -1
- package/dist/es/schemas/JsonLdIndexMapItem.json +1 -0
- package/dist/es/schemas/JsonLdJsonArray.json +1 -0
- package/dist/es/schemas/JsonLdJsonObject.json +2 -8
- package/dist/es/schemas/JsonLdJsonPrimitive.json +14 -5
- package/dist/es/schemas/JsonLdJsonValue.json +1 -0
- package/dist/es/schemas/JsonLdLanguageMap.json +1 -0
- package/dist/es/schemas/JsonLdListObject.json +2 -2
- package/dist/es/schemas/JsonLdListOrSetItem.json +1 -0
- package/dist/es/schemas/JsonLdNodeObject.json +12 -72
- package/dist/es/schemas/JsonLdNodePrimitive.json +1 -0
- package/dist/es/schemas/JsonLdObject.json +3 -3
- package/dist/es/schemas/JsonLdSetObject.json +2 -2
- package/dist/es/schemas/JsonLdTypeMap.json +1 -0
- package/dist/es/schemas/JsonLdValueObject.json +99 -87
- package/dist/es/utils/jsonLdHelper.js +181 -15
- package/dist/es/utils/jsonLdHelper.js.map +1 -1
- package/dist/es/utils/jsonLdProcessor.js +122 -33
- package/dist/es/utils/jsonLdProcessor.js.map +1 -1
- package/dist/types/helpers/jsonLdHelperTypes.d.ts +127 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/models/jsonLdContexts.d.ts +10 -2
- package/dist/types/utils/jsonLdHelper.d.ts +63 -6
- package/dist/types/utils/jsonLdProcessor.d.ts +10 -7
- package/docs/changelog.md +273 -1
- package/docs/examples.md +214 -1
- package/docs/reference/classes/JsonLdDataTypes.md +1 -1
- package/docs/reference/classes/JsonLdHelper.md +249 -13
- package/docs/reference/classes/JsonLdProcessor.md +51 -58
- package/docs/reference/index.md +23 -0
- package/docs/reference/interfaces/IJsonLdContextDefinition.md +20 -20
- package/docs/reference/interfaces/IJsonLdGraphObject.md +7 -7
- package/docs/reference/interfaces/IJsonLdIdMap.md +1 -1
- package/docs/reference/interfaces/IJsonLdIndexMap.md +1 -1
- package/docs/reference/interfaces/IJsonLdJsonObject.md +1 -1
- package/docs/reference/interfaces/IJsonLdLanguageMap.md +1 -1
- package/docs/reference/interfaces/IJsonLdListObject.md +3 -3
- package/docs/reference/interfaces/IJsonLdNodeObject.md +17 -17
- package/docs/reference/interfaces/IJsonLdObject.md +16 -16
- package/docs/reference/interfaces/IJsonLdSetObject.md +3 -3
- package/docs/reference/interfaces/IJsonLdTypeMap.md +1 -1
- package/docs/reference/type-aliases/IJsonLdExpandedTermDefinition.md +7 -7
- package/docs/reference/type-aliases/IJsonLdValueObject.md +2 -2
- package/docs/reference/type-aliases/JsonLdAliasKey.md +15 -0
- package/docs/reference/type-aliases/JsonLdExistingProperty.md +19 -0
- package/docs/reference/type-aliases/JsonLdExistingPropertyEither.md +24 -0
- package/docs/reference/type-aliases/JsonLdKeys.md +11 -0
- package/docs/reference/type-aliases/JsonLdObjectWithAliases.md +16 -0
- package/docs/reference/type-aliases/JsonLdObjectWithAtId.md +21 -0
- package/docs/reference/type-aliases/JsonLdObjectWithAtType.md +21 -0
- package/docs/reference/type-aliases/JsonLdObjectWithContext.md +21 -0
- package/docs/reference/type-aliases/JsonLdObjectWithId.md +21 -0
- package/docs/reference/type-aliases/JsonLdObjectWithNoAtId.md +11 -0
- package/docs/reference/type-aliases/JsonLdObjectWithNoAtType.md +11 -0
- package/docs/reference/type-aliases/JsonLdObjectWithNoContext.md +12 -0
- package/docs/reference/type-aliases/JsonLdObjectWithNoId.md +11 -0
- package/docs/reference/type-aliases/JsonLdObjectWithNoType.md +11 -0
- package/docs/reference/type-aliases/JsonLdObjectWithOptionalAtId.md +21 -0
- package/docs/reference/type-aliases/JsonLdObjectWithOptionalAtType.md +21 -0
- package/docs/reference/type-aliases/JsonLdObjectWithOptionalContext.md +22 -0
- package/docs/reference/type-aliases/JsonLdObjectWithOptionalId.md +21 -0
- package/docs/reference/type-aliases/JsonLdObjectWithOptionalType.md +21 -0
- package/docs/reference/type-aliases/JsonLdObjectWithType.md +21 -0
- package/docs/reference/type-aliases/JsonLdOptionalKeys.md +11 -0
- package/docs/reference/type-aliases/JsonLdRequiredKeys.md +11 -0
- package/docs/reference/type-aliases/JsonLdWithAliases.md +17 -0
- package/docs/reference/variables/JsonLdContexts.md +15 -3
- package/docs/reference/variables/JsonLdTypes.md +26 -26
- package/package.json +4 -4
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Type Alias: JsonLdWithAliases\<T, Prefix\>
|
|
2
|
+
|
|
3
|
+
> **JsonLdWithAliases**\<`T`, `Prefix`\> = `{ [K in Extract<JsonLdRequiredKeys<T>, string> as JsonLdAliasKey<K, Prefix>]: T[K] }` & `{ [K in Extract<JsonLdOptionalKeys<T>, string> as JsonLdAliasKey<K, Prefix>]?: T[K] }`
|
|
4
|
+
|
|
5
|
+
Remap an object type so JSON-LD keys ("@...") are preserved and
|
|
6
|
+
non-JSON-LD keys are exposed as `Prefix:key` aliases, while preserving
|
|
7
|
+
each key's original required/optional status.
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
### T
|
|
12
|
+
|
|
13
|
+
`T` *extends* `object`
|
|
14
|
+
|
|
15
|
+
### Prefix
|
|
16
|
+
|
|
17
|
+
`Prefix` *extends* `string`
|
|
@@ -6,8 +6,20 @@ The contexts of JSON-LD data.
|
|
|
6
6
|
|
|
7
7
|
## Type Declaration
|
|
8
8
|
|
|
9
|
-
###
|
|
9
|
+
### Namespace {#namespace}
|
|
10
10
|
|
|
11
|
-
> `readonly` **
|
|
11
|
+
> `readonly` **Namespace**: `"https://schema.twindev.org/json-ld/"` = `"https://schema.twindev.org/json-ld/"`
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
The canonical RDF namespace URI for JSON-LD.
|
|
14
|
+
|
|
15
|
+
### Context {#context}
|
|
16
|
+
|
|
17
|
+
> `readonly` **Context**: `"https://schema.twindev.org/json-ld/"` = `"https://schema.twindev.org/json-ld/"`
|
|
18
|
+
|
|
19
|
+
The value to use in JSON-LD context for JSON-LD.
|
|
20
|
+
|
|
21
|
+
### JsonLdContext {#jsonldcontext}
|
|
22
|
+
|
|
23
|
+
> `readonly` **JsonLdContext**: `"https://schema.twindev.org/json-ld/types.jsonld"` = `"https://schema.twindev.org/json-ld/types.jsonld"`
|
|
24
|
+
|
|
25
|
+
The JSON-LD Context URL for JSON-LD.
|
|
@@ -6,157 +6,157 @@ The types of JSON-LD data.
|
|
|
6
6
|
|
|
7
7
|
## Type Declaration
|
|
8
8
|
|
|
9
|
-
### Document
|
|
9
|
+
### Document {#document}
|
|
10
10
|
|
|
11
11
|
> `readonly` **Document**: `"JsonLdDocument"` = `"JsonLdDocument"`
|
|
12
12
|
|
|
13
13
|
Represents JSON-LD Document.
|
|
14
14
|
|
|
15
|
-
### Object
|
|
15
|
+
### Object {#object}
|
|
16
16
|
|
|
17
17
|
> `readonly` **Object**: `"JsonLdObject"` = `"JsonLdObject"`
|
|
18
18
|
|
|
19
19
|
Represents JSON-LD Object.
|
|
20
20
|
|
|
21
|
-
### NodeObject
|
|
21
|
+
### NodeObject {#nodeobject}
|
|
22
22
|
|
|
23
23
|
> `readonly` **NodeObject**: `"JsonLdNodeObject"` = `"JsonLdNodeObject"`
|
|
24
24
|
|
|
25
25
|
Represents JSON-LD Node Object.
|
|
26
26
|
|
|
27
|
-
### NodePrimitive
|
|
27
|
+
### NodePrimitive {#nodeprimitive}
|
|
28
28
|
|
|
29
29
|
> `readonly` **NodePrimitive**: `"JsonLdNodePrimitive"` = `"JsonLdNodePrimitive"`
|
|
30
30
|
|
|
31
31
|
Represents JSON-LD Node Primitive.
|
|
32
32
|
|
|
33
|
-
### GraphObject
|
|
33
|
+
### GraphObject {#graphobject}
|
|
34
34
|
|
|
35
35
|
> `readonly` **GraphObject**: `"JsonLdGraphObject"` = `"JsonLdGraphObject"`
|
|
36
36
|
|
|
37
37
|
Represents JSON-LD Graph Object.
|
|
38
38
|
|
|
39
|
-
### ValueObject
|
|
39
|
+
### ValueObject {#valueobject}
|
|
40
40
|
|
|
41
41
|
> `readonly` **ValueObject**: `"JsonLdValueObject"` = `"JsonLdValueObject"`
|
|
42
42
|
|
|
43
43
|
Represents JSON-LD Value Object.
|
|
44
44
|
|
|
45
|
-
### ListObject
|
|
45
|
+
### ListObject {#listobject}
|
|
46
46
|
|
|
47
47
|
> `readonly` **ListObject**: `"JsonLdListObject"` = `"JsonLdListObject"`
|
|
48
48
|
|
|
49
49
|
Represents JSON-LD List Object.
|
|
50
50
|
|
|
51
|
-
### SetObject
|
|
51
|
+
### SetObject {#setobject}
|
|
52
52
|
|
|
53
53
|
> `readonly` **SetObject**: `"JsonLdSetObject"` = `"JsonLdSetObject"`
|
|
54
54
|
|
|
55
55
|
Represents JSON-LD Set Object.
|
|
56
56
|
|
|
57
|
-
### LanguageMap
|
|
57
|
+
### LanguageMap {#languagemap}
|
|
58
58
|
|
|
59
59
|
> `readonly` **LanguageMap**: `"JsonLdLanguageMap"` = `"JsonLdLanguageMap"`
|
|
60
60
|
|
|
61
61
|
Represents JSON-LD Language Map.
|
|
62
62
|
|
|
63
|
-
### IndexMap
|
|
63
|
+
### IndexMap {#indexmap}
|
|
64
64
|
|
|
65
65
|
> `readonly` **IndexMap**: `"JsonLdIndexMap"` = `"JsonLdIndexMap"`
|
|
66
66
|
|
|
67
67
|
Represents JSON-LD Index Map.
|
|
68
68
|
|
|
69
|
-
### IndexMapItem
|
|
69
|
+
### IndexMapItem {#indexmapitem}
|
|
70
70
|
|
|
71
71
|
> `readonly` **IndexMapItem**: `"JsonLdIndexMapItem"` = `"JsonLdIndexMapItem"`
|
|
72
72
|
|
|
73
73
|
Represents JSON-LD Index Map Item.
|
|
74
74
|
|
|
75
|
-
### IdMap
|
|
75
|
+
### IdMap {#idmap}
|
|
76
76
|
|
|
77
77
|
> `readonly` **IdMap**: `"JsonLdIdMap"` = `"JsonLdIdMap"`
|
|
78
78
|
|
|
79
79
|
Represents JSON-LD Id Map.
|
|
80
80
|
|
|
81
|
-
### TypeMap
|
|
81
|
+
### TypeMap {#typemap}
|
|
82
82
|
|
|
83
83
|
> `readonly` **TypeMap**: `"JsonLdTypeMap"` = `"JsonLdTypeMap"`
|
|
84
84
|
|
|
85
85
|
Represents JSON-LD Type Map.
|
|
86
86
|
|
|
87
|
-
### IncludedBlock
|
|
87
|
+
### IncludedBlock {#includedblock}
|
|
88
88
|
|
|
89
89
|
> `readonly` **IncludedBlock**: `"JsonLdIncludedBlock"` = `"JsonLdIncludedBlock"`
|
|
90
90
|
|
|
91
91
|
Represents JSON-LD Included block.
|
|
92
92
|
|
|
93
|
-
### ContextDefinition
|
|
93
|
+
### ContextDefinition {#contextdefinition}
|
|
94
94
|
|
|
95
95
|
> `readonly` **ContextDefinition**: `"JsonLdContextDefinition"` = `"JsonLdContextDefinition"`
|
|
96
96
|
|
|
97
97
|
Represents JSON-LD Context Definition.
|
|
98
98
|
|
|
99
|
-
### ContextDefinitionElement
|
|
99
|
+
### ContextDefinitionElement {#contextdefinitionelement}
|
|
100
100
|
|
|
101
101
|
> `readonly` **ContextDefinitionElement**: `"JsonLdContextDefinitionElement"` = `"JsonLdContextDefinitionElement"`
|
|
102
102
|
|
|
103
103
|
Represents JSON-LD Context Definition Element.
|
|
104
104
|
|
|
105
|
-
### ContextDefinitionRoot
|
|
105
|
+
### ContextDefinitionRoot {#contextdefinitionroot}
|
|
106
106
|
|
|
107
107
|
> `readonly` **ContextDefinitionRoot**: `"JsonLdContextDefinitionRoot"` = `"JsonLdContextDefinitionRoot"`
|
|
108
108
|
|
|
109
109
|
Represents JSON-LD Context Definition Root.
|
|
110
110
|
|
|
111
|
-
### ExpandedTermDefinition
|
|
111
|
+
### ExpandedTermDefinition {#expandedtermdefinition}
|
|
112
112
|
|
|
113
113
|
> `readonly` **ExpandedTermDefinition**: `"JsonLdExpandedTermDefinition"` = `"JsonLdExpandedTermDefinition"`
|
|
114
114
|
|
|
115
115
|
Represents JSON-LD Expanded Term Definition.
|
|
116
116
|
|
|
117
|
-
### Keyword
|
|
117
|
+
### Keyword {#keyword}
|
|
118
118
|
|
|
119
119
|
> `readonly` **Keyword**: `"JsonLdKeyword"` = `"JsonLdKeyword"`
|
|
120
120
|
|
|
121
121
|
Represents JSON-LD Keyword.
|
|
122
122
|
|
|
123
|
-
### ListOrSetItem
|
|
123
|
+
### ListOrSetItem {#listorsetitem}
|
|
124
124
|
|
|
125
125
|
> `readonly` **ListOrSetItem**: `"JsonLdListOrSetItem"` = `"JsonLdListOrSetItem"`
|
|
126
126
|
|
|
127
127
|
Represents JSON-LD List or Set Item.
|
|
128
128
|
|
|
129
|
-
### ContainerType
|
|
129
|
+
### ContainerType {#containertype}
|
|
130
130
|
|
|
131
131
|
> `readonly` **ContainerType**: `"JsonLdContainerType"` = `"JsonLdContainerType"`
|
|
132
132
|
|
|
133
133
|
Represents JSON-LD Container Type.
|
|
134
134
|
|
|
135
|
-
### ContainerTypeArray
|
|
135
|
+
### ContainerTypeArray {#containertypearray}
|
|
136
136
|
|
|
137
137
|
> `readonly` **ContainerTypeArray**: `"JsonLdContainerTypeArray"` = `"JsonLdContainerTypeArray"`
|
|
138
138
|
|
|
139
139
|
Represents JSON-LD Container Type Array.
|
|
140
140
|
|
|
141
|
-
### JsonPrimitive
|
|
141
|
+
### JsonPrimitive {#jsonprimitive}
|
|
142
142
|
|
|
143
143
|
> `readonly` **JsonPrimitive**: `"JsonLdJsonPrimitive"` = `"JsonLdJsonPrimitive"`
|
|
144
144
|
|
|
145
145
|
Represents JSON-LD JSON Primitive.
|
|
146
146
|
|
|
147
|
-
### JsonArray
|
|
147
|
+
### JsonArray {#jsonarray}
|
|
148
148
|
|
|
149
149
|
> `readonly` **JsonArray**: `"JsonLdJsonArray"` = `"JsonLdJsonArray"`
|
|
150
150
|
|
|
151
151
|
Represents JSON-LD JSON Array.
|
|
152
152
|
|
|
153
|
-
### JsonObject
|
|
153
|
+
### JsonObject {#jsonobject}
|
|
154
154
|
|
|
155
155
|
> `readonly` **JsonObject**: `"JsonLdJsonObject"` = `"JsonLdJsonObject"`
|
|
156
156
|
|
|
157
157
|
Represents JSON-LD JSON Object.
|
|
158
158
|
|
|
159
|
-
### JsonValue
|
|
159
|
+
### JsonValue {#jsonvalue}
|
|
160
160
|
|
|
161
161
|
> `readonly` **JsonValue**: `"JsonLdJsonValue"` = `"JsonLdJsonValue"`
|
|
162
162
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@twin.org/data-json-ld",
|
|
3
|
-
"version": "0.0.3-next.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "0.0.3-next.20",
|
|
4
|
+
"description": "JSON-LD data models and helpers for working with linked data documents.",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "git+https://github.com/twinfoundation/data.git",
|
|
@@ -15,12 +15,12 @@
|
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@twin.org/core": "next",
|
|
18
|
-
"@twin.org/data-core": "0.0.3-next.
|
|
18
|
+
"@twin.org/data-core": "0.0.3-next.20",
|
|
19
19
|
"@twin.org/entity": "next",
|
|
20
20
|
"@twin.org/nameof": "next",
|
|
21
21
|
"@twin.org/web": "next",
|
|
22
22
|
"@types/jsonld": "1.5.15",
|
|
23
|
-
"jsonld": "
|
|
23
|
+
"jsonld": "9.0.0"
|
|
24
24
|
},
|
|
25
25
|
"main": "./dist/es/index.js",
|
|
26
26
|
"types": "./dist/types/index.d.ts",
|