@pod-os/core 0.12.1-7d2693a.0 → 0.12.1-e864b4f.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/dist/{chunk-GBIS3SJI.js → chunk-7C7N3OSJ.js} +622 -361
- package/dist/{dist-TVYD2Q5S.js → dist-762OQHAF.js} +3 -93
- package/dist/index.js +2417 -1628
- package/dist/{jsonld-ECVURSS6.js → jsonld-REJIJLLT.js} +3 -2
- package/lib/index.js +3060 -2128
- package/package.json +8 -8
- /package/dist/{chunk-U67V476Y.js → chunk-5NEDDTD5.js} +0 -0
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
__commonJS,
|
|
3
3
|
__export,
|
|
4
4
|
__toESM
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-5NEDDTD5.js";
|
|
6
6
|
|
|
7
7
|
// ../node_modules/@babel/runtime/helpers/typeof.js
|
|
8
8
|
var require_typeof = __commonJS({
|
|
@@ -119,9 +119,11 @@ var require_regeneratorRuntime = __commonJS({
|
|
|
119
119
|
function makeInvokeMethod(e2, r2, n2) {
|
|
120
120
|
var o2 = h;
|
|
121
121
|
return function(i2, a2) {
|
|
122
|
-
if (o2 === f)
|
|
122
|
+
if (o2 === f)
|
|
123
|
+
throw Error("Generator is already running");
|
|
123
124
|
if (o2 === s) {
|
|
124
|
-
if ("throw" === i2)
|
|
125
|
+
if ("throw" === i2)
|
|
126
|
+
throw a2;
|
|
125
127
|
return {
|
|
126
128
|
value: t,
|
|
127
129
|
done: true
|
|
@@ -132,19 +134,24 @@ var require_regeneratorRuntime = __commonJS({
|
|
|
132
134
|
if (c2) {
|
|
133
135
|
var u2 = maybeInvokeDelegate(c2, n2);
|
|
134
136
|
if (u2) {
|
|
135
|
-
if (u2 === y)
|
|
137
|
+
if (u2 === y)
|
|
138
|
+
continue;
|
|
136
139
|
return u2;
|
|
137
140
|
}
|
|
138
141
|
}
|
|
139
|
-
if ("next" === n2.method)
|
|
142
|
+
if ("next" === n2.method)
|
|
143
|
+
n2.sent = n2._sent = n2.arg;
|
|
140
144
|
else if ("throw" === n2.method) {
|
|
141
|
-
if (o2 === h)
|
|
145
|
+
if (o2 === h)
|
|
146
|
+
throw o2 = s, n2.arg;
|
|
142
147
|
n2.dispatchException(n2.arg);
|
|
143
|
-
} else
|
|
148
|
+
} else
|
|
149
|
+
"return" === n2.method && n2.abrupt("return", n2.arg);
|
|
144
150
|
o2 = f;
|
|
145
151
|
var p2 = tryCatch(e2, r2, n2);
|
|
146
152
|
if ("normal" === p2.type) {
|
|
147
|
-
if (o2 = n2.done ? s : l, p2.arg === y)
|
|
153
|
+
if (o2 = n2.done ? s : l, p2.arg === y)
|
|
154
|
+
continue;
|
|
148
155
|
return {
|
|
149
156
|
value: p2.arg,
|
|
150
157
|
done: n2.done
|
|
@@ -156,9 +163,11 @@ var require_regeneratorRuntime = __commonJS({
|
|
|
156
163
|
}
|
|
157
164
|
function maybeInvokeDelegate(e2, r2) {
|
|
158
165
|
var n2 = r2.method, o2 = e2.iterator[n2];
|
|
159
|
-
if (o2 === t)
|
|
166
|
+
if (o2 === t)
|
|
167
|
+
return r2.delegate = null, "throw" === n2 && e2.iterator["return"] && (r2.method = "return", r2.arg = t, maybeInvokeDelegate(e2, r2), "throw" === r2.method) || "return" !== n2 && (r2.method = "throw", r2.arg = new TypeError("The iterator does not provide a '" + n2 + "' method")), y;
|
|
160
168
|
var i2 = tryCatch(o2, e2.iterator, r2.arg);
|
|
161
|
-
if ("throw" === i2.type)
|
|
169
|
+
if ("throw" === i2.type)
|
|
170
|
+
return r2.method = "throw", r2.arg = i2.arg, r2.delegate = null, y;
|
|
162
171
|
var a2 = i2.arg;
|
|
163
172
|
return a2 ? a2.done ? (r2[e2.resultName] = a2.value, r2.next = e2.nextLoc, "return" !== r2.method && (r2.method = "next", r2.arg = t), r2.delegate = null, y) : a2 : (r2.method = "throw", r2.arg = new TypeError("iterator result is not an object"), r2.delegate = null, y);
|
|
164
173
|
}
|
|
@@ -180,11 +189,15 @@ var require_regeneratorRuntime = __commonJS({
|
|
|
180
189
|
function values(e2) {
|
|
181
190
|
if (e2 || "" === e2) {
|
|
182
191
|
var r2 = e2[a];
|
|
183
|
-
if (r2)
|
|
184
|
-
|
|
192
|
+
if (r2)
|
|
193
|
+
return r2.call(e2);
|
|
194
|
+
if ("function" == typeof e2.next)
|
|
195
|
+
return e2;
|
|
185
196
|
if (!isNaN(e2.length)) {
|
|
186
197
|
var o2 = -1, i2 = function next() {
|
|
187
|
-
for (; ++o2 < e2.length; )
|
|
198
|
+
for (; ++o2 < e2.length; )
|
|
199
|
+
if (n.call(e2, o2))
|
|
200
|
+
return next.value = e2[o2], next.done = false, next;
|
|
188
201
|
return next.value = t, next.done = true, next;
|
|
189
202
|
};
|
|
190
203
|
return i2.next = i2;
|
|
@@ -221,44 +234,56 @@ var require_regeneratorRuntime = __commonJS({
|
|
|
221
234
|
return "[object Generator]";
|
|
222
235
|
}), e.keys = function(t2) {
|
|
223
236
|
var e2 = Object(t2), r2 = [];
|
|
224
|
-
for (var n2 in e2)
|
|
237
|
+
for (var n2 in e2)
|
|
238
|
+
r2.push(n2);
|
|
225
239
|
return r2.reverse(), function next() {
|
|
226
240
|
for (; r2.length; ) {
|
|
227
241
|
var t3 = r2.pop();
|
|
228
|
-
if (t3 in e2)
|
|
242
|
+
if (t3 in e2)
|
|
243
|
+
return next.value = t3, next.done = false, next;
|
|
229
244
|
}
|
|
230
245
|
return next.done = true, next;
|
|
231
246
|
};
|
|
232
247
|
}, e.values = values, Context.prototype = {
|
|
233
248
|
constructor: Context,
|
|
234
249
|
reset: function reset(e2) {
|
|
235
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e2)
|
|
250
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e2)
|
|
251
|
+
for (var r2 in this)
|
|
252
|
+
"t" === r2.charAt(0) && n.call(this, r2) && !isNaN(+r2.slice(1)) && (this[r2] = t);
|
|
236
253
|
},
|
|
237
254
|
stop: function stop() {
|
|
238
255
|
this.done = true;
|
|
239
256
|
var t2 = this.tryEntries[0].completion;
|
|
240
|
-
if ("throw" === t2.type)
|
|
257
|
+
if ("throw" === t2.type)
|
|
258
|
+
throw t2.arg;
|
|
241
259
|
return this.rval;
|
|
242
260
|
},
|
|
243
261
|
dispatchException: function dispatchException(e2) {
|
|
244
|
-
if (this.done)
|
|
262
|
+
if (this.done)
|
|
263
|
+
throw e2;
|
|
245
264
|
var r2 = this;
|
|
246
265
|
function handle(n2, o3) {
|
|
247
266
|
return a2.type = "throw", a2.arg = e2, r2.next = n2, o3 && (r2.method = "next", r2.arg = t), !!o3;
|
|
248
267
|
}
|
|
249
268
|
for (var o2 = this.tryEntries.length - 1; o2 >= 0; --o2) {
|
|
250
269
|
var i2 = this.tryEntries[o2], a2 = i2.completion;
|
|
251
|
-
if ("root" === i2.tryLoc)
|
|
270
|
+
if ("root" === i2.tryLoc)
|
|
271
|
+
return handle("end");
|
|
252
272
|
if (i2.tryLoc <= this.prev) {
|
|
253
273
|
var c2 = n.call(i2, "catchLoc"), u2 = n.call(i2, "finallyLoc");
|
|
254
274
|
if (c2 && u2) {
|
|
255
|
-
if (this.prev < i2.catchLoc)
|
|
256
|
-
|
|
275
|
+
if (this.prev < i2.catchLoc)
|
|
276
|
+
return handle(i2.catchLoc, true);
|
|
277
|
+
if (this.prev < i2.finallyLoc)
|
|
278
|
+
return handle(i2.finallyLoc);
|
|
257
279
|
} else if (c2) {
|
|
258
|
-
if (this.prev < i2.catchLoc)
|
|
280
|
+
if (this.prev < i2.catchLoc)
|
|
281
|
+
return handle(i2.catchLoc, true);
|
|
259
282
|
} else {
|
|
260
|
-
if (!u2)
|
|
261
|
-
|
|
283
|
+
if (!u2)
|
|
284
|
+
throw Error("try statement without catch or finally");
|
|
285
|
+
if (this.prev < i2.finallyLoc)
|
|
286
|
+
return handle(i2.finallyLoc);
|
|
262
287
|
}
|
|
263
288
|
}
|
|
264
289
|
}
|
|
@@ -276,13 +301,15 @@ var require_regeneratorRuntime = __commonJS({
|
|
|
276
301
|
return a2.type = t2, a2.arg = e2, i2 ? (this.method = "next", this.next = i2.finallyLoc, y) : this.complete(a2);
|
|
277
302
|
},
|
|
278
303
|
complete: function complete(t2, e2) {
|
|
279
|
-
if ("throw" === t2.type)
|
|
304
|
+
if ("throw" === t2.type)
|
|
305
|
+
throw t2.arg;
|
|
280
306
|
return "break" === t2.type || "continue" === t2.type ? this.next = t2.arg : "return" === t2.type ? (this.rval = this.arg = t2.arg, this.method = "return", this.next = "end") : "normal" === t2.type && e2 && (this.next = e2), y;
|
|
281
307
|
},
|
|
282
308
|
finish: function finish(t2) {
|
|
283
309
|
for (var e2 = this.tryEntries.length - 1; e2 >= 0; --e2) {
|
|
284
310
|
var r2 = this.tryEntries[e2];
|
|
285
|
-
if (r2.finallyLoc === t2)
|
|
311
|
+
if (r2.finallyLoc === t2)
|
|
312
|
+
return this.complete(r2.completion, r2.afterLoc), resetTryEntry(r2), y;
|
|
286
313
|
}
|
|
287
314
|
},
|
|
288
315
|
"catch": function _catch(t2) {
|
|
@@ -487,7 +514,8 @@ var require_dom = __commonJS({
|
|
|
487
514
|
return current;
|
|
488
515
|
}
|
|
489
516
|
function toOrderedSet(input) {
|
|
490
|
-
if (!input)
|
|
517
|
+
if (!input)
|
|
518
|
+
return [];
|
|
491
519
|
var list = splitOnASCIIWhitespace(input);
|
|
492
520
|
return Object.keys(list.reduce(orderedSetReducer, {}));
|
|
493
521
|
}
|
|
@@ -559,10 +587,12 @@ var require_dom = __commonJS({
|
|
|
559
587
|
error2 = this;
|
|
560
588
|
Error.call(this, ExceptionMessage[code]);
|
|
561
589
|
this.message = ExceptionMessage[code];
|
|
562
|
-
if (Error.captureStackTrace)
|
|
590
|
+
if (Error.captureStackTrace)
|
|
591
|
+
Error.captureStackTrace(this, DOMException);
|
|
563
592
|
}
|
|
564
593
|
error2.code = code;
|
|
565
|
-
if (message)
|
|
594
|
+
if (message)
|
|
595
|
+
this.message = this.message + ": " + message;
|
|
566
596
|
return error2;
|
|
567
597
|
}
|
|
568
598
|
DOMException.prototype = Error.prototype;
|
|
@@ -4034,7 +4064,8 @@ var require_sax = __commonJS({
|
|
|
4034
4064
|
function ParseError(message, locator) {
|
|
4035
4065
|
this.message = message;
|
|
4036
4066
|
this.locator = locator;
|
|
4037
|
-
if (Error.captureStackTrace)
|
|
4067
|
+
if (Error.captureStackTrace)
|
|
4068
|
+
Error.captureStackTrace(this, ParseError);
|
|
4038
4069
|
}
|
|
4039
4070
|
ParseError.prototype = new Error();
|
|
4040
4071
|
ParseError.prototype.name = ParseError.name;
|
|
@@ -4589,7 +4620,8 @@ var require_sax = __commonJS({
|
|
|
4589
4620
|
reg.exec(source);
|
|
4590
4621
|
while (match = reg.exec(source)) {
|
|
4591
4622
|
buf.push(match);
|
|
4592
|
-
if (match[1])
|
|
4623
|
+
if (match[1])
|
|
4624
|
+
return buf;
|
|
4593
4625
|
}
|
|
4594
4626
|
}
|
|
4595
4627
|
exports.XMLReader = XMLReader;
|
|
@@ -7964,14 +7996,19 @@ var require_ttl2jsonld = __commonJS({
|
|
|
7964
7996
|
return {};
|
|
7965
7997
|
}, peg$c17 = /^[Bb]/, peg$c18 = peg$classExpectation(["B", "b"], false, false), peg$c19 = /^[Aa]/, peg$c20 = peg$classExpectation(["A", "a"], false, false), peg$c21 = /^[Ss]/, peg$c22 = peg$classExpectation(["S", "s"], false, false), peg$c23 = /^[Ee]/, peg$c24 = peg$classExpectation(["E", "e"], false, false), peg$c25 = /^[Pp]/, peg$c26 = peg$classExpectation(["P", "p"], false, false), peg$c27 = /^[Rr]/, peg$c28 = peg$classExpectation(["R", "r"], false, false), peg$c29 = /^[Ff]/, peg$c30 = peg$classExpectation(["F", "f"], false, false), peg$c31 = /^[Ii]/, peg$c32 = peg$classExpectation(["I", "i"], false, false), peg$c33 = /^[Xx]/, peg$c34 = peg$classExpectation(["X", "x"], false, false), peg$c35 = function(s, p) {
|
|
7966
7998
|
var x = {};
|
|
7967
|
-
if (typeof s === "string" && s !== "[]")
|
|
7968
|
-
|
|
7969
|
-
if (
|
|
7999
|
+
if (typeof s === "string" && s !== "[]")
|
|
8000
|
+
x["@id"] = s;
|
|
8001
|
+
else if (typeof s === "object")
|
|
8002
|
+
Object.assign(x, s);
|
|
8003
|
+
if (p)
|
|
8004
|
+
Object.assign(x, p);
|
|
7970
8005
|
return [x];
|
|
7971
8006
|
}, peg$c36 = function(s, p) {
|
|
7972
8007
|
var x = {};
|
|
7973
|
-
if (s)
|
|
7974
|
-
|
|
8008
|
+
if (s)
|
|
8009
|
+
Object.assign(x, s);
|
|
8010
|
+
if (p)
|
|
8011
|
+
Object.assign(x, p);
|
|
7975
8012
|
return [x];
|
|
7976
8013
|
}, peg$c37 = ";", peg$c38 = peg$literalExpectation(";", false), peg$c39 = function(a, b, e, f) {
|
|
7977
8014
|
var x = {};
|
|
@@ -7983,13 +8020,18 @@ var require_ttl2jsonld = __commonJS({
|
|
|
7983
8020
|
var x = {};
|
|
7984
8021
|
c.unshift(createObject(a, b));
|
|
7985
8022
|
c.forEach((t) => {
|
|
7986
|
-
if (!t)
|
|
8023
|
+
if (!t)
|
|
8024
|
+
return;
|
|
7987
8025
|
Object.keys(t).forEach((key) => {
|
|
7988
8026
|
t[key].forEach((val) => {
|
|
7989
|
-
if (key === "@type" && val["@id"] !== void 0)
|
|
7990
|
-
|
|
7991
|
-
|
|
7992
|
-
|
|
8027
|
+
if (key === "@type" && val["@id"] !== void 0)
|
|
8028
|
+
val = val["@id"];
|
|
8029
|
+
if (x[key] === void 0)
|
|
8030
|
+
x[key] = val;
|
|
8031
|
+
else if (Array.isArray(x[key]))
|
|
8032
|
+
x[key].push(val);
|
|
8033
|
+
else
|
|
8034
|
+
x[key] = [x[key], val];
|
|
7993
8035
|
});
|
|
7994
8036
|
});
|
|
7995
8037
|
});
|
|
@@ -8014,10 +8056,14 @@ var require_ttl2jsonld = __commonJS({
|
|
|
8014
8056
|
}, peg$c62 = function(a, b) {
|
|
8015
8057
|
return { "@value": a, "@language": b };
|
|
8016
8058
|
}, peg$c63 = "^^", peg$c64 = peg$literalExpectation("^^", false), peg$c65 = function(a, b) {
|
|
8017
|
-
if (b === "http://www.w3.org/2001/XMLSchema#boolean" && a === "true")
|
|
8018
|
-
|
|
8019
|
-
if (b === "http://www.w3.org/2001/XMLSchema#
|
|
8020
|
-
|
|
8059
|
+
if (b === "http://www.w3.org/2001/XMLSchema#boolean" && a === "true")
|
|
8060
|
+
return true;
|
|
8061
|
+
if (b === "http://www.w3.org/2001/XMLSchema#boolean" && a === "false")
|
|
8062
|
+
return false;
|
|
8063
|
+
if (b === "http://www.w3.org/2001/XMLSchema#integer")
|
|
8064
|
+
return parseInt(a);
|
|
8065
|
+
if (b === "http://www.w3.org/2001/XMLSchema#double")
|
|
8066
|
+
return parseFloat(a);
|
|
8021
8067
|
const uri = context.resolve(b, true);
|
|
8022
8068
|
if (uri) {
|
|
8023
8069
|
const prefix = b.split(":")[0];
|
|
@@ -8047,10 +8093,14 @@ var require_ttl2jsonld = __commonJS({
|
|
|
8047
8093
|
return a + ":";
|
|
8048
8094
|
}, peg$c73 = "<", peg$c74 = peg$literalExpectation("<", false), peg$c75 = /^[^\0- <>"{}|\^`\\]/, peg$c76 = peg$classExpectation([["\0", " "], "<", ">", '"', "{", "}", "|", "^", "`", "\\"], true, false), peg$c77 = ">", peg$c78 = peg$literalExpectation(">", false), peg$c79 = function(a) {
|
|
8049
8095
|
const decoded = a.map((s) => {
|
|
8050
|
-
if (65536 <= s.codePointAt(0) && s.codePointAt(0) <= 983039)
|
|
8051
|
-
|
|
8052
|
-
if (s.length ===
|
|
8053
|
-
|
|
8096
|
+
if (65536 <= s.codePointAt(0) && s.codePointAt(0) <= 983039)
|
|
8097
|
+
return "a";
|
|
8098
|
+
if (s.length === 1)
|
|
8099
|
+
return s;
|
|
8100
|
+
if (s.length === 6)
|
|
8101
|
+
return String.fromCharCode("0x" + s.substring(2));
|
|
8102
|
+
if (s.length === 10)
|
|
8103
|
+
return String.fromCodePoint("0x" + s.substring(2));
|
|
8054
8104
|
return s;
|
|
8055
8105
|
}).join("");
|
|
8056
8106
|
if (decoded.match(/^[^\u0000-\u0020<>"{}|^`\\]*$/)) {
|
|
@@ -8060,7 +8110,8 @@ var require_ttl2jsonld = __commonJS({
|
|
|
8060
8110
|
} catch (e) {
|
|
8061
8111
|
error2("Invalid IRIREF " + join2);
|
|
8062
8112
|
}
|
|
8063
|
-
} else
|
|
8113
|
+
} else
|
|
8114
|
+
error2("Invalid IRIREF " + a.join("") + " / " + decoded);
|
|
8064
8115
|
}, peg$c80 = ":", peg$c81 = peg$literalExpectation(":", false), peg$c82 = function(a) {
|
|
8065
8116
|
a = a || "0";
|
|
8066
8117
|
if (context.hasPrefix(a) === false)
|
|
@@ -12396,7 +12447,8 @@ var require_ttl2jsonld = __commonJS({
|
|
|
12396
12447
|
return;
|
|
12397
12448
|
}
|
|
12398
12449
|
const last = context.base[context.base.length - 1];
|
|
12399
|
-
if (last !== uri)
|
|
12450
|
+
if (last !== uri)
|
|
12451
|
+
context.base.push(new URL(uri, last).toString());
|
|
12400
12452
|
},
|
|
12401
12453
|
addPrefix: function(prefix, uri) {
|
|
12402
12454
|
const list = context.data[prefix];
|
|
@@ -12413,49 +12465,61 @@ var require_ttl2jsonld = __commonJS({
|
|
|
12413
12465
|
const prefix = Object.keys(context.data).find((key) => pname.indexOf(key + ":") === 0);
|
|
12414
12466
|
if (prefix !== void 0) {
|
|
12415
12467
|
const list = context.data[prefix];
|
|
12416
|
-
if (list.length === 1 && force !== true && isIRI(list[0].uri))
|
|
12468
|
+
if (list.length === 1 && force !== true && isIRI(list[0].uri))
|
|
12469
|
+
return pname;
|
|
12417
12470
|
const uri = list[list.length - 1].uri;
|
|
12418
12471
|
return pname.replace(prefix + ":", uri);
|
|
12419
12472
|
} else {
|
|
12420
12473
|
var base = context.base.length === 0 ? options.baseIRI : context.base[context.base.length - 1];
|
|
12421
|
-
if (!base || pname.match(/^(http:|https:|urn:|file:)/))
|
|
12422
|
-
|
|
12474
|
+
if (!base || pname.match(/^(http:|https:|urn:|file:)/))
|
|
12475
|
+
return pname;
|
|
12476
|
+
if (pname.indexOf("//") === 0 && base)
|
|
12477
|
+
return base.split("//")[0] + pname;
|
|
12423
12478
|
return new URL(pname, base).toString();
|
|
12424
12479
|
}
|
|
12425
12480
|
},
|
|
12426
12481
|
increment: function(prefix) {
|
|
12427
12482
|
const list = context.data[prefix];
|
|
12428
|
-
if (list !== void 0)
|
|
12483
|
+
if (list !== void 0)
|
|
12484
|
+
list[list.length - 1].count++;
|
|
12429
12485
|
},
|
|
12430
12486
|
decrement: function(prefix) {
|
|
12431
12487
|
const list = context.data[prefix];
|
|
12432
|
-
if (list !== void 0)
|
|
12488
|
+
if (list !== void 0)
|
|
12489
|
+
list[list.length - 1].count--;
|
|
12433
12490
|
},
|
|
12434
12491
|
toJSON: function() {
|
|
12435
12492
|
const root = {};
|
|
12436
12493
|
if (context.base.length > 0) {
|
|
12437
|
-
if (root["@context"] === void 0)
|
|
12494
|
+
if (root["@context"] === void 0)
|
|
12495
|
+
root["@context"] = {};
|
|
12438
12496
|
root["@context"]["@base"] = context.base[0];
|
|
12439
12497
|
}
|
|
12440
12498
|
Object.keys(context.data).forEach((key) => {
|
|
12441
12499
|
const head = context.data[key][0];
|
|
12442
|
-
if (head.uri === "http://www.w3.org/2001/XMLSchema#" && head.count < 1)
|
|
12443
|
-
|
|
12444
|
-
if (
|
|
12500
|
+
if (head.uri === "http://www.w3.org/2001/XMLSchema#" && head.count < 1)
|
|
12501
|
+
return;
|
|
12502
|
+
if (!isIRI(head.uri))
|
|
12503
|
+
return;
|
|
12504
|
+
if (root["@context"] === void 0)
|
|
12505
|
+
root["@context"] = {};
|
|
12445
12506
|
root["@context"][key] = head.uri;
|
|
12446
12507
|
});
|
|
12447
12508
|
return root;
|
|
12448
12509
|
}
|
|
12449
12510
|
};
|
|
12450
12511
|
function expandList(container, force) {
|
|
12451
|
-
if (container["@list"] === void 0)
|
|
12452
|
-
|
|
12512
|
+
if (container["@list"] === void 0)
|
|
12513
|
+
return container;
|
|
12514
|
+
if (!force && !container["@list"].find((x) => x["@list"] !== void 0))
|
|
12515
|
+
return container;
|
|
12453
12516
|
if (container["@list"].length === 0)
|
|
12454
12517
|
return { "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" };
|
|
12455
12518
|
var root = {};
|
|
12456
12519
|
var focus = null;
|
|
12457
12520
|
container["@list"].forEach((b) => {
|
|
12458
|
-
if (focus === null)
|
|
12521
|
+
if (focus === null)
|
|
12522
|
+
focus = root;
|
|
12459
12523
|
else {
|
|
12460
12524
|
focus["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"] = {};
|
|
12461
12525
|
focus = focus["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"];
|
|
@@ -13076,11 +13140,13 @@ function _classCallCheck(instance, Constructor) {
|
|
|
13076
13140
|
|
|
13077
13141
|
// ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
13078
13142
|
function toPrimitive(t, r) {
|
|
13079
|
-
if ("object" != _typeof(t) || !t)
|
|
13143
|
+
if ("object" != _typeof(t) || !t)
|
|
13144
|
+
return t;
|
|
13080
13145
|
var e = t[Symbol.toPrimitive];
|
|
13081
13146
|
if (void 0 !== e) {
|
|
13082
13147
|
var i = e.call(t, r || "default");
|
|
13083
|
-
if ("object" != _typeof(i))
|
|
13148
|
+
if ("object" != _typeof(i))
|
|
13149
|
+
return i;
|
|
13084
13150
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
13085
13151
|
}
|
|
13086
13152
|
return ("string" === r ? String : Number)(t);
|
|
@@ -13098,13 +13164,16 @@ function _defineProperties(target, props) {
|
|
|
13098
13164
|
var descriptor = props[i];
|
|
13099
13165
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
13100
13166
|
descriptor.configurable = true;
|
|
13101
|
-
if ("value" in descriptor)
|
|
13167
|
+
if ("value" in descriptor)
|
|
13168
|
+
descriptor.writable = true;
|
|
13102
13169
|
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
|
13103
13170
|
}
|
|
13104
13171
|
}
|
|
13105
13172
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
13106
|
-
if (protoProps)
|
|
13107
|
-
|
|
13173
|
+
if (protoProps)
|
|
13174
|
+
_defineProperties(Constructor.prototype, protoProps);
|
|
13175
|
+
if (staticProps)
|
|
13176
|
+
_defineProperties(Constructor, staticProps);
|
|
13108
13177
|
Object.defineProperty(Constructor, "prototype", {
|
|
13109
13178
|
writable: false
|
|
13110
13179
|
});
|
|
@@ -13180,7 +13249,8 @@ function _inherits(subClass, superClass) {
|
|
|
13180
13249
|
Object.defineProperty(subClass, "prototype", {
|
|
13181
13250
|
writable: false
|
|
13182
13251
|
});
|
|
13183
|
-
if (superClass)
|
|
13252
|
+
if (superClass)
|
|
13253
|
+
_setPrototypeOf(subClass, superClass);
|
|
13184
13254
|
}
|
|
13185
13255
|
|
|
13186
13256
|
// ../node_modules/rdflib/esm/class-order.js
|
|
@@ -13437,7 +13507,8 @@ var NamedNode = /* @__PURE__ */ function(_Node) {
|
|
|
13437
13507
|
var str = this.value.split("#")[0];
|
|
13438
13508
|
var p = str.slice(0, -1).lastIndexOf("/");
|
|
13439
13509
|
var q = str.indexOf("//");
|
|
13440
|
-
if (q >= 0 && p < q + 2 || p < 0)
|
|
13510
|
+
if (q >= 0 && p < q + 2 || p < 0)
|
|
13511
|
+
return null;
|
|
13441
13512
|
return new NamedNode3(str.slice(0, p + 1));
|
|
13442
13513
|
}
|
|
13443
13514
|
/**
|
|
@@ -13449,7 +13520,8 @@ var NamedNode = /* @__PURE__ */ function(_Node) {
|
|
|
13449
13520
|
value: function site() {
|
|
13450
13521
|
var str = this.value.split("#")[0];
|
|
13451
13522
|
var p = str.indexOf("//");
|
|
13452
|
-
if (p < 0)
|
|
13523
|
+
if (p < 0)
|
|
13524
|
+
throw new Error("This URI does not have a web site part (origin)");
|
|
13453
13525
|
var q = str.indexOf("/", p + 2);
|
|
13454
13526
|
if (q < 0) {
|
|
13455
13527
|
return new NamedNode3(str.slice(0) + "/");
|
|
@@ -14432,7 +14504,8 @@ function dumpNode(node, options, selfClosing, skipAttributes) {
|
|
|
14432
14504
|
var i;
|
|
14433
14505
|
var out = "";
|
|
14434
14506
|
var noEsc = [false];
|
|
14435
|
-
if (typeof node.nodeType === "undefined")
|
|
14507
|
+
if (typeof node.nodeType === "undefined")
|
|
14508
|
+
return out;
|
|
14436
14509
|
if (node.nodeType === 1) {
|
|
14437
14510
|
if (node.hasAttribute("class") && options && options.classWithChildText && node.matches(options.classWithChildText.class)) {
|
|
14438
14511
|
out += node.querySelector(options.classWithChildText.element).textContent;
|
|
@@ -14442,8 +14515,10 @@ function dumpNode(node, options, selfClosing, skipAttributes) {
|
|
|
14442
14515
|
var attrList = [];
|
|
14443
14516
|
for (i = node.attributes.length - 1; i >= 0; i--) {
|
|
14444
14517
|
var atn = node.attributes[i];
|
|
14445
|
-
if (skipAttributes && skipAttributes.length > 0 && skipAttributes[atn.name])
|
|
14446
|
-
|
|
14518
|
+
if (skipAttributes && skipAttributes.length > 0 && skipAttributes[atn.name])
|
|
14519
|
+
continue;
|
|
14520
|
+
if (/^\d+$/.test(atn.name))
|
|
14521
|
+
continue;
|
|
14447
14522
|
if (atn.name === "class" && options && options.replaceClassItemWith && atn.value.split(" ").indexOf(options.replaceClassItemWith.source) > -1) {
|
|
14448
14523
|
var re = new RegExp(options.replaceClassItemWith.source, "g");
|
|
14449
14524
|
atn.value = atn.value.replace(re, options.replaceClassItemWith.target).trim();
|
|
@@ -14466,7 +14541,8 @@ function dumpNode(node, options, selfClosing, skipAttributes) {
|
|
|
14466
14541
|
out += ">";
|
|
14467
14542
|
out += ename === "html" ? "\n " : "";
|
|
14468
14543
|
noEsc.push(ename === "style" || ename === "script");
|
|
14469
|
-
for (i = 0; i < node.childNodes.length; i++)
|
|
14544
|
+
for (i = 0; i < node.childNodes.length; i++)
|
|
14545
|
+
out += dumpNode(node.childNodes[i]);
|
|
14470
14546
|
noEsc.pop();
|
|
14471
14547
|
out += ename === "body" ? "</" + ename + ">\n" : "</" + ename + ">";
|
|
14472
14548
|
}
|
|
@@ -14497,9 +14573,12 @@ function heavyCompare(x, y, g, uriMap) {
|
|
|
14497
14573
|
};
|
|
14498
14574
|
var comparison = Object.prototype.hasOwnProperty.call(g, "compareTerms") ? g.compareTerms(x, y) : x.compareTerm(y);
|
|
14499
14575
|
if (x.termType === "BlankNode" && y.termType === "BlankNode") {
|
|
14500
|
-
if (comparison === 0)
|
|
14501
|
-
|
|
14502
|
-
if (signature(x)
|
|
14576
|
+
if (comparison === 0)
|
|
14577
|
+
return 0;
|
|
14578
|
+
if (signature(x) > signature(y))
|
|
14579
|
+
return 1;
|
|
14580
|
+
if (signature(x) < signature(y))
|
|
14581
|
+
return -1;
|
|
14503
14582
|
return comparison;
|
|
14504
14583
|
} else {
|
|
14505
14584
|
if (uriMap && x.uri && y.uri) {
|
|
@@ -14636,7 +14715,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14636
14715
|
value: function fromStr(s) {
|
|
14637
14716
|
if (s[0] === "{") {
|
|
14638
14717
|
var x = this.formulas[s];
|
|
14639
|
-
if (!x)
|
|
14718
|
+
if (!x)
|
|
14719
|
+
console.log("No formula object for " + s);
|
|
14640
14720
|
return x;
|
|
14641
14721
|
}
|
|
14642
14722
|
return this.store.fromNT(s);
|
|
@@ -14663,11 +14743,15 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14663
14743
|
}, {
|
|
14664
14744
|
key: "setPrefix",
|
|
14665
14745
|
value: function setPrefix(prefix, uri) {
|
|
14666
|
-
if (prefix.slice(0, 7) === "default")
|
|
14667
|
-
|
|
14668
|
-
if (
|
|
14746
|
+
if (prefix.slice(0, 7) === "default")
|
|
14747
|
+
return;
|
|
14748
|
+
if (prefix.slice(0, 2) === "ns")
|
|
14749
|
+
return;
|
|
14750
|
+
if (!prefix || !uri)
|
|
14751
|
+
return;
|
|
14669
14752
|
for (var existingNs in this.prefixes) {
|
|
14670
|
-
if (this.prefixes[existingNs] == prefix)
|
|
14753
|
+
if (this.prefixes[existingNs] == prefix)
|
|
14754
|
+
delete this.prefixes[existingNs];
|
|
14671
14755
|
}
|
|
14672
14756
|
this.prefixes[uri] = prefix;
|
|
14673
14757
|
this.namespaces[prefix] = uri;
|
|
@@ -14680,10 +14764,14 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14680
14764
|
}, {
|
|
14681
14765
|
key: "suggestPrefix",
|
|
14682
14766
|
value: function suggestPrefix(prefix, uri) {
|
|
14683
|
-
if (prefix.slice(0, 7) === "default")
|
|
14684
|
-
|
|
14685
|
-
if (
|
|
14686
|
-
|
|
14767
|
+
if (prefix.slice(0, 7) === "default")
|
|
14768
|
+
return;
|
|
14769
|
+
if (prefix.slice(0, 2) === "ns")
|
|
14770
|
+
return;
|
|
14771
|
+
if (!prefix || !uri)
|
|
14772
|
+
return;
|
|
14773
|
+
if (prefix in this.namespaces || uri in this.prefixes)
|
|
14774
|
+
return;
|
|
14687
14775
|
this.prefixes[uri] = prefix;
|
|
14688
14776
|
this.namespaces[prefix] = uri;
|
|
14689
14777
|
}
|
|
@@ -14717,17 +14805,22 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14717
14805
|
value: function makeUpPrefix(uri) {
|
|
14718
14806
|
var p = uri;
|
|
14719
14807
|
function canUseMethod(pp) {
|
|
14720
|
-
if (!this.validPrefix.test(pp))
|
|
14721
|
-
|
|
14722
|
-
if (pp
|
|
14808
|
+
if (!this.validPrefix.test(pp))
|
|
14809
|
+
return false;
|
|
14810
|
+
if (pp === "ns")
|
|
14811
|
+
return false;
|
|
14812
|
+
if (pp in this.namespaces)
|
|
14813
|
+
return false;
|
|
14723
14814
|
this.prefixes[uri] = pp;
|
|
14724
14815
|
this.namespaces[pp] = uri;
|
|
14725
14816
|
return pp;
|
|
14726
14817
|
}
|
|
14727
14818
|
var canUse = canUseMethod.bind(this);
|
|
14728
|
-
if ("#/".indexOf(p[p.length - 1]) >= 0)
|
|
14819
|
+
if ("#/".indexOf(p[p.length - 1]) >= 0)
|
|
14820
|
+
p = p.slice(0, -1);
|
|
14729
14821
|
var slash = p.lastIndexOf("/");
|
|
14730
|
-
if (slash >= 0)
|
|
14822
|
+
if (slash >= 0)
|
|
14823
|
+
p = p.slice(slash + 1);
|
|
14731
14824
|
var i = 0;
|
|
14732
14825
|
while (i < p.length) {
|
|
14733
14826
|
if (this.prefixchars.indexOf(p[i])) {
|
|
@@ -14737,16 +14830,24 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14737
14830
|
}
|
|
14738
14831
|
}
|
|
14739
14832
|
p = p.slice(0, i);
|
|
14740
|
-
if (p.length < 6 && canUse(p))
|
|
14741
|
-
|
|
14742
|
-
if (canUse(p.slice(0,
|
|
14743
|
-
|
|
14744
|
-
if (canUse(p.slice(0,
|
|
14745
|
-
|
|
14833
|
+
if (p.length < 6 && canUse(p))
|
|
14834
|
+
return p;
|
|
14835
|
+
if (canUse(p.slice(0, 3)))
|
|
14836
|
+
return p.slice(0, 3);
|
|
14837
|
+
if (canUse(p.slice(0, 2)))
|
|
14838
|
+
return p.slice(0, 2);
|
|
14839
|
+
if (canUse(p.slice(0, 4)))
|
|
14840
|
+
return p.slice(0, 4);
|
|
14841
|
+
if (canUse(p.slice(0, 1)))
|
|
14842
|
+
return p.slice(0, 1);
|
|
14843
|
+
if (canUse(p.slice(0, 5)))
|
|
14844
|
+
return p.slice(0, 5);
|
|
14746
14845
|
if (!this.validPrefix.test(p)) {
|
|
14747
14846
|
p = "n";
|
|
14748
14847
|
}
|
|
14749
|
-
for (var j = 0; ; j++)
|
|
14848
|
+
for (var j = 0; ; j++)
|
|
14849
|
+
if (canUse(p.slice(0, 3) + j))
|
|
14850
|
+
return p.slice(0, 3) + j;
|
|
14750
14851
|
}
|
|
14751
14852
|
}, {
|
|
14752
14853
|
key: "rootSubjects",
|
|
@@ -14757,7 +14858,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14757
14858
|
for (var i = 0; i < sts.length; i++) {
|
|
14758
14859
|
var st3 = sts[i];
|
|
14759
14860
|
var checkMentions = function checkMentions2(x) {
|
|
14760
|
-
if (!incoming.hasOwnProperty(x))
|
|
14861
|
+
if (!incoming.hasOwnProperty(x))
|
|
14862
|
+
incoming[x] = [];
|
|
14761
14863
|
incoming[x].push(st3.subject);
|
|
14762
14864
|
};
|
|
14763
14865
|
var st22 = [st3.subject, st3.predicate, st3.object];
|
|
@@ -14772,13 +14874,15 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14772
14874
|
});
|
|
14773
14875
|
checkMentions(sts[i].object);
|
|
14774
14876
|
var ss = subjects[this.toStr(st3.subject)];
|
|
14775
|
-
if (!ss)
|
|
14877
|
+
if (!ss)
|
|
14878
|
+
ss = [];
|
|
14776
14879
|
ss.push(st3);
|
|
14777
14880
|
subjects[this.toStr(st3.subject)] = ss;
|
|
14778
14881
|
}
|
|
14779
14882
|
var roots = [];
|
|
14780
14883
|
for (var xNT in subjects) {
|
|
14781
|
-
if (!subjects.hasOwnProperty(xNT))
|
|
14884
|
+
if (!subjects.hasOwnProperty(xNT))
|
|
14885
|
+
continue;
|
|
14782
14886
|
var y = this.fromStr(xNT);
|
|
14783
14887
|
if (y.termType !== "BlankNode" || !incoming[y] || incoming[y].length !== 1) {
|
|
14784
14888
|
roots.push(y);
|
|
@@ -14881,7 +14985,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14881
14985
|
}
|
|
14882
14986
|
var spaces = function spaces2(n) {
|
|
14883
14987
|
var s = "";
|
|
14884
|
-
for (var i = 0; i < n; i++)
|
|
14988
|
+
for (var i = 0; i < n; i++)
|
|
14989
|
+
s += " ";
|
|
14885
14990
|
return s;
|
|
14886
14991
|
};
|
|
14887
14992
|
var treeToLine = function treeToLine2(tree2) {
|
|
@@ -14904,7 +15009,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14904
15009
|
var treeToString = function treeToString2(tree2, level) {
|
|
14905
15010
|
var str = "";
|
|
14906
15011
|
var lastLength = 1e5;
|
|
14907
|
-
if (level === void 0)
|
|
15012
|
+
if (level === void 0)
|
|
15013
|
+
level = -1;
|
|
14908
15014
|
for (var i = 0; i < tree2.length; i++) {
|
|
14909
15015
|
var branch = tree2[i];
|
|
14910
15016
|
if (typeof branch !== "string") {
|
|
@@ -14916,7 +15022,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14916
15022
|
substr = "";
|
|
14917
15023
|
}
|
|
14918
15024
|
}
|
|
14919
|
-
if (substr)
|
|
15025
|
+
if (substr)
|
|
15026
|
+
lastLength = 1e4;
|
|
14920
15027
|
str += substr;
|
|
14921
15028
|
}
|
|
14922
15029
|
if (typeof branch === "string") {
|
|
@@ -15029,8 +15136,10 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15029
15136
|
str += "@prefix : " + this.explicitURI(this.defaultNamespace) + ".\n";
|
|
15030
15137
|
}
|
|
15031
15138
|
for (var ns3 in this.prefixes) {
|
|
15032
|
-
if (!this.prefixes.hasOwnProperty(ns3))
|
|
15033
|
-
|
|
15139
|
+
if (!this.prefixes.hasOwnProperty(ns3))
|
|
15140
|
+
continue;
|
|
15141
|
+
if (!this.namespacesUsed[ns3])
|
|
15142
|
+
continue;
|
|
15034
15143
|
str += "@prefix " + this.prefixes[ns3] + ": " + this.explicitURI(ns3) + ".\n";
|
|
15035
15144
|
}
|
|
15036
15145
|
return str + "\n";
|
|
@@ -15058,12 +15167,15 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15058
15167
|
case "http://www.w3.org/2001/XMLSchema#integer":
|
|
15059
15168
|
return val;
|
|
15060
15169
|
case "http://www.w3.org/2001/XMLSchema#decimal":
|
|
15061
|
-
if (val.indexOf(".") < 0)
|
|
15170
|
+
if (val.indexOf(".") < 0)
|
|
15171
|
+
val += ".0";
|
|
15062
15172
|
return val;
|
|
15063
15173
|
case "http://www.w3.org/2001/XMLSchema#double": {
|
|
15064
15174
|
var eNotation = val.toLowerCase().indexOf("e") > 0;
|
|
15065
|
-
if (val.indexOf(".") < 0 && !eNotation)
|
|
15066
|
-
|
|
15175
|
+
if (val.indexOf(".") < 0 && !eNotation)
|
|
15176
|
+
val += ".0";
|
|
15177
|
+
if (!eNotation)
|
|
15178
|
+
val += "e0";
|
|
15067
15179
|
return val;
|
|
15068
15180
|
}
|
|
15069
15181
|
case "http://www.w3.org/2001/XMLSchema#boolean":
|
|
@@ -15088,7 +15200,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15088
15200
|
}, {
|
|
15089
15201
|
key: "stringToN3",
|
|
15090
15202
|
value: function stringToN3(str, flags) {
|
|
15091
|
-
if (!flags)
|
|
15203
|
+
if (!flags)
|
|
15204
|
+
flags = "e";
|
|
15092
15205
|
var res = "";
|
|
15093
15206
|
var i, j, k;
|
|
15094
15207
|
var delim;
|
|
@@ -15106,7 +15219,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15106
15219
|
for (i = 0; i < str.length; ) {
|
|
15107
15220
|
forbidden.lastIndex = 0;
|
|
15108
15221
|
var m = forbidden.exec(str.slice(i));
|
|
15109
|
-
if (m == null)
|
|
15222
|
+
if (m == null)
|
|
15223
|
+
break;
|
|
15110
15224
|
j = i + forbidden.lastIndex - 1;
|
|
15111
15225
|
res += str.slice(i, j);
|
|
15112
15226
|
var ch = str[j];
|
|
@@ -15156,7 +15270,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15156
15270
|
return ":" + localid;
|
|
15157
15271
|
}
|
|
15158
15272
|
var prefix = this.prefixes[namesp];
|
|
15159
|
-
if (!prefix)
|
|
15273
|
+
if (!prefix)
|
|
15274
|
+
prefix = this.makeUpPrefix(namesp);
|
|
15160
15275
|
if (prefix) {
|
|
15161
15276
|
this.namespacesUsed[namesp] = true;
|
|
15162
15277
|
return prefix + ":" + localid;
|
|
@@ -15177,7 +15292,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15177
15292
|
var sources = this.store.index[3];
|
|
15178
15293
|
for (var s in sources) {
|
|
15179
15294
|
var source = kb.fromNT(s);
|
|
15180
|
-
if (session && source.equals(session))
|
|
15295
|
+
if (session && source.equals(session))
|
|
15296
|
+
continue;
|
|
15181
15297
|
write("\n" + this.atomicTermToN3(source) + " " + this.atomicTermToN3(kb.sym("http://www.w3.org/2000/10/swap/log#semantics")) + " { " + this.statementsToN3(kb.statementsMatching(void 0, void 0, void 0, source)) + " }.\n");
|
|
15182
15298
|
}
|
|
15183
15299
|
kb.statementsMatching(void 0, kb.sym("http://www.w3.org/2007/ont/link#requestedURI")).map(function(st3) {
|
|
@@ -15187,7 +15303,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15187
15303
|
write("}.\n");
|
|
15188
15304
|
});
|
|
15189
15305
|
var metaSources = [];
|
|
15190
|
-
if (session)
|
|
15306
|
+
if (session)
|
|
15307
|
+
metaSources.push(session);
|
|
15191
15308
|
var metadata = [];
|
|
15192
15309
|
metaSources.map(function(source2) {
|
|
15193
15310
|
metadata = metadata.concat(kb.statementsMatching(void 0, void 0, void 0, source2));
|
|
@@ -15205,7 +15322,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15205
15322
|
var liPrefix = "http://www.w3.org/1999/02/22-rdf-syntax-ns#_";
|
|
15206
15323
|
var spaces = function spaces2(n) {
|
|
15207
15324
|
var s = "";
|
|
15208
|
-
for (var i = 0; i < n; i++)
|
|
15325
|
+
for (var i = 0; i < n; i++)
|
|
15326
|
+
s += " ";
|
|
15209
15327
|
return s;
|
|
15210
15328
|
};
|
|
15211
15329
|
var XMLtreeToLine = function XMLtreeToLine2(tree3) {
|
|
@@ -15221,7 +15339,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15221
15339
|
var str2 = "";
|
|
15222
15340
|
var line;
|
|
15223
15341
|
var lastLength = 1e5;
|
|
15224
|
-
if (!level)
|
|
15342
|
+
if (!level)
|
|
15343
|
+
level = 0;
|
|
15225
15344
|
for (var i = 0; i < tree3.length; i++) {
|
|
15226
15345
|
var branch = tree3[i];
|
|
15227
15346
|
if (typeof branch !== "string") {
|
|
@@ -15233,7 +15352,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15233
15352
|
substr = "";
|
|
15234
15353
|
}
|
|
15235
15354
|
}
|
|
15236
|
-
if (substr)
|
|
15355
|
+
if (substr)
|
|
15356
|
+
lastLength = 1e4;
|
|
15237
15357
|
str2 += substr;
|
|
15238
15358
|
}
|
|
15239
15359
|
if (typeof branch === "string") {
|
|
@@ -15263,7 +15383,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15263
15383
|
}
|
|
15264
15384
|
var statementListToXMLTree = statementListToXMLTreeMethod.bind(this);
|
|
15265
15385
|
function escapeForXML(str2) {
|
|
15266
|
-
if (typeof str2 === "undefined")
|
|
15386
|
+
if (typeof str2 === "undefined")
|
|
15387
|
+
return "@@@undefined@@@@";
|
|
15267
15388
|
return str2.replace(/[&<"]/g, function(m) {
|
|
15268
15389
|
switch (m[0]) {
|
|
15269
15390
|
case "&":
|
|
@@ -15359,7 +15480,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15359
15480
|
function propertyXMLTreeMethod(subject, stats) {
|
|
15360
15481
|
var results = [];
|
|
15361
15482
|
var sts2 = stats.subjects[this.toStr(subject)];
|
|
15362
|
-
if (!sts2)
|
|
15483
|
+
if (!sts2)
|
|
15484
|
+
return results;
|
|
15363
15485
|
sts2.sort();
|
|
15364
15486
|
for (var i = 0; i < sts2.length; i++) {
|
|
15365
15487
|
var st3 = sts2[i];
|
|
@@ -15393,7 +15515,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15393
15515
|
if (j < 0 && this.flags.indexOf("/") < 0) {
|
|
15394
15516
|
j = uri.lastIndexOf("/");
|
|
15395
15517
|
}
|
|
15396
|
-
if (j < 0)
|
|
15518
|
+
if (j < 0)
|
|
15519
|
+
throw new Error("Cannot make qname out of <" + uri + ">");
|
|
15397
15520
|
for (var k = j + 1; k < uri.length; k++) {
|
|
15398
15521
|
if (this._notNameChars.indexOf(uri[k]) >= 0) {
|
|
15399
15522
|
throw new Error('Invalid character "' + uri[k] + '" cannot be in XML qname for URI: ' + uri);
|
|
@@ -15405,7 +15528,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15405
15528
|
return localid;
|
|
15406
15529
|
}
|
|
15407
15530
|
var prefix = this.prefixes[namesp];
|
|
15408
|
-
if (!prefix)
|
|
15531
|
+
if (!prefix)
|
|
15532
|
+
prefix = this.makeUpPrefix(namesp);
|
|
15409
15533
|
namespaceCounts[namesp] = true;
|
|
15410
15534
|
return prefix + ":" + localid;
|
|
15411
15535
|
}
|
|
@@ -15416,7 +15540,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15416
15540
|
str += ' xmlns="' + escapeForXML(this.defaultNamespace) + '"';
|
|
15417
15541
|
}
|
|
15418
15542
|
for (var ns3 in namespaceCounts) {
|
|
15419
|
-
if (!namespaceCounts.hasOwnProperty(ns3))
|
|
15543
|
+
if (!namespaceCounts.hasOwnProperty(ns3))
|
|
15544
|
+
continue;
|
|
15420
15545
|
var ns22 = this.base && this.flags.includes("z") ? uri_exports.refTo(this.base, ns3) : ns3;
|
|
15421
15546
|
str += "\n xmlns:" + this.prefixes[ns3] + '="' + escapeForXML(ns22) + '"';
|
|
15422
15547
|
}
|
|
@@ -15461,7 +15586,8 @@ function serialize(target, kb, base, contentType, callback, options) {
|
|
|
15461
15586
|
var documentString = void 0;
|
|
15462
15587
|
try {
|
|
15463
15588
|
var sz = createSerializer(kb);
|
|
15464
|
-
if (opts.flags)
|
|
15589
|
+
if (opts.flags)
|
|
15590
|
+
sz.setFlags(opts.flags);
|
|
15465
15591
|
var newSts = kb.statementsMatching(void 0, void 0, void 0, target);
|
|
15466
15592
|
if ("namespaces" in kb) {
|
|
15467
15593
|
sz.suggestNamespaces(kb.namespaces);
|
|
@@ -15540,7 +15666,8 @@ function arrayToStatements(rdfFactory, subject, data) {
|
|
|
15540
15666
|
function ArrayIndexOf(arr, item) {
|
|
15541
15667
|
var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
|
|
15542
15668
|
var length = arr.length;
|
|
15543
|
-
if (i < 0)
|
|
15669
|
+
if (i < 0)
|
|
15670
|
+
i = length + i;
|
|
15544
15671
|
for (; i < length; i++) {
|
|
15545
15672
|
if (arr[i] === item) {
|
|
15546
15673
|
return i;
|
|
@@ -15554,12 +15681,14 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
15554
15681
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
15555
15682
|
if (!it) {
|
|
15556
15683
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
15557
|
-
if (it)
|
|
15684
|
+
if (it)
|
|
15685
|
+
o = it;
|
|
15558
15686
|
var i = 0;
|
|
15559
15687
|
var F = function F2() {
|
|
15560
15688
|
};
|
|
15561
15689
|
return { s: F, n: function n() {
|
|
15562
|
-
if (i >= o.length)
|
|
15690
|
+
if (i >= o.length)
|
|
15691
|
+
return { done: true };
|
|
15563
15692
|
return { done: false, value: o[i++] };
|
|
15564
15693
|
}, e: function e(_e) {
|
|
15565
15694
|
throw _e;
|
|
@@ -15579,23 +15708,32 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
15579
15708
|
err = _e2;
|
|
15580
15709
|
}, f: function f() {
|
|
15581
15710
|
try {
|
|
15582
|
-
if (!normalCompletion && it.return != null)
|
|
15711
|
+
if (!normalCompletion && it.return != null)
|
|
15712
|
+
it.return();
|
|
15583
15713
|
} finally {
|
|
15584
|
-
if (didErr)
|
|
15714
|
+
if (didErr)
|
|
15715
|
+
throw err;
|
|
15585
15716
|
}
|
|
15586
15717
|
} };
|
|
15587
15718
|
}
|
|
15588
15719
|
function _unsupportedIterableToArray(o, minLen) {
|
|
15589
|
-
if (!o)
|
|
15590
|
-
|
|
15720
|
+
if (!o)
|
|
15721
|
+
return;
|
|
15722
|
+
if (typeof o === "string")
|
|
15723
|
+
return _arrayLikeToArray(o, minLen);
|
|
15591
15724
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
15592
|
-
if (n === "Object" && o.constructor)
|
|
15593
|
-
|
|
15594
|
-
if (n === "
|
|
15725
|
+
if (n === "Object" && o.constructor)
|
|
15726
|
+
n = o.constructor.name;
|
|
15727
|
+
if (n === "Map" || n === "Set")
|
|
15728
|
+
return Array.from(o);
|
|
15729
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
15730
|
+
return _arrayLikeToArray(o, minLen);
|
|
15595
15731
|
}
|
|
15596
15732
|
function _arrayLikeToArray(arr, len) {
|
|
15597
|
-
if (len == null || len > arr.length)
|
|
15598
|
-
|
|
15733
|
+
if (len == null || len > arr.length)
|
|
15734
|
+
len = arr.length;
|
|
15735
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
15736
|
+
arr2[i] = arr[i];
|
|
15599
15737
|
return arr2;
|
|
15600
15738
|
}
|
|
15601
15739
|
function _callSuper7(t, o, e) {
|
|
@@ -15809,7 +15947,8 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
15809
15947
|
var v;
|
|
15810
15948
|
bots = [];
|
|
15811
15949
|
for (var _k in types) {
|
|
15812
|
-
if (!types.hasOwnProperty(_k))
|
|
15950
|
+
if (!types.hasOwnProperty(_k))
|
|
15951
|
+
continue;
|
|
15813
15952
|
v = types[_k];
|
|
15814
15953
|
subs = this.each(void 0, this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"), this.rdfFactory.namedNode(_k));
|
|
15815
15954
|
bottom = true;
|
|
@@ -15913,7 +16052,8 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
15913
16052
|
members = {};
|
|
15914
16053
|
ref = this.transitiveClosure(seeds, this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"), true);
|
|
15915
16054
|
for (var t in ref) {
|
|
15916
|
-
if (!ref.hasOwnProperty(t))
|
|
16055
|
+
if (!ref.hasOwnProperty(t))
|
|
16056
|
+
continue;
|
|
15917
16057
|
ref1 = this.statementsMatching(void 0, this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), this.fromNT(t));
|
|
15918
16058
|
for (var i = 0, len = ref1.length; i < len; i++) {
|
|
15919
16059
|
st3 = ref1[i];
|
|
@@ -16069,9 +16209,11 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
16069
16209
|
};
|
|
16070
16210
|
var sts = self2.statementsMatching(null, null, x, doc).concat(self2.statementsMatching(x, null, null, doc));
|
|
16071
16211
|
sts = sts.filter(function(st3) {
|
|
16072
|
-
if (excludePredicateURIs[st3.predicate.value])
|
|
16212
|
+
if (excludePredicateURIs[st3.predicate.value])
|
|
16213
|
+
return false;
|
|
16073
16214
|
var hash = st3.toNT();
|
|
16074
|
-
if (doneArcs[hash])
|
|
16215
|
+
if (doneArcs[hash])
|
|
16216
|
+
return false;
|
|
16075
16217
|
doneArcs[hash] = true;
|
|
16076
16218
|
return true;
|
|
16077
16219
|
});
|
|
@@ -16201,7 +16343,8 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
16201
16343
|
var k, v;
|
|
16202
16344
|
var uris = {};
|
|
16203
16345
|
for (k in t) {
|
|
16204
|
-
if (!t.hasOwnProperty(k))
|
|
16346
|
+
if (!t.hasOwnProperty(k))
|
|
16347
|
+
continue;
|
|
16205
16348
|
v = t[k];
|
|
16206
16349
|
if (k[0] === "<") {
|
|
16207
16350
|
uris[k.slice(1, -1)] = v;
|
|
@@ -16277,7 +16420,8 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
16277
16420
|
while (true) {
|
|
16278
16421
|
t = function() {
|
|
16279
16422
|
for (var p in agenda) {
|
|
16280
|
-
if (!agenda.hasOwnProperty(p))
|
|
16423
|
+
if (!agenda.hasOwnProperty(p))
|
|
16424
|
+
continue;
|
|
16281
16425
|
return p;
|
|
16282
16426
|
}
|
|
16283
16427
|
}();
|
|
@@ -16319,7 +16463,8 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
16319
16463
|
var v;
|
|
16320
16464
|
tops = [];
|
|
16321
16465
|
for (k in types) {
|
|
16322
|
-
if (!types.hasOwnProperty(k))
|
|
16466
|
+
if (!types.hasOwnProperty(k))
|
|
16467
|
+
continue;
|
|
16323
16468
|
v = types[k];
|
|
16324
16469
|
n = 0;
|
|
16325
16470
|
ref = this.each(this.rdfFactory.namedNode(k), this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"));
|
|
@@ -16384,7 +16529,8 @@ Node2.toJS = function(term2) {
|
|
|
16384
16529
|
if (isCollection(term2)) {
|
|
16385
16530
|
return term2.elements.map(Node2.toJS);
|
|
16386
16531
|
}
|
|
16387
|
-
if (!isLiteral(term2))
|
|
16532
|
+
if (!isLiteral(term2))
|
|
16533
|
+
return term2;
|
|
16388
16534
|
if (term2.datatype.equals(ns.xsd("boolean"))) {
|
|
16389
16535
|
return term2.value === "1" || term2.value === "true";
|
|
16390
16536
|
}
|
|
@@ -16789,12 +16935,14 @@ function _createForOfIteratorHelper2(o, allowArrayLike) {
|
|
|
16789
16935
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
16790
16936
|
if (!it) {
|
|
16791
16937
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray2(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
16792
|
-
if (it)
|
|
16938
|
+
if (it)
|
|
16939
|
+
o = it;
|
|
16793
16940
|
var i = 0;
|
|
16794
16941
|
var F = function F2() {
|
|
16795
16942
|
};
|
|
16796
16943
|
return { s: F, n: function n() {
|
|
16797
|
-
if (i >= o.length)
|
|
16944
|
+
if (i >= o.length)
|
|
16945
|
+
return { done: true };
|
|
16798
16946
|
return { done: false, value: o[i++] };
|
|
16799
16947
|
}, e: function e(_e) {
|
|
16800
16948
|
throw _e;
|
|
@@ -16814,23 +16962,32 @@ function _createForOfIteratorHelper2(o, allowArrayLike) {
|
|
|
16814
16962
|
err = _e2;
|
|
16815
16963
|
}, f: function f() {
|
|
16816
16964
|
try {
|
|
16817
|
-
if (!normalCompletion && it.return != null)
|
|
16965
|
+
if (!normalCompletion && it.return != null)
|
|
16966
|
+
it.return();
|
|
16818
16967
|
} finally {
|
|
16819
|
-
if (didErr)
|
|
16968
|
+
if (didErr)
|
|
16969
|
+
throw err;
|
|
16820
16970
|
}
|
|
16821
16971
|
} };
|
|
16822
16972
|
}
|
|
16823
16973
|
function _unsupportedIterableToArray2(o, minLen) {
|
|
16824
|
-
if (!o)
|
|
16825
|
-
|
|
16974
|
+
if (!o)
|
|
16975
|
+
return;
|
|
16976
|
+
if (typeof o === "string")
|
|
16977
|
+
return _arrayLikeToArray2(o, minLen);
|
|
16826
16978
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
16827
|
-
if (n === "Object" && o.constructor)
|
|
16828
|
-
|
|
16829
|
-
if (n === "
|
|
16979
|
+
if (n === "Object" && o.constructor)
|
|
16980
|
+
n = o.constructor.name;
|
|
16981
|
+
if (n === "Map" || n === "Set")
|
|
16982
|
+
return Array.from(o);
|
|
16983
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
16984
|
+
return _arrayLikeToArray2(o, minLen);
|
|
16830
16985
|
}
|
|
16831
16986
|
function _arrayLikeToArray2(arr, len) {
|
|
16832
|
-
if (len == null || len > arr.length)
|
|
16833
|
-
|
|
16987
|
+
if (len == null || len > arr.length)
|
|
16988
|
+
len = arr.length;
|
|
16989
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
16990
|
+
arr2[i] = arr[i];
|
|
16834
16991
|
return arr2;
|
|
16835
16992
|
}
|
|
16836
16993
|
var RDF = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
|
|
@@ -16907,9 +17064,11 @@ function substituteNillsInDoc(store, doc) {
|
|
|
16907
17064
|
function convertFirstRestNil(store, doc) {
|
|
16908
17065
|
function preceding(ele, listSoFar, trash) {
|
|
16909
17066
|
var rests = store.statementsMatching(ele, RDF("rest"), null, doc);
|
|
16910
|
-
if (rests.length !== 1)
|
|
17067
|
+
if (rests.length !== 1)
|
|
17068
|
+
throw new Error("Bad list structure: no rest at ".concat(ele));
|
|
16911
17069
|
var firsts = store.statementsMatching(ele, RDF("first"), null, doc);
|
|
16912
|
-
if (firsts.length !== 1)
|
|
17070
|
+
if (firsts.length !== 1)
|
|
17071
|
+
throw new Error("Bad list structure: rest but ".concat(firsts.length, " firsts at ").concat(ele));
|
|
16913
17072
|
var value = firsts[0].object;
|
|
16914
17073
|
var total = [value].concat(listSoFar);
|
|
16915
17074
|
var totalTrash = trash.concat(rests).concat(firsts);
|
|
@@ -16920,16 +17079,19 @@ function convertFirstRestNil(store, doc) {
|
|
|
16920
17079
|
substituteInDoc(store, newList, ele, doc);
|
|
16921
17080
|
return;
|
|
16922
17081
|
}
|
|
16923
|
-
if (pres.length !== 1)
|
|
17082
|
+
if (pres.length !== 1)
|
|
17083
|
+
throw new Error("Bad list structure: ".concat(pres.length, " pres at ").concat(ele));
|
|
16924
17084
|
var pre = pres[0].subject;
|
|
16925
|
-
if (pre.termType !== "BlankNode")
|
|
17085
|
+
if (pre.termType !== "BlankNode")
|
|
17086
|
+
throw new Error("Bad list element node ".concat(pre, " type: ").concat(pre.termType, " "));
|
|
16926
17087
|
preceding(pre, total, totalTrash);
|
|
16927
17088
|
return;
|
|
16928
17089
|
}
|
|
16929
17090
|
substituteNillsInDoc(store, doc);
|
|
16930
17091
|
var tails = store.statementsMatching(null, RDF("rest"), RDF("nil"), doc);
|
|
16931
17092
|
tails.forEach(function(tail) {
|
|
16932
|
-
if (tail.subject.termType !== "BlankNode")
|
|
17093
|
+
if (tail.subject.termType !== "BlankNode")
|
|
17094
|
+
throw new Error("Bad list element node ".concat(tail.subject, " type: ").concat(tail.subject.termType, " "));
|
|
16933
17095
|
preceding(tail.subject, [], []);
|
|
16934
17096
|
});
|
|
16935
17097
|
}
|
|
@@ -16986,15 +17148,18 @@ var pyjslib_List = function pyjslib_List2(theList) {
|
|
|
16986
17148
|
return theList;
|
|
16987
17149
|
};
|
|
16988
17150
|
var pyjslib_Dict = function pyjslib_Dict2(listOfPairs) {
|
|
16989
|
-
if (listOfPairs.length > 0)
|
|
17151
|
+
if (listOfPairs.length > 0)
|
|
17152
|
+
throw "missing.js: oops nnonempty dict not imp";
|
|
16990
17153
|
return [];
|
|
16991
17154
|
};
|
|
16992
17155
|
var pyjslib_len = function pyjslib_len2(s) {
|
|
16993
17156
|
return s.length;
|
|
16994
17157
|
};
|
|
16995
17158
|
var pyjslib_slice = function pyjslib_slice2(str, i, j) {
|
|
16996
|
-
if (typeof str.slice == "undefined")
|
|
16997
|
-
|
|
17159
|
+
if (typeof str.slice == "undefined")
|
|
17160
|
+
throw "@@ mising.js: No .slice function for " + str + " of type " + _typeof(str);
|
|
17161
|
+
if (typeof j == "undefined" || j == null)
|
|
17162
|
+
return str.slice(i);
|
|
16998
17163
|
return str.slice(i, j);
|
|
16999
17164
|
};
|
|
17000
17165
|
var StopIteration = Error("dummy error stop iteration");
|
|
@@ -17002,7 +17167,8 @@ var pyjslib_Iterator = function pyjslib_Iterator2(theList) {
|
|
|
17002
17167
|
this.last = 0;
|
|
17003
17168
|
this.li = theList;
|
|
17004
17169
|
this.next = function() {
|
|
17005
|
-
if (this.last == this.li.length)
|
|
17170
|
+
if (this.last == this.li.length)
|
|
17171
|
+
throw StopIteration;
|
|
17006
17172
|
return this.li[this.last++];
|
|
17007
17173
|
};
|
|
17008
17174
|
return this;
|
|
@@ -17011,19 +17177,23 @@ var string_find = function string_find2(str, s) {
|
|
|
17011
17177
|
return str.indexOf(s);
|
|
17012
17178
|
};
|
|
17013
17179
|
var assertFudge = function assertFudge2(condition, desc) {
|
|
17014
|
-
if (condition)
|
|
17015
|
-
|
|
17180
|
+
if (condition)
|
|
17181
|
+
return;
|
|
17182
|
+
if (desc)
|
|
17183
|
+
throw "python Assertion failed: " + desc;
|
|
17016
17184
|
throw "(python) Assertion failed.";
|
|
17017
17185
|
};
|
|
17018
17186
|
var stringFromCharCode = function stringFromCharCode2(uesc) {
|
|
17019
17187
|
return String.fromCharCode(uesc);
|
|
17020
17188
|
};
|
|
17021
17189
|
String.prototype.encode = function(encoding) {
|
|
17022
|
-
if (encoding != "utf-8")
|
|
17190
|
+
if (encoding != "utf-8")
|
|
17191
|
+
throw "UTF8_converter: can only do utf-8";
|
|
17023
17192
|
return Utf8.encode(this);
|
|
17024
17193
|
};
|
|
17025
17194
|
String.prototype.decode = function(encoding) {
|
|
17026
|
-
if (encoding != "utf-8")
|
|
17195
|
+
if (encoding != "utf-8")
|
|
17196
|
+
throw "UTF8_converter: can only do utf-8";
|
|
17027
17197
|
return this;
|
|
17028
17198
|
};
|
|
17029
17199
|
var uripath_join = function uripath_join2(base, given) {
|
|
@@ -17061,13 +17231,20 @@ var n3parser_default = createSinkParser;
|
|
|
17061
17231
|
var SinkParser = /* @__PURE__ */ function() {
|
|
17062
17232
|
function SinkParser2(store, openFormula, thisDoc, baseURI, genPrefix, metaURI, flags, why) {
|
|
17063
17233
|
_classCallCheck(this, SinkParser2);
|
|
17064
|
-
if (typeof openFormula == "undefined")
|
|
17065
|
-
|
|
17066
|
-
if (typeof
|
|
17067
|
-
|
|
17068
|
-
if (typeof
|
|
17069
|
-
|
|
17070
|
-
if (typeof
|
|
17234
|
+
if (typeof openFormula == "undefined")
|
|
17235
|
+
openFormula = null;
|
|
17236
|
+
if (typeof thisDoc == "undefined")
|
|
17237
|
+
thisDoc = "";
|
|
17238
|
+
if (typeof baseURI == "undefined")
|
|
17239
|
+
baseURI = null;
|
|
17240
|
+
if (typeof genPrefix == "undefined")
|
|
17241
|
+
genPrefix = "";
|
|
17242
|
+
if (typeof metaURI == "undefined")
|
|
17243
|
+
metaURI = null;
|
|
17244
|
+
if (typeof flags == "undefined")
|
|
17245
|
+
flags = "";
|
|
17246
|
+
if (typeof why == "undefined")
|
|
17247
|
+
why = null;
|
|
17071
17248
|
this._bindings = new pyjslib_Dict([]);
|
|
17072
17249
|
this._flags = flags;
|
|
17073
17250
|
if (thisDoc != "") {
|
|
@@ -17491,7 +17668,8 @@ var SinkParser = /* @__PURE__ */ function() {
|
|
|
17491
17668
|
}, {
|
|
17492
17669
|
key: "node",
|
|
17493
17670
|
value: function node(str, i, res, subjectAlready) {
|
|
17494
|
-
if (typeof subjectAlready == "undefined")
|
|
17671
|
+
if (typeof subjectAlready == "undefined")
|
|
17672
|
+
subjectAlready = null;
|
|
17495
17673
|
var subj = subjectAlready;
|
|
17496
17674
|
var j = this.skipSpace(str, i);
|
|
17497
17675
|
if (j < 0) {
|
|
@@ -18382,7 +18560,7 @@ function listToCollection(kb, obj) {
|
|
|
18382
18560
|
}
|
|
18383
18561
|
function jsonldParser(str, kb, base, callback) {
|
|
18384
18562
|
var baseString = base && Object.prototype.hasOwnProperty.call(base, "termType") ? base.value : base;
|
|
18385
|
-
return import("./jsonld-
|
|
18563
|
+
return import("./jsonld-REJIJLLT.js").then(function(jsonld) {
|
|
18386
18564
|
return jsonld.flatten(JSON.parse(str), null, {
|
|
18387
18565
|
base: baseString
|
|
18388
18566
|
});
|
|
@@ -18849,7 +19027,8 @@ var N3Lexer = class {
|
|
|
18849
19027
|
const tokens = [];
|
|
18850
19028
|
let error2;
|
|
18851
19029
|
this._tokenizeToEnd((e, t) => e ? error2 = e : tokens.push(t), true);
|
|
18852
|
-
if (error2)
|
|
19030
|
+
if (error2)
|
|
19031
|
+
throw error2;
|
|
18853
19032
|
return tokens;
|
|
18854
19033
|
}
|
|
18855
19034
|
} else {
|
|
@@ -19526,7 +19705,8 @@ var N3Parser = class {
|
|
|
19526
19705
|
case "type":
|
|
19527
19706
|
case "typeIRI":
|
|
19528
19707
|
const datatype = this._readEntity(token);
|
|
19529
|
-
if (datatype === void 0)
|
|
19708
|
+
if (datatype === void 0)
|
|
19709
|
+
return;
|
|
19530
19710
|
literal4 = this._literal(this._literalValue, datatype);
|
|
19531
19711
|
token = null;
|
|
19532
19712
|
break;
|
|
@@ -19580,7 +19760,8 @@ var N3Parser = class {
|
|
|
19580
19760
|
case ".":
|
|
19581
19761
|
this._subject = null;
|
|
19582
19762
|
next = this._contextStack.length ? this._readSubject : this._readInTopContext;
|
|
19583
|
-
if (inversePredicate)
|
|
19763
|
+
if (inversePredicate)
|
|
19764
|
+
this._inversePredicate = false;
|
|
19584
19765
|
break;
|
|
19585
19766
|
case ";":
|
|
19586
19767
|
next = this._readPredicate;
|
|
@@ -19932,7 +20113,8 @@ var N3Parser = class {
|
|
|
19932
20113
|
this._lexer.tokenize(input).every((token) => {
|
|
19933
20114
|
return this._readCallback = this._readCallback(token);
|
|
19934
20115
|
});
|
|
19935
|
-
if (error2)
|
|
20116
|
+
if (error2)
|
|
20117
|
+
throw error2;
|
|
19936
20118
|
return quads;
|
|
19937
20119
|
}
|
|
19938
20120
|
this._callback = quadCallback;
|
|
@@ -20829,7 +21011,8 @@ var RDFaProcessor = /* @__PURE__ */ function() {
|
|
|
20829
21011
|
key: "toRDFNodeObject",
|
|
20830
21012
|
value: function toRDFNodeObject(x) {
|
|
20831
21013
|
var _this = this;
|
|
20832
|
-
if (typeof x === "undefined")
|
|
21014
|
+
if (typeof x === "undefined")
|
|
21015
|
+
return void 0;
|
|
20833
21016
|
if (typeof x === "string") {
|
|
20834
21017
|
if (x.substring(0, 2) === "_:") {
|
|
20835
21018
|
if (typeof this.blankNodes[x.substring(2)] === "undefined") {
|
|
@@ -21116,8 +21299,10 @@ var RDFParser = /* @__PURE__ */ function() {
|
|
|
21116
21299
|
if (el.localName) {
|
|
21117
21300
|
result = result + el.localName;
|
|
21118
21301
|
} else if (el.nodeName) {
|
|
21119
|
-
if (el.nodeName.indexOf(":") >= 0)
|
|
21120
|
-
|
|
21302
|
+
if (el.nodeName.indexOf(":") >= 0)
|
|
21303
|
+
result = result + el.nodeName.split(":")[1];
|
|
21304
|
+
else
|
|
21305
|
+
result = result + el.nodeName;
|
|
21121
21306
|
}
|
|
21122
21307
|
return result;
|
|
21123
21308
|
}.bind(this);
|
|
@@ -21300,7 +21485,8 @@ var RDFParser = /* @__PURE__ */ function() {
|
|
|
21300
21485
|
if (attrs[x].nodeName.substr(0, 3) === "xml") {
|
|
21301
21486
|
if (attrs[x].name.slice(0, 6) === "xmlns:") {
|
|
21302
21487
|
var uri = attrs[x].nodeValue;
|
|
21303
|
-
if (this.base)
|
|
21488
|
+
if (this.base)
|
|
21489
|
+
uri = join(uri, this.base);
|
|
21304
21490
|
this.store.setPrefixForURI(attrs[x].name.slice(6), uri);
|
|
21305
21491
|
}
|
|
21306
21492
|
element.removeAttributeNode(attrs[x]);
|
|
@@ -21497,12 +21683,14 @@ function _createForOfIteratorHelper3(o, allowArrayLike) {
|
|
|
21497
21683
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
21498
21684
|
if (!it) {
|
|
21499
21685
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray3(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
21500
|
-
if (it)
|
|
21686
|
+
if (it)
|
|
21687
|
+
o = it;
|
|
21501
21688
|
var i = 0;
|
|
21502
21689
|
var F = function F2() {
|
|
21503
21690
|
};
|
|
21504
21691
|
return { s: F, n: function n() {
|
|
21505
|
-
if (i >= o.length)
|
|
21692
|
+
if (i >= o.length)
|
|
21693
|
+
return { done: true };
|
|
21506
21694
|
return { done: false, value: o[i++] };
|
|
21507
21695
|
}, e: function e(_e) {
|
|
21508
21696
|
throw _e;
|
|
@@ -21522,23 +21710,32 @@ function _createForOfIteratorHelper3(o, allowArrayLike) {
|
|
|
21522
21710
|
err = _e2;
|
|
21523
21711
|
}, f: function f() {
|
|
21524
21712
|
try {
|
|
21525
|
-
if (!normalCompletion && it.return != null)
|
|
21713
|
+
if (!normalCompletion && it.return != null)
|
|
21714
|
+
it.return();
|
|
21526
21715
|
} finally {
|
|
21527
|
-
if (didErr)
|
|
21716
|
+
if (didErr)
|
|
21717
|
+
throw err;
|
|
21528
21718
|
}
|
|
21529
21719
|
} };
|
|
21530
21720
|
}
|
|
21531
21721
|
function _unsupportedIterableToArray3(o, minLen) {
|
|
21532
|
-
if (!o)
|
|
21533
|
-
|
|
21722
|
+
if (!o)
|
|
21723
|
+
return;
|
|
21724
|
+
if (typeof o === "string")
|
|
21725
|
+
return _arrayLikeToArray3(o, minLen);
|
|
21534
21726
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
21535
|
-
if (n === "Object" && o.constructor)
|
|
21536
|
-
|
|
21537
|
-
if (n === "
|
|
21727
|
+
if (n === "Object" && o.constructor)
|
|
21728
|
+
n = o.constructor.name;
|
|
21729
|
+
if (n === "Map" || n === "Set")
|
|
21730
|
+
return Array.from(o);
|
|
21731
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
21732
|
+
return _arrayLikeToArray3(o, minLen);
|
|
21538
21733
|
}
|
|
21539
21734
|
function _arrayLikeToArray3(arr, len) {
|
|
21540
|
-
if (len == null || len > arr.length)
|
|
21541
|
-
|
|
21735
|
+
if (len == null || len > arr.length)
|
|
21736
|
+
len = arr.length;
|
|
21737
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
21738
|
+
arr2[i] = arr[i];
|
|
21542
21739
|
return arr2;
|
|
21543
21740
|
}
|
|
21544
21741
|
function _callSuper8(t, o, e) {
|
|
@@ -22093,41 +22290,42 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
22093
22290
|
var _this3 = this;
|
|
22094
22291
|
var pendingPromise;
|
|
22095
22292
|
return import_regenerator.default.wrap(function _callee$(_context) {
|
|
22096
|
-
while (1)
|
|
22097
|
-
|
|
22098
|
-
|
|
22099
|
-
|
|
22100
|
-
_context.
|
|
22101
|
-
|
|
22102
|
-
|
|
22103
|
-
_context.next = 4;
|
|
22104
|
-
return this.fetchQueue[originalUri];
|
|
22105
|
-
case 4:
|
|
22106
|
-
_context.t0 = _context.sent;
|
|
22107
|
-
case 5:
|
|
22108
|
-
if (!_context.t0) {
|
|
22109
|
-
_context.next = 9;
|
|
22110
|
-
break;
|
|
22111
|
-
}
|
|
22112
|
-
pendingPromise = this.fetchQueue[originalUri];
|
|
22113
|
-
_context.next = 12;
|
|
22114
|
-
break;
|
|
22115
|
-
case 9:
|
|
22116
|
-
pendingPromise = Promise.race([this.setRequestTimeout(uri, options), this.fetchUri(uri, options)]);
|
|
22117
|
-
this.fetchQueue[originalUri] = pendingPromise;
|
|
22118
|
-
this.cleanupFetchRequest(originalUri, void 0, this.timeout);
|
|
22119
|
-
case 12:
|
|
22120
|
-
return _context.abrupt("return", pendingPromise.then(function(x) {
|
|
22121
|
-
if (uri in _this3.timeouts) {
|
|
22122
|
-
_this3.timeouts[uri].forEach(clearTimeout);
|
|
22123
|
-
delete _this3.timeouts[uri];
|
|
22293
|
+
while (1)
|
|
22294
|
+
switch (_context.prev = _context.next) {
|
|
22295
|
+
case 0:
|
|
22296
|
+
_context.t0 = !options.force;
|
|
22297
|
+
if (!_context.t0) {
|
|
22298
|
+
_context.next = 5;
|
|
22299
|
+
break;
|
|
22124
22300
|
}
|
|
22125
|
-
|
|
22126
|
-
|
|
22127
|
-
|
|
22128
|
-
|
|
22129
|
-
|
|
22130
|
-
|
|
22301
|
+
_context.next = 4;
|
|
22302
|
+
return this.fetchQueue[originalUri];
|
|
22303
|
+
case 4:
|
|
22304
|
+
_context.t0 = _context.sent;
|
|
22305
|
+
case 5:
|
|
22306
|
+
if (!_context.t0) {
|
|
22307
|
+
_context.next = 9;
|
|
22308
|
+
break;
|
|
22309
|
+
}
|
|
22310
|
+
pendingPromise = this.fetchQueue[originalUri];
|
|
22311
|
+
_context.next = 12;
|
|
22312
|
+
break;
|
|
22313
|
+
case 9:
|
|
22314
|
+
pendingPromise = Promise.race([this.setRequestTimeout(uri, options), this.fetchUri(uri, options)]);
|
|
22315
|
+
this.fetchQueue[originalUri] = pendingPromise;
|
|
22316
|
+
this.cleanupFetchRequest(originalUri, void 0, this.timeout);
|
|
22317
|
+
case 12:
|
|
22318
|
+
return _context.abrupt("return", pendingPromise.then(function(x) {
|
|
22319
|
+
if (uri in _this3.timeouts) {
|
|
22320
|
+
_this3.timeouts[uri].forEach(clearTimeout);
|
|
22321
|
+
delete _this3.timeouts[uri];
|
|
22322
|
+
}
|
|
22323
|
+
return x;
|
|
22324
|
+
}));
|
|
22325
|
+
case 13:
|
|
22326
|
+
case "end":
|
|
22327
|
+
return _context.stop();
|
|
22328
|
+
}
|
|
22131
22329
|
}, _callee, this);
|
|
22132
22330
|
}));
|
|
22133
22331
|
function pendingFetchPromise(_x, _x2, _x3) {
|
|
@@ -22378,7 +22576,8 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
22378
22576
|
}, {
|
|
22379
22577
|
key: "linkData",
|
|
22380
22578
|
value: function linkData(originalUri, rel, uri, why, reverse) {
|
|
22381
|
-
if (!uri)
|
|
22579
|
+
if (!uri)
|
|
22580
|
+
return;
|
|
22382
22581
|
var kb = this.store;
|
|
22383
22582
|
var predicate;
|
|
22384
22583
|
var obj = kb.rdfFactory.namedNode(join(uri, originalUri.value));
|
|
@@ -22407,13 +22606,15 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
22407
22606
|
var linkexp = /<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g;
|
|
22408
22607
|
var paramexp = /[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g;
|
|
22409
22608
|
var matches = linkHeader.match(linkexp);
|
|
22410
|
-
if (matches == null)
|
|
22609
|
+
if (matches == null)
|
|
22610
|
+
return;
|
|
22411
22611
|
for (var i = 0; i < matches.length; i++) {
|
|
22412
22612
|
var split = matches[i].split(">");
|
|
22413
22613
|
var href = split[0].substring(1);
|
|
22414
22614
|
var ps = split[1];
|
|
22415
22615
|
var s = ps.match(paramexp);
|
|
22416
|
-
if (s == null)
|
|
22616
|
+
if (s == null)
|
|
22617
|
+
return;
|
|
22417
22618
|
for (var j = 0; j < s.length; j++) {
|
|
22418
22619
|
var p = s[j];
|
|
22419
22620
|
var paramsplit = p.split("=");
|
|
@@ -22517,50 +22718,51 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
22517
22718
|
var _createIfNotExists = _asyncToGenerator(/* @__PURE__ */ import_regenerator.default.mark(function _callee2(doc) {
|
|
22518
22719
|
var contentType, data, fetcher3, response, _args2 = arguments;
|
|
22519
22720
|
return import_regenerator.default.wrap(function _callee2$(_context2) {
|
|
22520
|
-
while (1)
|
|
22521
|
-
|
|
22522
|
-
|
|
22523
|
-
|
|
22524
|
-
|
|
22525
|
-
|
|
22526
|
-
|
|
22527
|
-
|
|
22528
|
-
|
|
22529
|
-
|
|
22530
|
-
|
|
22531
|
-
|
|
22532
|
-
case 9:
|
|
22533
|
-
_context2.prev = 9;
|
|
22534
|
-
_context2.t0 = _context2["catch"](3);
|
|
22535
|
-
if (!(_context2.t0.response.status === 404)) {
|
|
22536
|
-
_context2.next = 25;
|
|
22721
|
+
while (1)
|
|
22722
|
+
switch (_context2.prev = _context2.next) {
|
|
22723
|
+
case 0:
|
|
22724
|
+
contentType = _args2.length > 1 && _args2[1] !== void 0 ? _args2[1] : TurtleContentType;
|
|
22725
|
+
data = _args2.length > 2 && _args2[2] !== void 0 ? _args2[2] : "";
|
|
22726
|
+
fetcher3 = this;
|
|
22727
|
+
_context2.prev = 3;
|
|
22728
|
+
_context2.next = 6;
|
|
22729
|
+
return fetcher3.load(doc);
|
|
22730
|
+
case 6:
|
|
22731
|
+
response = _context2.sent;
|
|
22732
|
+
_context2.next = 26;
|
|
22537
22733
|
break;
|
|
22538
|
-
|
|
22539
|
-
|
|
22540
|
-
|
|
22541
|
-
|
|
22542
|
-
|
|
22543
|
-
|
|
22544
|
-
|
|
22545
|
-
|
|
22546
|
-
|
|
22547
|
-
|
|
22548
|
-
|
|
22549
|
-
|
|
22550
|
-
|
|
22551
|
-
|
|
22552
|
-
|
|
22553
|
-
|
|
22554
|
-
|
|
22555
|
-
|
|
22556
|
-
|
|
22557
|
-
|
|
22558
|
-
|
|
22559
|
-
|
|
22560
|
-
|
|
22561
|
-
|
|
22562
|
-
|
|
22563
|
-
|
|
22734
|
+
case 9:
|
|
22735
|
+
_context2.prev = 9;
|
|
22736
|
+
_context2.t0 = _context2["catch"](3);
|
|
22737
|
+
if (!(_context2.t0.response.status === 404)) {
|
|
22738
|
+
_context2.next = 25;
|
|
22739
|
+
break;
|
|
22740
|
+
}
|
|
22741
|
+
_context2.prev = 12;
|
|
22742
|
+
_context2.next = 15;
|
|
22743
|
+
return fetcher3.webOperation("PUT", doc.value, {
|
|
22744
|
+
data,
|
|
22745
|
+
contentType
|
|
22746
|
+
});
|
|
22747
|
+
case 15:
|
|
22748
|
+
response = _context2.sent;
|
|
22749
|
+
_context2.next = 21;
|
|
22750
|
+
break;
|
|
22751
|
+
case 18:
|
|
22752
|
+
_context2.prev = 18;
|
|
22753
|
+
_context2.t1 = _context2["catch"](12);
|
|
22754
|
+
throw _context2.t1;
|
|
22755
|
+
case 21:
|
|
22756
|
+
delete fetcher3.requested[doc.value];
|
|
22757
|
+
return _context2.abrupt("return", response);
|
|
22758
|
+
case 25:
|
|
22759
|
+
throw _context2.t0;
|
|
22760
|
+
case 26:
|
|
22761
|
+
return _context2.abrupt("return", response);
|
|
22762
|
+
case 27:
|
|
22763
|
+
case "end":
|
|
22764
|
+
return _context2.stop();
|
|
22765
|
+
}
|
|
22564
22766
|
}, _callee2, this, [[3, 9], [12, 18]]);
|
|
22565
22767
|
}));
|
|
22566
22768
|
function createIfNotExists(_x4) {
|
|
@@ -22648,9 +22850,11 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
22648
22850
|
}
|
|
22649
22851
|
} else {
|
|
22650
22852
|
var msg2 = "Web error: " + response.status;
|
|
22651
|
-
if (response.statusText)
|
|
22853
|
+
if (response.statusText)
|
|
22854
|
+
msg2 += " (" + response.statusText + ")";
|
|
22652
22855
|
msg2 += " on " + method + " of <" + uri + ">";
|
|
22653
|
-
if (response.responseText)
|
|
22856
|
+
if (response.responseText)
|
|
22857
|
+
msg2 += ": " + response.responseText;
|
|
22654
22858
|
var e2 = new Error(msg2);
|
|
22655
22859
|
e2.response = response;
|
|
22656
22860
|
reject(e2);
|
|
@@ -23262,7 +23466,8 @@ var rdflib_data_factory_default = RDFlibDataFactory;
|
|
|
23262
23466
|
// ../node_modules/rdflib/esm/index.js
|
|
23263
23467
|
var boundDataFactory = {};
|
|
23264
23468
|
for (name in rdflib_data_factory_default) {
|
|
23265
|
-
if (typeof rdflib_data_factory_default[name] === "function")
|
|
23469
|
+
if (typeof rdflib_data_factory_default[name] === "function")
|
|
23470
|
+
boundDataFactory[name] = rdflib_data_factory_default[name].bind(rdflib_data_factory_default);
|
|
23266
23471
|
}
|
|
23267
23472
|
var name;
|
|
23268
23473
|
var fetcher2 = boundDataFactory.fetcher;
|
|
@@ -23306,12 +23511,14 @@ function _createForOfIteratorHelper4(o, allowArrayLike) {
|
|
|
23306
23511
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
23307
23512
|
if (!it) {
|
|
23308
23513
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray4(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
23309
|
-
if (it)
|
|
23514
|
+
if (it)
|
|
23515
|
+
o = it;
|
|
23310
23516
|
var i = 0;
|
|
23311
23517
|
var F = function F2() {
|
|
23312
23518
|
};
|
|
23313
23519
|
return { s: F, n: function n() {
|
|
23314
|
-
if (i >= o.length)
|
|
23520
|
+
if (i >= o.length)
|
|
23521
|
+
return { done: true };
|
|
23315
23522
|
return { done: false, value: o[i++] };
|
|
23316
23523
|
}, e: function e(_e) {
|
|
23317
23524
|
throw _e;
|
|
@@ -23331,23 +23538,32 @@ function _createForOfIteratorHelper4(o, allowArrayLike) {
|
|
|
23331
23538
|
err = _e2;
|
|
23332
23539
|
}, f: function f() {
|
|
23333
23540
|
try {
|
|
23334
|
-
if (!normalCompletion && it.return != null)
|
|
23541
|
+
if (!normalCompletion && it.return != null)
|
|
23542
|
+
it.return();
|
|
23335
23543
|
} finally {
|
|
23336
|
-
if (didErr)
|
|
23544
|
+
if (didErr)
|
|
23545
|
+
throw err;
|
|
23337
23546
|
}
|
|
23338
23547
|
} };
|
|
23339
23548
|
}
|
|
23340
23549
|
function _unsupportedIterableToArray4(o, minLen) {
|
|
23341
|
-
if (!o)
|
|
23342
|
-
|
|
23550
|
+
if (!o)
|
|
23551
|
+
return;
|
|
23552
|
+
if (typeof o === "string")
|
|
23553
|
+
return _arrayLikeToArray4(o, minLen);
|
|
23343
23554
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
23344
|
-
if (n === "Object" && o.constructor)
|
|
23345
|
-
|
|
23346
|
-
if (n === "
|
|
23555
|
+
if (n === "Object" && o.constructor)
|
|
23556
|
+
n = o.constructor.name;
|
|
23557
|
+
if (n === "Map" || n === "Set")
|
|
23558
|
+
return Array.from(o);
|
|
23559
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
23560
|
+
return _arrayLikeToArray4(o, minLen);
|
|
23347
23561
|
}
|
|
23348
23562
|
function _arrayLikeToArray4(arr, len) {
|
|
23349
|
-
if (len == null || len > arr.length)
|
|
23350
|
-
|
|
23563
|
+
if (len == null || len > arr.length)
|
|
23564
|
+
len = arr.length;
|
|
23565
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
23566
|
+
arr2[i] = arr[i];
|
|
23351
23567
|
return arr2;
|
|
23352
23568
|
}
|
|
23353
23569
|
function _callSuper9(t, o, e) {
|
|
@@ -23486,7 +23702,8 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23486
23702
|
function doPatch(onDonePatch) {
|
|
23487
23703
|
if (patch["delete"]) {
|
|
23488
23704
|
ds = patch["delete"];
|
|
23489
|
-
if (binding)
|
|
23705
|
+
if (binding)
|
|
23706
|
+
ds = ds.substitute(binding);
|
|
23490
23707
|
ds = ds.statements;
|
|
23491
23708
|
var bad = [];
|
|
23492
23709
|
var ds2 = ds.map(function(st3) {
|
|
@@ -23507,7 +23724,8 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23507
23724
|
}
|
|
23508
23725
|
if (patch["insert"]) {
|
|
23509
23726
|
ds = patch["insert"];
|
|
23510
|
-
if (binding)
|
|
23727
|
+
if (binding)
|
|
23728
|
+
ds = ds.substitute(binding);
|
|
23511
23729
|
ds = ds.statements;
|
|
23512
23730
|
ds.map(function(st3) {
|
|
23513
23731
|
st3.graph = target;
|
|
@@ -23548,7 +23766,8 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23548
23766
|
}, {
|
|
23549
23767
|
key: "declareExistential",
|
|
23550
23768
|
value: function declareExistential(x) {
|
|
23551
|
-
if (!this._existentialVariables)
|
|
23769
|
+
if (!this._existentialVariables)
|
|
23770
|
+
this._existentialVariables = [];
|
|
23552
23771
|
this._existentialVariables.push(x);
|
|
23553
23772
|
return x;
|
|
23554
23773
|
}
|
|
@@ -23799,7 +24018,8 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23799
24018
|
}, {
|
|
23800
24019
|
key: "copyTo",
|
|
23801
24020
|
value: function copyTo(template, target, flags) {
|
|
23802
|
-
if (!flags)
|
|
24021
|
+
if (!flags)
|
|
24022
|
+
flags = [];
|
|
23803
24023
|
var statList = this.statementsMatching(template);
|
|
23804
24024
|
if (ArrayIndexOf(flags, "two-direction") !== -1) {
|
|
23805
24025
|
statList.concat(this.statementsMatching(void 0, void 0, template));
|
|
@@ -23897,7 +24117,8 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23897
24117
|
}, {
|
|
23898
24118
|
key: "newExistential",
|
|
23899
24119
|
value: function newExistential(uri) {
|
|
23900
|
-
if (!uri)
|
|
24120
|
+
if (!uri)
|
|
24121
|
+
return this.bnode();
|
|
23901
24122
|
var x = this.sym(uri);
|
|
23902
24123
|
return this.declareExistential(x);
|
|
23903
24124
|
}
|
|
@@ -23930,7 +24151,8 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23930
24151
|
key: "newUniversal",
|
|
23931
24152
|
value: function newUniversal(uri) {
|
|
23932
24153
|
var x = this.sym(uri);
|
|
23933
|
-
if (!this._universalVariables)
|
|
24154
|
+
if (!this._universalVariables)
|
|
24155
|
+
this._universalVariables = [];
|
|
23934
24156
|
this._universalVariables.push(x);
|
|
23935
24157
|
return x;
|
|
23936
24158
|
}
|
|
@@ -23950,7 +24172,8 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23950
24172
|
value: function nextSymbol(doc) {
|
|
23951
24173
|
for (var i = 0; ; i++) {
|
|
23952
24174
|
var uri = doc.value + "#n" + i;
|
|
23953
|
-
if (!this.mentionsURI(uri))
|
|
24175
|
+
if (!this.mentionsURI(uri))
|
|
24176
|
+
return this.sym(uri);
|
|
23954
24177
|
}
|
|
23955
24178
|
}
|
|
23956
24179
|
/**
|
|
@@ -24075,9 +24298,12 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24075
24298
|
value: function removeMany(subj, pred, obj, why, limit) {
|
|
24076
24299
|
var sts = this.statementsMatching(subj, pred, obj, why, false);
|
|
24077
24300
|
var statements = [];
|
|
24078
|
-
for (var i = 0; i < sts.length; i++)
|
|
24079
|
-
|
|
24080
|
-
|
|
24301
|
+
for (var i = 0; i < sts.length; i++)
|
|
24302
|
+
statements.push(sts[i]);
|
|
24303
|
+
if (limit)
|
|
24304
|
+
statements = statements.slice(0, limit);
|
|
24305
|
+
for (i = 0; i < statements.length; i++)
|
|
24306
|
+
this.remove(statements[i]);
|
|
24081
24307
|
}
|
|
24082
24308
|
/**
|
|
24083
24309
|
* Remove all matching statements
|
|
@@ -24194,9 +24420,11 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24194
24420
|
return true;
|
|
24195
24421
|
}
|
|
24196
24422
|
var x1 = this.canon(x);
|
|
24197
|
-
if (!x1)
|
|
24423
|
+
if (!x1)
|
|
24424
|
+
return false;
|
|
24198
24425
|
var y1 = this.canon(y);
|
|
24199
|
-
if (!y1)
|
|
24426
|
+
if (!y1)
|
|
24427
|
+
return false;
|
|
24200
24428
|
return x1.value === y1.value;
|
|
24201
24429
|
}
|
|
24202
24430
|
}, {
|
|
@@ -24209,7 +24437,8 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24209
24437
|
return;
|
|
24210
24438
|
}
|
|
24211
24439
|
for (var existingPrefix in this.namespaces) {
|
|
24212
|
-
if (this.namespaces[existingPrefix] == nsuri)
|
|
24440
|
+
if (this.namespaces[existingPrefix] == nsuri)
|
|
24441
|
+
delete this.namespaces[existingPrefix];
|
|
24213
24442
|
}
|
|
24214
24443
|
this.namespaces[prefix] = nsuri;
|
|
24215
24444
|
}
|
|
@@ -24286,7 +24515,8 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24286
24515
|
}
|
|
24287
24516
|
if (st3 != null) {
|
|
24288
24517
|
results.push(st3);
|
|
24289
|
-
if (justOne)
|
|
24518
|
+
if (justOne)
|
|
24519
|
+
break;
|
|
24290
24520
|
}
|
|
24291
24521
|
}
|
|
24292
24522
|
return results;
|
|
@@ -24300,7 +24530,8 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24300
24530
|
value: function uris(term2) {
|
|
24301
24531
|
var cterm = this.canon(term2);
|
|
24302
24532
|
var terms = this.aliases[this.id(cterm)];
|
|
24303
|
-
if (!cterm.value)
|
|
24533
|
+
if (!cterm.value)
|
|
24534
|
+
return [];
|
|
24304
24535
|
var res = [cterm.value];
|
|
24305
24536
|
if (terms) {
|
|
24306
24537
|
for (var i = 0; i < terms.length; i++) {
|
|
@@ -24334,12 +24565,14 @@ function _createForOfIteratorHelper5(o, allowArrayLike) {
|
|
|
24334
24565
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
24335
24566
|
if (!it) {
|
|
24336
24567
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray5(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
24337
|
-
if (it)
|
|
24568
|
+
if (it)
|
|
24569
|
+
o = it;
|
|
24338
24570
|
var i = 0;
|
|
24339
24571
|
var F = function F2() {
|
|
24340
24572
|
};
|
|
24341
24573
|
return { s: F, n: function n() {
|
|
24342
|
-
if (i >= o.length)
|
|
24574
|
+
if (i >= o.length)
|
|
24575
|
+
return { done: true };
|
|
24343
24576
|
return { done: false, value: o[i++] };
|
|
24344
24577
|
}, e: function e(_e) {
|
|
24345
24578
|
throw _e;
|
|
@@ -24359,23 +24592,32 @@ function _createForOfIteratorHelper5(o, allowArrayLike) {
|
|
|
24359
24592
|
err = _e2;
|
|
24360
24593
|
}, f: function f() {
|
|
24361
24594
|
try {
|
|
24362
|
-
if (!normalCompletion && it.return != null)
|
|
24595
|
+
if (!normalCompletion && it.return != null)
|
|
24596
|
+
it.return();
|
|
24363
24597
|
} finally {
|
|
24364
|
-
if (didErr)
|
|
24598
|
+
if (didErr)
|
|
24599
|
+
throw err;
|
|
24365
24600
|
}
|
|
24366
24601
|
} };
|
|
24367
24602
|
}
|
|
24368
24603
|
function _unsupportedIterableToArray5(o, minLen) {
|
|
24369
|
-
if (!o)
|
|
24370
|
-
|
|
24604
|
+
if (!o)
|
|
24605
|
+
return;
|
|
24606
|
+
if (typeof o === "string")
|
|
24607
|
+
return _arrayLikeToArray5(o, minLen);
|
|
24371
24608
|
var n = Object.prototype.toString.call(o).slice(8, -1);
|
|
24372
|
-
if (n === "Object" && o.constructor)
|
|
24373
|
-
|
|
24374
|
-
if (n === "
|
|
24609
|
+
if (n === "Object" && o.constructor)
|
|
24610
|
+
n = o.constructor.name;
|
|
24611
|
+
if (n === "Map" || n === "Set")
|
|
24612
|
+
return Array.from(o);
|
|
24613
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))
|
|
24614
|
+
return _arrayLikeToArray5(o, minLen);
|
|
24375
24615
|
}
|
|
24376
24616
|
function _arrayLikeToArray5(arr, len) {
|
|
24377
|
-
if (len == null || len > arr.length)
|
|
24378
|
-
|
|
24617
|
+
if (len == null || len > arr.length)
|
|
24618
|
+
len = arr.length;
|
|
24619
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
24620
|
+
arr2[i] = arr[i];
|
|
24379
24621
|
return arr2;
|
|
24380
24622
|
}
|
|
24381
24623
|
var UpdateManager = /* @__PURE__ */ function() {
|
|
@@ -24471,33 +24713,34 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24471
24713
|
var _kb$fetcher2;
|
|
24472
24714
|
var initial, final;
|
|
24473
24715
|
return import_regenerator2.default.wrap(function _callee$(_context) {
|
|
24474
|
-
while (1)
|
|
24475
|
-
|
|
24476
|
-
|
|
24477
|
-
|
|
24478
|
-
|
|
24479
|
-
|
|
24480
|
-
|
|
24481
|
-
|
|
24482
|
-
|
|
24483
|
-
kb
|
|
24484
|
-
|
|
24485
|
-
|
|
24486
|
-
|
|
24487
|
-
|
|
24488
|
-
|
|
24489
|
-
|
|
24490
|
-
|
|
24491
|
-
|
|
24492
|
-
|
|
24493
|
-
|
|
24494
|
-
|
|
24495
|
-
|
|
24496
|
-
|
|
24497
|
-
|
|
24498
|
-
|
|
24499
|
-
|
|
24500
|
-
|
|
24716
|
+
while (1)
|
|
24717
|
+
switch (_context.prev = _context.next) {
|
|
24718
|
+
case 0:
|
|
24719
|
+
if (uri) {
|
|
24720
|
+
_context.next = 2;
|
|
24721
|
+
break;
|
|
24722
|
+
}
|
|
24723
|
+
return _context.abrupt("return", false);
|
|
24724
|
+
case 2:
|
|
24725
|
+
if (!kb) {
|
|
24726
|
+
kb = this.store;
|
|
24727
|
+
}
|
|
24728
|
+
initial = this.editable(uri, kb);
|
|
24729
|
+
if (!(initial !== void 0)) {
|
|
24730
|
+
_context.next = 6;
|
|
24731
|
+
break;
|
|
24732
|
+
}
|
|
24733
|
+
return _context.abrupt("return", initial);
|
|
24734
|
+
case 6:
|
|
24735
|
+
_context.next = 8;
|
|
24736
|
+
return (_kb$fetcher2 = kb.fetcher) === null || _kb$fetcher2 === void 0 ? void 0 : _kb$fetcher2.load(uri);
|
|
24737
|
+
case 8:
|
|
24738
|
+
final = this.editable(uri, kb);
|
|
24739
|
+
return _context.abrupt("return", final);
|
|
24740
|
+
case 10:
|
|
24741
|
+
case "end":
|
|
24742
|
+
return _context.stop();
|
|
24743
|
+
}
|
|
24501
24744
|
}, _callee, this);
|
|
24502
24745
|
}));
|
|
24503
24746
|
function checkEditable(_x, _x2) {
|
|
@@ -24532,7 +24775,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24532
24775
|
var _response2 = kb.any(request, this.ns.link("response"), null, meta);
|
|
24533
24776
|
if (_response2 !== void 0) {
|
|
24534
24777
|
var outOfDate = kb.anyJS(_response2, this.ns.link("outOfDate"), null, meta);
|
|
24535
|
-
if (outOfDate)
|
|
24778
|
+
if (outOfDate)
|
|
24779
|
+
continue;
|
|
24536
24780
|
var wacAllow = kb.anyValue(_response2, this.ns.httph("wac-allow"));
|
|
24537
24781
|
if (wacAllow) {
|
|
24538
24782
|
var _iterator2 = _createForOfIteratorHelper5(wacAllow.split(",")), _step2;
|
|
@@ -24554,9 +24798,12 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24554
24798
|
if (acceptPatch.length) {
|
|
24555
24799
|
for (var i = 0; i < acceptPatch.length; i++) {
|
|
24556
24800
|
method = acceptPatch[i].value.trim();
|
|
24557
|
-
if (method.indexOf("text/n3") >= 0)
|
|
24558
|
-
|
|
24559
|
-
if (method.indexOf("application/sparql-update
|
|
24801
|
+
if (method.indexOf("text/n3") >= 0)
|
|
24802
|
+
return "N3PATCH";
|
|
24803
|
+
if (method.indexOf("application/sparql-update") >= 0)
|
|
24804
|
+
return "SPARQL";
|
|
24805
|
+
if (method.indexOf("application/sparql-update-single-match") >= 0)
|
|
24806
|
+
return "SPARQL";
|
|
24560
24807
|
}
|
|
24561
24808
|
}
|
|
24562
24809
|
var authorVia = kb.each(_response2, this.ns.httph("ms-author-via"));
|
|
@@ -24572,8 +24819,10 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24572
24819
|
}
|
|
24573
24820
|
}
|
|
24574
24821
|
if (!this.isHttpUri(uri)) {
|
|
24575
|
-
if (!wacAllow)
|
|
24576
|
-
|
|
24822
|
+
if (!wacAllow)
|
|
24823
|
+
return false;
|
|
24824
|
+
else
|
|
24825
|
+
return "LOCALFILE";
|
|
24577
24826
|
}
|
|
24578
24827
|
var status = kb.each(_response2, this.ns.http("status"));
|
|
24579
24828
|
if (status.length) {
|
|
@@ -24710,7 +24959,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24710
24959
|
value: function bnodeContext1(x, source) {
|
|
24711
24960
|
for (var depth = 0; depth < 3; depth++) {
|
|
24712
24961
|
var con = this.bnodeContext2(x, source, depth);
|
|
24713
|
-
if (con !== null)
|
|
24962
|
+
if (con !== null)
|
|
24963
|
+
return con;
|
|
24714
24964
|
}
|
|
24715
24965
|
return this.store.connectedStatements(x, source);
|
|
24716
24966
|
}
|
|
@@ -24734,7 +24984,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24734
24984
|
this.cacheIfps();
|
|
24735
24985
|
for (var i = 0; i < bnodes.length; i++) {
|
|
24736
24986
|
var bnode = bnodes[i];
|
|
24737
|
-
if (!this.mentioned(bnode))
|
|
24987
|
+
if (!this.mentioned(bnode))
|
|
24988
|
+
continue;
|
|
24738
24989
|
context = context.concat(this.bnodeContext1(bnode, doc));
|
|
24739
24990
|
}
|
|
24740
24991
|
}
|
|
@@ -24824,7 +25075,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24824
25075
|
var query = this.contextWhere(this.statementContext(st0));
|
|
24825
25076
|
if (st3 instanceof Array) {
|
|
24826
25077
|
var stText = "";
|
|
24827
|
-
for (var i = 0; i < st3.length; i++)
|
|
25078
|
+
for (var i = 0; i < st3.length; i++)
|
|
25079
|
+
stText += st3[i] + "\n";
|
|
24828
25080
|
query += "INSERT DATA { " + stText + " }\n";
|
|
24829
25081
|
} else {
|
|
24830
25082
|
query += "INSERT DATA { " + this.anonymize(st3.subject) + " " + this.anonymize(st3.predicate) + " " + this.anonymize(st3.object) + " . }\n";
|
|
@@ -24838,7 +25090,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24838
25090
|
var query = this.contextWhere(this.statementContext(st0));
|
|
24839
25091
|
if (st3 instanceof Array) {
|
|
24840
25092
|
var stText = "";
|
|
24841
|
-
for (var i = 0; i < st3.length; i++)
|
|
25093
|
+
for (var i = 0; i < st3.length; i++)
|
|
25094
|
+
stText += st3[i] + "\n";
|
|
24842
25095
|
query += "DELETE DATA { " + stText + " }\n";
|
|
24843
25096
|
} else {
|
|
24844
25097
|
query += "DELETE DATA { " + this.anonymize(st3.subject) + " " + this.anonymize(st3.predicate) + " " + this.anonymize(st3.object) + " . }\n";
|
|
@@ -24885,7 +25138,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24885
25138
|
key: "getUpdatesVia",
|
|
24886
25139
|
value: function getUpdatesVia(doc) {
|
|
24887
25140
|
var linkHeaders = this.store.fetcher.getHeader(doc, "updates-via");
|
|
24888
|
-
if (!linkHeaders || !linkHeaders.length)
|
|
25141
|
+
if (!linkHeaders || !linkHeaders.length)
|
|
25142
|
+
return null;
|
|
24889
25143
|
return linkHeaders[0].trim();
|
|
24890
25144
|
}
|
|
24891
25145
|
}, {
|
|
@@ -25033,7 +25287,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25033
25287
|
docs.forEach(function(doc) {
|
|
25034
25288
|
if (!uniqueDocs.find(function(uniqueDoc) {
|
|
25035
25289
|
return uniqueDoc.equals(doc);
|
|
25036
|
-
}))
|
|
25290
|
+
}))
|
|
25291
|
+
uniqueDocs.push(doc);
|
|
25037
25292
|
});
|
|
25038
25293
|
var updates = uniqueDocs.map(function(doc) {
|
|
25039
25294
|
return thisUpdater.update(deletions.filter(function(st3) {
|
|
@@ -25085,7 +25340,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25085
25340
|
query += " } \n";
|
|
25086
25341
|
}
|
|
25087
25342
|
if (is.length) {
|
|
25088
|
-
if (ds.length)
|
|
25343
|
+
if (ds.length)
|
|
25344
|
+
query += " ; ";
|
|
25089
25345
|
query += "INSERT DATA { ";
|
|
25090
25346
|
for (var _i7 = 0; _i7 < is.length; _i7++) {
|
|
25091
25347
|
query += this.nTriples(is[_i7]) + "\n";
|
|
@@ -25217,8 +25473,10 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25217
25473
|
} else if (protocol2.indexOf("SPARQL") >= 0 || protocol2.indexOf("N3PATCH") >= 0) {
|
|
25218
25474
|
var isSparql = protocol2.indexOf("SPARQL") >= 0;
|
|
25219
25475
|
var bnodes = [];
|
|
25220
|
-
if (ds.length)
|
|
25221
|
-
|
|
25476
|
+
if (ds.length)
|
|
25477
|
+
bnodes = this.statementArrayBnodes(ds);
|
|
25478
|
+
if (is.length)
|
|
25479
|
+
bnodes = bnodes.concat(this.statementArrayBnodes(is));
|
|
25222
25480
|
var context = this.bnodeContext(bnodes, doc);
|
|
25223
25481
|
var query = isSparql ? this.constructSparqlUpdateQuery(ds, is, context) : this.constructN3PatchQuery(ds, is, context);
|
|
25224
25482
|
options.contentType = isSparql ? "application/sparql-update" : "text/n3";
|
|
@@ -25347,7 +25605,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25347
25605
|
options.body = this.serialize(doc.value, newSts, contentType);
|
|
25348
25606
|
options.contentType = contentType;
|
|
25349
25607
|
kb.fetcher.webOperation("PUT", doc.value, options).then(function(response) {
|
|
25350
|
-
if (!response.ok)
|
|
25608
|
+
if (!response.ok)
|
|
25609
|
+
return callbackFunction(doc.value, false, response.error);
|
|
25351
25610
|
for (var _i12 = 0; _i12 < ds.length; _i12++) {
|
|
25352
25611
|
kb.remove(ds[_i12]);
|
|
25353
25612
|
}
|
|
@@ -25448,8 +25707,10 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25448
25707
|
callbackFunction(false, "Non-HTTP error reloading data: " + body, response);
|
|
25449
25708
|
} else {
|
|
25450
25709
|
var elapsedTimeMs = Date.now() - startTime;
|
|
25451
|
-
if (!doc.reloadTimeTotal)
|
|
25452
|
-
|
|
25710
|
+
if (!doc.reloadTimeTotal)
|
|
25711
|
+
doc.reloadTimeTotal = 0;
|
|
25712
|
+
if (!doc.reloadTimeCount)
|
|
25713
|
+
doc.reloadTimeCount = 0;
|
|
25453
25714
|
doc.reloadTimeTotal += elapsedTimeMs;
|
|
25454
25715
|
doc.reloadTimeCount += 1;
|
|
25455
25716
|
callbackFunction(true);
|