@twin.org/data-json-ld 0.0.1-next.9 → 0.0.2-next.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 +173 -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 +6 -7
  66. package/docs/reference/type-aliases/IJsonLdKeyword.md +0 -105
@@ -3,101 +3,109 @@
3
3
  */
4
4
  export declare const JsonLdTypes: {
5
5
  /**
6
- * Context Root.
6
+ * Represents JSON-LD Document.
7
7
  */
8
- readonly ContextRoot: "https://schema.twindev.org/json-ld/";
8
+ readonly Document: "JsonLdDocument";
9
9
  /**
10
- * Represents JSON-LD Document.
10
+ * Represents JSON-LD Object.
11
11
  */
12
- readonly Document: "https://schema.twindev.org/json-ld/JsonLdDocument";
12
+ readonly Object: "JsonLdObject";
13
13
  /**
14
14
  * Represents JSON-LD Node Object.
15
15
  */
16
- readonly NodeObject: "https://schema.twindev.org/json-ld/JsonLdNodeObject";
16
+ readonly NodeObject: "JsonLdNodeObject";
17
17
  /**
18
18
  * Represents JSON-LD Node Primitive.
19
19
  */
20
- readonly NodePrimitive: "https://schema.twindev.org/json-ld/JsonLdNodePrimitive";
20
+ readonly NodePrimitive: "JsonLdNodePrimitive";
21
21
  /**
22
22
  * Represents JSON-LD Graph Object.
23
23
  */
24
- readonly GraphObject: "https://schema.twindev.org/json-ld/JsonLdGraphObject";
24
+ readonly GraphObject: "JsonLdGraphObject";
25
25
  /**
26
26
  * Represents JSON-LD Value Object.
27
27
  */
28
- readonly ValueObject: "https://schema.twindev.org/json-ld/JsonLdValueObject";
28
+ readonly ValueObject: "JsonLdValueObject";
29
29
  /**
30
30
  * Represents JSON-LD List Object.
31
31
  */
32
- readonly ListObject: "https://schema.twindev.org/json-ld/JsonLdListObject";
32
+ readonly ListObject: "JsonLdListObject";
33
33
  /**
34
34
  * Represents JSON-LD Set Object.
35
35
  */
36
- readonly SetObject: "https://schema.twindev.org/json-ld/JsonLdSetObject";
36
+ readonly SetObject: "JsonLdSetObject";
37
37
  /**
38
38
  * Represents JSON-LD Language Map.
39
39
  */
40
- readonly LanguageMap: "https://schema.twindev.org/json-ld/JsonLdLanguageMap";
40
+ readonly LanguageMap: "JsonLdLanguageMap";
41
41
  /**
42
42
  * Represents JSON-LD Index Map.
43
43
  */
44
- readonly IndexMap: "https://schema.twindev.org/json-ld/JsonLdIndexMap";
44
+ readonly IndexMap: "JsonLdIndexMap";
45
45
  /**
46
46
  * Represents JSON-LD Index Map Item.
47
47
  */
48
- readonly IndexMapItem: "https://schema.twindev.org/json-ld/JsonLdIndexMapItem";
48
+ readonly IndexMapItem: "JsonLdIndexMapItem";
49
49
  /**
50
50
  * Represents JSON-LD Id Map.
51
51
  */
52
- readonly IdMap: "https://schema.twindev.org/json-ld/JsonLdIdMap";
52
+ readonly IdMap: "JsonLdIdMap";
53
53
  /**
54
54
  * Represents JSON-LD Type Map.
55
55
  */
56
- readonly TypeMap: "https://schema.twindev.org/json-ld/JsonLdTypeMap";
56
+ readonly TypeMap: "JsonLdTypeMap";
57
57
  /**
58
58
  * Represents JSON-LD Included block.
59
59
  */
60
- readonly IncludedBlock: "https://schema.twindev.org/json-ld/JsonLdIncludedBlock";
60
+ readonly IncludedBlock: "JsonLdIncludedBlock";
61
61
  /**
62
62
  * Represents JSON-LD Context Definition.
63
63
  */
64
- readonly ContextDefinition: "https://schema.twindev.org/json-ld/JsonLdContextDefinition";
64
+ readonly ContextDefinition: "JsonLdContextDefinition";
65
+ /**
66
+ * Represents JSON-LD Context Definition Element.
67
+ */
68
+ readonly ContextDefinitionElement: "JsonLdContextDefinitionElement";
69
+ /**
70
+ * Represents JSON-LD Context Definition Root.
71
+ */
72
+ readonly ContextDefinitionRoot: "JsonLdContextDefinitionRoot";
65
73
  /**
66
74
  * Represents JSON-LD Expanded Term Definition.
67
75
  */
68
- readonly ExpandedTermDefinition: "https://schema.twindev.org/json-ld/JsonLdExpandedTermDefinition";
76
+ readonly ExpandedTermDefinition: "JsonLdExpandedTermDefinition";
69
77
  /**
70
78
  * Represents JSON-LD Keyword.
71
79
  */
72
- readonly Keyword: "https://schema.twindev.org/json-ld/JsonLdKeyword";
80
+ readonly Keyword: "JsonLdKeyword";
73
81
  /**
74
82
  * Represents JSON-LD List or Set Item.
75
83
  */
76
- readonly ListOrSetItem: "https://schema.twindev.org/json-ld/JsonLdListOrSetItem";
84
+ readonly ListOrSetItem: "JsonLdListOrSetItem";
77
85
  /**
78
86
  * Represents JSON-LD Container Type.
79
87
  */
80
- readonly ContainerType: "https://schema.twindev.org/json-ld/JsonLdContainerType";
88
+ readonly ContainerType: "JsonLdContainerType";
81
89
  /**
82
90
  * Represents JSON-LD Container Type Array.
83
91
  */
84
- readonly ContainerTypeArray: "https://schema.twindev.org/json-ld/JsonLdContainerTypeArray";
92
+ readonly ContainerTypeArray: "JsonLdContainerTypeArray";
85
93
  /**
86
94
  * Represents JSON-LD JSON Primitive.
87
95
  */
88
- readonly JsonPrimitive: "https://schema.twindev.org/json-ld/JsonLdJsonPrimitive";
96
+ readonly JsonPrimitive: "JsonLdJsonPrimitive";
89
97
  /**
90
98
  * Represents JSON-LD JSON Array.
91
99
  */
92
- readonly JsonArray: "https://schema.twindev.org/json-ld/JsonLdJsonArray";
100
+ readonly JsonArray: "JsonLdJsonArray";
93
101
  /**
94
102
  * Represents JSON-LD JSON Object.
95
103
  */
96
- readonly JsonObject: "https://schema.twindev.org/json-ld/JsonLdJsonObject";
104
+ readonly JsonObject: "JsonLdJsonObject";
97
105
  /**
98
106
  * Represents JSON-LD JSON Value.
99
107
  */
100
- readonly JsonValue: "https://schema.twindev.org/json-ld/JsonLdJsonValue";
108
+ readonly JsonValue: "JsonLdJsonValue";
101
109
  };
