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