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

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 (67) hide show
  1. package/dist/cjs/index.cjs +631 -351
  2. package/dist/esm/index.mjs +633 -354
  3. package/dist/types/index.d.ts +26 -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 +25 -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 +2 -189
  10. package/dist/types/models/IJsonLdExpandedTermDefinition.d.ts +28 -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/IJsonLdKeyword.d.ts +42 -0
  21. package/dist/types/models/IJsonLdLanguageMap.d.ts +11 -0
  22. package/dist/types/models/IJsonLdListObject.d.ts +13 -0
  23. package/dist/types/models/IJsonLdListOrSetItem.d.ts +10 -0
  24. package/dist/types/models/IJsonLdNodeObject.d.ts +19 -0
  25. package/dist/types/models/IJsonLdNodePrimitive.d.ts +13 -0
  26. package/dist/types/models/IJsonLdObject.d.ts +24 -0
  27. package/dist/types/models/IJsonLdSetObject.d.ts +13 -0
  28. package/dist/types/models/IJsonLdTypeMap.d.ts +12 -0
  29. package/dist/types/models/IJsonLdValueObject.d.ts +26 -0
  30. package/dist/types/models/jsonLdContexts.d.ts +13 -0
  31. package/dist/types/models/jsonLdTypes.d.ts +27 -23
  32. package/dist/types/utils/jsonLdProcessor.d.ts +86 -8
  33. package/docs/changelog.md +43 -1
  34. package/docs/reference/classes/JsonLdDataTypes.md +3 -3
  35. package/docs/reference/classes/JsonLdHelper.md +16 -8
  36. package/docs/reference/classes/JsonLdProcessor.md +322 -16
  37. package/docs/reference/index.md +20 -15
  38. package/docs/reference/interfaces/IJsonLdContextDefinition.md +1 -1
  39. package/docs/reference/interfaces/IJsonLdGraphObject.md +1 -1
  40. package/docs/reference/interfaces/IJsonLdIdMap.md +1 -1
  41. package/docs/reference/interfaces/IJsonLdIndexMap.md +1 -1
  42. package/docs/reference/interfaces/IJsonLdJsonObject.md +3 -1
  43. package/docs/reference/interfaces/IJsonLdLanguageMap.md +1 -1
  44. package/docs/reference/interfaces/IJsonLdNodeObject.md +40 -4
  45. package/docs/reference/interfaces/IJsonLdObject.md +64 -0
  46. package/docs/reference/interfaces/IJsonLdTypeMap.md +1 -1
  47. package/docs/reference/type-aliases/IJsonLdContainerType.md +3 -1
  48. package/docs/reference/type-aliases/IJsonLdContainerTypeArray.md +3 -1
  49. package/docs/reference/type-aliases/IJsonLdContextDefinitionElement.md +5 -0
  50. package/docs/reference/type-aliases/IJsonLdContextDefinitionRoot.md +5 -0
  51. package/docs/reference/type-aliases/IJsonLdDocument.md +1 -1
  52. package/docs/reference/type-aliases/IJsonLdExpandedTermDefinition.md +1 -1
  53. package/docs/reference/type-aliases/IJsonLdIncludedBlock.md +1 -1
  54. package/docs/reference/type-aliases/IJsonLdIndexMapItem.md +1 -1
  55. package/docs/reference/type-aliases/IJsonLdJsonArray.md +3 -1
  56. package/docs/reference/type-aliases/IJsonLdJsonPrimitive.md +3 -1
  57. package/docs/reference/type-aliases/IJsonLdJsonValue.md +3 -1
  58. package/docs/reference/type-aliases/IJsonLdKeyword.md +51 -7
  59. package/docs/reference/type-aliases/IJsonLdListOrSetItem.md +1 -1
  60. package/docs/reference/type-aliases/IJsonLdNodePrimitive.md +1 -1
  61. package/docs/reference/type-aliases/IJsonLdValueObject.md +1 -1
  62. package/docs/reference/type-aliases/JsonLdContexts.md +5 -0
  63. package/docs/reference/type-aliases/JsonLdTypes.md +1 -1
  64. package/docs/reference/variables/JsonLdContexts.md +13 -0
  65. package/docs/reference/variables/JsonLdTypes.md +29 -23
  66. package/locales/en.json +8 -3
  67. package/package.json +7 -37
@@ -1,5 +1,31 @@
1
1
  export * from "./dataTypes/jsonLdDataTypes";
2
+ export * from "./models/IJsonLdContainerType";
3
+ export * from "./models/IJsonLdContainerTypeArray";
4
+ export * from "./models/IJsonLdContextDefinition";
5
+ export * from "./models/IJsonLdContextDefinitionElement";
6
+ export * from "./models/IJsonLdContextDefinitionRoot";
2
7
  export * from "./models/IJsonLdDocument";
