@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,22 @@
|
|
|
1
|
+
# Type Alias: JsonLdObjectWithOptionalContext\<T, C\>
|
|
2
|
+
|
|
3
|
+
> **JsonLdObjectWithOptionalContext**\<`T`, `C`\> = `Omit`\<`T`, `"@context"`\> & `object`
|
|
4
|
+
|
|
5
|
+
Add optional "@context" to a type, inferring an existing context type from
|
|
6
|
+
the source type when available, otherwise using the provided default.
|
|
7
|
+
|
|
8
|
+
## Type Declaration
|
|
9
|
+
|
|
10
|
+
### @context?
|
|
11
|
+
|
|
12
|
+
> `optional` **@context?**: `C`
|
|
13
|
+
|
|
14
|
+
## Type Parameters
|
|
15
|
+
|
|
16
|
+
### T
|
|
17
|
+
|
|
18
|
+
`T` *extends* `object`
|
|
19
|
+
|
|
20
|
+
### C
|
|
21
|
+
|
|
22
|
+
`C` = [`JsonLdExistingProperty`](JsonLdExistingProperty.md)\<`T`, `"@context"`, [`IJsonLdContextDefinitionRoot`](IJsonLdContextDefinitionRoot.md)\>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Type Alias: JsonLdObjectWithOptionalId\<T, Id\>
|
|
2
|
+
|
|
3
|
+
> **JsonLdObjectWithOptionalId**\<`T`, `Id`\> = `Omit`\<`T`, `"id"` \| `"@id"`\> & `object`
|
|
4
|
+
|
|
5
|
+
Add optional "id" to a type.
|
|
6
|
+
|
|
7
|
+
## Type Declaration
|
|
8
|
+
|
|
9
|
+
### id?
|
|
10
|
+
|
|
11
|
+
> `optional` **id?**: `Id`
|
|
12
|
+
|
|
13
|
+
## Type Parameters
|
|
14
|
+
|
|
15
|
+
### T
|
|
16
|
+
|
|
17
|
+
`T` *extends* `object`
|
|
18
|
+
|
|
19
|
+
### Id
|
|
20
|
+
|
|
21
|
+
`Id` = [`JsonLdExistingPropertyEither`](JsonLdExistingPropertyEither.md)\<`T`, `"id"`, `"@id"`, `string`\>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Type Alias: JsonLdObjectWithOptionalType\<T, Ty\>
|
|
2
|
+
|
|
3
|
+
> **JsonLdObjectWithOptionalType**\<`T`, `Ty`\> = `Omit`\<`T`, `"type"` \| `"@type"`\> & `object`
|
|
4
|
+
|
|
5
|
+
Add optional "type" to a type.
|
|
6
|
+
|
|
7
|
+
## Type Declaration
|
|
8
|
+
|
|
9
|
+
### type?
|
|
10
|
+
|
|
11
|
+
> `optional` **type?**: `Ty`
|
|
12
|
+
|
|
13
|
+
## Type Parameters
|
|
14
|
+
|
|
15
|
+
### T
|
|
16
|
+
|
|
17
|
+
`T` *extends* `object`
|
|
18
|
+
|
|
19
|
+
### Ty
|
|
20
|
+
|
|
21
|
+
`Ty` = [`JsonLdExistingPropertyEither`](JsonLdExistingPropertyEither.md)\<`T`, `"type"`, `"@type"`, `string` \| `string`[]\>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Type Alias: JsonLdObjectWithType\<T, Ty\>
|
|
2
|
+
|
|
3
|
+
> **JsonLdObjectWithType**\<`T`, `Ty`\> = `Omit`\<`T`, `"type"` \| `"@type"`\> & `object`
|
|
4
|
+
|
|
5
|
+
Add "type" to a type.
|
|
6
|
+
|
|
7
|
+
## Type Declaration
|
|
8
|
+
|
|
9
|
+
### type
|
|
10
|
+
|
|
11
|
+
> **type**: `Ty`
|
|
12
|
+
|
|
13
|
+
## Type Parameters
|
|
14
|
+
|
|
15
|
+
### T
|
|
16
|
+
|
|
17
|
+
`T` *extends* `object`
|
|
18
|
+
|
|
19
|
+
### Ty
|
|
20
|
+
|
|
21
|
+
`Ty` = [`JsonLdExistingPropertyEither`](JsonLdExistingPropertyEither.md)\<`T`, `"type"`, `"@type"`, `string` \| `string`[]\>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Type Alias: JsonLdWithAliases\<T, Prefix\>
|
|
2
|
+
|
|
3
|
+
> **JsonLdWithAliases**\<`T`, `Prefix`\> = `{ [K in Extract<JsonLdRequiredKeys<T>, string> as JsonLdAliasKey<K, Prefix>]: T[K] }` & `{ [K in Extract<JsonLdOptionalKeys<T>, string> as JsonLdAliasKey<K, Prefix>]?: T[K] }`
|
|
4
|
+
|
|
5
|
+
Remap an object type so JSON-LD keys ("@...") are preserved and
|
|
6
|
+
non-JSON-LD keys are exposed as `Prefix:key` aliases, while preserving
|
|
7
|
+
each key's original required/optional status.
|
|
8
|
+
|
|
9
|
+
## Type Parameters
|
|
10
|
+
|
|
11
|
+
### T
|
|
12
|
+
|
|
13
|
+
`T` *extends* `object`
|
|
14
|
+
|
|
15
|
+
### Prefix
|
|
16
|
+
|
|
17
|
+
`Prefix` *extends* `string`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Variable: JsonLdContexts
|
|
2
|
+
|
|
3
|
+
> `const` **JsonLdContexts**: `object`
|
|
4
|
+
|
|
5
|
+
The contexts of JSON-LD data.
|
|
6
|
+
|
|
7
|
+
## Type Declaration
|
|
8
|
+
|
|
9
|
+
### Namespace {#namespace}
|
|
10
|
+
|
|
11
|
+
> `readonly` **Namespace**: `"https://schema.3sixty.global/json-ld/"` = `"https://schema.3sixty.global/json-ld/"`
|
|
12
|
+
|
|
13
|
+
The canonical RDF namespace URI for JSON-LD.
|
|
14
|
+
|
|
15
|
+
### Context {#context}
|
|
16
|
+
|
|
17
|
+
> `readonly` **Context**: `"https://schema.3sixty.global/json-ld/"` = `"https://schema.3sixty.global/json-ld/"`
|
|
18
|
+
|
|
19
|
+
The value to use in JSON-LD context for JSON-LD.
|
|
20
|
+
|
|
21
|
+
### JsonLdContext {#jsonldcontext}
|
|
22
|
+
|
|
23
|
+
> `readonly` **JsonLdContext**: `"https://schema.3sixty.global/json-ld/types.jsonld"` = `"https://schema.3sixty.global/json-ld/types.jsonld"`
|
|
24
|
+
|
|
25
|
+
The JSON-LD Context URL for JSON-LD.
|
|
@@ -0,0 +1,163 @@
|
|
|
1
|
+
# Variable: JsonLdTypes
|
|
2
|
+
|
|
3
|
+
> `const` **JsonLdTypes**: `object`
|
|
4
|
+
|
|
5
|
+
The types of JSON-LD data.
|
|
6
|
+
|
|
7
|
+
## Type Declaration
|
|
8
|
+
|
|
9
|
+
### Document {#document}
|
|
10
|
+
|
|
11
|
+
> `readonly` **Document**: `"JsonLdDocument"` = `"JsonLdDocument"`
|
|
12
|
+
|
|
13
|
+
Represents JSON-LD Document.
|
|
14
|
+
|
|
15
|
+
### Object {#object}
|
|
16
|
+
|
|
17
|
+
> `readonly` **Object**: `"JsonLdObject"` = `"JsonLdObject"`
|
|
18
|
+
|
|
19
|
+
Represents JSON-LD Object.
|
|
20
|
+
|
|
21
|
+
### NodeObject {#nodeobject}
|
|
22
|
+
|
|
23
|
+
> `readonly` **NodeObject**: `"JsonLdNodeObject"` = `"JsonLdNodeObject"`
|
|
24
|
+
|
|
25
|
+
Represents JSON-LD Node Object.
|
|
26
|
+
|
|
27
|
+
### NodePrimitive {#nodeprimitive}
|
|
28
|
+
|
|
29
|
+
> `readonly` **NodePrimitive**: `"JsonLdNodePrimitive"` = `"JsonLdNodePrimitive"`
|
|
30
|
+
|
|
31
|
+
Represents JSON-LD Node Primitive.
|
|
32
|
+
|
|
33
|
+
### GraphObject {#graphobject}
|
|
34
|
+
|
|
35
|
+
> `readonly` **GraphObject**: `"JsonLdGraphObject"` = `"JsonLdGraphObject"`
|
|
36
|
+
|
|
37
|
+
Represents JSON-LD Graph Object.
|
|
38
|
+
|
|
39
|
+
### ValueObject {#valueobject}
|
|
40
|
+
|
|
41
|
+
> `readonly` **ValueObject**: `"JsonLdValueObject"` = `"JsonLdValueObject"`
|
|
42
|
+
|
|
43
|
+
Represents JSON-LD Value Object.
|
|
44
|
+
|
|
45
|
+
### ListObject {#listobject}
|
|
46
|
+
|
|
47
|
+
> `readonly` **ListObject**: `"JsonLdListObject"` = `"JsonLdListObject"`
|
|
48
|
+
|
|
49
|
+
Represents JSON-LD List Object.
|
|
50
|
+
|
|
51
|
+
### SetObject {#setobject}
|
|
52
|
+
|
|
53
|
+
> `readonly` **SetObject**: `"JsonLdSetObject"` = `"JsonLdSetObject"`
|
|
54
|
+
|
|
55
|
+
Represents JSON-LD Set Object.
|
|
56
|
+
|
|
57
|
+
### LanguageMap {#languagemap}
|
|
58
|
+
|
|
59
|
+
> `readonly` **LanguageMap**: `"JsonLdLanguageMap"` = `"JsonLdLanguageMap"`
|
|
60
|
+
|
|
61
|
+
Represents JSON-LD Language Map.
|
|
62
|
+
|
|
63
|
+
### IndexMap {#indexmap}
|
|
64
|
+
|
|
65
|
+
> `readonly` **IndexMap**: `"JsonLdIndexMap"` = `"JsonLdIndexMap"`
|
|
66
|
+
|
|
67
|
+
Represents JSON-LD Index Map.
|
|
68
|
+
|
|
69
|
+
### IndexMapItem {#indexmapitem}
|
|
70
|
+
|
|
71
|
+
> `readonly` **IndexMapItem**: `"JsonLdIndexMapItem"` = `"JsonLdIndexMapItem"`
|
|
72
|
+
|
|
73
|
+
Represents JSON-LD Index Map Item.
|
|
74
|
+
|
|
75
|
+
### IdMap {#idmap}
|
|
76
|
+
|
|
77
|
+
> `readonly` **IdMap**: `"JsonLdIdMap"` = `"JsonLdIdMap"`
|
|
78
|
+
|
|
79
|
+
Represents JSON-LD Id Map.
|
|
80
|
+
|
|
81
|
+
### TypeMap {#typemap}
|
|
82
|
+
|
|
83
|
+
> `readonly` **TypeMap**: `"JsonLdTypeMap"` = `"JsonLdTypeMap"`
|
|
84
|
+
|
|
85
|
+
Represents JSON-LD Type Map.
|
|
86
|
+
|
|
87
|
+
### IncludedBlock {#includedblock}
|
|
88
|
+
|
|
89
|
+
> `readonly` **IncludedBlock**: `"JsonLdIncludedBlock"` = `"JsonLdIncludedBlock"`
|
|
90
|
+
|
|
91
|
+
Represents JSON-LD Included block.
|
|
92
|
+
|
|
93
|
+
### ContextDefinition {#contextdefinition}
|
|
94
|
+
|
|
95
|
+
> `readonly` **ContextDefinition**: `"JsonLdContextDefinition"` = `"JsonLdContextDefinition"`
|
|
96
|
+
|
|
97
|
+
Represents JSON-LD Context Definition.
|
|
98
|
+
|
|
99
|
+
### ContextDefinitionElement {#contextdefinitionelement}
|
|
100
|
+
|
|
101
|
+
> `readonly` **ContextDefinitionElement**: `"JsonLdContextDefinitionElement"` = `"JsonLdContextDefinitionElement"`
|
|
102
|
+
|
|
103
|
+
Represents JSON-LD Context Definition Element.
|
|
104
|
+
|
|
105
|
+
### ContextDefinitionRoot {#contextdefinitionroot}
|
|
106
|
+
|
|
107
|
+
> `readonly` **ContextDefinitionRoot**: `"JsonLdContextDefinitionRoot"` = `"JsonLdContextDefinitionRoot"`
|
|
108
|
+
|
|
109
|
+
Represents JSON-LD Context Definition Root.
|
|
110
|
+
|
|
111
|
+
### ExpandedTermDefinition {#expandedtermdefinition}
|
|
112
|
+
|
|
113
|
+
> `readonly` **ExpandedTermDefinition**: `"JsonLdExpandedTermDefinition"` = `"JsonLdExpandedTermDefinition"`
|
|
114
|
+
|
|
115
|
+
Represents JSON-LD Expanded Term Definition.
|
|
116
|
+
|
|
117
|
+
### Keyword {#keyword}
|
|
118
|
+
|
|
119
|
+
> `readonly` **Keyword**: `"JsonLdKeyword"` = `"JsonLdKeyword"`
|
|
120
|
+
|
|
121
|
+
Represents JSON-LD Keyword.
|
|
122
|
+
|
|
123
|
+
### ListOrSetItem {#listorsetitem}
|
|
124
|
+
|
|
125
|
+
> `readonly` **ListOrSetItem**: `"JsonLdListOrSetItem"` = `"JsonLdListOrSetItem"`
|
|
126
|
+
|
|
127
|
+
Represents JSON-LD List or Set Item.
|
|
128
|
+
|
|
129
|
+
### ContainerType {#containertype}
|
|
130
|
+
|
|
131
|
+
> `readonly` **ContainerType**: `"JsonLdContainerType"` = `"JsonLdContainerType"`
|
|
132
|
+
|
|
133
|
+
Represents JSON-LD Container Type.
|
|
134
|
+
|
|
135
|
+
### ContainerTypeArray {#containertypearray}
|
|
136
|
+
|
|
137
|
+
> `readonly` **ContainerTypeArray**: `"JsonLdContainerTypeArray"` = `"JsonLdContainerTypeArray"`
|
|
138
|
+
|
|
139
|
+
Represents JSON-LD Container Type Array.
|
|
140
|
+
|
|
141
|
+
### JsonPrimitive {#jsonprimitive}
|
|
142
|
+
|
|
143
|
+
> `readonly` **JsonPrimitive**: `"JsonLdJsonPrimitive"` = `"JsonLdJsonPrimitive"`
|
|
144
|
+
|
|
145
|
+
Represents JSON-LD JSON Primitive.
|
|
146
|
+
|
|
147
|
+
### JsonArray {#jsonarray}
|
|
148
|
+
|
|
149
|
+
> `readonly` **JsonArray**: `"JsonLdJsonArray"` = `"JsonLdJsonArray"`
|
|
150
|
+
|
|
151
|
+
Represents JSON-LD JSON Array.
|
|
152
|
+
|
|
153
|
+
### JsonObject {#jsonobject}
|
|
154
|
+
|
|
155
|
+
> `readonly` **JsonObject**: `"JsonLdJsonObject"` = `"JsonLdJsonObject"`
|
|
156
|
+
|
|
157
|
+
Represents JSON-LD JSON Object.
|
|
158
|
+
|
|
159
|
+
### JsonValue {#jsonvalue}
|
|
160
|
+
|
|
161
|
+
> `readonly` **JsonValue**: `"JsonLdJsonValue"` = `"JsonLdJsonValue"`
|
|
162
|
+
|
|
163
|
+
Represents JSON-LD JSON Value.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
^jsonld.InvalidUrl$
|
package/locales/en.json
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"error": {
|
|
3
|
+
"jsonLdProcessor": {
|
|
4
|
+
"compact": "The JSON-LD compaction failed",
|
|
5
|
+
"expand": "The JSON-LD expansion failed",
|
|
6
|
+
"canonize": "The JSON-LD canonization failed",
|
|
7
|
+
"invalidUrl": "The JSON-LD processing failed to retrieve from the following url \"{url}\"",
|
|
8
|
+
"jsonLdError": "The JSON-LD processing failed due to the following error: \"{code}\""
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,53 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
"name": "@3sixty/data-json-ld",
|
|
3
|
+
"version": "0.20.0-next.1",
|
|
4
|
+
"description": "JSON-LD data models and helpers for working with linked data documents.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/3sixtyglobal/data.git",
|
|
8
|
+
"directory": "packages/data-json-ld"
|
|
9
|
+
},
|
|
10
|
+
"author": "martyn.janes@iota.org",
|
|
11
|
+
"license": "Apache-2.0",
|
|
12
|
+
"type": "module",
|
|
13
|
+
"engines": {
|
|
14
|
+
"node": ">=24.0.0"
|
|
15
|
+
},
|
|
16
|
+
"dependencies": {
|
|
17
|
+
"@3sixty/core": "next",
|
|
18
|
+
"@3sixty/data-core": "0.20.0-next.1",
|
|
19
|
+
"@3sixty/entity": "next",
|
|
20
|
+
"@3sixty/nameof": "next",
|
|
21
|
+
"@3sixty/web": "next",
|
|
22
|
+
"@types/jsonld": "1.5.15",
|
|
23
|
+
"jsonld": "9.0.0"
|
|
24
|
+
},
|
|
25
|
+
"main": "./dist/es/index.js",
|
|
26
|
+
"types": "./dist/types/index.d.ts",
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/types/index.d.ts",
|
|
30
|
+
"import": "./dist/es/index.js",
|
|
31
|
+
"default": "./dist/es/index.js"
|
|
32
|
+
},
|
|
33
|
+
"./locales/*.json": "./locales/*.json"
|
|
34
|
+
},
|
|
35
|
+
"files": [
|
|
36
|
+
"dist/es",
|
|
37
|
+
"dist/types",
|
|
38
|
+
"locales",
|
|
39
|
+
"docs"
|
|
40
|
+
],
|
|
41
|
+
"keywords": [
|
|
42
|
+
"twin",
|
|
43
|
+
"trade",
|
|
44
|
+
"iota",
|
|
45
|
+
"framework",
|
|
46
|
+
"blockchain",
|
|
47
|
+
"data"
|
|
48
|
+
],
|
|
49
|
+
"bugs": {
|
|
50
|
+
"url": "git+https://github.com/3sixtyglobal/data/issues"
|
|
51
|
+
},
|
|
52
|
+
"homepage": "https://3sixty.global"
|
|
53
|
+
}
|