102
110
  /**
103
111
  * The types of JSON-LD data.
@@ -9,8 +9,13 @@ export declare class JsonLdHelper {
9
9
  * Validate a JSON-LD document.
10
10
  * @param document The JSON-LD document to validate.
11
11
  * @param validationFailures The list of validation failures to add to.
12
- * @param validationMode The validation mode to use, defaults to either.
12
+ * @param options Optional options for validation.
13
+ * @param options.failOnMissingType If true, will fail validation if the data type is missing, defaults to false.
14
+ * @param options.validationMode The validation mode to use, defaults to either.
13
15
  * @returns True if the document was valid.
14
16
  */
15
- static validate<T extends IJsonLdDocument = IJsonLdDocument>(document: T, validationFailures: IValidationFailure[], validationMode?: ValidationMode): Promise<boolean>;
17
+ static validate<T extends IJsonLdDocument = IJsonLdDocument>(document: T, validationFailures: IValidationFailure[], options?: {
18
+ validationMode?: ValidationMode;
19
+ failOnMissingType?: boolean;
20
+ }): Promise<boolean>;
16
21
  }
@@ -1,44 +1,80 @@
1
1
  import type { RemoteDocument, Url } from "jsonld/jsonld-spec";
2
- import type { IJsonLdContextDefinitionElement, IJsonLdContextDefinitionRoot, IJsonLdDocument, IJsonLdNodeObject } from "../models/IJsonLdDocument";
2
+ import type { IJsonLdContextDefinitionElement } from "../models/IJsonLdContextDefinitionElement";
3
+ import type { IJsonLdContextDefinitionRoot } from "../models/IJsonLdContextDefinitionRoot";
4
+ import type { IJsonLdNodeObject } from "../models/IJsonLdNodeObject";
3
5
  /**
4
6
  * JSON-LD Processor.
5
7
  */
