ldkit 0.5.1 → 0.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -1
- package/esm/library/asynciterator.js +95 -0
- package/esm/library/engine/query_engine.js +18 -16
- package/esm/library/engine/query_engine_proxy.js +9 -9
- package/esm/library/rdf.js +7 -7
- package/esm/library/resource/resource.js +16 -32
- package/package.json +7 -4
- package/script/library/asynciterator.js +101 -0
- package/script/library/engine/query_engine.js +18 -16
- package/script/library/engine/query_engine_proxy.js +9 -9
- package/script/library/rdf.js +7 -8
- package/script/library/resource/resource.js +16 -32
- package/types/library/asynciterator.d.ts +29 -0
- package/types/library/engine/query_engine.d.ts +7 -2
- 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 +1 -1
- package/types/library/rdf.d.ts +16 -5
- 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,95 @@
|
|
|
1
|
+
import { AsyncIterator } from "asynciterator";
|
|
2
|
+
export { ArrayIterator, MappingIterator, } from "asynciterator";
|
|
3
|
+
export class TreeIterator extends AsyncIterator {
|
|
4
|
+
constructor(tree) {
|
|
5
|
+
super();
|
|
6
|
+
Object.defineProperty(this, "_tree", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
configurable: true,
|
|
9
|
+
writable: true,
|
|
10
|
+
value: void 0
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(this, "_pointer", {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
configurable: true,
|
|
15
|
+
writable: true,
|
|
16
|
+
value: void 0
|
|
17
|
+
});
|
|
18
|
+
this._tree = tree;
|
|
19
|
+
this._pointer = this._buildPointerFromSource(tree);
|
|
20
|
+
this.readable = true;
|
|
21
|
+
}
|
|
22
|
+
read() {
|
|
23
|
+
if (this.closed) {
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
this._findNextCommonSegment();
|
|
27
|
+
this._findNextLeaf();
|
|
28
|
+
const p = this._pointer;
|
|
29
|
+
if (p.type === "leaf") {
|
|
30
|
+
p.index++;
|
|
31
|
+
if (p.index < p.items.length) {
|
|
32
|
+
return [...p.path, p.items[p.index]];
|
|
33
|
+
}
|
|
34
|
+
if (!p.parent) {
|
|
35
|
+
this.close();
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
if (p.type === "node") {
|
|
39
|
+
this.close();
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}
|
|
43
|
+
_buildPointerFromSource(tree, path = []) {
|
|
44
|
+
if (tree.constructor === Object && !Array.isArray(tree)) {
|
|
45
|
+
return {
|
|
46
|
+
tree,
|
|
47
|
+
parent: this._pointer,
|
|
48
|
+
type: "node",
|
|
49
|
+
items: Object.keys(tree),
|
|
50
|
+
path,
|
|
51
|
+
index: -1,
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
if (Array.isArray(tree)) {
|
|
55
|
+
return {
|
|
56
|
+
parent: this._pointer,
|
|
57
|
+
type: "leaf",
|
|
58
|
+
items: tree,
|
|
59
|
+
path,
|
|
60
|
+
index: -1,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
throw new Error("Invalid tree specified, expecting arrays in plain objects.");
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
_findNextCommonSegment() {
|
|
68
|
+
while (this._pointer.parent !== null) {
|
|
69
|
+
const p = this._pointer;
|
|
70
|
+
if (p.type === "leaf" && p.index < p.items.length - 1) {
|
|
71
|
+
// Points to a leaf that is not yet exhausted
|
|
72
|
+
break;
|
|
73
|
+
}
|
|
74
|
+
if (p.index >= p.items.length - 1 && this._pointer.parent) {
|
|
75
|
+
this._pointer = this._pointer.parent;
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
_findNextLeaf() {
|
|
83
|
+
while (this._pointer.type !== "leaf") {
|
|
84
|
+
const p = this._pointer;
|
|
85
|
+
p.index++;
|
|
86
|
+
if (p.index >= p.items.length) {
|
|
87
|
+
// no other keys present, the tree is exhausted;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
const key = p.items[p.index];
|
|
91
|
+
const source = this._pointer.tree[key];
|
|
92
|
+
this._pointer = this._buildPointerFromSource(source, [...p.path, key]);
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { BindingsFactory, QuadFactory, } from "../rdf.js";
|
|
2
|
+
import { ArrayIterator, MappingIterator, TreeIterator, } from "../asynciterator.js";
|
|
2
3
|
export class QueryEngine {
|
|
3
4
|
getSparqlEndpoint(context) {
|
|
4
5
|
if (!context) {
|
|
@@ -29,49 +30,50 @@ export class QueryEngine {
|
|
|
29
30
|
getFetch(context) {
|
|
30
31
|
return context && context.fetch ? context.fetch : fetch;
|
|
31
32
|
}
|
|
32
|
-
async query(query, context) {
|
|
33
|
+
async query(query, responseType, context) {
|
|
33
34
|
const endpoint = this.getSparqlEndpoint(context);
|
|
34
35
|
const fetchFn = this.getFetch(context);
|
|
35
|
-
|
|
36
|
+
const response = await fetchFn(endpoint, {
|
|
36
37
|
method: "POST",
|
|
37
38
|
headers: {
|
|
38
|
-
"accept":
|
|
39
|
+
"accept": responseType,
|
|
39
40
|
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
|
|
40
41
|
},
|
|
41
42
|
body: new URLSearchParams({
|
|
42
43
|
query,
|
|
43
44
|
}),
|
|
44
45
|
});
|
|
46
|
+
const json = await response.json();
|
|
47
|
+
return json;
|
|
45
48
|
}
|
|
46
49
|
async queryBindings(query, context) {
|
|
47
|
-
const
|
|
48
|
-
|
|
49
|
-
if (!Array.isArray(json?.results?.bindings)) {
|
|
50
|
+
const json = await this.query(query, "application/sparql-results+json", context);
|
|
51
|
+
if (!Array.isArray(json.results?.bindings)) {
|
|
50
52
|
throw new Error("Bindings SPARQL query result not found");
|
|
51
53
|
}
|
|
52
|
-
// Force richer type from RDF spec
|
|
53
54
|
const bindingsFactory = new BindingsFactory();
|
|
54
|
-
|
|
55
|
+
const bindingsIterator = new ArrayIterator(json.results.bindings);
|
|
56
|
+
// TODO: review the unknown type cast
|
|
57
|
+
return new MappingIterator(bindingsIterator, (i) => bindingsFactory.fromJson(i));
|
|
55
58
|
}
|
|
56
59
|
async queryBoolean(query, context) {
|
|
57
|
-
const
|
|
58
|
-
const json = await result.json();
|
|
60
|
+
const json = await this.query(query, "application/sparql-results+json", context);
|
|
59
61
|
if ("boolean" in json) {
|
|
60
62
|
return Boolean(json.boolean);
|
|
61
63
|
}
|
|
62
64
|
throw new Error("Boolean SPARQL query result not found");
|
|
63
65
|
}
|
|
64
66
|
async queryQuads(query, context) {
|
|
65
|
-
const
|
|
66
|
-
|
|
67
|
-
if (!Array.isArray(json?.results?.bindings)) {
|
|
67
|
+
const json = await this.query(query, "application/rdf+json", context);
|
|
68
|
+
if (!(json?.constructor === Object)) {
|
|
68
69
|
throw new Error("Quads SPARQL query result not found");
|
|
69
70
|
}
|
|
70
|
-
// Force richer type from RDF spec
|
|
71
71
|
const quadFactory = new QuadFactory();
|
|
72
|
-
|
|
72
|
+
const treeIterator = new TreeIterator(json);
|
|
73
|
+
// TODO: review the unknown type cast
|
|
74
|
+
return new MappingIterator(treeIterator, (i) => quadFactory.fromJson(i));
|
|
73
75
|
}
|
|
74
76
|
async queryVoid(query, context) {
|
|
75
|
-
await this.query(query, context);
|
|
77
|
+
await this.query(query, "application/sparql-results+json", context);
|
|
76
78
|
}
|
|
77
79
|
}
|
|
@@ -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();
|
|
@@ -68,24 +68,24 @@ export class BindingsFactory extends ComunicaBindingsFactory {
|
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
70
|
export class QuadFactory {
|
|
71
|
-
constructor(dataFactory = new DataFactory(),
|
|
71
|
+
constructor(dataFactory = new DataFactory(), termFactory = new TermFactory()) {
|
|
72
72
|
Object.defineProperty(this, "dataFactory", {
|
|
73
73
|
enumerable: true,
|
|
74
74
|
configurable: true,
|
|
75
75
|
writable: true,
|
|
76
76
|
value: void 0
|
|
77
77
|
});
|
|
78
|
-
Object.defineProperty(this, "
|
|
78
|
+
Object.defineProperty(this, "termFactory", {
|
|
79
79
|
enumerable: true,
|
|
80
80
|
configurable: true,
|
|
81
81
|
writable: true,
|
|
82
82
|
value: void 0
|
|
83
83
|
});
|
|
84
84
|
this.dataFactory = dataFactory;
|
|
85
|
-
this.
|
|
85
|
+
this.termFactory = termFactory;
|
|
86
86
|
}
|
|
87
|
-
fromJson(
|
|
88
|
-
const
|
|
89
|
-
return this.dataFactory.quad(
|
|
87
|
+
fromJson(jsonRdf) {
|
|
88
|
+
const [s, p, o] = jsonRdf;
|
|
89
|
+
return this.dataFactory.quad(this.dataFactory.namedNode(s), this.dataFactory.namedNode(p), this.termFactory.fromJson(o));
|
|
90
90
|
}
|
|
91
91
|
}
|
|
@@ -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,12 +3,15 @@
|
|
|
3
3
|
"main": "./script/mod.js",
|
|
4
4
|
"types": "./types/mod.d.ts",
|
|
5
5
|
"name": "ldkit",
|
|
6
|
-
"version": "0.
|
|
6
|
+
"version": "0.6.1",
|
|
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)",
|
|
10
10
|
"keywords": [
|
|
11
|
-
"linked data,
|
|
11
|
+
"linked data",
|
|
12
|
+
"rdf",
|
|
13
|
+
"sparql",
|
|
14
|
+
"deno"
|
|
12
15
|
],
|
|
13
16
|
"license": "MIT",
|
|
14
17
|
"repository": {
|
|
@@ -45,9 +48,9 @@
|
|
|
45
48
|
"@comunica/types": "2.4.0",
|
|
46
49
|
"@tpluscode/rdf-string": "0.2.26",
|
|
47
50
|
"@tpluscode/sparql-builder": "0.3.23",
|
|
51
|
+
"asynciterator": "3.7.0",
|
|
48
52
|
"rdf-data-factory": "1.1.1",
|
|
49
53
|
"rdf-js": "4.0.2",
|
|
50
|
-
"rdf-literal": "1.3.0"
|
|
51
|
-
"rxjs": "7.5.6"
|
|
54
|
+
"rdf-literal": "1.3.0"
|
|
52
55
|
}
|
|
53
56
|
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TreeIterator = exports.MappingIterator = exports.ArrayIterator = void 0;
|
|
4
|
+
const asynciterator_1 = require("asynciterator");
|
|
5
|
+
var asynciterator_2 = require("asynciterator");
|
|
6
|
+
Object.defineProperty(exports, "ArrayIterator", { enumerable: true, get: function () { return asynciterator_2.ArrayIterator; } });
|
|
7
|
+
Object.defineProperty(exports, "MappingIterator", { enumerable: true, get: function () { return asynciterator_2.MappingIterator; } });
|
|
8
|
+
class TreeIterator extends asynciterator_1.AsyncIterator {
|
|
9
|
+
constructor(tree) {
|
|
10
|
+
super();
|
|
11
|
+
Object.defineProperty(this, "_tree", {
|
|
12
|
+
enumerable: true,
|
|
13
|
+
configurable: true,
|
|
14
|
+
writable: true,
|
|
15
|
+
value: void 0
|
|
16
|
+
});
|
|
17
|
+
Object.defineProperty(this, "_pointer", {
|
|
18
|
+
enumerable: true,
|
|
19
|
+
configurable: true,
|
|
20
|
+
writable: true,
|
|
21
|
+
value: void 0
|
|
22
|
+
});
|
|
23
|
+
this._tree = tree;
|
|
24
|
+
this._pointer = this._buildPointerFromSource(tree);
|
|
25
|
+
this.readable = true;
|
|
26
|
+
}
|
|
27
|
+
read() {
|
|
28
|
+
if (this.closed) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
this._findNextCommonSegment();
|
|
32
|
+
this._findNextLeaf();
|
|
33
|
+
const p = this._pointer;
|
|
34
|
+
if (p.type === "leaf") {
|
|
35
|
+
p.index++;
|
|
36
|
+
if (p.index < p.items.length) {
|
|
37
|
+
return [...p.path, p.items[p.index]];
|
|
38
|
+
}
|
|
39
|
+
if (!p.parent) {
|
|
40
|
+
this.close();
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
if (p.type === "node") {
|
|
44
|
+
this.close();
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
_buildPointerFromSource(tree, path = []) {
|
|
49
|
+
if (tree.constructor === Object && !Array.isArray(tree)) {
|
|
50
|
+
return {
|
|
51
|
+
tree,
|
|
52
|
+
parent: this._pointer,
|
|
53
|
+
type: "node",
|
|
54
|
+
items: Object.keys(tree),
|
|
55
|
+
path,
|
|
56
|
+
index: -1,
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
if (Array.isArray(tree)) {
|
|
60
|
+
return {
|
|
61
|
+
parent: this._pointer,
|
|
62
|
+
type: "leaf",
|
|
63
|
+
items: tree,
|
|
64
|
+
path,
|
|
65
|
+
index: -1,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
throw new Error("Invalid tree specified, expecting arrays in plain objects.");
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
_findNextCommonSegment() {
|
|
73
|
+
while (this._pointer.parent !== null) {
|
|
74
|
+
const p = this._pointer;
|
|
75
|
+
if (p.type === "leaf" && p.index < p.items.length - 1) {
|
|
76
|
+
// Points to a leaf that is not yet exhausted
|
|
77
|
+
break;
|
|
78
|
+
}
|
|
79
|
+
if (p.index >= p.items.length - 1 && this._pointer.parent) {
|
|
80
|
+
this._pointer = this._pointer.parent;
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
break;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
_findNextLeaf() {
|
|
88
|
+
while (this._pointer.type !== "leaf") {
|
|
89
|
+
const p = this._pointer;
|
|
90
|
+
p.index++;
|
|
91
|
+
if (p.index >= p.items.length) {
|
|
92
|
+
// no other keys present, the tree is exhausted;
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
const key = p.items[p.index];
|
|
96
|
+
const source = this._pointer.tree[key];
|
|
97
|
+
this._pointer = this._buildPointerFromSource(source, [...p.path, key]);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
exports.TreeIterator = TreeIterator;
|
|
@@ -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) {
|
|
@@ -32,50 +33,51 @@ class QueryEngine {
|
|
|
32
33
|
getFetch(context) {
|
|
33
34
|
return context && context.fetch ? context.fetch : fetch;
|
|
34
35
|
}
|
|
35
|
-
async query(query, context) {
|
|
36
|
+
async query(query, responseType, context) {
|
|
36
37
|
const endpoint = this.getSparqlEndpoint(context);
|
|
37
38
|
const fetchFn = this.getFetch(context);
|
|
38
|
-
|
|
39
|
+
const response = await fetchFn(endpoint, {
|
|
39
40
|
method: "POST",
|
|
40
41
|
headers: {
|
|
41
|
-
"accept":
|
|
42
|
+
"accept": responseType,
|
|
42
43
|
"content-type": "application/x-www-form-urlencoded; charset=UTF-8",
|
|
43
44
|
},
|
|
44
45
|
body: new URLSearchParams({
|
|
45
46
|
query,
|
|
46
47
|
}),
|
|
47
48
|
});
|
|
49
|
+
const json = await response.json();
|
|
50
|
+
return json;
|
|
48
51
|
}
|
|
49
52
|
async queryBindings(query, context) {
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
if (!Array.isArray(json?.results?.bindings)) {
|
|
53
|
+
const json = await this.query(query, "application/sparql-results+json", context);
|
|
54
|
+
if (!Array.isArray(json.results?.bindings)) {
|
|
53
55
|
throw new Error("Bindings SPARQL query result not found");
|
|
54
56
|
}
|
|
55
|
-
// Force richer type from RDF spec
|
|
56
57
|
const bindingsFactory = new rdf_js_1.BindingsFactory();
|
|
57
|
-
|
|
58
|
+
const bindingsIterator = new asynciterator_js_1.ArrayIterator(json.results.bindings);
|
|
59
|
+
// TODO: review the unknown type cast
|
|
60
|
+
return new asynciterator_js_1.MappingIterator(bindingsIterator, (i) => bindingsFactory.fromJson(i));
|
|
58
61
|
}
|
|
59
62
|
async queryBoolean(query, context) {
|
|
60
|
-
const
|
|
61
|
-
const json = await result.json();
|
|
63
|
+
const json = await this.query(query, "application/sparql-results+json", context);
|
|
62
64
|
if ("boolean" in json) {
|
|
63
65
|
return Boolean(json.boolean);
|
|
64
66
|
}
|
|
65
67
|
throw new Error("Boolean SPARQL query result not found");
|
|
66
68
|
}
|
|
67
69
|
async queryQuads(query, context) {
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
if (!Array.isArray(json?.results?.bindings)) {
|
|
70
|
+
const json = await this.query(query, "application/rdf+json", context);
|
|
71
|
+
if (!(json?.constructor === Object)) {
|
|
71
72
|
throw new Error("Quads SPARQL query result not found");
|
|
72
73
|
}
|
|
73
|
-
// Force richer type from RDF spec
|
|
74
74
|
const quadFactory = new rdf_js_1.QuadFactory();
|
|
75
|
-
|
|
75
|
+
const treeIterator = new asynciterator_js_1.TreeIterator(json);
|
|
76
|
+
// TODO: review the unknown type cast
|
|
77
|
+
return new asynciterator_js_1.MappingIterator(treeIterator, (i) => quadFactory.fromJson(i));
|
|
76
78
|
}
|
|
77
79
|
async queryVoid(query, context) {
|
|
78
|
-
await this.query(query, context);
|
|
80
|
+
await this.query(query, "application/sparql-results+json", context);
|
|
79
81
|
}
|
|
80
82
|
}
|
|
81
83
|
exports.QueryEngine = QueryEngine;
|
|
@@ -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();
|
|
@@ -77,25 +76,25 @@ class BindingsFactory extends bindings_factory_1.BindingsFactory {
|
|
|
77
76
|
}
|
|
78
77
|
exports.BindingsFactory = BindingsFactory;
|
|
79
78
|
class QuadFactory {
|
|
80
|
-
constructor(dataFactory = new rdf_data_factory_1.DataFactory(),
|
|
79
|
+
constructor(dataFactory = new rdf_data_factory_1.DataFactory(), termFactory = new TermFactory()) {
|
|
81
80
|
Object.defineProperty(this, "dataFactory", {
|
|
82
81
|
enumerable: true,
|
|
83
82
|
configurable: true,
|
|
84
83
|
writable: true,
|
|
85
84
|
value: void 0
|
|
86
85
|
});
|
|
87
|
-
Object.defineProperty(this, "
|
|
86
|
+
Object.defineProperty(this, "termFactory", {
|
|
88
87
|
enumerable: true,
|
|
89
88
|
configurable: true,
|
|
90
89
|
writable: true,
|
|
91
90
|
value: void 0
|
|
92
91
|
});
|
|
93
92
|
this.dataFactory = dataFactory;
|
|
94
|
-
this.
|
|
93
|
+
this.termFactory = termFactory;
|
|
95
94
|
}
|
|
96
|
-
fromJson(
|
|
97
|
-
const
|
|
98
|
-
return this.dataFactory.quad(
|
|
95
|
+
fromJson(jsonRdf) {
|
|
96
|
+
const [s, p, o] = jsonRdf;
|
|
97
|
+
return this.dataFactory.quad(this.dataFactory.namedNode(s), this.dataFactory.namedNode(p), this.termFactory.fromJson(o));
|
|
99
98
|
}
|
|
100
99
|
}
|
|
101
100
|
exports.QuadFactory = QuadFactory;
|
|
@@ -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,29 @@
|
|
|
1
|
+
import { AsyncIterator } from "asynciterator";
|
|
2
|
+
export { ArrayIterator, type AsyncIterator, MappingIterator, } from "asynciterator";
|
|
3
|
+
declare type TreeNode<T> = {
|
|
4
|
+
[property: string]: T[] | TreeNode<T>;
|
|
5
|
+
};
|
|
6
|
+
export declare type Tree<T> = T[] | TreeNode<T>;
|
|
7
|
+
declare type Subtree<T> = {
|
|
8
|
+
type: "node";
|
|
9
|
+
tree: TreeNode<T>;
|
|
10
|
+
parent?: Subtree<T>;
|
|
11
|
+
items: string[];
|
|
12
|
+
path: string[];
|
|
13
|
+
index: number;
|
|
14
|
+
} | {
|
|
15
|
+
type: "leaf";
|
|
16
|
+
parent?: Subtree<T>;
|
|
17
|
+
items: T[];
|
|
18
|
+
path: string[];
|
|
19
|
+
index: number;
|
|
20
|
+
};
|
|
21
|
+
export declare class TreeIterator<T> extends AsyncIterator<[...string[], T]> {
|
|
22
|
+
private _tree;
|
|
23
|
+
private _pointer;
|
|
24
|
+
constructor(tree: Tree<T>);
|
|
25
|
+
read(): [...string[], T] | null;
|
|
26
|
+
protected _buildPointerFromSource(tree: Tree<T>, path?: string[]): Subtree<T>;
|
|
27
|
+
protected _findNextCommonSegment(): void;
|
|
28
|
+
protected _findNextLeaf(): void;
|
|
29
|
+
}
|
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { type Context, type IQueryEngine, type RDF } from "../rdf.js";
|
|
1
|
+
import { type Context, type IQueryEngine, type RDF, RDFJSON } from "../rdf.js";
|
|
2
|
+
declare type QueryResponseFormat = {
|
|
3
|
+
"application/sparql-results+json": RDFJSON.SparqlResultsJsonFormat;
|
|
4
|
+
"application/rdf+json": RDFJSON.RdfJsonFormat;
|
|
5
|
+
};
|
|
2
6
|
export declare class QueryEngine implements IQueryEngine {
|
|
3
7
|
protected getSparqlEndpoint(context?: Context): string;
|
|
4
8
|
protected getFetch(context?: Context): typeof fetch;
|
|
5
|
-
query(query: string, context?: Context): Promise<
|
|
9
|
+
query<ResponseType extends keyof QueryResponseFormat, ResponseFormat = QueryResponseFormat[ResponseType]>(query: string, responseType: ResponseType, context?: Context): Promise<ResponseFormat>;
|
|
6
10
|
queryBindings(query: string, context?: Context): Promise<RDF.ResultStream<RDF.Bindings>>;
|
|
7
11
|
queryBoolean(query: string, context?: Context): Promise<boolean>;
|
|
8
12
|
queryQuads(query: string, context?: Context): Promise<RDF.ResultStream<RDF.Quad>>;
|
|
9
13
|
queryVoid(query: string, context?: Context): Promise<void>;
|
|
10
14
|
}
|
|
15
|
+
export {};
|
|
@@ -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";
|
|
@@ -2,7 +2,6 @@ declare const _default: {
|
|
|
2
2
|
object: "schema:object";
|
|
3
3
|
value: "schema:value";
|
|
4
4
|
query: "schema:query";
|
|
5
|
-
error: "schema:error";
|
|
6
5
|
map: "schema:map";
|
|
7
6
|
Property: "schema:Property";
|
|
8
7
|
language: "schema:language";
|
|
@@ -1769,6 +1768,7 @@ declare const _default: {
|
|
|
1769
1768
|
episodeNumber: "schema:episodeNumber";
|
|
1770
1769
|
episodes: "schema:episodes";
|
|
1771
1770
|
equal: "schema:equal";
|
|
1771
|
+
error: "schema:error";
|
|
1772
1772
|
estimatedCost: "schema:estimatedCost";
|
|
1773
1773
|
estimatedFlightDuration: "schema:estimatedFlightDuration";
|
|
1774
1774
|
estimatedSalary: "schema:estimatedSalary";
|
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 = {
|
|
@@ -24,6 +25,16 @@ export declare namespace RDFJSON {
|
|
|
24
25
|
datatype?: string;
|
|
25
26
|
};
|
|
26
27
|
type Bindings = Record<string, Term>;
|
|
28
|
+
type SparqlResultsJsonFormat = {
|
|
29
|
+
head: {
|
|
30
|
+
vars?: string[];
|
|
31
|
+
};
|
|
32
|
+
results?: {
|
|
33
|
+
bindings: Bindings[];
|
|
34
|
+
};
|
|
35
|
+
boolean?: boolean;
|
|
36
|
+
};
|
|
37
|
+
type RdfJsonFormat = Record<Iri, Record<Iri, Term[]>>;
|
|
27
38
|
interface TermFactory {
|
|
28
39
|
fromJson(jsonTerm: Term): RDF.Term;
|
|
29
40
|
}
|
|
@@ -31,7 +42,7 @@ export declare namespace RDFJSON {
|
|
|
31
42
|
fromJson(jsonBindings: Bindings): RDF.Bindings;
|
|
32
43
|
}
|
|
33
44
|
interface QuadFactory {
|
|
34
|
-
fromJson(
|
|
45
|
+
fromJson(jsonRdf: [Iri, Iri, Term]): RDF.Quad;
|
|
35
46
|
}
|
|
36
47
|
}
|
|
37
48
|
export declare class TermFactory implements RDFJSON.TermFactory {
|
|
@@ -47,7 +58,7 @@ export declare class BindingsFactory extends ComunicaBindingsFactory implements
|
|
|
47
58
|
}
|
|
48
59
|
export declare class QuadFactory implements RDFJSON.QuadFactory {
|
|
49
60
|
protected readonly dataFactory: RDF.DataFactory;
|
|
50
|
-
protected readonly
|
|
51
|
-
constructor(dataFactory?: RDF.DataFactory,
|
|
52
|
-
fromJson(
|
|
61
|
+
protected readonly termFactory: RDFJSON.TermFactory;
|
|
62
|
+
constructor(dataFactory?: RDF.DataFactory, termFactory?: RDFJSON.TermFactory);
|
|
63
|
+
fromJson(jsonRdf: [Iri, Iri, RDFJSON.Term]): Quad;
|
|
53
64
|
}
|
|
@@ -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