ldkit 0.5.0 → 0.6.0
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/README.md +3 -1
- package/esm/library/asynciterator.js +1 -0
- package/esm/library/engine/query_engine.js +11 -6
- package/esm/library/engine/query_engine_proxy.js +9 -9
- package/esm/library/rdf.js +1 -1
- package/esm/library/resource/resource.js +16 -32
- package/package.json +3 -3
- package/script/library/asynciterator.js +6 -0
- package/script/library/engine/query_engine.js +11 -6
- package/script/library/engine/query_engine_proxy.js +9 -9
- package/script/library/rdf.js +1 -2
- package/script/library/resource/resource.js +16 -32
- package/types/library/asynciterator.d.ts +1 -0
- package/types/library/engine/query_engine_proxy.d.ts +4 -4
- package/types/library/namespaces/rdfs.d.ts +1 -1
- package/types/library/namespaces/schema.d.ts +2 -2
- package/types/library/rdf.d.ts +2 -1
- package/types/library/resource/resource.d.ts +10 -11
- package/esm/library/rxjs.js +0 -2
- package/script/library/rxjs.js +0 -14
- package/types/library/rxjs.d.ts +0 -2
package/README.md
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ArrayIterator, MappingIterator, } from "asynciterator";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BindingsFactory, QuadFactory, } from "../rdf.js";
|
|
2
|
+
import { ArrayIterator, MappingIterator } from "../asynciterator.js";
|
|
2
3
|
export class QueryEngine {
|
|
3
4
|
getSparqlEndpoint(context) {
|
|
4
5
|
if (!context) {
|
|
@@ -34,11 +35,13 @@ export class QueryEngine {
|
|
|
34
35
|
const fetchFn = this.getFetch(context);
|
|
35
36
|
return await fetchFn(endpoint, {
|
|
36
37
|
method: "POST",
|
|
37
|
-
body: query,
|
|
38
38
|
headers: {
|
|
39
|
-
"content-type": "application/sparql-query",
|
|
40
39
|
"accept": "application/sparql-results+json",
|
|
40
|
+
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
|
|
41
41
|
},
|
|
42
|
+
body: new URLSearchParams({
|
|
43
|
+
query,
|
|
44
|
+
}),
|
|
42
45
|
});
|
|
43
46
|
}
|
|
44
47
|
async queryBindings(query, context) {
|
|
@@ -47,9 +50,10 @@ export class QueryEngine {
|
|
|
47
50
|
if (!Array.isArray(json?.results?.bindings)) {
|
|
48
51
|
throw new Error("Bindings SPARQL query result not found");
|
|
49
52
|
}
|
|
50
|
-
// Force richer type from RDF spec
|
|
51
53
|
const bindingsFactory = new BindingsFactory();
|
|
52
|
-
|
|
54
|
+
const bindingsIterator = new ArrayIterator(json.results.bindings);
|
|
55
|
+
// TODO: review the unknown type cast
|
|
56
|
+
return new MappingIterator(bindingsIterator, (i) => bindingsFactory.fromJson(i));
|
|
53
57
|
}
|
|
54
58
|
async queryBoolean(query, context) {
|
|
55
59
|
const result = await this.query(query, context);
|
|
@@ -65,9 +69,10 @@ export class QueryEngine {
|
|
|
65
69
|
if (!Array.isArray(json?.results?.bindings)) {
|
|
66
70
|
throw new Error("Quads SPARQL query result not found");
|
|
67
71
|
}
|
|
68
|
-
// Force richer type from RDF spec
|
|
69
72
|
const quadFactory = new QuadFactory();
|
|
70
|
-
|
|
73
|
+
const bindingsIterator = new ArrayIterator(json.results.bindings);
|
|
74
|
+
// TODO: review the unknown type cast
|
|
75
|
+
return new MappingIterator(bindingsIterator, (i) => quadFactory.fromJson(i));
|
|
71
76
|
}
|
|
72
77
|
async queryVoid(query, context) {
|
|
73
78
|
await this.query(query, context);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { quadsToGraph } from "../rdf.js";
|
|
2
2
|
import { resolveContext, resolveEngine } from "../global.js";
|
|
3
|
-
import { from, map, of, switchMap } from "../rxjs.js";
|
|
4
3
|
export class QueryEngineProxy {
|
|
5
4
|
constructor(context, engine) {
|
|
6
5
|
Object.defineProperty(this, "context", {
|
|
@@ -19,17 +18,18 @@ export class QueryEngineProxy {
|
|
|
19
18
|
this.engine = resolveEngine(engine);
|
|
20
19
|
}
|
|
21
20
|
queryBoolean(query) {
|
|
22
|
-
return
|
|
21
|
+
return this.engine.queryBoolean(query, this.context);
|
|
23
22
|
}
|
|
24
|
-
queryBindings(query) {
|
|
25
|
-
|
|
23
|
+
async queryBindings(query) {
|
|
24
|
+
const bindingsStream = await this.engine.queryBindings(query, this.context);
|
|
25
|
+
return bindingsStream.toArray();
|
|
26
26
|
}
|
|
27
|
-
queryGraph(query) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
27
|
+
async queryGraph(query) {
|
|
28
|
+
const quadStream = await this.engine.queryQuads(query, this.context);
|
|
29
|
+
const quads = await (quadStream.toArray());
|
|
30
|
+
return quadsToGraph(quads);
|
|
31
31
|
}
|
|
32
32
|
queryVoid(query) {
|
|
33
|
-
return
|
|
33
|
+
return this.engine.queryVoid(query, this.context);
|
|
34
34
|
}
|
|
35
35
|
}
|
package/esm/library/rdf.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { fromRdf, toRdf } from "rdf-literal";
|
|
2
2
|
import { DataFactory } from "rdf-data-factory";
|
|
3
|
-
export { DataFactory }
|
|
3
|
+
export { DataFactory };
|
|
4
4
|
import { BindingsFactory as ComunicaBindingsFactory } from "@comunica/bindings-factory";
|
|
5
5
|
export const quadsToGraph = (quads) => {
|
|
6
6
|
const graph = new Map();
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { BehaviorSubject, map, share, switchMap, tap } from "../rxjs.js";
|
|
2
1
|
import { resolveContext } from "../global.js";
|
|
3
2
|
import { expandSchema, } from "../schema/mod.js";
|
|
4
3
|
import { decode } from "../decoder.js";
|
|
@@ -31,12 +30,6 @@ export class Resource {
|
|
|
31
30
|
writable: true,
|
|
32
31
|
value: void 0
|
|
33
32
|
});
|
|
34
|
-
Object.defineProperty(this, "$trigger", {
|
|
35
|
-
enumerable: true,
|
|
36
|
-
configurable: true,
|
|
37
|
-
writable: true,
|
|
38
|
-
value: new BehaviorSubject(null)
|
|
39
|
-
});
|
|
40
33
|
this.schema = expandSchema(schema);
|
|
41
34
|
this.context = resolveContext(context);
|
|
42
35
|
this.engine = new QueryEngineProxy(this.context, engine);
|
|
@@ -45,45 +38,36 @@ export class Resource {
|
|
|
45
38
|
decode(graph) {
|
|
46
39
|
return decode(graph, this.schema, this.context);
|
|
47
40
|
}
|
|
48
|
-
count() {
|
|
41
|
+
async count() {
|
|
49
42
|
const q = this.queryBuilder.countQuery();
|
|
50
43
|
console.log(q);
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
return parseInt(bindings[0].get("count").value);
|
|
54
|
-
}));
|
|
44
|
+
const bindings = await this.engine.queryBindings(q);
|
|
45
|
+
return parseInt(bindings[0].get("count").value);
|
|
55
46
|
}
|
|
56
47
|
//exists(entity: Identity) {}
|
|
57
|
-
query(sparqlConstructQuery) {
|
|
58
|
-
|
|
59
|
-
return this.
|
|
60
|
-
console.warn("GRAPH", graph);
|
|
61
|
-
return this.decode(graph);
|
|
62
|
-
}));
|
|
48
|
+
async query(sparqlConstructQuery) {
|
|
49
|
+
const graph = await this.engine.queryGraph(sparqlConstructQuery);
|
|
50
|
+
return this.decode(graph);
|
|
63
51
|
}
|
|
64
|
-
find(where, limit) {
|
|
52
|
+
async find(where, limit) {
|
|
65
53
|
const q = this.queryBuilder.getQuery(where, limit);
|
|
66
54
|
console.log(q);
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
return this.decode(graph);
|
|
70
|
-
}));
|
|
55
|
+
const graph = await this.engine.queryGraph(q);
|
|
56
|
+
return this.decode(graph);
|
|
71
57
|
}
|
|
72
|
-
findByIri(iri) {
|
|
73
|
-
|
|
58
|
+
async findByIri(iri) {
|
|
59
|
+
const results = await this.findByIris([iri]);
|
|
60
|
+
return results.length > 0 ? results[0] : undefined;
|
|
74
61
|
}
|
|
75
|
-
findByIris(iris) {
|
|
62
|
+
async findByIris(iris) {
|
|
76
63
|
const q = this.queryBuilder.getByIrisQuery(iris);
|
|
77
64
|
console.log(q);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}));
|
|
65
|
+
const graph = await this.engine.queryGraph(q);
|
|
66
|
+
return this.decode(graph);
|
|
81
67
|
}
|
|
82
68
|
updateQuery(query) {
|
|
83
69
|
console.log(query);
|
|
84
|
-
|
|
85
|
-
result.subscribe();
|
|
86
|
-
return result;
|
|
70
|
+
return this.engine.queryVoid(query);
|
|
87
71
|
}
|
|
88
72
|
insert(...entities) {
|
|
89
73
|
const q = this.queryBuilder.insertQuery(entities);
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"main": "./script/mod.js",
|
|
4
4
|
"types": "./types/mod.d.ts",
|
|
5
5
|
"name": "ldkit",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.6.0",
|
|
7
7
|
"description": "LDkit, a Linked Data query toolkit for TypeScript developers",
|
|
8
8
|
"homepage": "https://ldkit.io",
|
|
9
9
|
"author": "Karel Klima <karelklima@gmail.com> (https://karelklima.com)",
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"@comunica/types": "2.4.0",
|
|
46
46
|
"@tpluscode/rdf-string": "0.2.26",
|
|
47
47
|
"@tpluscode/sparql-builder": "0.3.23",
|
|
48
|
+
"asynciterator": "3.7.0",
|
|
48
49
|
"rdf-data-factory": "1.1.1",
|
|
49
50
|
"rdf-js": "4.0.2",
|
|
50
|
-
"rdf-literal": "1.3.0"
|
|
51
|
-
"rxjs": "7.5.6"
|
|
51
|
+
"rdf-literal": "1.3.0"
|
|
52
52
|
}
|
|
53
53
|
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MappingIterator = exports.ArrayIterator = void 0;
|
|
4
|
+
var asynciterator_1 = require("asynciterator");
|
|
5
|
+
Object.defineProperty(exports, "ArrayIterator", { enumerable: true, get: function () { return asynciterator_1.ArrayIterator; } });
|
|
6
|
+
Object.defineProperty(exports, "MappingIterator", { enumerable: true, get: function () { return asynciterator_1.MappingIterator; } });
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.QueryEngine = void 0;
|
|
4
4
|
const rdf_js_1 = require("../rdf.js");
|
|
5
|
+
const asynciterator_js_1 = require("../asynciterator.js");
|
|
5
6
|
class QueryEngine {
|
|
6
7
|
getSparqlEndpoint(context) {
|
|
7
8
|
if (!context) {
|
|
@@ -37,11 +38,13 @@ class QueryEngine {
|
|
|
37
38
|
const fetchFn = this.getFetch(context);
|
|
38
39
|
return await fetchFn(endpoint, {
|
|
39
40
|
method: "POST",
|
|
40
|
-
body: query,
|
|
41
41
|
headers: {
|
|
42
|
-
"content-type": "application/sparql-query",
|
|
43
42
|
"accept": "application/sparql-results+json",
|
|
43
|
+
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
|
|
44
44
|
},
|
|
45
|
+
body: new URLSearchParams({
|
|
46
|
+
query,
|
|
47
|
+
}),
|
|
45
48
|
});
|
|
46
49
|
}
|
|
47
50
|
async queryBindings(query, context) {
|
|
@@ -50,9 +53,10 @@ class QueryEngine {
|
|
|
50
53
|
if (!Array.isArray(json?.results?.bindings)) {
|
|
51
54
|
throw new Error("Bindings SPARQL query result not found");
|
|
52
55
|
}
|
|
53
|
-
// Force richer type from RDF spec
|
|
54
56
|
const bindingsFactory = new rdf_js_1.BindingsFactory();
|
|
55
|
-
|
|
57
|
+
const bindingsIterator = new asynciterator_js_1.ArrayIterator(json.results.bindings);
|
|
58
|
+
// TODO: review the unknown type cast
|
|
59
|
+
return new asynciterator_js_1.MappingIterator(bindingsIterator, (i) => bindingsFactory.fromJson(i));
|
|
56
60
|
}
|
|
57
61
|
async queryBoolean(query, context) {
|
|
58
62
|
const result = await this.query(query, context);
|
|
@@ -68,9 +72,10 @@ class QueryEngine {
|
|
|
68
72
|
if (!Array.isArray(json?.results?.bindings)) {
|
|
69
73
|
throw new Error("Quads SPARQL query result not found");
|
|
70
74
|
}
|
|
71
|
-
// Force richer type from RDF spec
|
|
72
75
|
const quadFactory = new rdf_js_1.QuadFactory();
|
|
73
|
-
|
|
76
|
+
const bindingsIterator = new asynciterator_js_1.ArrayIterator(json.results.bindings);
|
|
77
|
+
// TODO: review the unknown type cast
|
|
78
|
+
return new asynciterator_js_1.MappingIterator(bindingsIterator, (i) => quadFactory.fromJson(i));
|
|
74
79
|
}
|
|
75
80
|
async queryVoid(query, context) {
|
|
76
81
|
await this.query(query, context);
|
|
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.QueryEngineProxy = void 0;
|
|
4
4
|
const rdf_js_1 = require("../rdf.js");
|
|
5
5
|
const global_js_1 = require("../global.js");
|
|
6
|
-
const rxjs_js_1 = require("../rxjs.js");
|
|
7
6
|
class QueryEngineProxy {
|
|
8
7
|
constructor(context, engine) {
|
|
9
8
|
Object.defineProperty(this, "context", {
|
|
@@ -22,18 +21,19 @@ class QueryEngineProxy {
|
|
|
22
21
|
this.engine = (0, global_js_1.resolveEngine)(engine);
|
|
23
22
|
}
|
|
24
23
|
queryBoolean(query) {
|
|
25
|
-
return
|
|
24
|
+
return this.engine.queryBoolean(query, this.context);
|
|
26
25
|
}
|
|
27
|
-
queryBindings(query) {
|
|
28
|
-
|
|
26
|
+
async queryBindings(query) {
|
|
27
|
+
const bindingsStream = await this.engine.queryBindings(query, this.context);
|
|
28
|
+
return bindingsStream.toArray();
|
|
29
29
|
}
|
|
30
|
-
queryGraph(query) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
async queryGraph(query) {
|
|
31
|
+
const quadStream = await this.engine.queryQuads(query, this.context);
|
|
32
|
+
const quads = await (quadStream.toArray());
|
|
33
|
+
return (0, rdf_js_1.quadsToGraph)(quads);
|
|
34
34
|
}
|
|
35
35
|
queryVoid(query) {
|
|
36
|
-
return
|
|
36
|
+
return this.engine.queryVoid(query, this.context);
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
exports.QueryEngineProxy = QueryEngineProxy;
|
package/script/library/rdf.js
CHANGED
|
@@ -5,8 +5,7 @@ var rdf_literal_1 = require("rdf-literal");
|
|
|
5
5
|
Object.defineProperty(exports, "fromRdf", { enumerable: true, get: function () { return rdf_literal_1.fromRdf; } });
|
|
6
6
|
Object.defineProperty(exports, "toRdf", { enumerable: true, get: function () { return rdf_literal_1.toRdf; } });
|
|
7
7
|
const rdf_data_factory_1 = require("rdf-data-factory");
|
|
8
|
-
|
|
9
|
-
Object.defineProperty(exports, "DataFactory", { enumerable: true, get: function () { return rdf_data_factory_2.DataFactory; } });
|
|
8
|
+
Object.defineProperty(exports, "DataFactory", { enumerable: true, get: function () { return rdf_data_factory_1.DataFactory; } });
|
|
10
9
|
const bindings_factory_1 = require("@comunica/bindings-factory");
|
|
11
10
|
const quadsToGraph = (quads) => {
|
|
12
11
|
const graph = new Map();
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Resource = exports.createResource = void 0;
|
|
4
|
-
const rxjs_js_1 = require("../rxjs.js");
|
|
5
4
|
const global_js_1 = require("../global.js");
|
|
6
5
|
const mod_js_1 = require("../schema/mod.js");
|
|
7
6
|
const decoder_js_1 = require("../decoder.js");
|
|
@@ -35,12 +34,6 @@ class Resource {
|
|
|
35
34
|
writable: true,
|
|
36
35
|
value: void 0
|
|
37
36
|
});
|
|
38
|
-
Object.defineProperty(this, "$trigger", {
|
|
39
|
-
enumerable: true,
|
|
40
|
-
configurable: true,
|
|
41
|
-
writable: true,
|
|
42
|
-
value: new rxjs_js_1.BehaviorSubject(null)
|
|
43
|
-
});
|
|
44
37
|
this.schema = (0, mod_js_1.expandSchema)(schema);
|
|
45
38
|
this.context = (0, global_js_1.resolveContext)(context);
|
|
46
39
|
this.engine = new query_engine_proxy_js_1.QueryEngineProxy(this.context, engine);
|
|
@@ -49,45 +42,36 @@ class Resource {
|
|
|
49
42
|
decode(graph) {
|
|
50
43
|
return (0, decoder_js_1.decode)(graph, this.schema, this.context);
|
|
51
44
|
}
|
|
52
|
-
count() {
|
|
45
|
+
async count() {
|
|
53
46
|
const q = this.queryBuilder.countQuery();
|
|
54
47
|
console.log(q);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
return parseInt(bindings[0].get("count").value);
|
|
58
|
-
}));
|
|
48
|
+
const bindings = await this.engine.queryBindings(q);
|
|
49
|
+
return parseInt(bindings[0].get("count").value);
|
|
59
50
|
}
|
|
60
51
|
//exists(entity: Identity) {}
|
|
61
|
-
query(sparqlConstructQuery) {
|
|
62
|
-
|
|
63
|
-
return this.
|
|
64
|
-
console.warn("GRAPH", graph);
|
|
65
|
-
return this.decode(graph);
|
|
66
|
-
}));
|
|
52
|
+
async query(sparqlConstructQuery) {
|
|
53
|
+
const graph = await this.engine.queryGraph(sparqlConstructQuery);
|
|
54
|
+
return this.decode(graph);
|
|
67
55
|
}
|
|
68
|
-
find(where, limit) {
|
|
56
|
+
async find(where, limit) {
|
|
69
57
|
const q = this.queryBuilder.getQuery(where, limit);
|
|
70
58
|
console.log(q);
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
return this.decode(graph);
|
|
74
|
-
}));
|
|
59
|
+
const graph = await this.engine.queryGraph(q);
|
|
60
|
+
return this.decode(graph);
|
|
75
61
|
}
|
|
76
|
-
findByIri(iri) {
|
|
77
|
-
|
|
62
|
+
async findByIri(iri) {
|
|
63
|
+
const results = await this.findByIris([iri]);
|
|
64
|
+
return results.length > 0 ? results[0] : undefined;
|
|
78
65
|
}
|
|
79
|
-
findByIris(iris) {
|
|
66
|
+
async findByIris(iris) {
|
|
80
67
|
const q = this.queryBuilder.getByIrisQuery(iris);
|
|
81
68
|
console.log(q);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
}));
|
|
69
|
+
const graph = await this.engine.queryGraph(q);
|
|
70
|
+
return this.decode(graph);
|
|
85
71
|
}
|
|
86
72
|
updateQuery(query) {
|
|
87
73
|
console.log(query);
|
|
88
|
-
|
|
89
|
-
result.subscribe();
|
|
90
|
-
return result;
|
|
74
|
+
return this.engine.queryVoid(query);
|
|
91
75
|
}
|
|
92
76
|
insert(...entities) {
|
|
93
77
|
const q = this.queryBuilder.insertQuery(entities);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ArrayIterator, type AsyncIterator, MappingIterator, } from "asynciterator";
|
|
@@ -3,8 +3,8 @@ export declare class QueryEngineProxy {
|
|
|
3
3
|
private readonly context;
|
|
4
4
|
private readonly engine;
|
|
5
5
|
constructor(context?: Context, engine?: IQueryEngine);
|
|
6
|
-
queryBoolean(query: string):
|
|
7
|
-
queryBindings(query: string):
|
|
8
|
-
queryGraph(query: string):
|
|
9
|
-
queryVoid(query: string):
|
|
6
|
+
queryBoolean(query: string): Promise<boolean>;
|
|
7
|
+
queryBindings(query: string): Promise<RDF.Bindings[]>;
|
|
8
|
+
queryGraph(query: string): Promise<import("../rdf.js").Graph>;
|
|
9
|
+
queryVoid(query: string): Promise<void>;
|
|
10
10
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
Literal: "rdfs:Literal";
|
|
3
|
+
range: "rdfs:range";
|
|
3
4
|
Class: "rdfs:Class";
|
|
4
5
|
Container: "rdfs:Container";
|
|
5
6
|
ContainerMembershipProperty: "rdfs:ContainerMembershipProperty";
|
|
@@ -10,7 +11,6 @@ declare const _default: {
|
|
|
10
11
|
isDefinedBy: "rdfs:isDefinedBy";
|
|
11
12
|
label: "rdfs:label";
|
|
12
13
|
member: "rdfs:member";
|
|
13
|
-
range: "rdfs:range";
|
|
14
14
|
seeAlso: "rdfs:seeAlso";
|
|
15
15
|
subClassOf: "rdfs:subClassOf";
|
|
16
16
|
subPropertyOf: "rdfs:subPropertyOf";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
object: "schema:object";
|
|
3
3
|
value: "schema:value";
|
|
4
|
-
|
|
4
|
+
query: "schema:query";
|
|
5
5
|
map: "schema:map";
|
|
6
6
|
Property: "schema:Property";
|
|
7
7
|
language: "schema:language";
|
|
@@ -1768,6 +1768,7 @@ declare const _default: {
|
|
|
1768
1768
|
episodeNumber: "schema:episodeNumber";
|
|
1769
1769
|
episodes: "schema:episodes";
|
|
1770
1770
|
equal: "schema:equal";
|
|
1771
|
+
error: "schema:error";
|
|
1771
1772
|
estimatedCost: "schema:estimatedCost";
|
|
1772
1773
|
estimatedFlightDuration: "schema:estimatedFlightDuration";
|
|
1773
1774
|
estimatedSalary: "schema:estimatedSalary";
|
|
@@ -2327,7 +2328,6 @@ declare const _default: {
|
|
|
2327
2328
|
purchaseDate: "schema:purchaseDate";
|
|
2328
2329
|
qualifications: "schema:qualifications";
|
|
2329
2330
|
quarantineGuidelines: "schema:quarantineGuidelines";
|
|
2330
|
-
query: "schema:query";
|
|
2331
2331
|
quest: "schema:quest";
|
|
2332
2332
|
question: "schema:question";
|
|
2333
2333
|
rangeIncludes: "schema:rangeIncludes";
|
package/types/library/rdf.d.ts
CHANGED
|
@@ -3,7 +3,8 @@ export type { Bindings, BlankNode, Literal, NamedNode, Quad, Term, Variable };
|
|
|
3
3
|
import type * as RDF from "rdf-js";
|
|
4
4
|
export type { RDF };
|
|
5
5
|
export { fromRdf, toRdf } from "rdf-literal";
|
|
6
|
-
|
|
6
|
+
import { DataFactory } from "rdf-data-factory";
|
|
7
|
+
export { DataFactory };
|
|
7
8
|
import { BindingsFactory as ComunicaBindingsFactory } from "@comunica/bindings-factory";
|
|
8
9
|
import type { IDataSource, IQueryContextCommon } from "@comunica/types";
|
|
9
10
|
export declare type LDkitContext = {
|
|
@@ -7,18 +7,17 @@ export declare class Resource<S extends SchemaPrototype, I = SchemaInterface<S>>
|
|
|
7
7
|
private readonly context;
|
|
8
8
|
private readonly engine;
|
|
9
9
|
private readonly queryBuilder;
|
|
10
|
-
private readonly $trigger;
|
|
11
10
|
constructor(schema: S, context?: Context, engine?: IQueryEngine);
|
|
12
11
|
private decode;
|
|
13
|
-
count():
|
|
14
|
-
query(sparqlConstructQuery: string):
|
|
15
|
-
find(where?: string | RDF.Quad[], limit?: number):
|
|
16
|
-
findByIri(iri: Iri):
|
|
17
|
-
findByIris(iris: Iri[]):
|
|
12
|
+
count(): Promise<number>;
|
|
13
|
+
query(sparqlConstructQuery: string): Promise<I[]>;
|
|
14
|
+
find(where?: string | RDF.Quad[], limit?: number): Promise<I[]>;
|
|
15
|
+
findByIri(iri: Iri): Promise<I | undefined>;
|
|
16
|
+
findByIris(iris: Iri[]): Promise<I[]>;
|
|
18
17
|
private updateQuery;
|
|
19
|
-
insert(...entities: Entity<I>[]):
|
|
20
|
-
insertData(...quads: RDF.Quad[]):
|
|
21
|
-
update(...entities: Entity<I>[]):
|
|
22
|
-
delete(...identities: SchemaInterfaceIdentity[] | Iri[]):
|
|
23
|
-
deleteData(...quads: RDF.Quad[]):
|
|
18
|
+
insert(...entities: Entity<I>[]): Promise<void>;
|
|
19
|
+
insertData(...quads: RDF.Quad[]): Promise<void>;
|
|
20
|
+
update(...entities: Entity<I>[]): Promise<void>;
|
|
21
|
+
delete(...identities: SchemaInterfaceIdentity[] | Iri[]): Promise<void>;
|
|
22
|
+
deleteData(...quads: RDF.Quad[]): Promise<void>;
|
|
24
23
|
}
|
package/esm/library/rxjs.js
DELETED
package/script/library/rxjs.js
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tap = exports.switchMap = exports.share = exports.map = exports.of = exports.lastValueFrom = exports.from = exports.firstValueFrom = exports.BehaviorSubject = void 0;
|
|
4
|
-
var rxjs_1 = require("rxjs");
|
|
5
|
-
Object.defineProperty(exports, "BehaviorSubject", { enumerable: true, get: function () { return rxjs_1.BehaviorSubject; } });
|
|
6
|
-
Object.defineProperty(exports, "firstValueFrom", { enumerable: true, get: function () { return rxjs_1.firstValueFrom; } });
|
|
7
|
-
Object.defineProperty(exports, "from", { enumerable: true, get: function () { return rxjs_1.from; } });
|
|
8
|
-
Object.defineProperty(exports, "lastValueFrom", { enumerable: true, get: function () { return rxjs_1.lastValueFrom; } });
|
|
9
|
-
Object.defineProperty(exports, "of", { enumerable: true, get: function () { return rxjs_1.of; } });
|
|
10
|
-
var operators_1 = require("rxjs/operators");
|
|
11
|
-
Object.defineProperty(exports, "map", { enumerable: true, get: function () { return operators_1.map; } });
|
|
12
|
-
Object.defineProperty(exports, "share", { enumerable: true, get: function () { return operators_1.share; } });
|
|
13
|
-
Object.defineProperty(exports, "switchMap", { enumerable: true, get: function () { return operators_1.switchMap; } });
|
|
14
|
-
Object.defineProperty(exports, "tap", { enumerable: true, get: function () { return operators_1.tap; } });
|
package/types/library/rxjs.d.ts
DELETED