@arpproject/recrate 0.1.7-test5 → 0.1.7-test6
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/dist/app/App.d.ts +2 -0
- package/dist/app/EmbeddedComponent.d.ts +3 -0
- package/dist/app/index.d.ts +0 -0
- package/dist/app/lookup.d.ts +82 -0
- package/dist/crate-builder/CrateManager/contexts.d.ts +6 -0
- package/dist/crate-builder/CrateManager/crate-manager-benchmarking.spec.d.ts +1 -0
- package/dist/crate-builder/CrateManager/crate-manager-loading-exporting.spec.d.ts +1 -0
- package/dist/crate-builder/CrateManager/crate-manager-operations.spec.d.ts +0 -0
- package/dist/crate-builder/CrateManager/crate-manager.d.ts +641 -0
- package/dist/crate-builder/CrateManager/crate-manager.spec.d.ts +1 -0
- package/dist/crate-builder/CrateManager/lib.d.ts +26 -0
- package/dist/crate-builder/CrateManager/lib.spec.d.ts +1 -0
- package/dist/crate-builder/CrateManager/profile-manager.d.ts +143 -0
- package/dist/crate-builder/CrateManager/profile-manager.spec.d.ts +1 -0
- package/{src/crate-builder/CrateManager/schema-type-definitions.json → dist/crate-builder/CrateManager/schema-type-definitions.json.d.ts} +4 -1
- package/dist/crate-builder/CrateManager/validate-identifier.d.ts +10 -0
- package/dist/crate-builder/CrateManager/validate-identifier.spec.d.ts +1 -0
- package/dist/crate-builder/RenderEntity/Add.d.ts +26 -0
- package/dist/crate-builder/RenderEntity/AddControl.d.ts +14 -0
- package/dist/crate-builder/RenderEntity/AddControl.stories.d.ts +29 -0
- package/dist/crate-builder/RenderEntity/AutoComplete.d.ts +12 -0
- package/dist/crate-builder/RenderEntity/BulkAdd.d.ts +10 -0
- package/dist/crate-builder/RenderEntity/DeleteProperty.d.ts +8 -0
- package/dist/crate-builder/RenderEntity/DialogAddProperty.d.ts +9 -0
- package/dist/crate-builder/RenderEntity/DialogBrowseEntities.d.ts +8 -0
- package/dist/crate-builder/RenderEntity/DialogEditContext.d.ts +8 -0
- package/dist/crate-builder/RenderEntity/DialogPreviewCrate.d.ts +7 -0
- package/dist/crate-builder/RenderEntity/DialogSaveCrateAsTemplate.d.ts +13 -0
- package/dist/crate-builder/RenderEntity/DialogSaveEntityTemplate.d.ts +14 -0
- package/dist/crate-builder/RenderEntity/DisplayPropertyName.d.ts +8 -0
- package/dist/crate-builder/RenderEntity/DisplayPropertyName.stories.d.ts +6 -0
- package/dist/crate-builder/RenderEntity/EntityId.d.ts +13 -0
- package/dist/crate-builder/RenderEntity/EntityName.d.ts +13 -0
- package/dist/crate-builder/RenderEntity/EntityProperty.d.ts +19 -0
- package/dist/crate-builder/RenderEntity/EntityPropertyInstance.d.ts +25 -0
- package/dist/crate-builder/RenderEntity/EntityType.d.ts +12 -0
- package/dist/crate-builder/RenderEntity/ItemLink.d.ts +14 -0
- package/dist/crate-builder/RenderEntity/PaginateLinkedEntities.d.ts +23 -0
- package/dist/crate-builder/RenderEntity/PaginateLinkedEntities.stories.d.ts +7 -0
- package/dist/crate-builder/RenderEntity/PropertyHelp.d.ts +6 -0
- package/dist/crate-builder/RenderEntity/RenderControls.d.ts +22 -0
- package/dist/crate-builder/RenderEntity/RenderLinkedItem.d.ts +20 -0
- package/dist/crate-builder/RenderEntity/RenderPropertyHelp.d.ts +6 -0
- package/dist/crate-builder/RenderEntity/RenderReverseConnections.d.ts +16 -0
- package/dist/crate-builder/RenderEntity/RenderTypes.d.ts +6 -0
- package/dist/crate-builder/RenderEntity/Shell2.d.ts +14 -0
- package/dist/crate-builder/RenderEntity/UnlinkEntity.d.ts +14 -0
- package/dist/crate-builder/RenderEntity/auto-complete.lib.d.ts +25 -0
- package/dist/crate-builder/RenderEntity/keys.d.ts +4 -0
- package/dist/crate-builder/RenderEntity/layout.d.ts +14 -0
- package/dist/crate-builder/RenderEntity/layout.spec.d.ts +1 -0
- package/dist/crate-builder/Shell.d.ts +40 -0
- package/dist/crate-builder/editor-state.d.ts +72 -0
- package/dist/crate-builder/emotionCache.d.ts +1 -0
- package/dist/crate-builder/helpers.d.ts +9 -0
- package/dist/crate-builder/i18n.d.ts +2 -0
- package/dist/crate-builder/lib/validate-iri.d.ts +6 -0
- package/dist/crate-builder/locales/en.d.ts +79 -0
- package/dist/crate-builder/locales/hu.d.ts +79 -0
- package/dist/crate-builder/primitives/Boolean.d.ts +11 -0
- package/dist/crate-builder/primitives/Boolean.stories.d.ts +7 -0
- package/dist/crate-builder/primitives/Date.d.ts +11 -0
- package/dist/crate-builder/primitives/Date.stories.d.ts +5 -0
- package/dist/crate-builder/primitives/DateTime.d.ts +11 -0
- package/dist/crate-builder/primitives/DateTime.stories.d.ts +5 -0
- package/dist/crate-builder/primitives/Geo.d.ts +12 -0
- package/dist/crate-builder/primitives/Geo.stories.d.ts +26 -0
- package/dist/crate-builder/primitives/Map.SelectArea.d.ts +9 -0
- package/dist/crate-builder/primitives/Map.d.ts +15 -0
- package/dist/crate-builder/primitives/Map.stories.d.ts +6 -0
- package/dist/crate-builder/primitives/Number.d.ts +16 -0
- package/dist/crate-builder/primitives/Number.stories.d.ts +10 -0
- package/dist/crate-builder/primitives/Select.d.ts +15 -0
- package/dist/crate-builder/primitives/Select.stories.d.ts +9 -0
- package/dist/crate-builder/primitives/SelectObject.d.ts +13 -0
- package/dist/crate-builder/primitives/SelectObject.stories.d.ts +5 -0
- package/dist/crate-builder/primitives/SelectUrl.d.ts +14 -0
- package/dist/crate-builder/primitives/SelectUrl.stories.d.ts +7 -0
- package/dist/crate-builder/primitives/Text.d.ts +19 -0
- package/dist/crate-builder/primitives/Text.stories.d.ts +13 -0
- package/dist/crate-builder/primitives/Time.d.ts +11 -0
- package/dist/crate-builder/primitives/Time.stories.d.ts +7 -0
- package/dist/crate-builder/primitives/Url.d.ts +11 -0
- package/dist/crate-builder/primitives/Url.stories.d.ts +7 -0
- package/dist/crate-builder/primitives/Value.d.ts +7 -0
- package/dist/crate-builder/primitives/Value.stories.d.ts +7 -0
- package/dist/crate-builder/primitives/date-libs.d.ts +1 -0
- package/dist/crate-builder/property-definitions.d.ts +78 -0
- package/dist/crate-builder/store.d.ts +8 -0
- package/dist/index.d.ts +5 -0
- package/dist/recrate.css +1896 -0
- package/dist/recrate.es.js +38508 -0
- package/dist/types.d.ts +42 -0
- package/package.json +31 -24
- package/.eslintrc.json +0 -37
- package/.storybook/main.ts +0 -40
- package/.storybook/preview.tsx +0 -46
- package/babel.config.json +0 -5
- package/docker-compose.yml +0 -30
- package/docs/.nojekyll +0 -1
- package/docs/assets/highlight.css +0 -99
- package/docs/assets/icons.js +0 -18
- package/docs/assets/icons.svg +0 -1
- package/docs/assets/main.js +0 -60
- package/docs/assets/navigation.js +0 -1
- package/docs/assets/search.js +0 -1
- package/docs/assets/style.css +0 -1448
- package/docs/classes/src_crate_builder_CrateManager_crate_manager.CrateManager.html +0 -240
- package/docs/classes/src_crate_builder_CrateManager_profile_manager.ProfileManager.html +0 -42
- package/docs/classes/src_crate_builder_editor_state.EditorState.html +0 -28
- package/docs/classes/src_crate_builder_types.CrateManagerType.html +0 -57
- package/docs/classes/src_crate_builder_types.ProfileManagerType.html +0 -13
- package/docs/functions/src_crate_builder_CrateManager_lib.isURL.html +0 -2
- package/docs/functions/src_crate_builder_CrateManager_lib.mintNewCrate.html +0 -3
- package/docs/functions/src_crate_builder_CrateManager_lib.normalise.html +0 -5
- package/docs/functions/src_crate_builder_CrateManager_lib.normaliseEntityType.html +0 -1
- package/docs/index.html +0 -58
- package/docs/interfaces/src_crate_builder_types.NormalisedCrate.html +0 -3
- package/docs/interfaces/src_crate_builder_types.NormalisedEntityDefinition.html +0 -4
- package/docs/interfaces/src_crate_builder_types.NormalisedProfile.html +0 -9
- package/docs/interfaces/src_crate_builder_types.ProfileLayout.html +0 -2
- package/docs/interfaces/src_crate_builder_types.ProfileLayoutGroup.html +0 -9
- package/docs/interfaces/src_crate_builder_types.UnverifiedCrate.html +0 -3
- package/docs/interfaces/src_crate_builder_types.UnverifiedEntityDefinition.html +0 -4
- package/docs/modules/src_crate_builder_CrateManager_crate_manager.html +0 -2
- package/docs/modules/src_crate_builder_CrateManager_lib.html +0 -6
- package/docs/modules/src_crate_builder_CrateManager_profile_manager.html +0 -2
- package/docs/modules/src_crate_builder_editor_state.html +0 -2
- package/docs/modules/src_crate_builder_types.html +0 -16
- package/docs/types/src_crate_builder_types.EntityReference.html +0 -1
- package/docs/types/src_crate_builder_types.NormalisedContext.html +0 -1
- package/docs/types/src_crate_builder_types.PrimitiveType.html +0 -1
- package/docs/types/src_crate_builder_types.ProfileAssociation.html +0 -1
- package/docs/types/src_crate_builder_types.ProfileInput.html +0 -1
- package/docs/types/src_crate_builder_types.UnverifiedContext.html +0 -1
- package/docs/variables/src_crate_builder_CrateManager_lib.urlProtocols.html +0 -1
- package/index.html +0 -13
- package/load-data-packs.cjs +0 -38
- package/postcss.config.cjs +0 -6
- package/react-app-env.d.ts +0 -1
- package/rollup.config.js +0 -26
- package/src/app/App.tsx +0 -13
- package/src/app/EmbeddedComponent.tsx +0 -432
- package/src/app/index.html +0 -20
- package/src/app/index.tsx +0 -19
- package/src/app/lookup.ts +0 -141
- package/src/app/override-styles.css +0 -96
- package/src/crate-builder/CrateManager/contexts/1.1-context.jsonld +0 -2660
- package/src/crate-builder/CrateManager/contexts/1.2-DRAFT-context.jsonld +0 -2918
- package/src/crate-builder/CrateManager/contexts.ts +0 -42
- package/src/crate-builder/CrateManager/crate-manager-benchmarking.spec.ts +0 -31
- package/src/crate-builder/CrateManager/crate-manager-loading-exporting.spec.ts +0 -431
- package/src/crate-builder/CrateManager/crate-manager-operations.spec.ts +0 -298
- package/src/crate-builder/CrateManager/crate-manager.spec.ts +0 -2336
- package/src/crate-builder/CrateManager/crate-manager.ts +0 -2111
- package/src/crate-builder/CrateManager/lib.spec.ts +0 -133
- package/src/crate-builder/CrateManager/lib.ts +0 -170
- package/src/crate-builder/CrateManager/profile-manager.spec.ts +0 -593
- package/src/crate-builder/CrateManager/profile-manager.ts +0 -367
- package/src/crate-builder/CrateManager/validate-identifier.spec.ts +0 -82
- package/src/crate-builder/CrateManager/validate-identifier.ts +0 -65
- package/src/crate-builder/RenderEntity/Add.tsx +0 -249
- package/src/crate-builder/RenderEntity/AddControl.stories.tsx +0 -126
- package/src/crate-builder/RenderEntity/AddControl.tsx +0 -84
- package/src/crate-builder/RenderEntity/AutoComplete.tsx +0 -215
- package/src/crate-builder/RenderEntity/BulkAdd.tsx +0 -136
- package/src/crate-builder/RenderEntity/DeleteProperty.tsx +0 -33
- package/src/crate-builder/RenderEntity/DialogAddProperty.tsx +0 -83
- package/src/crate-builder/RenderEntity/DialogBrowseEntities.tsx +0 -136
- package/src/crate-builder/RenderEntity/DialogEditContext.tsx +0 -107
- package/src/crate-builder/RenderEntity/DialogPreviewCrate.tsx +0 -54
- package/src/crate-builder/RenderEntity/DialogSaveCrateAsTemplate.tsx +0 -65
- package/src/crate-builder/RenderEntity/DialogSaveEntityTemplate.tsx +0 -87
- package/src/crate-builder/RenderEntity/DisplayPropertyName.stories.tsx +0 -30
- package/src/crate-builder/RenderEntity/DisplayPropertyName.tsx +0 -21
- package/src/crate-builder/RenderEntity/EntityId.tsx +0 -75
- package/src/crate-builder/RenderEntity/EntityName.tsx +0 -49
- package/src/crate-builder/RenderEntity/EntityProperty.tsx +0 -188
- package/src/crate-builder/RenderEntity/EntityPropertyInstance.tsx +0 -255
- package/src/crate-builder/RenderEntity/EntityType.tsx +0 -95
- package/src/crate-builder/RenderEntity/ItemLink.tsx +0 -37
- package/src/crate-builder/RenderEntity/PaginateLinkedEntities.stories.tsx +0 -43
- package/src/crate-builder/RenderEntity/PaginateLinkedEntities.tsx +0 -141
- package/src/crate-builder/RenderEntity/PropertyHelp.tsx +0 -39
- package/src/crate-builder/RenderEntity/RenderControls.tsx +0 -278
- package/src/crate-builder/RenderEntity/RenderLinkedItem.tsx +0 -139
- package/src/crate-builder/RenderEntity/RenderPropertyHelp.tsx +0 -41
- package/src/crate-builder/RenderEntity/RenderReverseConnections.tsx +0 -150
- package/src/crate-builder/RenderEntity/RenderTypes.tsx +0 -102
- package/src/crate-builder/RenderEntity/Shell2.tsx +0 -576
- package/src/crate-builder/RenderEntity/UnlinkEntity.tsx +0 -30
- package/src/crate-builder/RenderEntity/auto-complete.lib.ts +0 -184
- package/src/crate-builder/RenderEntity/keys.ts +0 -4
- package/src/crate-builder/RenderEntity/layout.spec.js +0 -593
- package/src/crate-builder/RenderEntity/layout.ts +0 -220
- package/src/crate-builder/Shell.tsx +0 -337
- package/src/crate-builder/component.css +0 -65
- package/src/crate-builder/editor-state.ts +0 -114
- package/src/crate-builder/emotionCache.ts +0 -8
- package/src/crate-builder/helpers.ts +0 -16
- package/src/crate-builder/i18n.ts +0 -22
- package/src/crate-builder/lib/validate-iri.ts +0 -57
- package/src/crate-builder/locales/en.js +0 -149
- package/src/crate-builder/locales/hu.js +0 -147
- package/src/crate-builder/primitives/Boolean.stories.tsx +0 -33
- package/src/crate-builder/primitives/Boolean.tsx +0 -67
- package/src/crate-builder/primitives/Date.stories.tsx +0 -32
- package/src/crate-builder/primitives/Date.tsx +0 -58
- package/src/crate-builder/primitives/DateTime.stories.tsx +0 -32
- package/src/crate-builder/primitives/DateTime.tsx +0 -64
- package/src/crate-builder/primitives/Geo.stories.tsx +0 -57
- package/src/crate-builder/primitives/Geo.tsx +0 -225
- package/src/crate-builder/primitives/Map.SelectArea.js +0 -359
- package/src/crate-builder/primitives/Map.stories.tsx +0 -61
- package/src/crate-builder/primitives/Map.tsx +0 -124
- package/src/crate-builder/primitives/Number.stories.tsx +0 -74
- package/src/crate-builder/primitives/Number.tsx +0 -166
- package/src/crate-builder/primitives/Select.stories.tsx +0 -66
- package/src/crate-builder/primitives/Select.tsx +0 -121
- package/src/crate-builder/primitives/SelectObject.stories.tsx +0 -29
- package/src/crate-builder/primitives/SelectObject.tsx +0 -105
- package/src/crate-builder/primitives/SelectUrl.stories.tsx +0 -42
- package/src/crate-builder/primitives/SelectUrl.tsx +0 -110
- package/src/crate-builder/primitives/Text.stories.tsx +0 -106
- package/src/crate-builder/primitives/Text.tsx +0 -197
- package/src/crate-builder/primitives/Time.stories.tsx +0 -38
- package/src/crate-builder/primitives/Time.tsx +0 -71
- package/src/crate-builder/primitives/Url.stories.tsx +0 -43
- package/src/crate-builder/primitives/Url.tsx +0 -75
- package/src/crate-builder/primitives/Value.stories.tsx +0 -37
- package/src/crate-builder/primitives/Value.tsx +0 -30
- package/src/crate-builder/primitives/date-libs.ts +0 -12
- package/src/crate-builder/profile-schema.json +0 -145
- package/src/crate-builder/property-definitions.ts +0 -78
- package/src/crate-builder/recrate.css +0 -3
- package/src/crate-builder/store.ts +0 -14
- package/src/crate-builder/tailwind.css +0 -5
- package/src/crate-builder/types.d.ts +0 -318
- package/src/examples/collection/collections-entity-example.json +0 -131
- package/src/examples/collection/crate-builder-entity-example.json +0 -33
- package/src/examples/item/complex-collection/ro-crate-metadata.json +0 -174
- package/src/examples/item/complex-item/ro-crate-metadata.json +0 -769
- package/src/examples/item/crate-with-language.json +0 -38
- package/src/examples/item/empty/ro-crate-metadata.json +0 -20
- package/src/examples/item/item-with-relationship-and-action/ro-crate-metadata.json +0 -66
- package/src/examples/item/large-crate/ro-crate-metadata.json +0 -5762
- package/src/examples/item/multiple-types/ro-crate-metadata.json +0 -20
- package/src/examples/item/ridiculously-big-collection/ro-crate-metadata.json +0 -162977
- package/src/examples/profile/aroma.complex.profile.json +0 -11098
- package/src/examples/profile/aroma.profile.json +0 -9158
- package/src/examples/profile/nyingarn-item-profile.json +0 -426
- package/src/examples/profile/profile-to-test-inverse-associations.json +0 -73
- package/src/examples/profile/profile-to-test-multiple-types.json +0 -31
- package/src/examples/profile/profile-with-all-primitives-and-groups.json +0 -207
- package/src/examples/profile/profile-with-all-primitives.json +0 -244
- package/src/examples/profile/profile-with-constraints.json +0 -446
- package/src/examples/profile/profile-with-resolve.json +0 -57
- package/src/examples/profile/vocabulary-creation-profile.json +0 -231
- package/src/images.d.ts +0 -5
- package/src/index.ts +0 -12
- package/src/types.ts +0 -104
- package/tailwind.config.js +0 -21
- package/tsconfig.app.json +0 -31
- package/tsconfig.json +0 -26
- package/typedoc.json +0 -11
- package/update-deps.sh +0 -4
- package/vite-env.d.ts +0 -1
- package/vite.config.ts +0 -67
- /package/{public → dist}/favicon.ico +0 -0
- /package/{public → dist}/index.html +0 -0
- /package/{public → dist}/logo192.png +0 -0
- /package/{public → dist}/logo512.png +0 -0
- /package/{public → dist}/manifest.json +0 -0
- /package/{public → dist}/marker-icon.png +0 -0
- /package/{public → dist}/marker-shadow.png +0 -0
- /package/{public → dist}/robots.txt +0 -0
|
@@ -0,0 +1,641 @@
|
|
|
1
|
+
import { UnverifiedContext, NormalisedContext, UnverifiedCrate, NormalisedCrate, ProfileManagerType, UnverifiedEntityDefinition, NormalisedEntityDefinition, EntityReference, PrimitiveType, NormalisedProfile } from '../types.js';
|
|
2
|
+
interface errorsInterface {
|
|
3
|
+
hasError: Boolean;
|
|
4
|
+
init: {
|
|
5
|
+
description: string;
|
|
6
|
+
messages: string[];
|
|
7
|
+
};
|
|
8
|
+
missingIdentifier: {
|
|
9
|
+
description: string;
|
|
10
|
+
entity: UnverifiedEntityDefinition[];
|
|
11
|
+
};
|
|
12
|
+
missingTypeDefinition: {
|
|
13
|
+
description: string;
|
|
14
|
+
entity: UnverifiedEntityDefinition[];
|
|
15
|
+
};
|
|
16
|
+
invalidIdentifier: {
|
|
17
|
+
description: string;
|
|
18
|
+
entity: UnverifiedEntityDefinition[];
|
|
19
|
+
};
|
|
20
|
+
clash: {
|
|
21
|
+
description: string;
|
|
22
|
+
messages: string[];
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
interface warningsInterface {
|
|
26
|
+
hasWarning: Boolean;
|
|
27
|
+
init: {
|
|
28
|
+
description: string;
|
|
29
|
+
messages: string[];
|
|
30
|
+
};
|
|
31
|
+
invalidIdentifier: {
|
|
32
|
+
description: string;
|
|
33
|
+
entity: UnverifiedEntityDefinition[];
|
|
34
|
+
};
|
|
35
|
+
clash: {
|
|
36
|
+
description: string;
|
|
37
|
+
messages: string[];
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @class
|
|
42
|
+
*
|
|
43
|
+
* CrateManager
|
|
44
|
+
*
|
|
45
|
+
* A class to work with RO-Crates
|
|
46
|
+
*
|
|
47
|
+
* @param {crate} - an RO Crate to handle
|
|
48
|
+
*/
|
|
49
|
+
export declare class CrateManager {
|
|
50
|
+
crate: {
|
|
51
|
+
"@context": NormalisedContext;
|
|
52
|
+
"@graph": Array<NormalisedEntityDefinition | undefined>;
|
|
53
|
+
};
|
|
54
|
+
pm: ProfileManagerType;
|
|
55
|
+
reverse: {
|
|
56
|
+
[key: string]: any;
|
|
57
|
+
};
|
|
58
|
+
graphLength: number;
|
|
59
|
+
rootDescriptor?: number;
|
|
60
|
+
rootDataset?: number;
|
|
61
|
+
entityIdIndex: {
|
|
62
|
+
[key: string]: number;
|
|
63
|
+
};
|
|
64
|
+
providedContext: UnverifiedContext;
|
|
65
|
+
contextDefinitions: {
|
|
66
|
+
[key: string]: boolean;
|
|
67
|
+
};
|
|
68
|
+
localContext: {
|
|
69
|
+
[key: string]: string;
|
|
70
|
+
};
|
|
71
|
+
entityTypes: {
|
|
72
|
+
[key: string]: number;
|
|
73
|
+
};
|
|
74
|
+
entityTimestamps: Boolean;
|
|
75
|
+
blankNodes: string[];
|
|
76
|
+
coreProperties: string[];
|
|
77
|
+
errors: errorsInterface;
|
|
78
|
+
warnings: warningsInterface;
|
|
79
|
+
constructor({ crate, pm, context, entityTimestamps, }: {
|
|
80
|
+
crate: UnverifiedCrate;
|
|
81
|
+
pm?: ProfileManagerType;
|
|
82
|
+
context?: UnverifiedContext;
|
|
83
|
+
entityTimestamps?: Boolean;
|
|
84
|
+
});
|
|
85
|
+
/** Get the context
|
|
86
|
+
* @returns the crate context
|
|
87
|
+
*/
|
|
88
|
+
getContext(): NormalisedContext;
|
|
89
|
+
/**
|
|
90
|
+
* Set the context
|
|
91
|
+
*
|
|
92
|
+
* This is equivalent to a profile author setting a context. It gets
|
|
93
|
+
* used as is and data updates going forward do not get dealth with.
|
|
94
|
+
* @param {*} context
|
|
95
|
+
*/
|
|
96
|
+
setContext(context: NormalisedContext): void;
|
|
97
|
+
/**
|
|
98
|
+
* Set a profile
|
|
99
|
+
*
|
|
100
|
+
* CrateManager can set reverse associations if defined in a profile.
|
|
101
|
+
*
|
|
102
|
+
* */
|
|
103
|
+
setProfileManager(pm: ProfileManagerType): void;
|
|
104
|
+
/**
|
|
105
|
+
* Get the root dataset
|
|
106
|
+
*
|
|
107
|
+
* @returns the root dataset entity
|
|
108
|
+
* @example
|
|
109
|
+
|
|
110
|
+
const cm = new CrateManager({ crate })
|
|
111
|
+
let rd = cm.getRootDataset()
|
|
112
|
+
|
|
113
|
+
*/
|
|
114
|
+
getRootDataset(): NormalisedEntityDefinition;
|
|
115
|
+
getRootDescriptor(): NormalisedEntityDefinition;
|
|
116
|
+
/**
|
|
117
|
+
* Get an entity
|
|
118
|
+
*
|
|
119
|
+
* @param {Object} options
|
|
120
|
+
* @param {string} options.id - the id of the entity to get
|
|
121
|
+
* @param {boolean} options.stub - if true, only the `@id, @type and name` prop's will be returned. That is,
|
|
122
|
+
* you get a stub entry not the complete entity data.
|
|
123
|
+
* @param {boolean} options.link - if true, all the associated entities are filled out as stubs
|
|
124
|
+
* @param {boolean} options.materialise - if true, the entity will be created if it doesn't exist (consider
|
|
125
|
+
* when URL's point outside the crate, in this case, they will be created as entities inside it)
|
|
126
|
+
* @returns the entity
|
|
127
|
+
*
|
|
128
|
+
* @example
|
|
129
|
+
|
|
130
|
+
const cm = new CrateManager({ crate })
|
|
131
|
+
|
|
132
|
+
// get the full entity
|
|
133
|
+
let rd = cm.getEntity({ id: './' })
|
|
134
|
+
|
|
135
|
+
// return a stub entry
|
|
136
|
+
rd = cm.getEntity({ id: './', stub: true })
|
|
137
|
+
|
|
138
|
+
*/
|
|
139
|
+
getEntity({ id, stub, link, materialise, }: {
|
|
140
|
+
id: string;
|
|
141
|
+
stub?: boolean;
|
|
142
|
+
link?: boolean;
|
|
143
|
+
materialise?: boolean;
|
|
144
|
+
}): NormalisedEntityDefinition | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* Get Entity Types
|
|
147
|
+
*
|
|
148
|
+
* @returns an array of entity types, sorted, found in the crate
|
|
149
|
+
*/
|
|
150
|
+
getEntityTypes(): string[];
|
|
151
|
+
/**
|
|
152
|
+
* @generator
|
|
153
|
+
*
|
|
154
|
+
* @param {Object} params
|
|
155
|
+
* @param {Number} params.limit - how many entities to return
|
|
156
|
+
* @param {string} params.query - a string to match against @id, @type and name
|
|
157
|
+
* @param {string} params.type - a string to match against @type
|
|
158
|
+
* @yields {entity}
|
|
159
|
+
* @example
|
|
160
|
+
|
|
161
|
+
const cm = new CrateManager({crate})
|
|
162
|
+
let entities = cm.getEntities()
|
|
163
|
+
|
|
164
|
+
for (let entity of entities) {
|
|
165
|
+
...
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
To get an array just spread the return
|
|
169
|
+
let entities = [ ...cm.getEntities() ]
|
|
170
|
+
|
|
171
|
+
// query @id, @type and name
|
|
172
|
+
entities = cm.getEntities({ query: 'person' })
|
|
173
|
+
|
|
174
|
+
// query @id, @type and name for entites of type Person
|
|
175
|
+
entities = cm.getEntities({ query: 'person', type: 'Person' })
|
|
176
|
+
|
|
177
|
+
// query @id, @type and name for entites of type Person - limit 10 matches
|
|
178
|
+
entities = cm.getEntities({ query: 'person', type: 'Person', limit: 10 })
|
|
179
|
+
|
|
180
|
+
*/
|
|
181
|
+
getEntities(params?: {
|
|
182
|
+
limit?: number;
|
|
183
|
+
query?: string;
|
|
184
|
+
type?: string;
|
|
185
|
+
}): Generator<NormalisedEntityDefinition>;
|
|
186
|
+
/**
|
|
187
|
+
*
|
|
188
|
+
* locateEntity
|
|
189
|
+
*
|
|
190
|
+
* Given a set of id's, find the entity or entities that link to all of them.
|
|
191
|
+
* This is really for finding grouping type entities like Relationships and Actions so that
|
|
192
|
+
* you can augment their description.
|
|
193
|
+
* @param { object } params
|
|
194
|
+
* @param { array } params.entityIds - an array of entity id's that are linked to from another entity
|
|
195
|
+
* @param { boolean } params.strict - if true return entities that have exactly entityIds linked. If false,
|
|
196
|
+
* return entities that have at least entityIds linked
|
|
197
|
+
* @returns [] entities matching or undefined
|
|
198
|
+
*/
|
|
199
|
+
locateEntity({ entityIds, strict, }: {
|
|
200
|
+
entityIds: string[];
|
|
201
|
+
strict?: boolean;
|
|
202
|
+
}): NormalisedEntityDefinition[] | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* resolveLinkedEntities
|
|
205
|
+
*
|
|
206
|
+
* Given an entity and a profile, if the entity matches a resolve configuration
|
|
207
|
+
* this method will populate the entities linked from the resolve properties
|
|
208
|
+
* defined in the profile.
|
|
209
|
+
*
|
|
210
|
+
* @param {Object} entity
|
|
211
|
+
* @param {Object} profile
|
|
212
|
+
*
|
|
213
|
+
* @returns an array of associations
|
|
214
|
+
* @example
|
|
215
|
+
|
|
216
|
+
// given an entity
|
|
217
|
+
let entity = {
|
|
218
|
+
"@id": "#createAction1",
|
|
219
|
+
"@type": ["CreateAction"],
|
|
220
|
+
name: "A very long named create action to demonstrate what happens with display of long names",
|
|
221
|
+
object: { "@id": "#person2" },
|
|
222
|
+
participant: { "@id": "#participant1" },
|
|
223
|
+
agent: { "@id": "#agent1" },
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
// and a profile with a resolve configuration
|
|
227
|
+
let profile = {
|
|
228
|
+
...
|
|
229
|
+
resolve: [
|
|
230
|
+
{
|
|
231
|
+
types: [ 'Relationship', 'Related' ],
|
|
232
|
+
properties: [ 'source', 'target' ]
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
types: [ 'CreateAction', 'EditAction' ],
|
|
236
|
+
properties: [ 'object', 'participant', 'agent' ]
|
|
237
|
+
}
|
|
238
|
+
]
|
|
239
|
+
...
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
// get a list of the associated entities
|
|
243
|
+
console.log(cm.resolveLinkedEntityAssociations({ entity, profile }))
|
|
244
|
+
|
|
245
|
+
|
|
246
|
+
associations === [
|
|
247
|
+
{
|
|
248
|
+
property: 'object',
|
|
249
|
+
'@id': '#person2',
|
|
250
|
+
'@type': [ 'Thing' ],
|
|
251
|
+
name: '#person2'
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
property: 'participant',
|
|
255
|
+
'@id': '#participant1',
|
|
256
|
+
'@type': [ 'Thing' ],
|
|
257
|
+
name: '#participant1'
|
|
258
|
+
},
|
|
259
|
+
{
|
|
260
|
+
property: 'agent',
|
|
261
|
+
'@id': '#agent1',
|
|
262
|
+
'@type': [ 'Thing' ],
|
|
263
|
+
name: '#agent1'
|
|
264
|
+
}
|
|
265
|
+
]
|
|
266
|
+
|
|
267
|
+
*/
|
|
268
|
+
resolveLinkedEntityAssociations({ entity, profile, }: {
|
|
269
|
+
entity: NormalisedEntityDefinition;
|
|
270
|
+
profile: NormalisedProfile;
|
|
271
|
+
}): {
|
|
272
|
+
property: string;
|
|
273
|
+
"@id": string;
|
|
274
|
+
"@type": string[];
|
|
275
|
+
name: string;
|
|
276
|
+
}[] | [];
|
|
277
|
+
/**
|
|
278
|
+
* Add an entity to the graph
|
|
279
|
+
*
|
|
280
|
+
* The entity must have '@id' and '@type' defined.
|
|
281
|
+
*
|
|
282
|
+
* @param {Object} entity - an entity definition to add to the crate
|
|
283
|
+
* @returns the entity
|
|
284
|
+
* @example
|
|
285
|
+
|
|
286
|
+
const cm = new CrateManager({ crate })
|
|
287
|
+
let entity = {
|
|
288
|
+
"@id": '#e1',
|
|
289
|
+
"@type": "Person",
|
|
290
|
+
name: 'person1',
|
|
291
|
+
};
|
|
292
|
+
let r = cm.addEntity(entity);
|
|
293
|
+
|
|
294
|
+
*/
|
|
295
|
+
addEntity(entity: UnverifiedEntityDefinition): NormalisedEntityDefinition;
|
|
296
|
+
/**
|
|
297
|
+
* Add an entity with a blank node id ('_:...') to the graph.
|
|
298
|
+
*
|
|
299
|
+
* Use this when you want to add a non contextual entity to the graph. In thoses
|
|
300
|
+
* cases providing an `@id` and name don't really make sense even though those properties are still required
|
|
301
|
+
* therefore this method simplifies the process of adding those entity types. For example,
|
|
302
|
+
* Actions (e.g. CreateAction), Relationships, GeoShape, GeoCoordinates etc
|
|
303
|
+
*
|
|
304
|
+
* @param {string} type - the entity type to configure for the new entity
|
|
305
|
+
* @returns the entity
|
|
306
|
+
* @example
|
|
307
|
+
|
|
308
|
+
const cm = new CrateManager({ crate })
|
|
309
|
+
let r = cm.addBlankNode('Relationship);
|
|
310
|
+
|
|
311
|
+
r === {
|
|
312
|
+
'@id': '_:Relationship1',
|
|
313
|
+
'@type': [ 'Relationship' ],
|
|
314
|
+
name: '_:Relationship1'
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
*/
|
|
318
|
+
addBlankNode(type: string): NormalisedEntityDefinition;
|
|
319
|
+
/**
|
|
320
|
+
* Add files or folders - use addFile or addFolder in preference to this
|
|
321
|
+
*
|
|
322
|
+
* This is a helper method specifically for adding files and folders in the crate. This method
|
|
323
|
+
* will add the intermediate paths as 'Datasets' (as per the spec) and link everything via the hasPart
|
|
324
|
+
* property as required. It is assumed that the path is relative to the root of the folder.
|
|
325
|
+
*
|
|
326
|
+
* @param {object} params
|
|
327
|
+
* @param {string} params.path - a file or folder path
|
|
328
|
+
* @param {string} params.type - the type of thing being added - File or Dataset
|
|
329
|
+
* @returns the entity
|
|
330
|
+
* @example
|
|
331
|
+
|
|
332
|
+
const cm = new CrateManager({ crate })
|
|
333
|
+
let r = cm.addFileOrFolder('/a/b/c/file.txt);
|
|
334
|
+
*/
|
|
335
|
+
addFileOrFolder({ path, type, }: {
|
|
336
|
+
path: string;
|
|
337
|
+
type: string;
|
|
338
|
+
}): NormalisedEntityDefinition;
|
|
339
|
+
/**
|
|
340
|
+
* Add file
|
|
341
|
+
*
|
|
342
|
+
* This is a helper method specifically for adding files to the crate. This method
|
|
343
|
+
* will add the intermediate paths as 'Datasets' (as per the spec) and link everything via the hasPart
|
|
344
|
+
* property as required. It is assumed that the path is relative to the root of the folder.
|
|
345
|
+
*
|
|
346
|
+
* @param {string} path - a file path to add - ensure the file path is relative to the folder root
|
|
347
|
+
* @returns the entity
|
|
348
|
+
* @example
|
|
349
|
+
|
|
350
|
+
const cm = new CrateManager({ crate })
|
|
351
|
+
let r = cm.addFile('/a/b/c/file.txt);
|
|
352
|
+
*/
|
|
353
|
+
addFile(path: string): NormalisedEntityDefinition;
|
|
354
|
+
/**
|
|
355
|
+
* Add folder
|
|
356
|
+
*
|
|
357
|
+
* This is a helper method specifically for adding folders to the crate. This method
|
|
358
|
+
* will add the intermediate paths as 'Datasets' (as per the spec) and link everything via the hasPart
|
|
359
|
+
* property as required. It is assumed that the path is relative to the root of the folder.
|
|
360
|
+
*
|
|
361
|
+
* @param {string} path - a folder path to add - ensure the folder path is relative to the folder root
|
|
362
|
+
* @returns the entity
|
|
363
|
+
* @example
|
|
364
|
+
|
|
365
|
+
const cm = new CrateManager({ crate })
|
|
366
|
+
let r = cm.addFolder('/a/b/c);
|
|
367
|
+
*/
|
|
368
|
+
addFolder(path: string): NormalisedEntityDefinition;
|
|
369
|
+
/**
|
|
370
|
+
* Delete an entity
|
|
371
|
+
*
|
|
372
|
+
* @param {Object} options
|
|
373
|
+
* @param {string} options.id - the id of the entity to delete from the crate
|
|
374
|
+
*
|
|
375
|
+
* @returns true if successful
|
|
376
|
+
* @example
|
|
377
|
+
|
|
378
|
+
const cm = new CrateManager({ crate })
|
|
379
|
+
cm.deleteEntity({ id: '#e1' })
|
|
380
|
+
|
|
381
|
+
*/
|
|
382
|
+
deleteEntity({ id }: {
|
|
383
|
+
id: string;
|
|
384
|
+
}): true | undefined;
|
|
385
|
+
/**
|
|
386
|
+
* Set a property on an entity
|
|
387
|
+
*
|
|
388
|
+
* @param {Object} options
|
|
389
|
+
* @param {options.id} options.id - the id of the entity to add the property to
|
|
390
|
+
* @param {options.property } options.property - the property to add
|
|
391
|
+
* @param {options.value} options.value - the data to add to that property. Can be string or object with '@id'
|
|
392
|
+
* @returns true if successful
|
|
393
|
+
* @example
|
|
394
|
+
|
|
395
|
+
const cm = new CrateManager({ crate })
|
|
396
|
+
const authorId = chance.url();
|
|
397
|
+
|
|
398
|
+
// setting an object reference
|
|
399
|
+
cm.setProperty({ id: "./", property: "author", value: { "@id": authorId } });
|
|
400
|
+
|
|
401
|
+
// setting a text string
|
|
402
|
+
cm.setProperty({ id: "./", property: "author", value: "text" });
|
|
403
|
+
|
|
404
|
+
// setting a number
|
|
405
|
+
cm.setProperty({ id: "./", property: "author", value: 3 });
|
|
406
|
+
|
|
407
|
+
*/
|
|
408
|
+
setProperty({ id, property, propertyId, value, }: {
|
|
409
|
+
id: string;
|
|
410
|
+
property: string;
|
|
411
|
+
propertyId?: string;
|
|
412
|
+
value: PrimitiveType | EntityReference;
|
|
413
|
+
}): boolean | undefined;
|
|
414
|
+
/**
|
|
415
|
+
* Update a property on an entity
|
|
416
|
+
*
|
|
417
|
+
* @param {Object} options
|
|
418
|
+
* @param {string} options.id - the id of the entity to add the property to
|
|
419
|
+
* @param {string} options.property - the property to add
|
|
420
|
+
* @param {string} options.idx - the idx of the property array to update
|
|
421
|
+
* @param {string} options.value - the data to add to that property, string or object with '@id'
|
|
422
|
+
* @example
|
|
423
|
+
|
|
424
|
+
const cm = new CrateManager({ crate })
|
|
425
|
+
cm.updateProperty({ id: "./", property: "@id", value: "something else" });
|
|
426
|
+
cm.updateProperty({ id: "./", property: "author", idx: 1, value: "new" });
|
|
427
|
+
|
|
428
|
+
*/
|
|
429
|
+
updateProperty({ id, property, idx, value, }: {
|
|
430
|
+
id: string;
|
|
431
|
+
property: string;
|
|
432
|
+
idx?: number;
|
|
433
|
+
value: PrimitiveType | PrimitiveType[] | EntityReference;
|
|
434
|
+
}): NormalisedEntityDefinition | undefined | string;
|
|
435
|
+
/**
|
|
436
|
+
* Delete a specific property from the entity. That is, an instance of a property.
|
|
437
|
+
*
|
|
438
|
+
* @param {Object}
|
|
439
|
+
* @param {string} options.id - the id of the entity to remove the property value from
|
|
440
|
+
* @param {string} options.property - the property
|
|
441
|
+
* @param {string} options.idx - the idx of the property array to delete
|
|
442
|
+
* @example
|
|
443
|
+
|
|
444
|
+
const cm = new CrateManager({ crate })
|
|
445
|
+
cm.deleteProperty({ id: "./", property: "author", idx: 1 });
|
|
446
|
+
|
|
447
|
+
*/
|
|
448
|
+
deleteProperty({ id, property, idx }: {
|
|
449
|
+
id: string;
|
|
450
|
+
property: string;
|
|
451
|
+
idx?: number;
|
|
452
|
+
}): void;
|
|
453
|
+
/**
|
|
454
|
+
* Ingest and link a nested json object
|
|
455
|
+
*
|
|
456
|
+
* @param {Object} options
|
|
457
|
+
* @param {string} options.id - the id of the entity to join the data into
|
|
458
|
+
* @param {string} options.property - the property to join the data into
|
|
459
|
+
* @param {string} options.propertyId - the propertyId of the property - ie the url to the definition
|
|
460
|
+
* @param {json} options.json - the data object to join in
|
|
461
|
+
* @example
|
|
462
|
+
|
|
463
|
+
const cm = new CrateManager({ crate })
|
|
464
|
+
let json = {
|
|
465
|
+
...,
|
|
466
|
+
}
|
|
467
|
+
cm.ingestAndLink({
|
|
468
|
+
id: "./",
|
|
469
|
+
property: "language",
|
|
470
|
+
json,
|
|
471
|
+
});
|
|
472
|
+
|
|
473
|
+
*/
|
|
474
|
+
ingestAndLink({ id, property, propertyId, json, }: {
|
|
475
|
+
id: string | undefined;
|
|
476
|
+
property: string | undefined;
|
|
477
|
+
propertyId: string | undefined;
|
|
478
|
+
json: UnverifiedEntityDefinition;
|
|
479
|
+
}): void;
|
|
480
|
+
/**
|
|
481
|
+
* Flatten a nested json object to an array
|
|
482
|
+
*
|
|
483
|
+
* @param {Object} json - a potentially nested data blob to flatten into array
|
|
484
|
+
* @returns an array of objects
|
|
485
|
+
* @example
|
|
486
|
+
|
|
487
|
+
const cm = new CrateManager({ crate })
|
|
488
|
+
let json = {
|
|
489
|
+
...,
|
|
490
|
+
}
|
|
491
|
+
let arrayOfObjects = cm.flatten(json)
|
|
492
|
+
|
|
493
|
+
*/
|
|
494
|
+
flatten(json: UnverifiedEntityDefinition): NormalisedEntityDefinition[];
|
|
495
|
+
/**
|
|
496
|
+
* Link two entities
|
|
497
|
+
*
|
|
498
|
+
* Link two entities via a property. If there is a profile defined
|
|
499
|
+
* and it has reverse associations, then they will be added.
|
|
500
|
+
*
|
|
501
|
+
* @param {Object} options
|
|
502
|
+
* @param {string} options.id - the id of the entity to add the association to
|
|
503
|
+
* @param {string} options.property - the property to add the association to
|
|
504
|
+
* @param {string} options.propertyId - the propertyId of the property - ie the url to the definition
|
|
505
|
+
* @param {object} options.value - an object with '@id' defining the association to create
|
|
506
|
+
* @example
|
|
507
|
+
|
|
508
|
+
const cm = new CrateManager({ crate })
|
|
509
|
+
cm.linkEntity({ id: './', property: 'author', value: { '@id': '#e1' }})
|
|
510
|
+
|
|
511
|
+
**/
|
|
512
|
+
linkEntity({ id, property, propertyId, value, }: {
|
|
513
|
+
id: string;
|
|
514
|
+
property: string;
|
|
515
|
+
propertyId?: string;
|
|
516
|
+
value: {
|
|
517
|
+
"@id": string;
|
|
518
|
+
};
|
|
519
|
+
}): void;
|
|
520
|
+
/**
|
|
521
|
+
* Unlink two entities
|
|
522
|
+
*
|
|
523
|
+
* Remove an association between two entities. If there is a profile defined
|
|
524
|
+
* and it has reverse associations, then they will be removed as well.
|
|
525
|
+
*
|
|
526
|
+
* @param {Object} options
|
|
527
|
+
* @param {string} options.id - the id of the entity to remove the association from
|
|
528
|
+
* @param {string} options.property - the property containing the association
|
|
529
|
+
* @param {object} options.value - an object with '@id' defining the association to remove
|
|
530
|
+
* @example
|
|
531
|
+
|
|
532
|
+
const cm = new CrateManager({ crate })
|
|
533
|
+
const cm = new CrateManager({ crate })
|
|
534
|
+
cm.unlinkEntity({ id: './', property: 'author', value: { '@id': '#e1' }})
|
|
535
|
+
|
|
536
|
+
**/
|
|
537
|
+
unlinkEntity({ id, property, value, stop, }: {
|
|
538
|
+
id: string | undefined;
|
|
539
|
+
property: string | undefined;
|
|
540
|
+
value: {
|
|
541
|
+
"@id": string;
|
|
542
|
+
} | undefined;
|
|
543
|
+
stop?: boolean;
|
|
544
|
+
}): void;
|
|
545
|
+
/**
|
|
546
|
+
* Purge unlinked entities from the crate
|
|
547
|
+
*
|
|
548
|
+
* Clean up the graph and purge any unlinked entities including disconnected subtrees.
|
|
549
|
+
* @example
|
|
550
|
+
|
|
551
|
+
const cm = new CrateManager({ crate })
|
|
552
|
+
cm.purgeUnlinkedEntities()
|
|
553
|
+
|
|
554
|
+
*/
|
|
555
|
+
purgeUnlinkedEntities(): void;
|
|
556
|
+
/**
|
|
557
|
+
* Export the RO-Crate
|
|
558
|
+
* @returns the complete ro-crate
|
|
559
|
+
* @example
|
|
560
|
+
|
|
561
|
+
const cm = new CrateManager({ crate })
|
|
562
|
+
let crate = cm.exportCrate()
|
|
563
|
+
|
|
564
|
+
*/
|
|
565
|
+
exportCrate(): NormalisedCrate;
|
|
566
|
+
/**
|
|
567
|
+
* exportEntityTemplate
|
|
568
|
+
*
|
|
569
|
+
* Export an entity as a template to be reused.
|
|
570
|
+
* 1. If resolveDepth = 0 then the entity is returned with all associations removed
|
|
571
|
+
* 2. If resolveDepth = 1 then the entity is returned with one level of associations populated but
|
|
572
|
+
* all of their associations will be removed.
|
|
573
|
+
*
|
|
574
|
+
* @param {Object} options
|
|
575
|
+
* @param {String} options.id - the id of the entity to export as a template
|
|
576
|
+
* @param {String} options.resolveDepth - 0 or 1. If 1, linked entities will be joined in
|
|
577
|
+
*
|
|
578
|
+
* @returns entity
|
|
579
|
+
* @example
|
|
580
|
+
|
|
581
|
+
const cm = new CrateManager({ crate })
|
|
582
|
+
let entity = cm.exportEntityTemplate({ id: '#person' })
|
|
583
|
+
let entity = cm.exportEntityTemplate({ id: '#person', resolveDepth: 1 })
|
|
584
|
+
|
|
585
|
+
*/
|
|
586
|
+
exportEntityTemplate({ id, resolveDepth, }: {
|
|
587
|
+
id: string;
|
|
588
|
+
resolveDepth?: number;
|
|
589
|
+
}): NormalisedEntityDefinition;
|
|
590
|
+
/**
|
|
591
|
+
* getErrors
|
|
592
|
+
*
|
|
593
|
+
* @returns { errors }
|
|
594
|
+
*
|
|
595
|
+
*/
|
|
596
|
+
getErrors(): errorsInterface;
|
|
597
|
+
/**
|
|
598
|
+
* getWarnings
|
|
599
|
+
*
|
|
600
|
+
* @returns { warnings }
|
|
601
|
+
*/
|
|
602
|
+
getWarnings(): warningsInterface;
|
|
603
|
+
__updateContext({ name, id }: {
|
|
604
|
+
name: string;
|
|
605
|
+
id?: string;
|
|
606
|
+
}): void;
|
|
607
|
+
/**
|
|
608
|
+
* Normalise context
|
|
609
|
+
*
|
|
610
|
+
* Collapse all objects into a single object
|
|
611
|
+
*
|
|
612
|
+
* @param {*} context
|
|
613
|
+
* @returns context
|
|
614
|
+
*/
|
|
615
|
+
__normaliseContext(context: UnverifiedContext): NormalisedContext;
|
|
616
|
+
__storeEntityType(entity: NormalisedEntityDefinition): void;
|
|
617
|
+
__removeEntityType(entity: NormalisedEntityDefinition): void;
|
|
618
|
+
__collectAllDefinitions(context: NormalisedContext): {
|
|
619
|
+
[key: string]: boolean;
|
|
620
|
+
};
|
|
621
|
+
__setError(error: keyof typeof this.errors, entity: string | UnverifiedEntityDefinition): void;
|
|
622
|
+
__setWarning(warning: keyof typeof this.warnings, entity: string | UnverifiedEntityDefinition): void;
|
|
623
|
+
__materialiseEntity({ id }: {
|
|
624
|
+
id: string;
|
|
625
|
+
}): NormalisedEntityDefinition;
|
|
626
|
+
__confirmNoClash({ entity, mintNewId, }: {
|
|
627
|
+
entity: NormalisedEntityDefinition;
|
|
628
|
+
mintNewId?: boolean;
|
|
629
|
+
}): NormalisedEntityDefinition | boolean;
|
|
630
|
+
__updateEntityId({ oldId, newId }: {
|
|
631
|
+
oldId: string;
|
|
632
|
+
newId: string;
|
|
633
|
+
}): NormalisedEntityDefinition | undefined;
|
|
634
|
+
__addReverse({ id, property, value, }: {
|
|
635
|
+
id: string;
|
|
636
|
+
property: string;
|
|
637
|
+
value: EntityReference;
|
|
638
|
+
}): void;
|
|
639
|
+
__removeAssociations(entity: NormalisedEntityDefinition): NormalisedEntityDefinition;
|
|
640
|
+
}
|
|
641
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { UnverifiedEntityDefinition, NormalisedEntityDefinition } from '../types.js';
|
|
2
|
+
export declare const urlProtocols: string[];
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {string} value - string to check as a URL: checks 'http','https','ftp', 'arcp'
|
|
6
|
+
*/
|
|
7
|
+
export declare function isURL(value: string | number | boolean | undefined | null): boolean;
|
|
8
|
+
/**
|
|
9
|
+
* This method normalises an entity. It checks that the '@type' is sensible, '@id' is valid and sets the name to the '@id' if not set
|
|
10
|
+
*
|
|
11
|
+
* @param {Object} entity - an entity to normalise
|
|
12
|
+
* @param {string} i - if an id is not defined, then it will be set to #e${i}
|
|
13
|
+
*
|
|
14
|
+
* @returns the entity ready for use
|
|
15
|
+
*/
|
|
16
|
+
export declare function normalise(entity: UnverifiedEntityDefinition, i: number): NormalisedEntityDefinition;
|
|
17
|
+
export declare function normaliseEntityType({ entity }: {
|
|
18
|
+
entity: UnverifiedEntityDefinition;
|
|
19
|
+
}): string[];
|
|
20
|
+
/**
|
|
21
|
+
*
|
|
22
|
+
* Mint an empty RO-Crate that conforms to the spec
|
|
23
|
+
*
|
|
24
|
+
* @returns a skeleton crate ready to be used
|
|
25
|
+
*/
|
|
26
|
+
export declare function mintNewCrate(): {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|