6
8
  export declare class JsonLdProcessor {
7
9
  /**
8
- * Redirects to use during document resolution.
10
+ * The document loader to use.
11
+ * @param documentLoader The document loader to use.
9
12
  */
10
- private static readonly _redirects;
13
+ static setDocumentLoader(documentLoader: (url: Url) => Promise<RemoteDocument>): void;
11
14
  /**
12
- * The document loader to use.
15
+ * The document loader to use for retrieving JSON-LD documents.
16
+ * @returns The document loader.
17
+ */
18
+ static getDocumentLoader(): (url: Url) => Promise<RemoteDocument>;
19
+ /**
20
+ * Set the cache time limit for documents.
21
+ * @param cacheLimitMs The cache limit in milliseconds.
22
+ */
23
+ static setCacheLimit(cacheLimitMs: number): void;
24
+ /**
25
+ * Get the cache limit for documents.
26
+ * @returns The document loader.
27
+ */
28
+ static getCacheLimit(): number;
29
+ /**
30
+ * Set the global redirects for JSON-LD, use addRedirect for default handling.
31
+ * @param redirects The redirects to use.
32
+ */
33
+ static setRedirects(redirects: {
34
+ from: RegExp;
35
+ to: string;
36
+ }[]): void;
37
+ /**
38
+ * Get the global redirects for JSON-LD.
39
+ * @returns The registered redirects.
13
40
  */
14
- static DOCUMENT_LOADER: (url: Url) => Promise<RemoteDocument>;
41
+ static getRedirects(): {
42
+ from: RegExp;
43
+ to: string;
44
+ }[];
15
45
  /**
16
46
  * Compact a document according to a particular context.
17
47
  * @param document The JSON-LD document to compact.
18
- * @param context The context to compact the document to, if not provided will try and gather from the object.
48
+ * @param context The context to compact the document to, if not provided will use the one in the document.
49
+ * @param options The options for compacting the document.
50
+ * @param options.itemListOverride Whether to override the itemListElement context with a set, defaults to true.
19
51
  * @returns The compacted JSON-LD document.
20
52
  */
21
- static compact(document: IJsonLdDocument, context?: IJsonLdContextDefinitionRoot): Promise<IJsonLdDocument>;
53
+ static compact<T>(document: T, context?: IJsonLdContextDefinitionRoot, options?: {
54
+ itemListOverride: boolean;
55
+ }): Promise<T>;
22
56
  /**
23
57
  * Expand a document, removing its context.
24
58
  * @param compacted The compacted JSON-LD document to expand.
25
59
  * @returns The expanded JSON-LD document.
26
60
  */
27
- static expand(compacted: IJsonLdDocument): Promise<IJsonLdDocument>;
61
+ static expand<T>(compacted: T): Promise<IJsonLdNodeObject[]>;
62
+ /**
63
+ * Canonize a document.
64
+ * @param document The document to canonize.
65
+ * @param options The options for canonization.
66
+ * @param options.algorithm The algorithm to use for canonization, defaults to URDNA2015.
67
+ * @returns The canonized document.
68
+ */
69
+ static canonize<T extends IJsonLdNodeObject>(document: T, options?: {
70
+ algorithm?: "URDNA2015" | "URGNA2012" | undefined;
71
+ }): Promise<string>;
28
72
  /**
29
73
  * Add a redirect to use during document resolution.
30
74
  * @param from The URL to redirect from.
31
75
  * @param to The URL to redirect to.
32
76
  */
33
77
  static addRedirect(from: RegExp, to: string): void;
34
- /**
35
- * Extract a property from the JSON-LD.
36
- * @param nodeObject The JSON-LD node object to extract from.
37
- * @param propertyNames The possible names for the property.
38
- * @param deleteProperty Delete the property from the object, defaults to true.
39
- * @returns The properties if available.
40
- */
41
- static extractProperty<T>(nodeObject: IJsonLdNodeObject, propertyNames: string[], deleteProperty?: boolean): T | undefined;
42
78
  /**
43
79
  * Combine contexts.
44
80
  * @param context1 The first JSON-LD context to combine.
@@ -52,9 +88,7 @@ export declare class JsonLdProcessor {
52
88
  * @param initial The initial context.
53
89
  * @returns The combined contexts.
54
90
  */
55
- static gatherContexts(element: {
56
- [id: string]: unknown;
57
- }, initial?: IJsonLdContextDefinitionRoot): IJsonLdContextDefinitionRoot | undefined;
91
+ static gatherContexts<T>(element: T, initial?: IJsonLdContextDefinitionRoot): IJsonLdContextDefinitionRoot | undefined;
58
92
  /**
59
93
  * Remove all the contexts that match the pattern.
60
94
  * @param context The context to remove the entries from.
@@ -62,4 +96,17 @@ export declare class JsonLdProcessor {
62
96
  * @returns The updated contexts.
63
97
  */
64
98
  static removeContexts(context: IJsonLdContextDefinitionRoot | undefined, match?: IJsonLdContextDefinitionElement[]): IJsonLdContextDefinitionRoot | undefined;
99
+ /**
100
+ * Add a context directly to the document loader cache.
101
+ * @param url The url the ld context is for.
102
+ * @param ldContext The context to add.
103
+ * @returns Nothing.
104
+ */
105
+ static documentCacheAdd(url: string, ldContext: unknown): Promise<void>;
106
+ /**
107
+ * Remove a context from the document loader cache.
108
+ * @param url The url the ld context is for.
109
+ * @returns Nothing.
110
+ */
111
+ static documentCacheRemove(url: string): Promise<void>;
65
112
  }