8
+ export * from "./models/IJsonLdExpandedTermDefinition";
9
+ export * from "./models/IJsonLdGraphObject";
10
+ export * from "./models/IJsonLdIdMap";
11
+ export * from "./models/IJsonLdIncludedBlock";
12
+ export * from "./models/IJsonLdIndexMap";
13
+ export * from "./models/IJsonLdIndexMapItem";
14
+ export * from "./models/IJsonLdJsonArray";
15
+ export * from "./models/IJsonLdJsonObject";
16
+ export * from "./models/IJsonLdJsonPrimitive";
17
+ export * from "./models/IJsonLdJsonValue";
18
+ export * from "./models/IJsonLdKeyword";
19
+ export * from "./models/IJsonLdLanguageMap";
20
+ export * from "./models/IJsonLdListObject";
21
+ export * from "./models/IJsonLdListOrSetItem";
22
+ export * from "./models/IJsonLdNodeObject";
23
+ export * from "./models/IJsonLdNodePrimitive";
24
+ export * from "./models/IJsonLdObject";
25
+ export * from "./models/IJsonLdSetObject";
26
+ export * from "./models/IJsonLdTypeMap";
27
+ export * from "./models/IJsonLdValueObject";
28
+ export * from "./models/jsonLdContexts";
3
29
  export * from "./models/jsonLdTypes";
4
30
  export * from "./utils/jsonLdHelper";
