@thi.ng/rstream-query 2.1.125 → 2.1.126
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/CHANGELOG.md +1 -1
- package/package.json +16 -16
- package/pattern.js +3 -6
- package/store.js +2 -4
- package/xforms.js +2 -4
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/rstream-query",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.126",
|
|
4
4
|
"description": "@thi.ng/rstream based triple store & reactive query engine",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -36,22 +36,22 @@
|
|
|
36
36
|
"tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@thi.ng/api": "^8.11.
|
|
40
|
-
"@thi.ng/associative": "^6.3.
|
|
41
|
-
"@thi.ng/checks": "^3.6.
|
|
42
|
-
"@thi.ng/equiv": "^2.1.
|
|
43
|
-
"@thi.ng/errors": "^2.5.
|
|
44
|
-
"@thi.ng/logger": "^3.0.
|
|
45
|
-
"@thi.ng/math": "^5.10.
|
|
46
|
-
"@thi.ng/rstream": "^8.
|
|
47
|
-
"@thi.ng/rstream-dot": "^3.0.
|
|
48
|
-
"@thi.ng/transducers": "^9.0.
|
|
39
|
+
"@thi.ng/api": "^8.11.2",
|
|
40
|
+
"@thi.ng/associative": "^6.3.60",
|
|
41
|
+
"@thi.ng/checks": "^3.6.4",
|
|
42
|
+
"@thi.ng/equiv": "^2.1.58",
|
|
43
|
+
"@thi.ng/errors": "^2.5.7",
|
|
44
|
+
"@thi.ng/logger": "^3.0.12",
|
|
45
|
+
"@thi.ng/math": "^5.10.13",
|
|
46
|
+
"@thi.ng/rstream": "^8.5.0",
|
|
47
|
+
"@thi.ng/rstream-dot": "^3.0.76",
|
|
48
|
+
"@thi.ng/transducers": "^9.0.5"
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@microsoft/api-extractor": "^7.43.
|
|
52
|
-
"esbuild": "^0.
|
|
53
|
-
"typedoc": "^0.25.
|
|
54
|
-
"typescript": "^5.4.
|
|
51
|
+
"@microsoft/api-extractor": "^7.43.2",
|
|
52
|
+
"esbuild": "^0.21.1",
|
|
53
|
+
"typedoc": "^0.25.13",
|
|
54
|
+
"typescript": "^5.4.5"
|
|
55
55
|
},
|
|
56
56
|
"keywords": [
|
|
57
57
|
"database",
|
|
@@ -109,5 +109,5 @@
|
|
|
109
109
|
"parent": "@thi.ng/rstream",
|
|
110
110
|
"year": 2018
|
|
111
111
|
},
|
|
112
|
-
"gitHead": "
|
|
112
|
+
"gitHead": "df34b4a9e650cc7323575356de207d78933bdcf3\n"
|
|
113
113
|
}
|
package/pattern.js
CHANGED
|
@@ -2,12 +2,9 @@ import { repeatedly } from "@thi.ng/transducers/repeatedly";
|
|
|
2
2
|
import { autoQVar, isQVar, qvarName } from "./qvar.js";
|
|
3
3
|
const patternVarCount = (p) => {
|
|
4
4
|
let n = 0;
|
|
5
|
-
if (isQVar(p[0]))
|
|
6
|
-
|
|
7
|
-
if (isQVar(p[
|
|
8
|
-
n++;
|
|
9
|
-
if (isQVar(p[2]))
|
|
10
|
-
n++;
|
|
5
|
+
if (isQVar(p[0])) n++;
|
|
6
|
+
if (isQVar(p[1])) n++;
|
|
7
|
+
if (isQVar(p[2])) n++;
|
|
11
8
|
return n;
|
|
12
9
|
};
|
|
13
10
|
const patternVars = ([s, p, o]) => {
|
package/store.js
CHANGED
|
@@ -85,8 +85,7 @@ class TripleStore {
|
|
|
85
85
|
let s = this.indexS.get(t[0]);
|
|
86
86
|
let p = this.indexP.get(t[1]);
|
|
87
87
|
let o = this.indexO.get(t[2]);
|
|
88
|
-
if (this.findTriple(s, p, o, t) !== -1)
|
|
89
|
-
return false;
|
|
88
|
+
if (this.findTriple(s, p, o, t) !== -1) return false;
|
|
90
89
|
const id = this.nextID();
|
|
91
90
|
const is = s || /* @__PURE__ */ new Set();
|
|
92
91
|
const ip = p || /* @__PURE__ */ new Set();
|
|
@@ -114,8 +113,7 @@ class TripleStore {
|
|
|
114
113
|
let p = this.indexP.get(t[1]);
|
|
115
114
|
let o = this.indexO.get(t[2]);
|
|
116
115
|
const id = this.findTriple(s, p, o, t);
|
|
117
|
-
if (id === -1)
|
|
118
|
-
return false;
|
|
116
|
+
if (id === -1) return false;
|
|
119
117
|
s.delete(id);
|
|
120
118
|
!s.size && this.indexS.delete(t[0]);
|
|
121
119
|
p.delete(id);
|
package/xforms.js
CHANGED
|
@@ -24,8 +24,7 @@ const indexSel = (key) => (rfn) => {
|
|
|
24
24
|
};
|
|
25
25
|
const resultTriples = (graph) => map((ids) => {
|
|
26
26
|
const res = /* @__PURE__ */ new Set();
|
|
27
|
-
for (let id of ids)
|
|
28
|
-
res.add(graph.triples[id]);
|
|
27
|
+
for (let id of ids) res.add(graph.triples[id]);
|
|
29
28
|
return res;
|
|
30
29
|
});
|
|
31
30
|
const joinSolutions = (n) => map((src) => {
|
|
@@ -53,8 +52,7 @@ const limitSolutions = (n) => map((sol) => {
|
|
|
53
52
|
let m = n;
|
|
54
53
|
for (let s of sol) {
|
|
55
54
|
res.add(s);
|
|
56
|
-
if (--m <= 0)
|
|
57
|
-
break;
|
|
55
|
+
if (--m <= 0) break;
|
|
58
56
|
}
|
|
59
57
|
return res;
|
|
60
58
|
});
|