package/docs/changelog.md CHANGED
@@ -1,5 +1,177 @@
1
1
  # @twin.org/data-json-ld - Changelog
2
2
 
3
- ## v0.0.1-next.9
3
+ ## [0.0.2-next.1](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.2-next.0...data-json-ld-v0.0.2-next.1) (2025-08-19)
4
+
5
+
6
+ ### Features
7
+
8
+ * add document cache access methods ([dbf1e36](https://github.com/twinfoundation/data/commit/dbf1e36d176c5f428f8c52628fb5a1ff7a6a174a))
9
+ * add fail on missing type option and both mode ([e8b9702](https://github.com/twinfoundation/data/commit/e8b97029a04b646497ff0e55b9610291e58ae92a))
10
+ * expand Json LD Keyword ([70632d1](https://github.com/twinfoundation/data/commit/70632d1e11ad85cf3c57e118476b125a673f1681))
11
+ * support multiple type JSON-LD ([8f0d530](https://github.com/twinfoundation/data/commit/8f0d530f66302ab19413ecf968f170f97456e31e))
12
+ * update framework core ([c077b8c](https://github.com/twinfoundation/data/commit/c077b8c07e7ee66b5482254eab6f2a52cd911270))
13
+ * update ts-to-schema ([8c3cd91](https://github.com/twinfoundation/data/commit/8c3cd9131113f2d609f6e709562402e5c7766c1a))
14
+ * use fully qualified names for data type lookups ([b7b5c74](https://github.com/twinfoundation/data/commit/b7b5c746b0180a87baa976f6a7a76cedd53d8ff7))
15
+ * use shared store mechanism ([#3](https://github.com/twinfoundation/data/issues/3)) ([33eb221](https://github.com/twinfoundation/data/commit/33eb221ccec2b4a79549c06e9a04225009b93a46))
16
+ * use updated JSON schema specs ([465223a](https://github.com/twinfoundation/data/commit/465223a9e9c24af546480ef084327a78fa366eaa))
17
+
18
+
19
+ ### Bug Fixes
20
+
21
+ * itemListElement compaction override ([d908a10](https://github.com/twinfoundation/data/commit/d908a1043d7792e31b3101221d17850757b6c2a6))
22
+
23
+
24
+ ### Dependencies
25
+
26
+ * The following workspace dependencies were updated
27
+ * dependencies
28
+ * @twin.org/data-core bumped from 0.0.2-next.0 to 0.0.2-next.1
29
+
30
+ ## 0.0.1 (2025-07-03)
31
+
32
+
33
+ ### Features
34
+
35
+ * add document cache access methods ([dbf1e36](https://github.com/twinfoundation/data/commit/dbf1e36d176c5f428f8c52628fb5a1ff7a6a174a))
36
+ * add fail on missing type option and both mode ([e8b9702](https://github.com/twinfoundation/data/commit/e8b97029a04b646497ff0e55b9610291e58ae92a))
37
+ * expand Json LD Keyword ([70632d1](https://github.com/twinfoundation/data/commit/70632d1e11ad85cf3c57e118476b125a673f1681))
38
+ * support multiple type JSON-LD ([8f0d530](https://github.com/twinfoundation/data/commit/8f0d530f66302ab19413ecf968f170f97456e31e))
39
+ * update ts-to-schema ([8c3cd91](https://github.com/twinfoundation/data/commit/8c3cd9131113f2d609f6e709562402e5c7766c1a))
40
+ * use fully qualified names for data type lookups ([b7b5c74](https://github.com/twinfoundation/data/commit/b7b5c746b0180a87baa976f6a7a76cedd53d8ff7))
41
+ * use shared store mechanism ([#3](https://github.com/twinfoundation/data/issues/3)) ([33eb221](https://github.com/twinfoundation/data/commit/33eb221ccec2b4a79549c06e9a04225009b93a46))
42
+ * use updated JSON schema specs ([465223a](https://github.com/twinfoundation/data/commit/465223a9e9c24af546480ef084327a78fa366eaa))
43
+
44
+
45
+ ### Bug Fixes
46
+
47
+ * itemListElement compaction override ([d908a10](https://github.com/twinfoundation/data/commit/d908a1043d7792e31b3101221d17850757b6c2a6))
48
+
49
+ ## [0.0.1-next.37](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.1-next.36...data-json-ld-v0.0.1-next.37) (2025-06-11)
50
+
51
+
52
+ ### Features
53
+
54
+ * use updated JSON schema specs ([465223a](https://github.com/twinfoundation/data/commit/465223a9e9c24af546480ef084327a78fa366eaa))
55
+
56
+
57
+ ### Dependencies
58
+
59
+ * The following workspace dependencies were updated
60
+ * dependencies
61
+ * @twin.org/data-core bumped from 0.0.1-next.36 to 0.0.1-next.37
62
+
63
+ ## [0.0.1-next.36](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.1-next.35...data-json-ld-v0.0.1-next.36) (2025-06-10)
64
+
65
+
66
+ ### Features
67
+
68
+ * expand Json LD Keyword ([70632d1](https://github.com/twinfoundation/data/commit/70632d1e11ad85cf3c57e118476b125a673f1681))
69
+
70
+
71
+ ### Dependencies
72
+
73
+ * The following workspace dependencies were updated
74
+ * dependencies
75
+ * @twin.org/data-core bumped from 0.0.1-next.35 to 0.0.1-next.36
76
+
77
+ ## [0.0.1-next.35](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.1-next.34...data-json-ld-v0.0.1-next.35) (2025-06-03)
78
+
79
+
80
+ ### Features
81
+
82
+ * update ts-to-schema ([8c3cd91](https://github.com/twinfoundation/data/commit/8c3cd9131113f2d609f6e709562402e5c7766c1a))
83
+
84
+
85
+ ### Dependencies
86
+
87
+ * The following workspace dependencies were updated
88
+ * dependencies
89
+ * @twin.org/data-core bumped from 0.0.1-next.34 to 0.0.1-next.35
90
+
91
+ ## [0.0.1-next.34](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.1-next.33...data-json-ld-v0.0.1-next.34) (2025-06-02)
92
+
93
+
94
+ ### Features
95
+
96
+ * support multiple type JSON-LD ([8f0d530](https://github.com/twinfoundation/data/commit/8f0d530f66302ab19413ecf968f170f97456e31e))
97
+
98
+
99
+ ### Dependencies
100
+
101
+ * The following workspace dependencies were updated
102
+ * dependencies
103
+ * @twin.org/data-core bumped from 0.0.1-next.33 to 0.0.1-next.34
104
+
105
+ ## [0.0.1-next.33](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.1-next.32...data-json-ld-v0.0.1-next.33) (2025-06-02)
106
+
107
+
108
+ ### Features
109
+
110
+ * add fail on missing type option and both mode ([e8b9702](https://github.com/twinfoundation/data/commit/e8b97029a04b646497ff0e55b9610291e58ae92a))
111
+
112
+
113
+ ### Dependencies
114
+
115
+ * The following workspace dependencies were updated
116
+ * dependencies
117
+ * @twin.org/data-core bumped from 0.0.1-next.32 to 0.0.1-next.33
118
+
119
+ ## [0.0.1-next.32](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.1-next.31...data-json-ld-v0.0.1-next.32) (2025-05-28)
120
+
121
+
122
+ ### Features
123
+
124
+ * use fully qualified names for data type lookups ([b7b5c74](https://github.com/twinfoundation/data/commit/b7b5c746b0180a87baa976f6a7a76cedd53d8ff7))
125
+
126
+
127
+ ### Dependencies
128
+
129
+ * The following workspace dependencies were updated
130
+ * dependencies
131
+ * @twin.org/data-core bumped from 0.0.1-next.31 to 0.0.1-next.32
132
+
133
+ ## [0.0.1-next.31](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.1-next.30...data-json-ld-v0.0.1-next.31) (2025-05-08)
134
+
135
+
136
+ ### Bug Fixes
137
+
138
+ * itemListElement compaction override ([d908a10](https://github.com/twinfoundation/data/commit/d908a1043d7792e31b3101221d17850757b6c2a6))
139
+
140
+
141
+ ### Dependencies
142
+
143
+ * The following workspace dependencies were updated
144
+ * dependencies
145
+ * @twin.org/data-core bumped from 0.0.1-next.30 to 0.0.1-next.31
146
+
147
+ ## [0.0.1-next.30](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.1-next.29...data-json-ld-v0.0.1-next.30) (2025-04-17)
148
+
149
+
150
+ ### Features
151
+
152
+ * use shared store mechanism ([#3](https://github.com/twinfoundation/data/issues/3)) ([33eb221](https://github.com/twinfoundation/data/commit/33eb221ccec2b4a79549c06e9a04225009b93a46))
153
+
154
+
155
+ ### Dependencies
156
+
157
+ * The following workspace dependencies were updated
158
+ * dependencies
159
+ * @twin.org/data-core bumped from 0.0.1-next.29 to 0.0.1-next.30
160
+
161
+ ## [0.0.1-next.29](https://github.com/twinfoundation/data/compare/data-json-ld-v0.0.1-next.28...data-json-ld-v0.0.1-next.29) (2025-03-28)
162
+
163
+
164
+ ### Features
165
+
166
+ * add document cache access methods ([dbf1e36](https://github.com/twinfoundation/data/commit/dbf1e36d176c5f428f8c52628fb5a1ff7a6a174a))
167
+
168
+
169
+ ### Dependencies
170
+
171
+ * The following workspace dependencies were updated
172
+ * dependencies
173
+ * @twin.org/data-core bumped from 0.0.1-next.28 to 0.0.1-next.29
174
+
175
+ ## v0.0.1-next.28
4
176
 
5
177
  - Initial Release
@@ -4,13 +4,13 @@ Handle all the data types for JSON-LD.
4
4
 
5
5
  ## Constructors
6
6
 
7
- ### new JsonLdDataTypes()
7
+ ### Constructor
8
8
 
9
- > **new JsonLdDataTypes**(): [`JsonLdDataTypes`](JsonLdDataTypes.md)
9
+ > **new JsonLdDataTypes**(): `JsonLdDataTypes`
10
10
 
11
11
  #### Returns
12
12
 
13
- [`JsonLdDataTypes`](JsonLdDataTypes.md)
13
+ `JsonLdDataTypes`
14
14
 
15
15
  ## Methods
16
16
 
@@ -4,40 +4,58 @@ Class to help with JSON LD.
4
4
 
5
5
  ## Constructors
6
6
 
7
- ### new JsonLdHelper()
7
+ ### Constructor
8
8
 
9
- > **new JsonLdHelper**(): [`JsonLdHelper`](JsonLdHelper.md)
9
+ > **new JsonLdHelper**(): `JsonLdHelper`
10
10
 
11
11
  #### Returns
12
12
 
13
- [`JsonLdHelper`](JsonLdHelper.md)
13
+ `JsonLdHelper`
14
14
 
15
15
  ## Methods
16
16
 
17
17
  ### validate()
18
18
 
19
- > `static` **validate**\<`T`\>(`document`, `validationFailures`, `validationMode`?): `Promise`\<`boolean`\>
19
+ > `static` **validate**\<`T`\>(`document`, `validationFailures`, `options?`): `Promise`\<`boolean`\>
20
20
 
21
21
  Validate a JSON-LD document.
22
22
 
23
23
  #### Type Parameters
24
24
 
25
- **T** *extends* [`IJsonLdDocument`](../type-aliases/IJsonLdDocument.md) = [`IJsonLdDocument`](../type-aliases/IJsonLdDocument.md)
25
+ ##### T
26
+
27
+ `T` *extends* [`IJsonLdDocument`](../type-aliases/IJsonLdDocument.md) = [`IJsonLdDocument`](../type-aliases/IJsonLdDocument.md)
26
28
 
27
29
  #### Parameters
28
30
 
29
- **document**: `T`
31
+ ##### document
32
+
33
+ `T`
30
34
 
31
35
  The JSON-LD document to validate.
32
36
 
33
- **validationFailures**: `IValidationFailure`[]
37
+ ##### validationFailures
38
+
39
+ `IValidationFailure`[]
34
40
 
35
41
  The list of validation failures to add to.
36
42
 
37
- **validationMode?**: `ValidationMode`
43
+ ##### options?
44
+
45
+ Optional options for validation.
46
+
47
+ ###### validationMode?
48
+
49
+ `ValidationMode`
38
50
 
39
51
  The validation mode to use, defaults to either.
40
52
 
53
+ ###### failOnMissingType?
54
+
55
+ `boolean`
56
+
57
+ If true, will fail validation if the data type is missing, defaults to false.
58
+
41
59
  #### Returns
42
60
 
43
61
  `Promise`\<`boolean`\>