@3sixty/data-json-ld 0.0.0-stage → 0.20.0-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.
- package/LICENSE +201 -0
- package/README.md +24 -2
- package/dist/es/compiled/validators.js +3895 -0
- package/dist/es/compiled/validators.js.map +1 -0
- package/dist/es/dataTypes/jsonLdDataTypes.js +170 -0
- package/dist/es/dataTypes/jsonLdDataTypes.js.map +1 -0
- package/dist/es/helpers/jsonLdAliasKey.js +4 -0
- package/dist/es/helpers/jsonLdAliasKey.js.map +1 -0
- package/dist/es/helpers/jsonLdExistingProperty.js +4 -0
- package/dist/es/helpers/jsonLdExistingProperty.js.map +1 -0
- package/dist/es/helpers/jsonLdExistingPropertyEither.js +2 -0
- package/dist/es/helpers/jsonLdExistingPropertyEither.js.map +1 -0
- package/dist/es/helpers/jsonLdKeys.js +4 -0
- package/dist/es/helpers/jsonLdKeys.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithAliases.js +2 -0
- package/dist/es/helpers/jsonLdObjectWithAliases.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithAtId.js +2 -0
- package/dist/es/helpers/jsonLdObjectWithAtId.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithAtType.js +2 -0
- package/dist/es/helpers/jsonLdObjectWithAtType.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithContext.js +2 -0
- package/dist/es/helpers/jsonLdObjectWithContext.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithId.js +2 -0
- package/dist/es/helpers/jsonLdObjectWithId.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithNoAtId.js +4 -0
- package/dist/es/helpers/jsonLdObjectWithNoAtId.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithNoAtType.js +4 -0
- package/dist/es/helpers/jsonLdObjectWithNoAtType.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithNoContext.js +4 -0
- package/dist/es/helpers/jsonLdObjectWithNoContext.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithNoId.js +4 -0
- package/dist/es/helpers/jsonLdObjectWithNoId.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithNoType.js +4 -0
- package/dist/es/helpers/jsonLdObjectWithNoType.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithOptionalAtId.js +2 -0
- package/dist/es/helpers/jsonLdObjectWithOptionalAtId.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithOptionalAtType.js +2 -0
- package/dist/es/helpers/jsonLdObjectWithOptionalAtType.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithOptionalContext.js +2 -0
- package/dist/es/helpers/jsonLdObjectWithOptionalContext.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithOptionalId.js +2 -0
- package/dist/es/helpers/jsonLdObjectWithOptionalId.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithOptionalType.js +2 -0
- package/dist/es/helpers/jsonLdObjectWithOptionalType.js.map +1 -0
- package/dist/es/helpers/jsonLdObjectWithType.js +2 -0
- package/dist/es/helpers/jsonLdObjectWithType.js.map +1 -0
- package/dist/es/helpers/jsonLdOptionalKeys.js +4 -0
- package/dist/es/helpers/jsonLdOptionalKeys.js.map +1 -0
- package/dist/es/helpers/jsonLdRequiredKeys.js +2 -0
- package/dist/es/helpers/jsonLdRequiredKeys.js.map +1 -0
- package/dist/es/helpers/jsonLdWithAliases.js +2 -0
- package/dist/es/helpers/jsonLdWithAliases.js.map +1 -0
- package/dist/es/index.js +57 -0
- package/dist/es/index.js.map +1 -0
- package/dist/es/models/IJsonLdContainerType.js +4 -0
- package/dist/es/models/IJsonLdContainerType.js.map +1 -0
- package/dist/es/models/IJsonLdContainerTypeArray.js +2 -0
- package/dist/es/models/IJsonLdContainerTypeArray.js.map +1 -0
- package/dist/es/models/IJsonLdContextDefinition.js +2 -0
- package/dist/es/models/IJsonLdContextDefinition.js.map +1 -0
- package/dist/es/models/IJsonLdContextDefinitionElement.js +2 -0
- package/dist/es/models/IJsonLdContextDefinitionElement.js.map +1 -0
- package/dist/es/models/IJsonLdContextDefinitionRoot.js +2 -0
- package/dist/es/models/IJsonLdContextDefinitionRoot.js.map +1 -0
- package/dist/es/models/IJsonLdDocument.js +2 -0
- package/dist/es/models/IJsonLdDocument.js.map +1 -0
- package/dist/es/models/IJsonLdExpandedTermDefinition.js +2 -0
- package/dist/es/models/IJsonLdExpandedTermDefinition.js.map +1 -0
- package/dist/es/models/IJsonLdGraphObject.js +2 -0
- package/dist/es/models/IJsonLdGraphObject.js.map +1 -0
- package/dist/es/models/IJsonLdIdMap.js +2 -0
- package/dist/es/models/IJsonLdIdMap.js.map +1 -0
- package/dist/es/models/IJsonLdIncludedBlock.js +2 -0
- package/dist/es/models/IJsonLdIncludedBlock.js.map +1 -0
- package/dist/es/models/IJsonLdIndexMap.js +2 -0
- package/dist/es/models/IJsonLdIndexMap.js.map +1 -0
- package/dist/es/models/IJsonLdIndexMapItem.js +2 -0
- package/dist/es/models/IJsonLdIndexMapItem.js.map +1 -0
- package/dist/es/models/IJsonLdJsonArray.js +2 -0
- package/dist/es/models/IJsonLdJsonArray.js.map +1 -0
- package/dist/es/models/IJsonLdJsonObject.js +2 -0
- package/dist/es/models/IJsonLdJsonObject.js.map +1 -0
- package/dist/es/models/IJsonLdJsonPrimitive.js +4 -0
- package/dist/es/models/IJsonLdJsonPrimitive.js.map +1 -0
- package/dist/es/models/IJsonLdJsonValue.js +2 -0
- package/dist/es/models/IJsonLdJsonValue.js.map +1 -0
- package/dist/es/models/IJsonLdLanguageMap.js +4 -0
- package/dist/es/models/IJsonLdLanguageMap.js.map +1 -0
- package/dist/es/models/IJsonLdListObject.js +2 -0
- package/dist/es/models/IJsonLdListObject.js.map +1 -0
- package/dist/es/models/IJsonLdListOrSetItem.js +2 -0
- package/dist/es/models/IJsonLdListOrSetItem.js.map +1 -0
- package/dist/es/models/IJsonLdNodeObject.js +2 -0
- package/dist/es/models/IJsonLdNodeObject.js.map +1 -0
- package/dist/es/models/IJsonLdNodePrimitive.js +2 -0
- package/dist/es/models/IJsonLdNodePrimitive.js.map +1 -0
- package/dist/es/models/IJsonLdObject.js +2 -0
- package/dist/es/models/IJsonLdObject.js.map +1 -0
- package/dist/es/models/IJsonLdSetObject.js +2 -0
- package/dist/es/models/IJsonLdSetObject.js.map +1 -0
- package/dist/es/models/IJsonLdTypeMap.js +2 -0
- package/dist/es/models/IJsonLdTypeMap.js.map +1 -0
- package/dist/es/models/IJsonLdValueObject.js +2 -0
- package/dist/es/models/IJsonLdValueObject.js.map +1 -0
- package/dist/es/models/jsonLdContexts.js +21 -0
- package/dist/es/models/jsonLdContexts.js.map +1 -0
- package/dist/es/models/jsonLdTypes.js +113 -0
- package/dist/es/models/jsonLdTypes.js.map +1 -0
- package/dist/es/schemas/JsonLdContainerType.json +23 -0
- package/dist/es/schemas/JsonLdContainerTypeArray.json +166 -0
- package/dist/es/schemas/JsonLdContextDefinition.json +134 -0
- package/dist/es/schemas/JsonLdContextDefinitionElement.json +17 -0
- package/dist/es/schemas/JsonLdContextDefinitionRoot.json +17 -0
- package/dist/es/schemas/JsonLdDocument.json +48 -0
- package/dist/es/schemas/JsonLdExpandedTermDefinition.json +148 -0
- package/dist/es/schemas/JsonLdGraphObject.json +44 -0
- package/dist/es/schemas/JsonLdIdMap.json +10 -0
- package/dist/es/schemas/JsonLdIncludedBlock.json +17 -0
- package/dist/es/schemas/JsonLdIndexMap.json +20 -0
- package/dist/es/schemas/JsonLdIndexMapItem.json +32 -0
- package/dist/es/schemas/JsonLdJsonArray.json +10 -0
- package/dist/es/schemas/JsonLdJsonObject.json +10 -0
- package/dist/es/schemas/JsonLdJsonPrimitive.json +20 -0
- package/dist/es/schemas/JsonLdJsonValue.json +17 -0
- package/dist/es/schemas/JsonLdLanguageMap.json +23 -0
- package/dist/es/schemas/JsonLdListObject.json +28 -0
- package/dist/es/schemas/JsonLdListOrSetItem.json +26 -0
- package/dist/es/schemas/JsonLdNodeObject.json +40 -0
- package/dist/es/schemas/JsonLdNodePrimitive.json +35 -0
- package/dist/es/schemas/JsonLdObject.json +76 -0
- package/dist/es/schemas/JsonLdSetObject.json +28 -0
- package/dist/es/schemas/JsonLdTypeMap.json +17 -0
- package/dist/es/schemas/JsonLdValueObject.json +125 -0
- package/dist/es/utils/jsonLdHelper.js +301 -0
- package/dist/es/utils/jsonLdHelper.js.map +1 -0
- package/dist/es/utils/jsonLdProcessor.js +507 -0
- package/dist/es/utils/jsonLdProcessor.js.map +1 -0
- package/dist/types/compiled/validators.d.ts +101 -0
- package/dist/types/dataTypes/jsonLdDataTypes.d.ts +9 -0
- package/dist/types/helpers/jsonLdAliasKey.d.ts +4 -0
- package/dist/types/helpers/jsonLdExistingProperty.d.ts +6 -0
- package/dist/types/helpers/jsonLdExistingPropertyEither.d.ts +6 -0
- package/dist/types/helpers/jsonLdKeys.d.ts +4 -0
- package/dist/types/helpers/jsonLdObjectWithAliases.d.ts +7 -0
- package/dist/types/helpers/jsonLdObjectWithAtId.d.ts +7 -0
- package/dist/types/helpers/jsonLdObjectWithAtType.d.ts +7 -0
- package/dist/types/helpers/jsonLdObjectWithContext.d.ts +7 -0
- package/dist/types/helpers/jsonLdObjectWithId.d.ts +7 -0
- package/dist/types/helpers/jsonLdObjectWithNoAtId.d.ts +4 -0
- package/dist/types/helpers/jsonLdObjectWithNoAtType.d.ts +4 -0
- package/dist/types/helpers/jsonLdObjectWithNoContext.d.ts +5 -0
- package/dist/types/helpers/jsonLdObjectWithNoId.d.ts +4 -0
- package/dist/types/helpers/jsonLdObjectWithNoType.d.ts +4 -0
- package/dist/types/helpers/jsonLdObjectWithOptionalAtId.d.ts +7 -0
- package/dist/types/helpers/jsonLdObjectWithOptionalAtType.d.ts +7 -0
- package/dist/types/helpers/jsonLdObjectWithOptionalContext.d.ts +9 -0
- package/dist/types/helpers/jsonLdObjectWithOptionalId.d.ts +7 -0
- package/dist/types/helpers/jsonLdObjectWithOptionalType.d.ts +7 -0
- package/dist/types/helpers/jsonLdObjectWithType.d.ts +7 -0
- package/dist/types/helpers/jsonLdOptionalKeys.d.ts +6 -0
- package/dist/types/helpers/jsonLdRequiredKeys.d.ts +5 -0
- package/dist/types/helpers/jsonLdWithAliases.d.ts +13 -0
- package/dist/types/index.d.ts +54 -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 +24 -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 +17 -0
- package/dist/types/models/IJsonLdExpandedTermDefinition.d.ts +29 -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/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 +25 -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/models/jsonLdContexts.d.ts +21 -0
- package/dist/types/models/jsonLdTypes.d.ts +113 -0
- package/dist/types/utils/jsonLdHelper.d.ts +97 -0
- package/dist/types/utils/jsonLdProcessor.d.ts +117 -0
- package/docs/changelog.md +15 -0
- package/docs/examples.md +214 -0
- package/docs/reference/classes/JsonLdDataTypes.md +25 -0
- package/docs/reference/classes/JsonLdHelper.md +371 -0
- package/docs/reference/classes/JsonLdProcessor.md +400 -0
- package/docs/reference/index.md +93 -0
- package/docs/reference/interfaces/IJsonLdContextDefinition.md +73 -0
- package/docs/reference/interfaces/IJsonLdGraphObject.md +31 -0
- package/docs/reference/interfaces/IJsonLdIdMap.md +11 -0
- package/docs/reference/interfaces/IJsonLdIndexMap.md +12 -0
- package/docs/reference/interfaces/IJsonLdJsonObject.md +7 -0
- package/docs/reference/interfaces/IJsonLdLanguageMap.md +11 -0
- package/docs/reference/interfaces/IJsonLdListObject.md +19 -0
- package/docs/reference/interfaces/IJsonLdNodeObject.md +100 -0
- package/docs/reference/interfaces/IJsonLdObject.md +64 -0
- package/docs/reference/interfaces/IJsonLdSetObject.md +19 -0
- package/docs/reference/interfaces/IJsonLdTypeMap.md +11 -0
- package/docs/reference/type-aliases/IJsonLdContainerType.md +5 -0
- package/docs/reference/type-aliases/IJsonLdContainerTypeArray.md +5 -0
- package/docs/reference/type-aliases/IJsonLdContextDefinitionElement.md +5 -0
- package/docs/reference/type-aliases/IJsonLdContextDefinitionRoot.md +5 -0
- package/docs/reference/type-aliases/IJsonLdDocument.md +11 -0
- package/docs/reference/type-aliases/IJsonLdExpandedTermDefinition.md +41 -0
- package/docs/reference/type-aliases/IJsonLdIncludedBlock.md +9 -0
- package/docs/reference/type-aliases/IJsonLdIndexMapItem.md +5 -0
- package/docs/reference/type-aliases/IJsonLdJsonArray.md +5 -0
- package/docs/reference/type-aliases/IJsonLdJsonPrimitive.md +5 -0
- package/docs/reference/type-aliases/IJsonLdJsonValue.md +5 -0
- package/docs/reference/type-aliases/IJsonLdListOrSetItem.md +5 -0
- package/docs/reference/type-aliases/IJsonLdNodePrimitive.md +5 -0
- package/docs/reference/type-aliases/IJsonLdValueObject.md +20 -0
- package/docs/reference/type-aliases/JsonLdAliasKey.md +15 -0
- package/docs/reference/type-aliases/JsonLdContexts.md +5 -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/JsonLdTypes.md +5 -0
- package/docs/reference/type-aliases/JsonLdWithAliases.md +17 -0
- package/docs/reference/variables/CompiledJsonLdContainerType.md +5 -0
- package/docs/reference/variables/CompiledJsonLdContainerTypeArray.md +5 -0
- package/docs/reference/variables/CompiledJsonLdContextDefinition.md +5 -0
- package/docs/reference/variables/CompiledJsonLdContextDefinitionElement.md +5 -0
- package/docs/reference/variables/CompiledJsonLdContextDefinitionRoot.md +5 -0
- package/docs/reference/variables/CompiledJsonLdDocument.md +5 -0
- package/docs/reference/variables/CompiledJsonLdExpandedTermDefinition.md +5 -0
- package/docs/reference/variables/CompiledJsonLdGraphObject.md +5 -0
- package/docs/reference/variables/CompiledJsonLdIdMap.md +5 -0
- package/docs/reference/variables/CompiledJsonLdIncludedBlock.md +5 -0
- package/docs/reference/variables/CompiledJsonLdIndexMap.md +5 -0
- package/docs/reference/variables/CompiledJsonLdIndexMapItem.md +5 -0
- package/docs/reference/variables/CompiledJsonLdJsonArray.md +5 -0
- package/docs/reference/variables/CompiledJsonLdJsonObject.md +5 -0
- package/docs/reference/variables/CompiledJsonLdJsonPrimitive.md +5 -0
- package/docs/reference/variables/CompiledJsonLdJsonValue.md +5 -0
- package/docs/reference/variables/CompiledJsonLdLanguageMap.md +5 -0
- package/docs/reference/variables/CompiledJsonLdListObject.md +5 -0
- package/docs/reference/variables/CompiledJsonLdListOrSetItem.md +5 -0
- package/docs/reference/variables/CompiledJsonLdNodeObject.md +5 -0
- package/docs/reference/variables/CompiledJsonLdNodePrimitive.md +5 -0
- package/docs/reference/variables/CompiledJsonLdObject.md +5 -0
- package/docs/reference/variables/CompiledJsonLdSetObject.md +5 -0
- package/docs/reference/variables/CompiledJsonLdTypeMap.md +5 -0
- package/docs/reference/variables/CompiledJsonLdValueObject.md +5 -0
- package/docs/reference/variables/JsonLdContexts.md +25 -0
- package/docs/reference/variables/JsonLdTypes.md +163 -0
- package/locales/.validate-ignore +1 -0
- package/locales/en.json +11 -0
- package/package.json +52 -5
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { IJsonLdIdMap } from "./IJsonLdIdMap.js";
|
|
2
|
+
import type { IJsonLdIncludedBlock } from "./IJsonLdIncludedBlock.js";
|
|
3
|
+
import type { IJsonLdIndexMap } from "./IJsonLdIndexMap.js";
|
|
4
|
+
import type { IJsonLdLanguageMap } from "./IJsonLdLanguageMap.js";
|
|
5
|
+
import type { IJsonLdNodePrimitive } from "./IJsonLdNodePrimitive.js";
|
|
6
|
+
import type { IJsonLdObject } from "./IJsonLdObject.js";
|
|
7
|
+
import type { IJsonLdTypeMap } from "./IJsonLdTypeMap.js";
|
|
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.js";
|
|
2
|
+
import type { IJsonLdListObject } from "./IJsonLdListObject.js";
|
|
3
|
+
import type { IJsonLdNodeObject } from "./IJsonLdNodeObject.js";
|
|
4
|
+
import type { IJsonLdSetObject } from "./IJsonLdSetObject.js";
|
|
5
|
+
import type { IJsonLdValueObject } from "./IJsonLdValueObject.js";
|
|
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,25 @@
|
|
|
1
|
+
import type { IJsonLdContextDefinitionRoot } from "./IJsonLdContextDefinitionRoot.js";
|
|
2
|
+
import type { IJsonLdIncludedBlock } from "./IJsonLdIncludedBlock.js";
|
|
3
|
+
import type { IJsonLdJsonObject } from "./IJsonLdJsonObject.js";
|
|
4
|
+
import type { IJsonLdNodeObject } from "./IJsonLdNodeObject.js";
|
|
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
|
+
* An object represents the pre-defined properties of the node object
|
|
11
|
+
* in the graph serialized by the JSON-LD document.
|
|
12
|
+
* @see https://www.w3.org/TR/json-ld11/#node-objects
|
|
13
|
+
*/
|
|
14
|
+
export interface IJsonLdObject {
|
|
15
|
+
"@context"?: IJsonLdContextDefinitionRoot | undefined;
|
|
16
|
+
"@id"?: string | string[] | undefined;
|
|
17
|
+
"@included"?: IJsonLdIncludedBlock | undefined;
|
|
18
|
+
"@graph"?: IJsonLdNodeObject | IJsonLdNodeObject[] | undefined;
|
|
19
|
+
"@nest"?: IJsonLdJsonObject | IJsonLdJsonObject[] | undefined;
|
|
20
|
+
"@type"?: string | string[] | undefined;
|
|
21
|
+
"@reverse"?: {
|
|
22
|
+
[key: string]: string;
|
|
23
|
+
} | undefined;
|
|
24
|
+
"@index"?: string | undefined;
|
|
25
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IJsonLdListOrSetItem } from "./IJsonLdListOrSetItem.js";
|
|
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": IJsonLdListOrSetItem | IJsonLdListOrSetItem[];
|
|
12
|
+
"@index"?: string | undefined;
|
|
13
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { IJsonLdNodeObject } from "./IJsonLdNodeObject.js";
|
|
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 { IJsonLdContextDefinitionRoot } from "./IJsonLdContextDefinitionRoot.js";
|
|
2
|
+
import type { IJsonLdJsonArray } from "./IJsonLdJsonArray.js";
|
|
3
|
+
import type { IJsonLdJsonObject } from "./IJsonLdJsonObject.js";
|
|
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"?: string | undefined;
|
|
15
|
+
"@context"?: IJsonLdContextDefinitionRoot | undefined;
|
|
16
|
+
} & ({
|
|
17
|
+
"@value": null | boolean | number | string;
|
|
18
|
+
"@language"?: string | undefined;
|
|
19
|
+
"@direction"?: "ltr" | "rtl" | null | undefined;
|
|
20
|
+
} | {
|
|
21
|
+
"@value": null | boolean | number | string;
|
|
22
|
+
"@type": string;
|
|
23
|
+
} | {
|
|
24
|
+
"@value": null | boolean | number | string | IJsonLdJsonObject | IJsonLdJsonArray;
|
|
25
|
+
"@type": "@json";
|
|
26
|
+
});
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The contexts of JSON-LD data.
|
|
3
|
+
*/
|
|
4
|
+
export declare const JsonLdContexts: {
|
|
5
|
+
/**
|
|
6
|
+
* The canonical RDF namespace URI for JSON-LD.
|
|
7
|
+
*/
|
|
8
|
+
readonly Namespace: "https://schema.3sixty.global/json-ld/";
|
|
9
|
+
/**
|
|
10
|
+
* The value to use in JSON-LD context for JSON-LD.
|
|
11
|
+
*/
|
|
12
|
+
readonly Context: "https://schema.3sixty.global/json-ld/";
|
|
13
|
+
/**
|
|
14
|
+
* The JSON-LD Context URL for JSON-LD.
|
|
15
|
+
*/
|
|
16
|
+
readonly JsonLdContext: "https://schema.3sixty.global/json-ld/types.jsonld";
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* The contexts of JSON-LD data.
|
|
20
|
+
*/
|
|
21
|
+
export type JsonLdContexts = (typeof JsonLdContexts)[keyof typeof JsonLdContexts];
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The types of JSON-LD data.
|
|
3
|
+
*/
|
|
4
|
+
export declare const JsonLdTypes: {
|
|
5
|
+
/**
|
|
6
|
+
* Represents JSON-LD Document.
|
|
7
|
+
*/
|
|
8
|
+
readonly Document: "JsonLdDocument";
|
|
9
|
+
/**
|
|
10
|
+
* Represents JSON-LD Object.
|
|
11
|
+
*/
|
|
12
|
+
readonly Object: "JsonLdObject";
|
|
13
|
+
/**
|
|
14
|
+
* Represents JSON-LD Node Object.
|
|
15
|
+
*/
|
|
16
|
+
readonly NodeObject: "JsonLdNodeObject";
|
|
17
|
+
/**
|
|
18
|
+
* Represents JSON-LD Node Primitive.
|
|
19
|
+
*/
|
|
20
|
+
readonly NodePrimitive: "JsonLdNodePrimitive";
|
|
21
|
+
/**
|
|
22
|
+
* Represents JSON-LD Graph Object.
|
|
23
|
+
*/
|
|
24
|
+
readonly GraphObject: "JsonLdGraphObject";
|
|
25
|
+
/**
|
|
26
|
+
* Represents JSON-LD Value Object.
|
|
27
|
+
*/
|
|
28
|
+
readonly ValueObject: "JsonLdValueObject";
|
|
29
|
+
/**
|
|
30
|
+
* Represents JSON-LD List Object.
|
|
31
|
+
*/
|
|
32
|
+
readonly ListObject: "JsonLdListObject";
|
|
33
|
+
/**
|
|
34
|
+
* Represents JSON-LD Set Object.
|
|
35
|
+
*/
|
|
36
|
+
readonly SetObject: "JsonLdSetObject";
|
|
37
|
+
/**
|
|
38
|
+
* Represents JSON-LD Language Map.
|
|
39
|
+
*/
|
|
40
|
+
readonly LanguageMap: "JsonLdLanguageMap";
|
|
41
|
+
/**
|
|
42
|
+
* Represents JSON-LD Index Map.
|
|
43
|
+
*/
|
|
44
|
+
readonly IndexMap: "JsonLdIndexMap";
|
|
45
|
+
/**
|
|
46
|
+
* Represents JSON-LD Index Map Item.
|
|
47
|
+
*/
|
|
48
|
+
readonly IndexMapItem: "JsonLdIndexMapItem";
|
|
49
|
+
/**
|
|
50
|
+
* Represents JSON-LD Id Map.
|
|
51
|
+
*/
|
|
52
|
+
readonly IdMap: "JsonLdIdMap";
|
|
53
|
+
/**
|
|
54
|
+
* Represents JSON-LD Type Map.
|
|
55
|
+
*/
|
|
56
|
+
readonly TypeMap: "JsonLdTypeMap";
|
|
57
|
+
/**
|
|
58
|
+
* Represents JSON-LD Included block.
|
|
59
|
+
*/
|
|
60
|
+
readonly IncludedBlock: "JsonLdIncludedBlock";
|
|
61
|
+
/**
|
|
62
|
+
* Represents JSON-LD Context Definition.
|
|
63
|
+
*/
|
|
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";
|
|
73
|
+
/**
|
|
74
|
+
* Represents JSON-LD Expanded Term Definition.
|
|
75
|
+
*/
|
|
76
|
+
readonly ExpandedTermDefinition: "JsonLdExpandedTermDefinition";
|
|
77
|
+
/**
|
|
78
|
+
* Represents JSON-LD Keyword.
|
|
79
|
+
*/
|
|
80
|
+
readonly Keyword: "JsonLdKeyword";
|
|
81
|
+
/**
|
|
82
|
+
* Represents JSON-LD List or Set Item.
|
|
83
|
+
*/
|
|
84
|
+
readonly ListOrSetItem: "JsonLdListOrSetItem";
|
|
85
|
+
/**
|
|
86
|
+
* Represents JSON-LD Container Type.
|
|
87
|
+
*/
|
|
88
|
+
readonly ContainerType: "JsonLdContainerType";
|
|
89
|
+
/**
|
|
90
|
+
* Represents JSON-LD Container Type Array.
|
|
91
|
+
*/
|
|
92
|
+
readonly ContainerTypeArray: "JsonLdContainerTypeArray";
|
|
93
|
+
/**
|
|
94
|
+
* Represents JSON-LD JSON Primitive.
|
|
95
|
+
*/
|
|
96
|
+
readonly JsonPrimitive: "JsonLdJsonPrimitive";
|
|
97
|
+
/**
|
|
98
|
+
* Represents JSON-LD JSON Array.
|
|
99
|
+
*/
|
|
100
|
+
readonly JsonArray: "JsonLdJsonArray";
|
|
101
|
+
/**
|
|
102
|
+
* Represents JSON-LD JSON Object.
|
|
103
|
+
*/
|
|
104
|
+
readonly JsonObject: "JsonLdJsonObject";
|
|
105
|
+
/**
|
|
106
|
+
* Represents JSON-LD JSON Value.
|
|
107
|
+
*/
|
|
108
|
+
readonly JsonValue: "JsonLdJsonValue";
|
|
109
|
+
};
|
|
110
|
+
/**
|
|
111
|
+
* The types of JSON-LD data.
|
|
112
|
+
*/
|
|
113
|
+
export type JsonLdTypes = (typeof JsonLdTypes)[keyof typeof JsonLdTypes];
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { type IValidationFailure } from "@3sixty/core";
|
|
2
|
+
import { type ValidationMode } from "@3sixty/data-core";
|
|
3
|
+
import type { IJsonLdDocument } from "../models/IJsonLdDocument.js";
|
|
4
|
+
import type { IJsonLdNodeObject } from "../models/IJsonLdNodeObject.js";
|
|
5
|
+
import type { IJsonLdNodePrimitive } from "../models/IJsonLdNodePrimitive.js";
|
|
6
|
+
/**
|
|
7
|
+
* Class to help with JSON LD.
|
|
8
|
+
*/
|
|
9
|
+
export declare class JsonLdHelper {
|
|
10
|
+
/**
|
|
11
|
+
* Validate a JSON-LD document.
|
|
12
|
+
* @param document The JSON-LD document to validate.
|
|
13
|
+
* @param validationFailures The list of validation failures to add to.
|
|
14
|
+
* @param options Optional options for validation.
|
|
15
|
+
* @param options.failOnMissingType If true, will fail validation if the data type is missing, defaults to false.
|
|
16
|
+
* @param options.validationMode The validation mode to use, defaults to either.
|
|
17
|
+
* @returns True if the document was valid.
|
|
18
|
+
*/
|
|
19
|
+
static validate<T extends IJsonLdDocument = IJsonLdDocument>(document: T, validationFailures: IValidationFailure[], options?: {
|
|
20
|
+
validationMode?: ValidationMode;
|
|
21
|
+
failOnMissingType?: boolean;
|
|
22
|
+
}): Promise<boolean>;
|
|
23
|
+
/**
|
|
24
|
+
* Convert an object to a JSON-LD node object.
|
|
25
|
+
* @param object The object to convert.
|
|
26
|
+
* @returns The JSON-LD node object.
|
|
27
|
+
*/
|
|
28
|
+
static toNodeObject<T = unknown>(object: T): T & IJsonLdNodeObject;
|
|
29
|
+
/**
|
|
30
|
+
* Convert the JSON-LD node object to a structured object.
|
|
31
|
+
* @param nodeObject The JSON-LD node object to convert.
|
|
32
|
+
* @returns The structured object.
|
|
33
|
+
*/
|
|
34
|
+
static toStructuredObject<T = unknown>(nodeObject: IJsonLdNodeObject): T;
|
|
35
|
+
/**
|
|
36
|
+
* Expand the JSON-LD document.
|
|
37
|
+
* @param document The JSON-LD document to expand.
|
|
38
|
+
* @returns The expanded JSON-LD document.
|
|
39
|
+
*/
|
|
40
|
+
static expand(document: IJsonLdDocument): Promise<IJsonLdNodeObject[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Expand the JSON-LD document and check if it is of a specific type.
|
|
43
|
+
* @param documentOrExpanded The JSON-LD document to check or already expanded document.
|
|
44
|
+
* @param type The type to check for.
|
|
45
|
+
* @returns True if the document is of the specified type.
|
|
46
|
+
*/
|
|
47
|
+
static isType(documentOrExpanded: IJsonLdDocument | IJsonLdNodeObject[], type: string[]): Promise<boolean>;
|
|
48
|
+
/**
|
|
49
|
+
* Get the types from the document.
|
|
50
|
+
* @param documentOrExpanded The JSON-LD document to check or already expanded document.
|
|
51
|
+
* @returns The type(s) extracted from the document.
|
|
52
|
+
*/
|
|
53
|
+
static getType(documentOrExpanded: IJsonLdDocument | IJsonLdNodeObject[]): Promise<string[]>;
|
|
54
|
+
/**
|
|
55
|
+
* Get the id from the document.
|
|
56
|
+
* @param documentOrExpanded The JSON-LD document to get the id from or already expanded document.
|
|
57
|
+
* @param additionalIdProperties Optional additional properties to check for the id, in addition to "@id" and "id".
|
|
58
|
+
* @returns The id extracted from the document.
|
|
59
|
+
*/
|
|
60
|
+
static getId(documentOrExpanded: IJsonLdDocument | IJsonLdNodeObject[], additionalIdProperties?: string[]): Promise<string | undefined>;
|
|
61
|
+
/**
|
|
62
|
+
* Get property values by a single full expanded property name.
|
|
63
|
+
* @param documentOrExpanded The JSON-LD document to get the property from or already expanded document.
|
|
64
|
+
* @param propertyFullName The full expanded property name.
|
|
65
|
+
* @param language Optional filter values by their language property.
|
|
66
|
+
* @returns Matching property values for the input property.
|
|
67
|
+
*/
|
|
68
|
+
static getPropertyValue(documentOrExpanded: IJsonLdDocument | IJsonLdNodeObject[], propertyFullName: string, language?: string): Promise<IJsonLdNodePrimitive[] | undefined>;
|
|
69
|
+
/**
|
|
70
|
+
* Get property values by their full expanded property names.
|
|
71
|
+
* @param documentOrExpanded The JSON-LD document to get the property from or already expanded document.
|
|
72
|
+
* @param propertyFullNames The full expanded property names.
|
|
73
|
+
* @param language Optional filter values by their language property.
|
|
74
|
+
* @returns Matching property values for each input property, in the same index order.
|
|
75
|
+
*/
|
|
76
|
+
static getPropertyValues(documentOrExpanded: IJsonLdDocument | IJsonLdNodeObject[], propertyFullNames: string[], language?: string): Promise<(IJsonLdNodePrimitive[] | undefined)[]>;
|
|
77
|
+
/**
|
|
78
|
+
* Prefix all properties in the document with the provided prefix, except for JSON-LD properties.
|
|
79
|
+
* This is useful for ensuring that all properties are fully qualified with a namespace.
|
|
80
|
+
* For example, if the prefix is "ex" and the document has a property "name", it will be transformed to "ex:name".
|
|
81
|
+
* @param nodeObject The JSON-LD node object to prefix properties on.
|
|
82
|
+
* @param prefix The prefix to add to the properties.
|
|
83
|
+
* @param properties Optional list of properties to prefix. If not provided, all properties except for JSON-LD properties.
|
|
84
|
+
* @returns A new JSON-LD node object with the properties prefixed.
|
|
85
|
+
*/
|
|
86
|
+
static prefixProperties<T extends IJsonLdNodeObject>(nodeObject: T, prefix: string, properties?: string[]): IJsonLdNodeObject;
|
|
87
|
+
/**
|
|
88
|
+
* Strip a prefix from properties in the document, except for JSON-LD properties.
|
|
89
|
+
* This is useful for converting fully qualified namespaced properties back to local names.
|
|
90
|
+
* For example, if the prefix is "ex" and the document has a property "ex:name", it will be transformed to "name".
|
|
91
|
+
* @param nodeObject The JSON-LD node object to strip prefixed properties from.
|
|
92
|
+
* @param prefix The prefix to remove from the properties.
|
|
93
|
+
* @param properties Optional list of unprefixed properties to strip. If not provided, all matching prefixed properties.
|
|
94
|
+
* @returns A new JSON-LD node object with the prefix stripped from matching properties.
|
|
95
|
+
*/
|
|
96
|
+
static stripPrefixProperties<T extends IJsonLdNodeObject>(nodeObject: T, prefix: string, properties?: string[]): IJsonLdNodeObject;
|
|
97
|
+
}
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
import type { RemoteDocument, Url } from "jsonld/jsonld-spec.js";
|
|
2
|
+
import type { IJsonLdContextDefinitionElement } from "../models/IJsonLdContextDefinitionElement.js";
|
|
3
|
+
import type { IJsonLdContextDefinitionRoot } from "../models/IJsonLdContextDefinitionRoot.js";
|
|
4
|
+
import type { IJsonLdNodeObject } from "../models/IJsonLdNodeObject.js";
|
|
5
|
+
/**
|
|
6
|
+
* JSON-LD Processor.
|
|
7
|
+
*/
|
|
8
|
+
export declare class JsonLdProcessor {
|
|
9
|
+
/**
|
|
10
|
+
* Set the document loader used for retrieving JSON-LD documents.
|
|
11
|
+
* @param documentLoader The document loader to use.
|
|
12
|
+
*/
|
|
13
|
+
static setDocumentLoader(documentLoader: (url: Url) => Promise<RemoteDocument>): void;
|
|
14
|
+
/**
|
|
15
|
+
* Get the document loader used for retrieving JSON-LD documents.
|
|
16
|
+
* @returns The active document loader function.
|
|
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 cache limit in milliseconds.
|
|
27
|
+
*/
|
|
28
|
+
static getCacheLimit(): number;
|
|
29
|
+
/**
|
|
30
|
+
* Replace the global redirect list (use {@link JsonLdProcessor.addRedirect} to append without replacing).
|
|
31
|
+
* Redirects run before any HTTP GET or `Link` discovery; use them for stable overrides, tests, or hosts that do not expose a suitable `Link` header.
|
|
32
|
+
* @param redirects The redirects to use.
|
|
33
|
+
*/
|
|
34
|
+
static setRedirects(redirects: {
|
|
35
|
+
from: RegExp;
|
|
36
|
+
to: string;
|
|
37
|
+
}[]): void;
|
|
38
|
+
/**
|
|
39
|
+
* Get the global redirects for JSON-LD.
|
|
40
|
+
* @returns The registered redirects.
|
|
41
|
+
*/
|
|
42
|
+
static getRedirects(): {
|
|
43
|
+
from: RegExp;
|
|
44
|
+
to: string;
|
|
45
|
+
}[];
|
|
46
|
+
/**
|
|
47
|
+
* Append a redirect rule (ignored if the same `RegExp.source` is already registered).
|
|
48
|
+
* Optional when the vocabulary URL supports HTTP `Link` discovery (`rel` includes `alternate`, `type` is `application/ld+json`) via the default document loader.
|
|
49
|
+
* Standards packages often expose `registerRedirects()` helpers that call this method; those are optional for the same reason.
|
|
50
|
+
* @param from The URL to redirect from.
|
|
51
|
+
* @param to The URL to redirect to.
|
|
52
|
+
*/
|
|
53
|
+
static addRedirect(from: RegExp, to: string): void;
|
|
54
|
+
/**
|
|
55
|
+
* Compact a document according to a particular context.
|
|
56
|
+
* @param document The JSON-LD document to compact.
|
|
57
|
+
* @param context The context to compact the document to, if not provided will use the one in the document.
|
|
58
|
+
* @param options The options for compacting the document.
|
|
59
|
+
* @param options.compactArrays Whether to allow single-item arrays to be compacted to scalars, defaults to true (matches jsonld.js default behaviour). Set to false to preserve all single-item arrays.
|
|
60
|
+
* @param options.noCompactProperties Additional dot-notation property paths that must always remain arrays, merged with the built-in always-array set.
|
|
61
|
+
* @returns The compacted JSON-LD document.
|
|
62
|
+
*/
|
|
63
|
+
static compact<T>(document: T, context?: IJsonLdContextDefinitionRoot, options?: {
|
|
64
|
+
compactArrays?: boolean;
|
|
65
|
+
noCompactProperties?: string[];
|
|
66
|
+
}): Promise<T>;
|
|
67
|
+
/**
|
|
68
|
+
* Expand a document, removing its context.
|
|
69
|
+
* @param compacted The compacted JSON-LD document to expand.
|
|
70
|
+
* @returns The expanded JSON-LD document.
|
|
71
|
+
*/
|
|
72
|
+
static expand<T>(compacted: T): Promise<IJsonLdNodeObject[]>;
|
|
73
|
+
/**
|
|
74
|
+
* Canonize a document.
|
|
75
|
+
* @param document The document to canonize.
|
|
76
|
+
* @param options The options for canonization.
|
|
77
|
+
* @param options.algorithm The algorithm to use for canonization, defaults to URDNA2015.
|
|
78
|
+
* @returns The canonized document.
|
|
79
|
+
*/
|
|
80
|
+
static canonize<T extends IJsonLdNodeObject>(document: T, options?: {
|
|
81
|
+
algorithm?: "URDNA2015" | "URGNA2012" | undefined;
|
|
82
|
+
}): Promise<string>;
|
|
83
|
+
/**
|
|
84
|
+
* Combine contexts.
|
|
85
|
+
* @param context1 The first JSON-LD context to combine.
|
|
86
|
+
* @param context2 The second JSON-LD context to combine.
|
|
87
|
+
* @returns The combined context.
|
|
88
|
+
*/
|
|
89
|
+
static combineContexts(context1: IJsonLdContextDefinitionRoot | undefined, context2: IJsonLdContextDefinitionRoot | undefined): IJsonLdContextDefinitionRoot | undefined;
|
|
90
|
+
/**
|
|
91
|
+
* Gather all the contexts from the element and it's children.
|
|
92
|
+
* @param element The element to gather the contexts from.
|
|
93
|
+
* @param initial The initial context.
|
|
94
|
+
* @returns The combined contexts.
|
|
95
|
+
*/
|
|
96
|
+
static gatherContexts<T>(element: T, initial?: IJsonLdContextDefinitionRoot): IJsonLdContextDefinitionRoot | undefined;
|
|
97
|
+
/**
|
|
98
|
+
* Remove all the contexts that match the pattern.
|
|
99
|
+
* @param context The context to remove the entries from.
|
|
100
|
+
* @param match The element to try and match.
|
|
101
|
+
* @returns The updated contexts.
|
|
102
|
+
*/
|
|
103
|
+
static removeContexts(context: IJsonLdContextDefinitionRoot | undefined, match?: IJsonLdContextDefinitionElement[]): IJsonLdContextDefinitionRoot | undefined;
|
|
104
|
+
/**
|
|
105
|
+
* Add a context directly to the document loader cache.
|
|
106
|
+
* @param url The url the ld context is for.
|
|
107
|
+
* @param ldContext The context to add.
|
|
108
|
+
* @returns A promise that resolves when the entry has been stored in the cache.
|
|
109
|
+
*/
|
|
110
|
+
static documentCacheAdd(url: string, ldContext: unknown): Promise<void>;
|
|
111
|
+
/**
|
|
112
|
+
* Remove a context from the document loader cache.
|
|
113
|
+
* @param url The url the ld context is for.
|
|
114
|
+
* @returns A promise that resolves when the entry has been removed from the cache.
|
|
115
|
+
*/
|
|
116
|
+
static documentCacheRemove(url: string): Promise<void>;
|
|
117
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.20.0-next.1](https://github.com/3sixtyglobal/data/compare/data-json-ld-v0.20.0-next.0...data-json-ld-v0.20.0-next.1) (2026-10-09)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Features
|
|
7
|
+
|
|
8
|
+
* publish packages under the [@3sixty](https://github.com/3sixty) namespace ([a556efc](https://github.com/3sixtyglobal/data/commit/a556efcb6b4c0143b1c4012731a9860f035c9ee8))
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
### Dependencies
|
|
12
|
+
|
|
13
|
+
* The following workspace dependencies were updated
|
|
14
|
+
* dependencies
|
|
15
|
+
* @3sixty/data-core bumped from 0.20.0-next.0 to 0.20.0-next.1
|