5
31
  export * from "./utils/jsonLdProcessor";
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
3
+ * that are used in other packages cannot understand some of the types e.g. OrArray
4
+ */
5
+ /**
6
+ * Helper Types
7
+ */
8
+ export type IJsonLdContainerType = "@language" | "@index" | "@id" | "@graph" | "@type";
@@ -0,0 +1,9 @@
1
+ import type { IJsonLdContainerType } from "./IJsonLdContainerType";
2
+ /**
3
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
4
+ * that are used in other packages cannot understand some of the types e.g. OrArray
5
+ */
6
+ /**
7
+ * Helper Types.
8
+ */
9
+ export type 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, "@set"];
@@ -0,0 +1,25 @@
1
+ import type { IJsonLdExpandedTermDefinition } from "./IJsonLdExpandedTermDefinition";
2
+ import type { IJsonLdKeyword } from "./IJsonLdKeyword";
3
+ /**
4
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
5
+ * that are used in other packages cannot understand some of the types e.g. OrArray
6
+ */
7
+ /**
8
+ * A context definition defines a local context in a node object.
9
+ * @see https://www.w3.org/TR/json-ld11/#context-definitions
10
+ */
11
+ export interface IJsonLdContextDefinition {
12
+ [key: string]: null | string | IJsonLdExpandedTermDefinition | IJsonLdContextDefinition[keyof IJsonLdContextDefinition];
13
+ "@base"?: IJsonLdKeyword["@base"] | undefined;
14
+ "@direction"?: IJsonLdKeyword["@direction"] | undefined;
15
+ "@import"?: IJsonLdKeyword["@import"] | undefined;
16
+ "@language"?: IJsonLdKeyword["@language"] | undefined;
17
+ "@propagate"?: IJsonLdKeyword["@propagate"] | undefined;
18
+ "@protected"?: IJsonLdKeyword["@protected"] | undefined;
19
+ "@type"?: {
20
+ "@container": "@set";
21
+ "@protected"?: IJsonLdKeyword["@protected"] | undefined;
22
+ } | undefined;
23
+ "@version"?: IJsonLdKeyword["@version"] | undefined;
24
+ "@vocab"?: IJsonLdKeyword["@vocab"] | undefined;
25
+ }
@@ -0,0 +1,9 @@
1
+ import type { IJsonLdContextDefinition } from "./IJsonLdContextDefinition";
2
+ /**
3
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
4
+ * that are used in other packages cannot understand some of the types e.g. OrArray
5
+ */
6
+ /**
7
+ * A context definition element is used to define the types of a context definition.
8
+ */
9
+ export type IJsonLdContextDefinitionElement = null | string | IJsonLdContextDefinition;
@@ -0,0 +1,9 @@
1
+ import type { IJsonLdContextDefinitionElement } from "./IJsonLdContextDefinitionElement";
2
+ /**
3
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
4
+ * that are used in other packages cannot understand some of the types e.g. OrArray
5
+ */
6
+ /**
7
+ * A context definition root is used to define the root of a context definition.
8
+ */
9
+ export type IJsonLdContextDefinitionRoot = IJsonLdContextDefinitionElement | IJsonLdContextDefinitionElement[];
@@ -1,3 +1,5 @@
1
+ import type { IJsonLdKeyword } from "./IJsonLdKeyword";
2
+ import type { IJsonLdNodeObject } from "./IJsonLdNodeObject";
1
3
  /**
2
4
  * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
3
5
  * that are used in other packages cannot understand some of the types e.g. OrArray
@@ -16,192 +18,3 @@ export type IJsonLdDocument = IJsonLdNodeObject | IJsonLdNodeObject[] | {
16
18
  "@context"?: IJsonLdKeyword["@context"] | undefined;
17
19
  "@graph"?: IJsonLdKeyword["@graph"] | undefined;
18
20
  };
19
- /**
20
- * A node object represents zero or more properties of a node
21
- * in the graph serialized by the JSON-LD document.
22
- * @see https://www.w3.org/TR/json-ld11/#node-objects
23
- */
24
- export interface IJsonLdNodeObject {
25
- [key: string]: IJsonLdNodePrimitive | IJsonLdNodePrimitive[] | IJsonLdLanguageMap | IJsonLdIndexMap | IJsonLdIncludedBlock | IJsonLdIdMap | IJsonLdTypeMap | IJsonLdNodeObject[keyof IJsonLdNodeObject];
26
- "@context"?: IJsonLdKeyword["@context"] | undefined;
27
- "@id"?: IJsonLdKeyword["@id"] | undefined;
28
- "@included"?: IJsonLdKeyword["@included"] | undefined;
29
- "@graph"?: IJsonLdNodeObject | IJsonLdNodeObject[] | undefined;
30
- "@nest"?: IJsonLdJsonObject | IJsonLdJsonObject[] | undefined;
31
- "@type"?: IJsonLdKeyword["@type"] | IJsonLdKeyword["@type"][] | undefined;
32
- "@reverse"?: {
33
- [key: string]: IJsonLdKeyword["@reverse"];
34
- } | undefined;
35
- "@index"?: IJsonLdKeyword["@index"] | undefined;
36
- }
37
- /**
38
- * A node primitive is a JSON-LD value which is not one of the defined NodeObject properties.
39
- */
40
- export type IJsonLdNodePrimitive = null | boolean | number | string | IJsonLdNodeObject | IJsonLdGraphObject | IJsonLdValueObject | IJsonLdListObject | IJsonLdSetObject;
41
- /**
42
- * A graph object represents a named graph, which MAY include an explicit graph name.
43
- * @see https://www.w3.org/TR/json-ld11/#graph-objects
44
- */
45
- export interface IJsonLdGraphObject {
46
- "@graph": IJsonLdNodeObject | IJsonLdNodeObject[];
47
- "@index"?: IJsonLdKeyword["@index"] | undefined;
48
- "@id"?: IJsonLdKeyword["@id"] | undefined;
49
- "@context"?: IJsonLdKeyword["@context"] | undefined;
50
- }
51
- /**
52
- * A value object is used to explicitly associate a type or a language with a value
53
- * to create a typed value or a language-tagged string and possibly associate a base direction.
54
- * @see https://www.w3.org/TR/json-ld11/#value-objects
55
- */
56
- export type IJsonLdValueObject = {
57
- "@index"?: IJsonLdKeyword["@index"] | undefined;
58
- "@context"?: IJsonLdKeyword["@context"] | undefined;
59
- } & ({
60
- "@value": IJsonLdKeyword["@value"];
61
- "@language"?: IJsonLdKeyword["@language"] | undefined;
62
- "@direction"?: IJsonLdKeyword["@direction"] | undefined;
63
- } | {
64
- "@value": IJsonLdKeyword["@value"];
65
- "@type": IJsonLdKeyword["@type"];
66
- } | {
67
- "@value": IJsonLdKeyword["@value"] | IJsonLdJsonObject | IJsonLdJsonArray;
68
- "@type": "@json";
69
- });
70
- /**
71
- * A list represents an ordered set of values.
72
- * @see https://www.w3.org/TR/json-ld11/#lists-and-sets
73
- */
74
- export interface IJsonLdListObject {
75
- "@list": IJsonLdKeyword["@list"];
76
- "@index"?: IJsonLdKeyword["@index"] | undefined;
77
- }
78
- /**
79
- * A set represents an unordered set of values.
80
- * @see https://www.w3.org/TR/json-ld11/#lists-and-sets
81
- */
82
- export interface IJsonLdSetObject {
83
- "@set": IJsonLdKeyword["@set"];
84
- "@index"?: IJsonLdKeyword["@index"] | undefined;
85
- }
86
- /**
87
- * A language map is used to associate a language with a value in a way that allows easy programmatic access.
88
- * @see https://www.w3.org/TR/json-ld11/#language-maps
89
- */
90
- export interface IJsonLdLanguageMap {
91
- [key: string]: null | string | string[];
92
- }
93
- /**
94
- * An index map allows keys that have no semantic meaning, but should be preserved regardless,
95
- * to be used in JSON-LD documents.
96
- * @see https://www.w3.org/TR/json-ld11/#index-maps
97
- */
98
- export interface IJsonLdIndexMap {
99
- [key: string]: IJsonLdIndexMapItem | IJsonLdIndexMapItem[];
100
- }
101
- /**
102
- * The items that can be stored in an index map.
103
- */
104
- export type IJsonLdIndexMapItem = null | boolean | number | string | IJsonLdNodeObject | IJsonLdValueObject | IJsonLdListObject | IJsonLdSetObject;
105
- /**
106
- * An id map is used to associate an IRI with a value that allows easy programmatic access.
107
- * @see https://www.w3.org/TR/json-ld11/#id-maps
108
- */
109
- export interface IJsonLdIdMap {
110
- [key: string]: IJsonLdNodeObject;
111
- }
112
- /**
113
- * A type map is used to associate an IRI with a value that allows easy programmatic access.
114
- * @see https://www.w3.org/TR/json-ld11/#type-maps
115
- */
116
- export interface IJsonLdTypeMap {
117
- [key: string]: string | IJsonLdNodeObject;
118
- }
119
- /**
120
- * An included block is used to provide a set of node objects.
121
- * @see https://www.w3.org/TR/json-ld11/#included-blocks
122
- */
123
- export type IJsonLdIncludedBlock = IJsonLdNodeObject | IJsonLdNodeObject[];
124
- /**
125
- * A context definition defines a local context in a node object.
126
- * @see https://www.w3.org/TR/json-ld11/#context-definitions
127
- */
128
- export interface IJsonLdContextDefinition {
129
- [key: string]: null | string | IJsonLdExpandedTermDefinition | IJsonLdContextDefinition[keyof IJsonLdContextDefinition];
130
- "@base"?: IJsonLdKeyword["@base"] | undefined;
131
- "@direction"?: IJsonLdKeyword["@direction"] | undefined;
132
- "@import"?: IJsonLdKeyword["@import"] | undefined;
133
- "@language"?: IJsonLdKeyword["@language"] | undefined;
134
- "@propagate"?: IJsonLdKeyword["@propagate"] | undefined;
135
- "@protected"?: IJsonLdKeyword["@protected"] | undefined;
136
- "@type"?: {
137
- "@container": "@set";
138
- "@protected"?: IJsonLdKeyword["@protected"] | undefined;
139
- } | undefined;
140
- "@version"?: IJsonLdKeyword["@version"] | undefined;
141
- "@vocab"?: IJsonLdKeyword["@vocab"] | undefined;
142
- }
143
- /**
144
- * An expanded term definition is used to describe the mapping between a term
145
- * and its expanded identifier, as well as other properties of the value
146
- * associated with the term when it is used as key in a node object.
147
- * @see https://www.w3.org/TR/json-ld11/#expanded-term-definition
148
- */
149
- export type IJsonLdExpandedTermDefinition = {
150
- "@type"?: "@id" | "@json" | "@none" | "@vocab" | string | undefined;
151
- "@language"?: IJsonLdKeyword["@language"] | undefined;
152
- "@index"?: IJsonLdKeyword["@index"] | undefined;
153
- "@context"?: IJsonLdContextDefinition | undefined;
154
- "@prefix"?: IJsonLdKeyword["@prefix"] | undefined;
155
- "@propagate"?: IJsonLdKeyword["@propagate"] | undefined;
156
- "@protected"?: IJsonLdKeyword["@protected"] | undefined;
157
- } & ({
158
- "@id"?: IJsonLdKeyword["@id"] | null | undefined;
159
- "@nest"?: "@nest" | string | undefined;
160
- "@container"?: IJsonLdKeyword["@container"] | undefined;
161
- } | {
162
- "@reverse": IJsonLdKeyword["@reverse"];
163
- "@container"?: "@set" | "@index" | null | undefined;
164
- });
165
- /**
166
- * A list of keywords and their types.
167
- * Only used for internal reference; not an actual interface.
168
- * Not for export.
169
- * @see https://www.w3.org/TR/json-ld/#keywords
170
- */
171
- export type IJsonLdKeyword = {
172
- "@base": string | null;
173
- "@container": ("@list" | "@set" | IJsonLdContainerType) | ("@list" | "@set" | IJsonLdContainerType)[] | IJsonLdContainerTypeArray | null;
174
- "@context": null | string | IJsonLdContextDefinition | (null | string | IJsonLdContextDefinition)[];
175
- "@direction": "ltr" | "rtl" | null;
176
- "@graph": IJsonLdValueObject | IJsonLdNodeObject | (IJsonLdValueObject | IJsonLdNodeObject)[];
177
- "@id": string | string[];
178
- "@import": string;
179
- "@included": IJsonLdIncludedBlock;
180
- "@index": string;
181
- "@json": "@json";
182
- "@language": string;
183
- "@list": IJsonLdListOrSetItem | IJsonLdListOrSetItem[];
184
- "@nest": object;
185
- "@none": "@none";
186
- "@prefix": boolean;
187
- "@propagate": boolean;
188
- "@protected": boolean;
189
- "@reverse": string;
190
- "@set": IJsonLdListOrSetItem | IJsonLdListOrSetItem[];
191
- "@type": string;
192
- "@value": null | boolean | number | string;
193
- "@version": "1.1";
194
- "@vocab": string | null;
195
- };
196
- /**
197
- * A list or set item can be a null, boolean, number, string, node object, or value object.
198
- */
199
- export type IJsonLdListOrSetItem = null | boolean | number | string | IJsonLdNodeObject | IJsonLdValueObject;
200
- export type IJsonLdContainerType = "@language" | "@index" | "@id" | "@graph" | "@type";
201
- export type 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, "@set"];
202
- export type IJsonLdJsonPrimitive = string | number | boolean | null;
203
- export type IJsonLdJsonArray = IJsonLdJsonValue[];
204
- export interface IJsonLdJsonObject {
205
- [key: string]: IJsonLdJsonValue | undefined;
206
- }
207
- export type IJsonLdJsonValue = IJsonLdJsonPrimitive | IJsonLdJsonArray | IJsonLdJsonObject;
@@ -0,0 +1,28 @@
1
+ import type { IJsonLdContextDefinition } from "./IJsonLdContextDefinition";
2
+ import type { IJsonLdKeyword } from "./IJsonLdKeyword";
3
+ /**
4
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
5
+ * that are used in other packages cannot understand some of the types e.g. OrArray
6
+ */
7
+ /**
8
+ * An expanded term definition is used to describe the mapping between a term
9
+ * and its expanded identifier, as well as other properties of the value
10
+ * associated with the term when it is used as key in a node object.
11
+ * @see https://www.w3.org/TR/json-ld11/#expanded-term-definition
12
+ */
13
+ export type IJsonLdExpandedTermDefinition = {
14
+ "@type"?: "@id" | "@json" | "@none" | "@vocab" | string | undefined;
15
+ "@language"?: IJsonLdKeyword["@language"] | undefined;
16
+ "@index"?: IJsonLdKeyword["@index"] | undefined;
17
+ "@context"?: IJsonLdContextDefinition | undefined;
18
+ "@prefix"?: IJsonLdKeyword["@prefix"] | undefined;
19
+ "@propagate"?: IJsonLdKeyword["@propagate"] | undefined;
20
+ "@protected"?: IJsonLdKeyword["@protected"] | undefined;
21
+ } & ({
22
+ "@id"?: IJsonLdKeyword["@id"] | null | undefined;
23
+ "@nest"?: "@nest" | string | undefined;
24
+ "@container"?: IJsonLdKeyword["@container"] | undefined;
25
+ } | {
26
+ "@reverse": IJsonLdKeyword["@reverse"];
27
+ "@container"?: "@set" | "@index" | null | undefined;
28
+ });
@@ -0,0 +1,16 @@
1
+ import type { IJsonLdKeyword } from "./IJsonLdKeyword";
2
+ import type { IJsonLdNodeObject } from "./IJsonLdNodeObject";
3
+ /**
4
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
5
+ * that are used in other packages cannot understand some of the types e.g. OrArray
6
+ */
7
+ /**
8
+ * A graph object represents a named graph, which MAY include an explicit graph name.
9
+ * @see https://www.w3.org/TR/json-ld11/#graph-objects
10
+ */
11
+ export interface IJsonLdGraphObject {
12
+ "@graph": IJsonLdNodeObject | IJsonLdNodeObject[];
13
+ "@index"?: IJsonLdKeyword["@index"] | undefined;
14
+ "@id"?: IJsonLdKeyword["@id"] | undefined;
15
+ "@context"?: IJsonLdKeyword["@context"] | undefined;
16
+ }
@@ -0,0 +1,12 @@
1
+ import type { IJsonLdNodeObject } from "./IJsonLdNodeObject";
2
+ /**
3
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
4
+ * that are used in other packages cannot understand some of the types e.g. OrArray
5
+ */
6
+ /**
7
+ * An id map is used to associate an IRI with a value that allows easy programmatic access.
8
+ * @see https://www.w3.org/TR/json-ld11/#id-maps
9
+ */
10
+ export interface IJsonLdIdMap {
11
+ [key: string]: IJsonLdNodeObject;
12
+ }
@@ -0,0 +1,10 @@
1
+ import type { IJsonLdNodeObject } from "./IJsonLdNodeObject";
2
+ /**
3
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
4
+ * that are used in other packages cannot understand some of the types e.g. OrArray
5
+ */
6
+ /**
7
+ * An included block is used to provide a set of node objects.
8
+ * @see https://www.w3.org/TR/json-ld11/#included-blocks
9
+ */
10
+ export type IJsonLdIncludedBlock = IJsonLdNodeObject | IJsonLdNodeObject[];
@@ -0,0 +1,13 @@
1
+ import type { IJsonLdIndexMapItem } from "./IJsonLdIndexMapItem";
2
+ /**
3
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
4
+ * that are used in other packages cannot understand some of the types e.g. OrArray
5
+ */
6
+ /**
7
+ * An index map allows keys that have no semantic meaning, but should be preserved regardless,
8
+ * to be used in JSON-LD documents.
9
+ * @see https://www.w3.org/TR/json-ld11/#index-maps
10
+ */
11
+ export interface IJsonLdIndexMap {
12
+ [key: string]: IJsonLdIndexMapItem | IJsonLdIndexMapItem[];
13
+ }
@@ -0,0 +1,12 @@
1
+ import type { IJsonLdListObject } from "./IJsonLdListObject";
2
+ import type { IJsonLdNodeObject } from "./IJsonLdNodeObject";
3
+ import type { IJsonLdSetObject } from "./IJsonLdSetObject";
4
+ import type { IJsonLdValueObject } from "./IJsonLdValueObject";
5
+ /**
6
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
7
+ * that are used in other packages cannot understand some of the types e.g. OrArray
8
+ */
9
+ /**
10
+ * The items that can be stored in an index map.
11
+ */
12
+ export type IJsonLdIndexMapItem = null | boolean | number | string | IJsonLdNodeObject | IJsonLdValueObject | IJsonLdListObject | IJsonLdSetObject;
@@ -0,0 +1,9 @@
1
+ import type { IJsonLdJsonValue } from "./IJsonLdJsonValue";
2
+ /**
3
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
4
+ * that are used in other packages cannot understand some of the types e.g. OrArray
5
+ */
6
+ /**
7
+ * JSON Type for array.
8
+ */
9
+ export type IJsonLdJsonArray = IJsonLdJsonValue[];
@@ -0,0 +1,11 @@
1
+ import type { IJsonLdJsonValue } from "./IJsonLdJsonValue";
2
+ /**
3
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
4
+ * that are used in other packages cannot understand some of the types e.g. OrArray
5
+ */
6
+ /**
7
+ * JSON Type for object.
8
+ */
9
+ export interface IJsonLdJsonObject {
10
+ [key: string]: IJsonLdJsonValue | undefined;
11
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
3
+ * that are used in other packages cannot understand some of the types e.g. OrArray
4
+ */
5
+ /**
6
+ * JSON Primitive.
7
+ */
8
+ export type IJsonLdJsonPrimitive = string | number | boolean | null;
@@ -0,0 +1,11 @@
1
+ import type { IJsonLdJsonArray } from "./IJsonLdJsonArray";
2
+ import type { IJsonLdJsonObject } from "./IJsonLdJsonObject";
3
+ import type { IJsonLdJsonPrimitive } from "./IJsonLdJsonPrimitive";
4
+ /**
5
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
6
+ * that are used in other packages cannot understand some of the types e.g. OrArray
7
+ */
8
+ /**
9
+ * JSON Value.
10
+ */
11
+ export type IJsonLdJsonValue = IJsonLdJsonPrimitive | IJsonLdJsonArray | IJsonLdJsonObject;
@@ -0,0 +1,42 @@
1
+ import type { IJsonLdContainerType } from "./IJsonLdContainerType";
2
+ import type { IJsonLdContainerTypeArray } from "./IJsonLdContainerTypeArray";
3
+ import type { IJsonLdContextDefinitionRoot } from "./IJsonLdContextDefinitionRoot";
4
+ import type { IJsonLdIncludedBlock } from "./IJsonLdIncludedBlock";
5
+ import type { IJsonLdListOrSetItem } from "./IJsonLdListOrSetItem";
6
+ import type { IJsonLdNodeObject } from "./IJsonLdNodeObject";
7
+ import type { IJsonLdValueObject } from "./IJsonLdValueObject";
8
+ /**
9
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
10
+ * that are used in other packages cannot understand some of the types e.g. OrArray
11
+ */
12
+ /**
13
+ * A list of keywords and their types.
14
+ * Only used for internal reference; not an actual interface.
15
+ * Not for export.
16
+ * @see https://www.w3.org/TR/json-ld/#keywords
17
+ */
18
+ export type IJsonLdKeyword = {
19
+ "@base": string | null;
20
+ "@container": ("@list" | "@set" | IJsonLdContainerType) | ("@list" | "@set" | IJsonLdContainerType)[] | IJsonLdContainerTypeArray | null;
21
+ "@context": IJsonLdContextDefinitionRoot;
22
+ "@direction": "ltr" | "rtl" | null;
23
+ "@graph": IJsonLdValueObject | IJsonLdNodeObject | (IJsonLdValueObject | IJsonLdNodeObject)[];
24
+ "@id": string | string[];
25
+ "@import": string;
26
+ "@included": IJsonLdIncludedBlock;
27
+ "@index": string;
28
+ "@json": "@json";
29
+ "@language": string;
30
+ "@list": IJsonLdListOrSetItem | IJsonLdListOrSetItem[];
31
+ "@nest": object;
32
+ "@none": "@none";
33
+ "@prefix": boolean;
34
+ "@propagate": boolean;
35
+ "@protected": boolean;
36
+ "@reverse": string;
37
+ "@set": IJsonLdListOrSetItem | IJsonLdListOrSetItem[];
38
+ "@type": string;
39
+ "@value": null | boolean | number | string;
40
+ "@version": "1.1";
41
+ "@vocab": string | null;
42
+ };
@@ -0,0 +1,11 @@
1
+ /**
2
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
3
+ * that are used in other packages cannot understand some of the types e.g. OrArray
4
+ */
5
+ /**
6
+ * A language map is used to associate a language with a value in a way that allows easy programmatic access.
7
+ * @see https://www.w3.org/TR/json-ld11/#language-maps
8
+ */
9
+ export interface IJsonLdLanguageMap {
10
+ [key: string]: null | string | string[];
11
+ }
@@ -0,0 +1,13 @@
1
+ import type { IJsonLdKeyword } from "./IJsonLdKeyword";
2
+ /**
3
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
4
+ * that are used in other packages cannot understand some of the types e.g. OrArray
5
+ */
6
+ /**
7
+ * A list represents an ordered set of values.
8
+ * @see https://www.w3.org/TR/json-ld11/#lists-and-sets
9
+ */
10
+ export interface IJsonLdListObject {
11
+ "@list": IJsonLdKeyword["@list"];
12
+ "@index"?: IJsonLdKeyword["@index"] | undefined;
13
+ }
@@ -0,0 +1,10 @@
1
+ import type { IJsonLdNodeObject } from "./IJsonLdNodeObject";
2
+ import type { IJsonLdValueObject } from "./IJsonLdValueObject";
3
+ /**
4
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
5
+ * that are used in other packages cannot understand some of the types e.g. OrArray
6
+ */
7
+ /**
8
+ * A list or set item can be a null, boolean, number, string, node object, or value object.
9
+ */
10
+ export type IJsonLdListOrSetItem = null | boolean | number | string | IJsonLdNodeObject | IJsonLdValueObject;
@@ -0,0 +1,19 @@
1
+ import type { IJsonLdIdMap } from "./IJsonLdIdMap";
2
+ import type { IJsonLdIncludedBlock } from "./IJsonLdIncludedBlock";
3
+ import type { IJsonLdIndexMap } from "./IJsonLdIndexMap";
4
+ import type { IJsonLdLanguageMap } from "./IJsonLdLanguageMap";
5
+ import type { IJsonLdNodePrimitive } from "./IJsonLdNodePrimitive";
6
+ import type { IJsonLdObject } from "./IJsonLdObject";
7
+ import type { IJsonLdTypeMap } from "./IJsonLdTypeMap";
8
+ /**
9
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
10
+ * that are used in other packages cannot understand some of the types e.g. OrArray
11
+ */
12
+ /**
13
+ * A node object represents zero or more properties of a node
14
+ * in the graph serialized by the JSON-LD document.
15
+ * @see https://www.w3.org/TR/json-ld11/#node-objects
16
+ */
17
+ export interface IJsonLdNodeObject extends IJsonLdObject {
18
+ [key: string]: IJsonLdNodePrimitive | IJsonLdNodePrimitive[] | IJsonLdLanguageMap | IJsonLdIndexMap | IJsonLdIncludedBlock | IJsonLdIdMap | IJsonLdTypeMap | IJsonLdNodeObject[keyof IJsonLdNodeObject];
19
+ }
@@ -0,0 +1,13 @@
1
+ import type { IJsonLdGraphObject } from "./IJsonLdGraphObject";
2
+ import type { IJsonLdListObject } from "./IJsonLdListObject";
3
+ import type { IJsonLdNodeObject } from "./IJsonLdNodeObject";
4
+ import type { IJsonLdSetObject } from "./IJsonLdSetObject";
5
+ import type { IJsonLdValueObject } from "./IJsonLdValueObject";
6
+ /**
7
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
8
+ * that are used in other packages cannot understand some of the types e.g. OrArray
9
+ */
10
+ /**
11
+ * A node primitive is a JSON-LD value which is not one of the defined NodeObject properties.
12
+ */
13
+ export type IJsonLdNodePrimitive = null | boolean | number | string | IJsonLdNodeObject | IJsonLdGraphObject | IJsonLdValueObject | IJsonLdListObject | IJsonLdSetObject;
@@ -0,0 +1,24 @@
1
+ import type { IJsonLdJsonObject } from "./IJsonLdJsonObject";
2
+ import type { IJsonLdKeyword } from "./IJsonLdKeyword";
3
+ import type { IJsonLdNodeObject } from "./IJsonLdNodeObject";
4
+ /**
5
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
6
+ * that are used in other packages cannot understand some of the types e.g. OrArray
7
+ */
8
+ /**
9
+ * An object represents the pre-defined properties of the node object
10
+ * in the graph serialized by the JSON-LD document.
11
+ * @see https://www.w3.org/TR/json-ld11/#node-objects
12
+ */
13
+ export interface IJsonLdObject {
14
+ "@context"?: IJsonLdKeyword["@context"] | undefined;
15
+ "@id"?: IJsonLdKeyword["@id"] | undefined;
16
+ "@included"?: IJsonLdKeyword["@included"] | undefined;
17
+ "@graph"?: IJsonLdNodeObject | IJsonLdNodeObject[] | undefined;
18
+ "@nest"?: IJsonLdJsonObject | IJsonLdJsonObject[] | undefined;
19
+ "@type"?: IJsonLdKeyword["@type"] | IJsonLdKeyword["@type"][] | undefined;
20
+ "@reverse"?: {
21
+ [key: string]: IJsonLdKeyword["@reverse"];
22
+ } | undefined;
23
+ "@index"?: IJsonLdKeyword["@index"] | undefined;
24
+ }
@@ -0,0 +1,13 @@
1
+ import type { IJsonLdKeyword } from "./IJsonLdKeyword";
2
+ /**
3
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
4
+ * that are used in other packages cannot understand some of the types e.g. OrArray
5
+ */
6
+ /**
7
+ * A set represents an unordered set of values.
8
+ * @see https://www.w3.org/TR/json-ld11/#lists-and-sets
9
+ */
10
+ export interface IJsonLdSetObject {
11
+ "@set": IJsonLdKeyword["@set"];
12
+ "@index"?: IJsonLdKeyword["@index"] | undefined;
13
+ }
@@ -0,0 +1,12 @@
1
+ import type { IJsonLdNodeObject } from "./IJsonLdNodeObject";
2
+ /**
3
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
4
+ * that are used in other packages cannot understand some of the types e.g. OrArray
5
+ */
6
+ /**
7
+ * A type map is used to associate an IRI with a value that allows easy programmatic access.
8
+ * @see https://www.w3.org/TR/json-ld11/#type-maps
9
+ */
10
+ export interface IJsonLdTypeMap {
11
+ [key: string]: string | IJsonLdNodeObject;
12
+ }
@@ -0,0 +1,26 @@
1
+ import type { IJsonLdJsonArray } from "./IJsonLdJsonArray";
2
+ import type { IJsonLdJsonObject } from "./IJsonLdJsonObject";
3
+ import type { IJsonLdKeyword } from "./IJsonLdKeyword";
4
+ /**
5
+ * This is a copy of the types from the npm jsonld package. This is necessary as the JSON schema generators
6
+ * that are used in other packages cannot understand some of the types e.g. OrArray
7
+ */
8
+ /**
9
+ * A value object is used to explicitly associate a type or a language with a value
10
+ * to create a typed value or a language-tagged string and possibly associate a base direction.
11
+ * @see https://www.w3.org/TR/json-ld11/#value-objects
12
+ */
13
+ export type IJsonLdValueObject = {
14
+ "@index"?: IJsonLdKeyword["@index"] | undefined;
15
+ "@context"?: IJsonLdKeyword["@context"] | undefined;
16
+ } & ({
17
+ "@value": IJsonLdKeyword["@value"];
18
+ "@language"?: IJsonLdKeyword["@language"] | undefined;
19
+ "@direction"?: IJsonLdKeyword["@direction"] | undefined;
20
+ } | {
21
+ "@value": IJsonLdKeyword["@value"];
22
+ "@type": IJsonLdKeyword["@type"];
23
+ } | {
24
+ "@value": IJsonLdKeyword["@value"] | IJsonLdJsonObject | IJsonLdJsonArray;
25
+ "@type": "@json";
26
+ });