@ldo/solid-type-index 1.0.0-alpha.32 → 1.0.0-alpha.34
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/.ldo/profile.context.cjs +22 -0
- package/dist/.ldo/profile.context.js +22 -0
- package/dist/.ldo/profile.context.js.map +1 -0
- package/dist/.ldo/profile.schema.cjs +52 -0
- package/dist/.ldo/profile.schema.js +52 -0
- package/dist/.ldo/profile.schema.js.map +1 -0
- package/dist/.ldo/profile.shapeTypes.cjs +20 -0
- package/dist/.ldo/profile.shapeTypes.js +21 -0
- package/dist/.ldo/profile.shapeTypes.js.map +1 -0
- package/dist/.ldo/profile.typings.d.cts +32 -0
- package/dist/.ldo/profile.typings.d.cts.map +1 -0
- package/dist/.ldo/profile.typings.d.ts +32 -0
- package/dist/.ldo/profile.typings.d.ts.map +1 -0
- package/dist/.ldo/typeIndex.context.cjs +55 -0
- package/dist/.ldo/typeIndex.context.js +55 -0
- package/dist/.ldo/typeIndex.context.js.map +1 -0
- package/dist/.ldo/typeIndex.schema.cjs +117 -0
- package/dist/.ldo/typeIndex.schema.js +117 -0
- package/dist/.ldo/typeIndex.schema.js.map +1 -0
- package/dist/.ldo/typeIndex.shapeTypes.cjs +29 -0
- package/dist/.ldo/typeIndex.shapeTypes.js +29 -0
- package/dist/.ldo/typeIndex.shapeTypes.js.map +1 -0
- package/dist/.ldo/typeIndex.typings.d.cts +39 -0
- package/dist/.ldo/typeIndex.typings.d.cts.map +1 -0
- package/dist/.ldo/typeIndex.typings.d.ts +39 -0
- package/dist/.ldo/typeIndex.typings.d.ts.map +1 -0
- package/dist/_virtual/rolldown_runtime.cjs +30 -0
- package/dist/constants.cjs +10 -0
- package/dist/constants.js +8 -0
- package/dist/constants.js.map +1 -0
- package/dist/getTypeIndex.cjs +57 -0
- package/dist/getTypeIndex.d.cts +16 -0
- package/dist/getTypeIndex.d.cts.map +1 -0
- package/dist/getTypeIndex.d.ts +16 -0
- package/dist/getTypeIndex.d.ts.map +1 -0
- package/dist/getTypeIndex.js +55 -0
- package/dist/getTypeIndex.js.map +1 -0
- package/dist/index.cjs +16 -0
- package/dist/index.d.cts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +6 -0
- package/dist/react/useInstanceUris.cjs +31 -0
- package/dist/react/useInstanceUris.d.cts +15 -0
- package/dist/react/useInstanceUris.d.cts.map +1 -0
- package/dist/react/useInstanceUris.d.ts +15 -0
- package/dist/react/useInstanceUris.d.ts.map +1 -0
- package/dist/react/useInstanceUris.js +31 -0
- package/dist/react/useInstanceUris.js.map +1 -0
- package/dist/react/useTypeIndexProfile.cjs +14 -0
- package/dist/react/useTypeIndexProfile.d.cts +9 -0
- package/dist/react/useTypeIndexProfile.d.cts.map +1 -0
- package/dist/react/useTypeIndexProfile.d.ts +9 -0
- package/dist/react/useTypeIndexProfile.d.ts.map +1 -0
- package/dist/react/useTypeIndexProfile.js +14 -0
- package/dist/react/useTypeIndexProfile.js.map +1 -0
- package/dist/react/util/useSubscribeToUris.cjs +28 -0
- package/dist/react/util/useSubscribeToUris.js +28 -0
- package/dist/react/util/useSubscribeToUris.js.map +1 -0
- package/dist/setTypeIndex.cjs +129 -0
- package/dist/{types/setTypeIndex.d.ts → setTypeIndex.d.cts} +17 -13
- package/dist/setTypeIndex.d.cts.map +1 -0
- package/dist/setTypeIndex.d.ts +57 -0
- package/dist/setTypeIndex.d.ts.map +1 -0
- package/dist/setTypeIndex.js +125 -0
- package/dist/setTypeIndex.js.map +1 -0
- package/dist/util/Options.cjs +16 -0
- package/dist/util/Options.d.cts +11 -0
- package/dist/util/Options.d.cts.map +1 -0
- package/dist/util/Options.d.ts +11 -0
- package/dist/util/Options.d.ts.map +1 -0
- package/dist/util/Options.js +16 -0
- package/dist/util/Options.js.map +1 -0
- package/package.json +22 -18
- package/src/.ldo/profile.shapeTypes.ts +3 -3
- package/src/.ldo/typeIndex.shapeTypes.ts +3 -3
- package/src/getTypeIndex.ts +7 -7
- package/src/index.ts +4 -4
- package/src/react/useInstanceUris.ts +5 -5
- package/src/react/useTypeIndexProfile.ts +2 -2
- package/src/setTypeIndex.ts +6 -6
- package/dist/cjs/.ldo/profile.context.cjs +0 -21
- package/dist/cjs/.ldo/profile.context.js.map +0 -1
- package/dist/cjs/.ldo/profile.schema.cjs +0 -64
- package/dist/cjs/.ldo/profile.schema.js.map +0 -1
- package/dist/cjs/.ldo/profile.shapeTypes.cjs +0 -19
- package/dist/cjs/.ldo/profile.shapeTypes.js.map +0 -1
- package/dist/cjs/.ldo/profile.typings.cjs +0 -3
- package/dist/cjs/.ldo/profile.typings.js.map +0 -1
- package/dist/cjs/.ldo/typeIndex.context.cjs +0 -66
- package/dist/cjs/.ldo/typeIndex.context.js.map +0 -1
- package/dist/cjs/.ldo/typeIndex.schema.cjs +0 -146
- package/dist/cjs/.ldo/typeIndex.schema.js.map +0 -1
- package/dist/cjs/.ldo/typeIndex.shapeTypes.cjs +0 -27
- package/dist/cjs/.ldo/typeIndex.shapeTypes.js.map +0 -1
- package/dist/cjs/.ldo/typeIndex.typings.cjs +0 -3
- package/dist/cjs/.ldo/typeIndex.typings.js.map +0 -1
- package/dist/cjs/constants.cjs +0 -9
- package/dist/cjs/constants.js.map +0 -1
- package/dist/cjs/getTypeIndex.cjs +0 -67
- package/dist/cjs/getTypeIndex.js.map +0 -1
- package/dist/cjs/index.cjs +0 -21
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/react/useInstanceUris.cjs +0 -33
- package/dist/cjs/react/useInstanceUris.js.map +0 -1
- package/dist/cjs/react/useTypeIndexProfile.cjs +0 -12
- package/dist/cjs/react/useTypeIndexProfile.js.map +0 -1
- package/dist/cjs/react/util/useSubscribeToUris.cjs +0 -33
- package/dist/cjs/react/util/useSubscribeToUris.js.map +0 -1
- package/dist/cjs/setTypeIndex.cjs +0 -163
- package/dist/cjs/setTypeIndex.js.map +0 -1
- package/dist/cjs/util/Options.cjs +0 -12
- package/dist/cjs/util/Options.js.map +0 -1
- package/dist/esm/.ldo/profile.context.js +0 -18
- package/dist/esm/.ldo/profile.context.js.map +0 -1
- package/dist/esm/.ldo/profile.schema.js +0 -61
- package/dist/esm/.ldo/profile.schema.js.map +0 -1
- package/dist/esm/.ldo/profile.shapeTypes.js +0 -16
- package/dist/esm/.ldo/profile.shapeTypes.js.map +0 -1
- package/dist/esm/.ldo/profile.typings.js +0 -2
- package/dist/esm/.ldo/profile.typings.js.map +0 -1
- package/dist/esm/.ldo/typeIndex.context.js +0 -63
- package/dist/esm/.ldo/typeIndex.context.js.map +0 -1
- package/dist/esm/.ldo/typeIndex.schema.js +0 -143
- package/dist/esm/.ldo/typeIndex.schema.js.map +0 -1
- package/dist/esm/.ldo/typeIndex.shapeTypes.js +0 -24
- package/dist/esm/.ldo/typeIndex.shapeTypes.js.map +0 -1
- package/dist/esm/.ldo/typeIndex.typings.js +0 -2
- package/dist/esm/.ldo/typeIndex.typings.js.map +0 -1
- package/dist/esm/constants.js +0 -6
- package/dist/esm/constants.js.map +0 -1
- package/dist/esm/getTypeIndex.js +0 -61
- package/dist/esm/getTypeIndex.js.map +0 -1
- package/dist/esm/index.js +0 -5
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/react/useInstanceUris.js +0 -30
- package/dist/esm/react/useInstanceUris.js.map +0 -1
- package/dist/esm/react/useTypeIndexProfile.js +0 -9
- package/dist/esm/react/useTypeIndexProfile.js.map +0 -1
- package/dist/esm/react/util/useSubscribeToUris.js +0 -30
- package/dist/esm/react/util/useSubscribeToUris.js.map +0 -1
- package/dist/esm/setTypeIndex.js +0 -156
- package/dist/esm/setTypeIndex.js.map +0 -1
- package/dist/esm/util/Options.js +0 -9
- package/dist/esm/util/Options.js.map +0 -1
- package/dist/types/.ldo/profile.context.d.ts +0 -8
- package/dist/types/.ldo/profile.context.d.ts.map +0 -1
- package/dist/types/.ldo/profile.schema.d.ts +0 -8
- package/dist/types/.ldo/profile.schema.d.ts.map +0 -1
- package/dist/types/.ldo/profile.shapeTypes.d.ts +0 -12
- package/dist/types/.ldo/profile.shapeTypes.d.ts.map +0 -1
- package/dist/types/.ldo/profile.typings.d.ts +0 -26
- package/dist/types/.ldo/profile.typings.d.ts.map +0 -1
- package/dist/types/.ldo/typeIndex.context.d.ts +0 -8
- package/dist/types/.ldo/typeIndex.context.d.ts.map +0 -1
- package/dist/types/.ldo/typeIndex.schema.d.ts +0 -8
- package/dist/types/.ldo/typeIndex.schema.d.ts.map +0 -1
- package/dist/types/.ldo/typeIndex.shapeTypes.d.ts +0 -16
- package/dist/types/.ldo/typeIndex.shapeTypes.d.ts.map +0 -1
- package/dist/types/.ldo/typeIndex.typings.d.ts +0 -53
- package/dist/types/.ldo/typeIndex.typings.d.ts.map +0 -1
- package/dist/types/constants.d.ts +0 -6
- package/dist/types/constants.d.ts.map +0 -1
- package/dist/types/getTypeIndex.d.ts +0 -10
- package/dist/types/getTypeIndex.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -5
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/react/useInstanceUris.d.ts +0 -9
- package/dist/types/react/useInstanceUris.d.ts.map +0 -1
- package/dist/types/react/useTypeIndexProfile.d.ts +0 -3
- package/dist/types/react/useTypeIndexProfile.d.ts.map +0 -1
- package/dist/types/react/util/useSubscribeToUris.d.ts +0 -2
- package/dist/types/react/util/useSubscribeToUris.d.ts.map +0 -1
- package/dist/types/setTypeIndex.d.ts.map +0 -1
- package/dist/types/util/Options.d.ts +0 -11
- package/dist/types/util/Options.d.ts.map +0 -1
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useSubscribeToUris = useSubscribeToUris;
|
|
4
|
-
const solid_react_1 = require("@ldo/solid-react");
|
|
5
|
-
const react_1 = require("react");
|
|
6
|
-
function useSubscribeToUris(uris) {
|
|
7
|
-
const { dataset } = (0, solid_react_1.useLdo)();
|
|
8
|
-
const currentlySubscribed = (0, react_1.useRef)({});
|
|
9
|
-
(0, react_1.useEffect)(() => {
|
|
10
|
-
const resources = uris.map((uri) => dataset.getResource(uri));
|
|
11
|
-
const previousSubscriptions = { ...currentlySubscribed.current };
|
|
12
|
-
Promise.all(resources.map(async (resource) => {
|
|
13
|
-
if (!previousSubscriptions[resource.uri]) {
|
|
14
|
-
// Read and subscribe
|
|
15
|
-
await resource.readIfUnfetched();
|
|
16
|
-
currentlySubscribed.current[resource.uri] =
|
|
17
|
-
await resource.subscribeToNotifications();
|
|
18
|
-
}
|
|
19
|
-
else {
|
|
20
|
-
delete previousSubscriptions[resource.uri];
|
|
21
|
-
}
|
|
22
|
-
})).then(async () => {
|
|
23
|
-
// Unsubscribe from all remaining previous subscriptions
|
|
24
|
-
await Promise.all(Object.entries(previousSubscriptions).map(async ([resourceUri, subscriptionId]) => {
|
|
25
|
-
// Unsubscribe
|
|
26
|
-
delete currentlySubscribed.current[resourceUri];
|
|
27
|
-
const resource = dataset.getResource(resourceUri);
|
|
28
|
-
await resource.unsubscribeFromNotifications(subscriptionId);
|
|
29
|
-
}));
|
|
30
|
-
});
|
|
31
|
-
}, [uris]);
|
|
32
|
-
}
|
|
33
|
-
//# sourceMappingURL=useSubscribeToUris.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSubscribeToUris.js","sourceRoot":"","sources":["../../../../src/react/util/useSubscribeToUris.ts"],"names":[],"mappings":";;AAGA,gDA+BC;AAlCD,kDAA0C;AAC1C,iCAA0C;AAE1C,SAAgB,kBAAkB,CAAC,IAAc;IAC/C,MAAM,EAAE,OAAO,EAAE,GAAG,IAAA,oBAAM,GAAE,CAAC;IAC7B,MAAM,mBAAmB,GAAG,IAAA,cAAM,EAAyB,EAAE,CAAC,CAAC;IAC/D,IAAA,iBAAS,EAAC,GAAG,EAAE;QACb,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,OAAO,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC;QAC9D,MAAM,qBAAqB,GAAG,EAAE,GAAG,mBAAmB,CAAC,OAAO,EAAE,CAAC;QACjE,OAAO,CAAC,GAAG,CACT,SAAS,CAAC,GAAG,CAAC,KAAK,EAAE,QAAQ,EAAE,EAAE;YAC/B,IAAI,CAAC,qBAAqB,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;gBACzC,qBAAqB;gBACrB,MAAM,QAAQ,CAAC,eAAe,EAAE,CAAC;gBACjC,mBAAmB,CAAC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC;oBACvC,MAAM,QAAQ,CAAC,wBAAwB,EAAE,CAAC;YAC9C,CAAC;iBAAM,CAAC;gBACN,OAAO,qBAAqB,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;YAC7C,CAAC;QACH,CAAC,CAAC,CACH,CAAC,IAAI,CAAC,KAAK,IAAI,EAAE;YAChB,wDAAwD;YACxD,MAAM,OAAO,CAAC,GAAG,CACf,MAAM,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC,GAAG,CACvC,KAAK,EAAE,CAAC,WAAW,EAAE,cAAc,CAAC,EAAE,EAAE;gBACtC,cAAc;gBACd,OAAO,mBAAmB,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;gBAChD,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;gBAClD,MAAM,QAAQ,CAAC,4BAA4B,CAAC,cAAc,CAAC,CAAC;YAC9D,CAAC,CACF,CACF,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,CAAC;AACb,CAAC"}
|
|
@@ -1,163 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.initTypeIndex = initTypeIndex;
|
|
4
|
-
exports.createIndex = createIndex;
|
|
5
|
-
exports.addRegistration = addRegistration;
|
|
6
|
-
exports.removeRegistration = removeRegistration;
|
|
7
|
-
exports.findAppropriateTypeRegistration = findAppropriateTypeRegistration;
|
|
8
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
9
|
-
const uuid_1 = require("uuid");
|
|
10
|
-
const constants_js_1 = require("./constants.js");
|
|
11
|
-
const Options_js_1 = require("./util/Options.js");
|
|
12
|
-
const rdf_utils_1 = require("@ldo/rdf-utils");
|
|
13
|
-
const getTypeIndex_js_1 = require("./getTypeIndex.js");
|
|
14
|
-
const profile_shapeTypes_js_1 = require("./.ldo/profile.shapeTypes.js");
|
|
15
|
-
const ldo_1 = require("@ldo/ldo");
|
|
16
|
-
const typeIndex_shapeTypes_js_1 = require("./.ldo/typeIndex.shapeTypes.js");
|
|
17
|
-
/**
|
|
18
|
-
* =============================================================================
|
|
19
|
-
* INITIALIZERS
|
|
20
|
-
* =============================================================================
|
|
21
|
-
*/
|
|
22
|
-
async function initTypeIndex(webId, options) {
|
|
23
|
-
const { dataset } = (0, Options_js_1.guaranteeOptions)(options);
|
|
24
|
-
const profile = await (0, getTypeIndex_js_1.getProfile)(webId, options);
|
|
25
|
-
if (!profile.privateTypeIndex?.size || !profile.publicTypeIndex?.size) {
|
|
26
|
-
const profileFolder = await dataset
|
|
27
|
-
.getResource(webId)
|
|
28
|
-
.getParentContainer();
|
|
29
|
-
if (profileFolder?.isError)
|
|
30
|
-
throw profileFolder;
|
|
31
|
-
if (!profileFolder)
|
|
32
|
-
throw new Error("No folder to save the type indexes to.");
|
|
33
|
-
if (!profile.privateTypeIndex?.size) {
|
|
34
|
-
await createIndex(webId, profileFolder, dataset, true);
|
|
35
|
-
}
|
|
36
|
-
if (!profile.publicTypeIndex?.size) {
|
|
37
|
-
await createIndex(webId, profileFolder, dataset, false);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* @internal
|
|
43
|
-
* @param webId
|
|
44
|
-
* @param profileFolder
|
|
45
|
-
* @param dataset
|
|
46
|
-
*/
|
|
47
|
-
async function createIndex(webId, profileFolder, dataset, isPrivate) {
|
|
48
|
-
// Create a private type index
|
|
49
|
-
const createResult = await profileFolder.createChildAndOverwrite(`${isPrivate ? "private" : "public"}_index_${(0, uuid_1.v4)()}`);
|
|
50
|
-
if (createResult.isError)
|
|
51
|
-
throw createResult;
|
|
52
|
-
const indexResource = createResult.resource;
|
|
53
|
-
const wacResult = await indexResource.setWac({
|
|
54
|
-
agent: {
|
|
55
|
-
[webId]: { read: true, write: true, append: true, control: true },
|
|
56
|
-
},
|
|
57
|
-
public: {
|
|
58
|
-
read: isPrivate ? false : true,
|
|
59
|
-
write: true,
|
|
60
|
-
append: true,
|
|
61
|
-
control: true,
|
|
62
|
-
},
|
|
63
|
-
authenticated: {
|
|
64
|
-
read: isPrivate ? false : true,
|
|
65
|
-
write: true,
|
|
66
|
-
append: true,
|
|
67
|
-
control: true,
|
|
68
|
-
},
|
|
69
|
-
});
|
|
70
|
-
if (wacResult.isError)
|
|
71
|
-
throw wacResult;
|
|
72
|
-
const transaction = dataset.startTransaction();
|
|
73
|
-
const cProfile = transaction
|
|
74
|
-
.usingType(profile_shapeTypes_js_1.TypeIndexProfileShapeType)
|
|
75
|
-
.write(dataset.getResource(webId).uri)
|
|
76
|
-
.fromSubject(webId);
|
|
77
|
-
if (isPrivate) {
|
|
78
|
-
cProfile.privateTypeIndex?.add({ "@id": indexResource.uri });
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
cProfile.publicTypeIndex?.add({ "@id": indexResource.uri });
|
|
82
|
-
}
|
|
83
|
-
const cTypeIndex = transaction
|
|
84
|
-
.usingType(typeIndex_shapeTypes_js_1.TypeIndexDocumentShapeType)
|
|
85
|
-
.write(indexResource.uri)
|
|
86
|
-
.fromSubject(indexResource.uri);
|
|
87
|
-
cTypeIndex.type = (0, ldo_1.set)({ "@id": "ListedDocument" }, { "@id": "TypeIndex" });
|
|
88
|
-
const commitResult = await transaction.commitToRemote();
|
|
89
|
-
if (commitResult.isError)
|
|
90
|
-
throw commitResult;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Adds an instance to a TypeRegistration
|
|
94
|
-
* @param indexUri The URI of the TypeIndex
|
|
95
|
-
* @param classUri The URI for the class the instance should be added to
|
|
96
|
-
* @param instances Objects representing the instances to add
|
|
97
|
-
* @param options Options
|
|
98
|
-
*/
|
|
99
|
-
function addRegistration(indexUri, classUri, instances, options) {
|
|
100
|
-
// Check to see if its already in the index
|
|
101
|
-
const typeRegistration = findAppropriateTypeRegistration(indexUri, classUri, options);
|
|
102
|
-
// Add instances to type registration
|
|
103
|
-
instances.instance?.forEach((instance) => {
|
|
104
|
-
typeRegistration.instance?.add({ "@id": instance });
|
|
105
|
-
});
|
|
106
|
-
instances.instanceContainer?.forEach((instanceContainer) => {
|
|
107
|
-
typeRegistration.instanceContainer?.add({ "@id": instanceContainer });
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
/**
|
|
111
|
-
* Removes instances from a TypeRegistration
|
|
112
|
-
* @param indexUri The URI of the TypeIndex
|
|
113
|
-
* @param classUri The URI for the class the instance should be removed from
|
|
114
|
-
* @param instances Objects representing the instances to remove
|
|
115
|
-
* @param options Options
|
|
116
|
-
*/
|
|
117
|
-
async function removeRegistration(indexUri, classUri, instances, options) {
|
|
118
|
-
// Check to see if its already in the index
|
|
119
|
-
const typeRegistration = findAppropriateTypeRegistration(indexUri, classUri, options);
|
|
120
|
-
// Add instances to type registration
|
|
121
|
-
instances.instance?.forEach((instanceUri) => {
|
|
122
|
-
typeRegistration.instance?.delete({ "@id": instanceUri });
|
|
123
|
-
});
|
|
124
|
-
instances.instanceContainer?.forEach((instanceContainerUri) => {
|
|
125
|
-
typeRegistration.instanceContainer?.delete({ "@id": instanceContainerUri });
|
|
126
|
-
});
|
|
127
|
-
}
|
|
128
|
-
/**
|
|
129
|
-
* Finds a TypeRegistration inside of a type index. If it doesn't exist, it
|
|
130
|
-
* creates one.
|
|
131
|
-
* @param indexUri The URI of the typeIndex
|
|
132
|
-
* @param classUri The URI of the class in question for the TypeRegistration
|
|
133
|
-
* @param options
|
|
134
|
-
* @returns The Type Index
|
|
135
|
-
*/
|
|
136
|
-
function findAppropriateTypeRegistration(indexUri, classUri, options) {
|
|
137
|
-
const { dataset } = (0, Options_js_1.guaranteeOptions)(options);
|
|
138
|
-
// Check to see if its already in the index
|
|
139
|
-
const existingRegistrationsUris = dataset
|
|
140
|
-
.match(null, (0, rdf_utils_1.namedNode)(constants_js_1.RDF_TYPE), (0, rdf_utils_1.namedNode)(constants_js_1.TYPE_REGISTRATION), (0, rdf_utils_1.namedNode)(indexUri))
|
|
141
|
-
.toArray()
|
|
142
|
-
.map((quad) => quad.subject);
|
|
143
|
-
const existingRegistrationForClassUri = existingRegistrationsUris.find((registrationUri) => {
|
|
144
|
-
return dataset.has((0, rdf_utils_1.quad)(registrationUri, (0, rdf_utils_1.namedNode)(constants_js_1.FOR_CLASS), (0, rdf_utils_1.namedNode)(classUri), (0, rdf_utils_1.namedNode)(indexUri)));
|
|
145
|
-
})?.value;
|
|
146
|
-
let typeRegistration;
|
|
147
|
-
if (existingRegistrationForClassUri) {
|
|
148
|
-
typeRegistration = dataset
|
|
149
|
-
.usingType(typeIndex_shapeTypes_js_1.TypeRegistrationShapeType)
|
|
150
|
-
.write(indexUri)
|
|
151
|
-
.fromSubject(existingRegistrationForClassUri);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
typeRegistration = dataset
|
|
155
|
-
.usingType(typeIndex_shapeTypes_js_1.TypeRegistrationShapeType)
|
|
156
|
-
.write(indexUri)
|
|
157
|
-
.fromSubject(`${indexUri}#${(0, uuid_1.v4)()}`);
|
|
158
|
-
typeRegistration.type = { "@id": "TypeRegistration" };
|
|
159
|
-
typeRegistration.forClass = { "@id": classUri };
|
|
160
|
-
}
|
|
161
|
-
return typeRegistration;
|
|
162
|
-
}
|
|
163
|
-
//# sourceMappingURL=setTyp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AAA,qBAAS,EAAC,QAAQ,CAAC,CACpB,CACF,CAAC;IACJ,CAAC,CACF,EAAE,KAAK,CAAC;IAET,IAAI,gBAAkC,CAAC;IACvC,IAAI,+BAA+B,EAAE,CAAC;QACpC,gBAAgB,GAAG,OAAO;aACvB,SAAS,CAAC,mDAAyB,CAAC;aACpC,KAAK,CAAC,QAAQ,CAAC;aACf,WAAW,CAAC,+BAA+B,CAAC,CAAC;IAClD,CAAC;SAAM,CAAC;QACN,gBAAgB,GAAG,OAAO;aACvB,SAAS,CAAC,mDAAyB,CAAC;aACpC,KAAK,CAAC,QAAQ,CAAC;aACf,WAAW,CAAC,GAAG,QAAQ,IAAI,IAAA,SAAE,GAAE,EAAE,CAAC,CAAC;QACtC,gBAAgB,CAAC,IAAI,GAAG,EAAE,KAAK,EAAE,kBAAkB,EAAE,CAAC;QACtD,gBAAgB,CAAC,QAAQ,GAAG,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC;IAClD,CAAC;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.guaranteeOptions = guaranteeOptions;
|
|
4
|
-
const connected_solid_1 = require("@ldo/connected-solid");
|
|
5
|
-
function guaranteeOptions(options) {
|
|
6
|
-
const fetch = (0, connected_solid_1.guaranteeFetch)(options?.fetch);
|
|
7
|
-
const dataset = (options?.solidLdoDataset ??
|
|
8
|
-
(0, connected_solid_1.createSolidLdoDataset)());
|
|
9
|
-
dataset.setContext("solid", { fetch });
|
|
10
|
-
return { fetch, dataset };
|
|
11
|
-
}
|
|
12
|
-
//# sourceMappingURL=Options.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Options.js","sourceRoot":"","sources":["../../../src/util/Options.ts"],"names":[],"mappings":";;AAUA,4CAMC;AAbD,0DAA6E;AAO7E,SAAgB,gBAAgB,CAAC,OAAiB;IAChD,MAAM,KAAK,GAAG,IAAA,gCAAc,EAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IAC7C,MAAM,OAAO,GAAG,CAAC,OAAO,EAAE,eAAe;QACvC,IAAA,uCAAqB,GAAE,CAAgD,CAAC;IAC1E,OAAO,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,CAAC,CAAC;IACvC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* =============================================================================
|
|
3
|
-
* profileContext: JSONLD Context for profile
|
|
4
|
-
* =============================================================================
|
|
5
|
-
*/
|
|
6
|
-
export const profileContext = {
|
|
7
|
-
privateTypeIndex: {
|
|
8
|
-
"@id": "http://www.w3.org/ns/solid/terms#privateTypeIndex",
|
|
9
|
-
"@type": "@id",
|
|
10
|
-
"@isCollection": true,
|
|
11
|
-
},
|
|
12
|
-
publicTypeIndex: {
|
|
13
|
-
"@id": "http://www.w3.org/ns/solid/terms#publicTypeIndex",
|
|
14
|
-
"@type": "@id",
|
|
15
|
-
"@isCollection": true,
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
//# sourceMappingURL=profile.context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.context.js","sourceRoot":"","sources":["../../../src/.ldo/profile.context.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAqB;IAC9C,gBAAgB,EAAE;QAChB,KAAK,EAAE,mDAAmD;QAC1D,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,IAAI;KACtB;IACD,eAAe,EAAE;QACf,KAAK,EAAE,kDAAkD;QACzD,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,IAAI;KACtB;CACF,CAAC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* =============================================================================
|
|
3
|
-
* profileSchema: ShexJ Schema for profile
|
|
4
|
-
* =============================================================================
|
|
5
|
-
*/
|
|
6
|
-
export const profileSchema = {
|
|
7
|
-
type: "Schema",
|
|
8
|
-
shapes: [
|
|
9
|
-
{
|
|
10
|
-
id: "https://shaperepo.com/schemas/solidProfile#TypeIndexProfile",
|
|
11
|
-
type: "ShapeDecl",
|
|
12
|
-
shapeExpr: {
|
|
13
|
-
type: "Shape",
|
|
14
|
-
expression: {
|
|
15
|
-
type: "EachOf",
|
|
16
|
-
expressions: [
|
|
17
|
-
{
|
|
18
|
-
type: "TripleConstraint",
|
|
19
|
-
predicate: "http://www.w3.org/ns/solid/terms#privateTypeIndex",
|
|
20
|
-
valueExpr: {
|
|
21
|
-
type: "NodeConstraint",
|
|
22
|
-
nodeKind: "iri",
|
|
23
|
-
},
|
|
24
|
-
min: 0,
|
|
25
|
-
max: -1,
|
|
26
|
-
annotations: [
|
|
27
|
-
{
|
|
28
|
-
type: "Annotation",
|
|
29
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
30
|
-
object: {
|
|
31
|
-
value: "A registry of all types used on the user's Pod (for private access only)",
|
|
32
|
-
},
|
|
33
|
-
},
|
|
34
|
-
],
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
type: "TripleConstraint",
|
|
38
|
-
predicate: "http://www.w3.org/ns/solid/terms#publicTypeIndex",
|
|
39
|
-
valueExpr: {
|
|
40
|
-
type: "NodeConstraint",
|
|
41
|
-
nodeKind: "iri",
|
|
42
|
-
},
|
|
43
|
-
min: 0,
|
|
44
|
-
max: -1,
|
|
45
|
-
annotations: [
|
|
46
|
-
{
|
|
47
|
-
type: "Annotation",
|
|
48
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
49
|
-
object: {
|
|
50
|
-
value: "A registry of all types used on the user's Pod (for public access)",
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
],
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
},
|
|
59
|
-
],
|
|
60
|
-
};
|
|
61
|
-
//# sourceMappingURL=profile.schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.schema.js","sourceRoot":"","sources":["../../../src/.ldo/profile.schema.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAW;IACnC,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE;QACN;YACE,EAAE,EAAE,6DAA6D;YACjE,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE;wBACX;4BACE,IAAI,EAAE,kBAAkB;4BACxB,SAAS,EAAE,mDAAmD;4BAC9D,SAAS,EAAE;gCACT,IAAI,EAAE,gBAAgB;gCACtB,QAAQ,EAAE,KAAK;6BAChB;4BACD,GAAG,EAAE,CAAC;4BACN,GAAG,EAAE,CAAC,CAAC;4BACP,WAAW,EAAE;gCACX;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,8CAA8C;oCACzD,MAAM,EAAE;wCACN,KAAK,EACH,0EAA0E;qCAC7E;iCACF;6BACF;yBACF;wBACD;4BACE,IAAI,EAAE,kBAAkB;4BACxB,SAAS,EAAE,kDAAkD;4BAC7D,SAAS,EAAE;gCACT,IAAI,EAAE,gBAAgB;gCACtB,QAAQ,EAAE,KAAK;6BAChB;4BACD,GAAG,EAAE,CAAC;4BACN,GAAG,EAAE,CAAC,CAAC;4BACP,WAAW,EAAE;gCACX;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,8CAA8C;oCACzD,MAAM,EAAE;wCACN,KAAK,EACH,oEAAoE;qCACvE;iCACF;6BACF;yBACF;qBACF;iBACF;aACF;SACF;KACF;CACF,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { profileSchema } from "./profile.schema.js";
|
|
2
|
-
import { profileContext } from "./profile.context.js";
|
|
3
|
-
/**
|
|
4
|
-
* =============================================================================
|
|
5
|
-
* LDO ShapeTypes profile
|
|
6
|
-
* =============================================================================
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* TypeIndexProfile ShapeType
|
|
10
|
-
*/
|
|
11
|
-
export const TypeIndexProfileShapeType = {
|
|
12
|
-
schema: profileSchema,
|
|
13
|
-
shape: "https://shaperepo.com/schemas/solidProfile#TypeIndexProfile",
|
|
14
|
-
context: profileContext,
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=profile.shapeTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.shapeTypes.js","sourceRoot":"","sources":["../../../src/.ldo/profile.shapeTypes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAGtD;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAgC;IACpE,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,6DAA6D;IACpE,OAAO,EAAE,cAAc;CACxB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"profile.typings.js","sourceRoot":"","sources":["../../../src/.ldo/profile.typings.ts"],"names":[],"mappings":""}
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* =============================================================================
|
|
3
|
-
* typeIndexContext: JSONLD Context for typeIndex
|
|
4
|
-
* =============================================================================
|
|
5
|
-
*/
|
|
6
|
-
export const typeIndexContext = {
|
|
7
|
-
type: {
|
|
8
|
-
"@id": "@type",
|
|
9
|
-
},
|
|
10
|
-
TypeIndex: {
|
|
11
|
-
"@id": "http://www.w3.org/ns/solid/terms#TypeIndex",
|
|
12
|
-
"@context": {
|
|
13
|
-
type: {
|
|
14
|
-
"@id": "@type",
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
ListedDocument: {
|
|
19
|
-
"@id": "http://www.w3.org/ns/solid/terms#ListedDocument",
|
|
20
|
-
"@context": {
|
|
21
|
-
type: {
|
|
22
|
-
"@id": "@type",
|
|
23
|
-
},
|
|
24
|
-
},
|
|
25
|
-
},
|
|
26
|
-
TypeRegistration: {
|
|
27
|
-
"@id": "http://www.w3.org/ns/solid/terms#TypeRegistration",
|
|
28
|
-
"@context": {
|
|
29
|
-
type: {
|
|
30
|
-
"@id": "@type",
|
|
31
|
-
},
|
|
32
|
-
forClass: {
|
|
33
|
-
"@id": "http://www.w3.org/ns/solid/terms#forClass",
|
|
34
|
-
"@type": "@id",
|
|
35
|
-
},
|
|
36
|
-
instance: {
|
|
37
|
-
"@id": "http://www.w3.org/ns/solid/terms#instance",
|
|
38
|
-
"@type": "@id",
|
|
39
|
-
"@isCollection": true,
|
|
40
|
-
},
|
|
41
|
-
instanceContainer: {
|
|
42
|
-
"@id": "http://www.w3.org/ns/solid/terms#instanceContainer",
|
|
43
|
-
"@type": "@id",
|
|
44
|
-
"@isCollection": true,
|
|
45
|
-
},
|
|
46
|
-
},
|
|
47
|
-
},
|
|
48
|
-
forClass: {
|
|
49
|
-
"@id": "http://www.w3.org/ns/solid/terms#forClass",
|
|
50
|
-
"@type": "@id",
|
|
51
|
-
},
|
|
52
|
-
instance: {
|
|
53
|
-
"@id": "http://www.w3.org/ns/solid/terms#instance",
|
|
54
|
-
"@type": "@id",
|
|
55
|
-
"@isCollection": true,
|
|
56
|
-
},
|
|
57
|
-
instanceContainer: {
|
|
58
|
-
"@id": "http://www.w3.org/ns/solid/terms#instanceContainer",
|
|
59
|
-
"@type": "@id",
|
|
60
|
-
"@isCollection": true,
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
//# sourceMappingURL=typeIndex.context.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.context.js","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.context.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD,IAAI,EAAE;QACJ,KAAK,EAAE,OAAO;KACf;IACD,SAAS,EAAE;QACT,KAAK,EAAE,4CAA4C;QACnD,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,KAAK,EAAE,OAAO;aACf;SACF;KACF;IACD,cAAc,EAAE;QACd,KAAK,EAAE,iDAAiD;QACxD,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,KAAK,EAAE,OAAO;aACf;SACF;KACF;IACD,gBAAgB,EAAE;QAChB,KAAK,EAAE,mDAAmD;QAC1D,UAAU,EAAE;YACV,IAAI,EAAE;gBACJ,KAAK,EAAE,OAAO;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,2CAA2C;gBAClD,OAAO,EAAE,KAAK;aACf;YACD,QAAQ,EAAE;gBACR,KAAK,EAAE,2CAA2C;gBAClD,OAAO,EAAE,KAAK;gBACd,eAAe,EAAE,IAAI;aACtB;YACD,iBAAiB,EAAE;gBACjB,KAAK,EAAE,oDAAoD;gBAC3D,OAAO,EAAE,KAAK;gBACd,eAAe,EAAE,IAAI;aACtB;SACF;KACF;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,2CAA2C;QAClD,OAAO,EAAE,KAAK;KACf;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,2CAA2C;QAClD,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,IAAI;KACtB;IACD,iBAAiB,EAAE;QACjB,KAAK,EAAE,oDAAoD;QAC3D,OAAO,EAAE,KAAK;QACd,eAAe,EAAE,IAAI;KACtB;CACF,CAAC"}
|
|
@@ -1,143 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* =============================================================================
|
|
3
|
-
* typeIndexSchema: ShexJ Schema for typeIndex
|
|
4
|
-
* =============================================================================
|
|
5
|
-
*/
|
|
6
|
-
export const typeIndexSchema = {
|
|
7
|
-
type: "Schema",
|
|
8
|
-
shapes: [
|
|
9
|
-
{
|
|
10
|
-
id: "https://shaperepo.com/schemas/solidProfile#TypeIndexDocument",
|
|
11
|
-
type: "ShapeDecl",
|
|
12
|
-
shapeExpr: {
|
|
13
|
-
type: "Shape",
|
|
14
|
-
expression: {
|
|
15
|
-
type: "EachOf",
|
|
16
|
-
expressions: [
|
|
17
|
-
{
|
|
18
|
-
type: "TripleConstraint",
|
|
19
|
-
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
20
|
-
valueExpr: {
|
|
21
|
-
type: "NodeConstraint",
|
|
22
|
-
values: ["http://www.w3.org/ns/solid/terms#TypeIndex"],
|
|
23
|
-
},
|
|
24
|
-
annotations: [
|
|
25
|
-
{
|
|
26
|
-
type: "Annotation",
|
|
27
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
28
|
-
object: {
|
|
29
|
-
value: "Defines the node as a TypeIndex",
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
],
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
type: "TripleConstraint",
|
|
36
|
-
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
37
|
-
valueExpr: {
|
|
38
|
-
type: "NodeConstraint",
|
|
39
|
-
values: ["http://www.w3.org/ns/solid/terms#ListedDocument"],
|
|
40
|
-
},
|
|
41
|
-
annotations: [
|
|
42
|
-
{
|
|
43
|
-
type: "Annotation",
|
|
44
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
45
|
-
object: {
|
|
46
|
-
value: "Defines the node as a Listed Document",
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
],
|
|
50
|
-
},
|
|
51
|
-
],
|
|
52
|
-
},
|
|
53
|
-
extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"],
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: "https://shaperepo.com/schemas/solidProfile#TypeRegistration",
|
|
58
|
-
type: "ShapeDecl",
|
|
59
|
-
shapeExpr: {
|
|
60
|
-
type: "Shape",
|
|
61
|
-
expression: {
|
|
62
|
-
type: "EachOf",
|
|
63
|
-
expressions: [
|
|
64
|
-
{
|
|
65
|
-
type: "TripleConstraint",
|
|
66
|
-
predicate: "http://www.w3.org/1999/02/22-rdf-syntax-ns#type",
|
|
67
|
-
valueExpr: {
|
|
68
|
-
type: "NodeConstraint",
|
|
69
|
-
values: ["http://www.w3.org/ns/solid/terms#TypeRegistration"],
|
|
70
|
-
},
|
|
71
|
-
annotations: [
|
|
72
|
-
{
|
|
73
|
-
type: "Annotation",
|
|
74
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
75
|
-
object: {
|
|
76
|
-
value: "Defines this node as a Type Registration",
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
],
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
type: "TripleConstraint",
|
|
83
|
-
predicate: "http://www.w3.org/ns/solid/terms#forClass",
|
|
84
|
-
valueExpr: {
|
|
85
|
-
type: "NodeConstraint",
|
|
86
|
-
nodeKind: "iri",
|
|
87
|
-
},
|
|
88
|
-
annotations: [
|
|
89
|
-
{
|
|
90
|
-
type: "Annotation",
|
|
91
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
92
|
-
object: {
|
|
93
|
-
value: "The class of object at this type.",
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
],
|
|
97
|
-
},
|
|
98
|
-
{
|
|
99
|
-
type: "TripleConstraint",
|
|
100
|
-
predicate: "http://www.w3.org/ns/solid/terms#instance",
|
|
101
|
-
valueExpr: {
|
|
102
|
-
type: "NodeConstraint",
|
|
103
|
-
nodeKind: "iri",
|
|
104
|
-
},
|
|
105
|
-
min: 0,
|
|
106
|
-
max: -1,
|
|
107
|
-
annotations: [
|
|
108
|
-
{
|
|
109
|
-
type: "Annotation",
|
|
110
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
111
|
-
object: {
|
|
112
|
-
value: "A specific resource that contains the class.",
|
|
113
|
-
},
|
|
114
|
-
},
|
|
115
|
-
],
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
type: "TripleConstraint",
|
|
119
|
-
predicate: "http://www.w3.org/ns/solid/terms#instanceContainer",
|
|
120
|
-
valueExpr: {
|
|
121
|
-
type: "NodeConstraint",
|
|
122
|
-
nodeKind: "iri",
|
|
123
|
-
},
|
|
124
|
-
min: 0,
|
|
125
|
-
max: -1,
|
|
126
|
-
annotations: [
|
|
127
|
-
{
|
|
128
|
-
type: "Annotation",
|
|
129
|
-
predicate: "http://www.w3.org/2000/01/rdf-schema#comment",
|
|
130
|
-
object: {
|
|
131
|
-
value: "Containers that contain resources with the class.",
|
|
132
|
-
},
|
|
133
|
-
},
|
|
134
|
-
],
|
|
135
|
-
},
|
|
136
|
-
],
|
|
137
|
-
},
|
|
138
|
-
extra: ["http://www.w3.org/1999/02/22-rdf-syntax-ns#type"],
|
|
139
|
-
},
|
|
140
|
-
},
|
|
141
|
-
],
|
|
142
|
-
};
|
|
143
|
-
//# sourceMappingURL=typeIndex.schema.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.schema.js","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.schema.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,MAAM,CAAC,MAAM,eAAe,GAAW;IACrC,IAAI,EAAE,QAAQ;IACd,MAAM,EAAE;QACN;YACE,EAAE,EAAE,8DAA8D;YAClE,IAAI,EAAE,WAAW;YACjB,SAAS,EAAE;gBACT,IAAI,EAAE,OAAO;gBACb,UAAU,EAAE;oBACV,IAAI,EAAE,QAAQ;oBACd,WAAW,EAAE;wBACX;4BACE,IAAI,EAAE,kBAAkB;4BACxB,SAAS,EAAE,iDAAiD;4BAC5D,SAAS,EAAE;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;oCAClB,SAAS,EAAE,8CAA8C;oCACzD,MAAM,EAAE;wCACN,KAAK,EAAE,mCAAmC;qCAC3C;iCACF;6BACF;yBACF;wBACD;4BACE,IAAI,EAAE,kBAAkB;4BACxB,SAAS,EAAE,2CAA2C;4BACtD,SAAS,EAAE;gCACT,IAAI,EAAE,gBAAgB;gCACtB,QAAQ,EAAE,KAAK;6BAChB;4BACD,GAAG,EAAE,CAAC;4BACN,GAAG,EAAE,CAAC,CAAC;4BACP,WAAW,EAAE;gCACX;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,8CAA8C;oCACzD,MAAM,EAAE;wCACN,KAAK,EAAE,8CAA8C;qCACtD;iCACF;6BACF;yBACF;wBACD;4BACE,IAAI,EAAE,kBAAkB;4BACxB,SAAS,EAAE,oDAAoD;4BAC/D,SAAS,EAAE;gCACT,IAAI,EAAE,gBAAgB;gCACtB,QAAQ,EAAE,KAAK;6BAChB;4BACD,GAAG,EAAE,CAAC;4BACN,GAAG,EAAE,CAAC,CAAC;4BACP,WAAW,EAAE;gCACX;oCACE,IAAI,EAAE,YAAY;oCAClB,SAAS,EAAE,8CAA8C;oCACzD,MAAM,EAAE;wCACN,KAAK,EAAE,mDAAmD;qCAC3D;iCACF;6BACF;yBACF;qBACF;iBACF;gBACD,KAAK,EAAE,CAAC,iDAAiD,CAAC;aAC3D;SACF;KACF;CACF,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { typeIndexSchema } from "./typeIndex.schema.js";
|
|
2
|
-
import { typeIndexContext } from "./typeIndex.context.js";
|
|
3
|
-
/**
|
|
4
|
-
* =============================================================================
|
|
5
|
-
* LDO ShapeTypes typeIndex
|
|
6
|
-
* =============================================================================
|
|
7
|
-
*/
|
|
8
|
-
/**
|
|
9
|
-
* TypeIndexDocument ShapeType
|
|
10
|
-
*/
|
|
11
|
-
export const TypeIndexDocumentShapeType = {
|
|
12
|
-
schema: typeIndexSchema,
|
|
13
|
-
shape: "https://shaperepo.com/schemas/solidProfile#TypeIndexDocument",
|
|
14
|
-
context: typeIndexContext,
|
|
15
|
-
};
|
|
16
|
-
/**
|
|
17
|
-
* TypeRegistration ShapeType
|
|
18
|
-
*/
|
|
19
|
-
export const TypeRegistrationShapeType = {
|
|
20
|
-
schema: typeIndexSchema,
|
|
21
|
-
shape: "https://shaperepo.com/schemas/solidProfile#TypeRegistration",
|
|
22
|
-
context: typeIndexContext,
|
|
23
|
-
};
|
|
24
|
-
//# sourceMappingURL=typeIndex.shapeTypes.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.shapeTypes.js","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.shapeTypes.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAG1D;;;;GAIG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,0BAA0B,GAAiC;IACtE,MAAM,EAAE,eAAe;IACvB,KAAK,EAAE,8DAA8D;IACrE,OAAO,EAAE,gBAAgB;CAC1B,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAgC;IACpE,MAAM,EAAE,eAAe;IACvB,KAAK,EAAE,6DAA6D;IACpE,OAAO,EAAE,gBAAgB;CAC1B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"typeIndex.typings.js","sourceRoot":"","sources":["../../../src/.ldo/typeIndex.typings.ts"],"names":[],"mappings":""}
|
package/dist/esm/constants.js
DELETED
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
export const RDF_TYPE = "http://www.w3.org/1999/02/22-rdf-syntax-ns#type";
|
|
2
|
-
export const TYPE_REGISTRATION = "http://www.w3.org/ns/solid/terms#TypeRegistration";
|
|
3
|
-
export const FOR_CLASS = "http://www.w3.org/ns/solid/terms#forClass";
|
|
4
|
-
export const INSTANCE = "http://www.w3.org/ns/solid/terms#instance";
|
|
5
|
-
export const INSTANCE_CONTAINER = "http://www.w3.org/ns/solid/terms#instanceContainer";
|
|
6
|
-
//# sourceMappingURL=constants.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,QAAQ,GAAG,iDAAiD,CAAC;AAC1E,MAAM,CAAC,MAAM,iBAAiB,GAC5B,mDAAmD,CAAC;AACtD,MAAM,CAAC,MAAM,SAAS,GAAG,2CAA2C,CAAC;AACrE,MAAM,CAAC,MAAM,QAAQ,GAAG,2CAA2C,CAAC;AACpE,MAAM,CAAC,MAAM,kBAAkB,GAC7B,oDAAoD,CAAC"}
|