@rdfx/tinybase 0.0.46 → 0.0.48
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/TinyBaseGraphStore.d.ts +14 -6
- package/dist/TinyBaseGraphStore.js +7 -7
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +6 -6
|
@@ -4,18 +4,28 @@ import { Either, Maybe } from "purify-ts";
|
|
|
4
4
|
import { type NoValuesSchema, type Store } from "tinybase/with-schemas";
|
|
5
5
|
import type { Logger } from "ts-log";
|
|
6
6
|
export declare class TinyBaseGraphStore implements GraphStore {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
protected readonly dataFactory: DataFactory;
|
|
8
|
+
protected readonly datasetFactory: DatasetCoreFactory;
|
|
9
|
+
protected readonly logger: Logger;
|
|
10
|
+
protected readonly parseGraph: (identifier: GraphIdentifier, ntriples: string) => Either<Error, readonly Quad[]>;
|
|
10
11
|
readonly tinyBaseStore: TinyBaseGraphStore.TinyBaseStore;
|
|
11
12
|
constructor({ dataFactory, datasetFactory, logger, parseGraph, tinyBaseStore, }: {
|
|
12
13
|
dataFactory: DataFactory;
|
|
13
14
|
datasetFactory: DatasetCoreFactory;
|
|
14
15
|
logger: Logger;
|
|
15
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Function to parse the given N-Triples string (in the default graph) into Quads
|
|
18
|
+
* with every Quad's graph set to the given graph identifier.
|
|
19
|
+
*
|
|
20
|
+
* @param identifier graph identifier
|
|
21
|
+
* @param ntriples \n-joined N-Triples string
|
|
22
|
+
* @returns array of Quads
|
|
23
|
+
*/
|
|
24
|
+
parseGraph?: (identifier: GraphIdentifier, ntriples: string) => Either<Error, readonly Quad[]>;
|
|
16
25
|
tinyBaseStore?: TinyBaseGraphStore.TinyBaseStore;
|
|
17
26
|
});
|
|
18
27
|
clear(): Promise<Either<Error, object>>;
|
|
28
|
+
clearSync(): Either<Error, object>;
|
|
19
29
|
delete(identifier: GraphIdentifier): Promise<Either<Error, object>>;
|
|
20
30
|
deleteSync(identifier: GraphIdentifier): Either<Error, object>;
|
|
21
31
|
get(identifier: GraphIdentifier): Promise<Either<Error, Maybe<Stream>>>;
|
|
@@ -29,8 +39,6 @@ export declare class TinyBaseGraphStore implements GraphStore {
|
|
|
29
39
|
isEmptySync(): Either<Error, boolean>;
|
|
30
40
|
post(quads: Stream): Promise<Either<Error, object>>;
|
|
31
41
|
put(quads: Stream): Promise<Either<Error, object>>;
|
|
32
|
-
private clearSync;
|
|
33
|
-
private readonly parseGraph;
|
|
34
42
|
}
|
|
35
43
|
export declare namespace TinyBaseGraphStore {
|
|
36
44
|
type TinyBaseStore = Store<[typeof tablesSchema, NoValuesSchema]>;
|
|
@@ -8,6 +8,7 @@ export class TinyBaseGraphStore {
|
|
|
8
8
|
dataFactory;
|
|
9
9
|
datasetFactory;
|
|
10
10
|
logger;
|
|
11
|
+
parseGraph;
|
|
11
12
|
tinyBaseStore;
|
|
12
13
|
constructor({ dataFactory, datasetFactory, logger, parseGraph, tinyBaseStore, }) {
|
|
13
14
|
this.dataFactory = dataFactory;
|
|
@@ -28,6 +29,12 @@ export class TinyBaseGraphStore {
|
|
|
28
29
|
async clear() {
|
|
29
30
|
return this.clearSync();
|
|
30
31
|
}
|
|
32
|
+
clearSync() {
|
|
33
|
+
return Either.encase(() => {
|
|
34
|
+
this.tinyBaseStore.delTable("graph");
|
|
35
|
+
return {};
|
|
36
|
+
});
|
|
37
|
+
}
|
|
31
38
|
async delete(identifier) {
|
|
32
39
|
return this.deleteSync(identifier);
|
|
33
40
|
}
|
|
@@ -163,13 +170,6 @@ export class TinyBaseGraphStore {
|
|
|
163
170
|
});
|
|
164
171
|
});
|
|
165
172
|
}
|
|
166
|
-
clearSync() {
|
|
167
|
-
return Either.encase(() => {
|
|
168
|
-
this.tinyBaseStore.delTable("graph");
|
|
169
|
-
return {};
|
|
170
|
-
});
|
|
171
|
-
}
|
|
172
|
-
parseGraph;
|
|
173
173
|
}
|
|
174
174
|
(function (TinyBaseGraphStore) {
|
|
175
175
|
TinyBaseGraphStore.tablesSchema = {
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./TinyBaseGraphStore.js";
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./TinyBaseGraphStore.js";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"dependencies": {
|
|
3
|
-
"@rdfx/graph-store": "0.0.
|
|
4
|
-
"@rdfx/stream": "0.0.
|
|
5
|
-
"@rdfx/string": "0.0.
|
|
3
|
+
"@rdfx/graph-store": "0.0.48",
|
|
4
|
+
"@rdfx/stream": "0.0.48",
|
|
5
|
+
"@rdfx/string": "0.0.48",
|
|
6
6
|
"@rdfjs/types": "~2.0.1",
|
|
7
7
|
"@types/n3": "~1.26.0",
|
|
8
8
|
"n3": "~1.26.0",
|
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
"ts-log": "~3.0.2"
|
|
12
12
|
},
|
|
13
13
|
"devDependencies": {
|
|
14
|
-
"@rdfx/collection": "0.0.
|
|
15
|
-
"@rdfx/data-factory": "0.0.
|
|
14
|
+
"@rdfx/collection": "0.0.48",
|
|
15
|
+
"@rdfx/data-factory": "0.0.48"
|
|
16
16
|
},
|
|
17
17
|
"files": [
|
|
18
18
|
"LICENSE",
|
|
@@ -37,5 +37,5 @@
|
|
|
37
37
|
},
|
|
38
38
|
"type": "module",
|
|
39
39
|
"types": "./dist/index.d.ts",
|
|
40
|
-
"version": "0.0.
|
|
40
|
+
"version": "0.0.48"
|
|
41
41
|
}
|