@pod-os/core 0.12.1-e864b4f.0 → 0.12.1-fef97c9.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-7VQUARYZ.js} +421 -623
- package/dist/{dist-762OQHAF.js → dist-F3EUFQHU.js} +283 -159
- package/dist/index.js +1928 -2493
- package/dist/{jsonld-REJIJLLT.js → jsonld-ECVURSS6.js} +2 -3
- package/lib/index.js +2823 -3377
- package/package.json +16 -16
- package/types/Store.spec.d.ts +0 -1
- /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;
|
|
@@ -1766,6 +1736,8 @@ var require_dom = __commonJS({
|
|
|
1766
1736
|
return buf.push("<?", node.target, " ", node.data, "?>");
|
|
1767
1737
|
case ENTITY_REFERENCE_NODE:
|
|
1768
1738
|
return buf.push("&", node.nodeName, ";");
|
|
1739
|
+
//case ENTITY_NODE:
|
|
1740
|
+
//case NOTATION_NODE:
|
|
1769
1741
|
default:
|
|
1770
1742
|
buf.push("??", node.nodeName);
|
|
1771
1743
|
}
|
|
@@ -1776,6 +1748,11 @@ var require_dom = __commonJS({
|
|
|
1776
1748
|
case ELEMENT_NODE:
|
|
1777
1749
|
node2 = node.cloneNode(false);
|
|
1778
1750
|
node2.ownerDocument = doc;
|
|
1751
|
+
//var attrs = node2.attributes;
|
|
1752
|
+
//var len = attrs.length;
|
|
1753
|
+
//for(var i=0;i<len;i++){
|
|
1754
|
+
//node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));
|
|
1755
|
+
//}
|
|
1779
1756
|
case DOCUMENT_FRAGMENT_NODE:
|
|
1780
1757
|
break;
|
|
1781
1758
|
case ATTRIBUTE_NODE:
|
|
@@ -4064,8 +4041,7 @@ var require_sax = __commonJS({
|
|
|
4064
4041
|
function ParseError(message, locator) {
|
|
4065
4042
|
this.message = message;
|
|
4066
4043
|
this.locator = locator;
|
|
4067
|
-
if (Error.captureStackTrace)
|
|
4068
|
-
Error.captureStackTrace(this, ParseError);
|
|
4044
|
+
if (Error.captureStackTrace) Error.captureStackTrace(this, ParseError);
|
|
4069
4045
|
}
|
|
4070
4046
|
ParseError.prototype = new Error();
|
|
4071
4047
|
ParseError.prototype.name = ParseError.name;
|
|
@@ -4179,6 +4155,7 @@ var require_sax = __commonJS({
|
|
|
4179
4155
|
}
|
|
4180
4156
|
end++;
|
|
4181
4157
|
break;
|
|
4158
|
+
// end elment
|
|
4182
4159
|
case "?":
|
|
4183
4160
|
locator && position(tagStart);
|
|
4184
4161
|
end = parseInstruction(source, tagStart, domBuilder);
|
|
@@ -4314,6 +4291,7 @@ var require_sax = __commonJS({
|
|
|
4314
4291
|
case S_ATTR_SPACE:
|
|
4315
4292
|
el.closed = true;
|
|
4316
4293
|
break;
|
|
4294
|
+
//case S_EQ:
|
|
4317
4295
|
default:
|
|
4318
4296
|
throw new Error("attribute invalid close char('/')");
|
|
4319
4297
|
}
|
|
@@ -4332,7 +4310,9 @@ var require_sax = __commonJS({
|
|
|
4332
4310
|
case S_TAG_SPACE:
|
|
4333
4311
|
case S_TAG_CLOSE:
|
|
4334
4312
|
break;
|
|
4313
|
+
//normal
|
|
4335
4314
|
case S_ATTR_NOQUOT_VALUE:
|
|
4315
|
+
//Compatible state
|
|
4336
4316
|
case S_ATTR:
|
|
4337
4317
|
value = source.slice(start, p);
|
|
4338
4318
|
if (value.slice(-1) === "/") {
|
|
@@ -4357,6 +4337,7 @@ var require_sax = __commonJS({
|
|
|
4357
4337
|
throw new Error("attribute value missed!!");
|
|
4358
4338
|
}
|
|
4359
4339
|
return p;
|
|
4340
|
+
/*xml space '\x20' | #x9 | #xD | #xA; */
|
|
4360
4341
|
case "\x80":
|
|
4361
4342
|
c = " ";
|
|
4362
4343
|
default:
|
|
@@ -4380,6 +4361,9 @@ var require_sax = __commonJS({
|
|
|
4380
4361
|
}
|
|
4381
4362
|
} else {
|
|
4382
4363
|
switch (s) {
|
|
4364
|
+
//case S_TAG:void();break;
|
|
4365
|
+
//case S_ATTR:void();break;
|
|
4366
|
+
//case S_ATTR_NOQUOT_VALUE:void();break;
|
|
4383
4367
|
case S_ATTR_SPACE:
|
|
4384
4368
|
var tagName = el.tagName;
|
|
4385
4369
|
if (!NAMESPACE.isHTML(currentNSMap[""]) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {
|
|
@@ -4620,8 +4604,7 @@ var require_sax = __commonJS({
|
|
|
4620
4604
|
reg.exec(source);
|
|
4621
4605
|
while (match = reg.exec(source)) {
|
|
4622
4606
|
buf.push(match);
|
|
4623
|
-
if (match[1])
|
|
4624
|
-
return buf;
|
|
4607
|
+
if (match[1]) return buf;
|
|
4625
4608
|
}
|
|
4626
4609
|
}
|
|
4627
4610
|
exports.XMLReader = XMLReader;
|
|
@@ -7108,6 +7091,7 @@ var require_parse = __commonJS({
|
|
|
7108
7091
|
parameterLimit: 1e3,
|
|
7109
7092
|
parseArrays: true,
|
|
7110
7093
|
plainObjects: false,
|
|
7094
|
+
strictDepth: false,
|
|
7111
7095
|
strictNullHandling: false
|
|
7112
7096
|
};
|
|
7113
7097
|
var interpretNumericEntities = function(str) {
|
|
@@ -7126,6 +7110,7 @@ var require_parse = __commonJS({
|
|
|
7126
7110
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
7127
7111
|
var obj = { __proto__: null };
|
|
7128
7112
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
|
|
7113
|
+
cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
7129
7114
|
var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
|
|
7130
7115
|
var parts = cleanStr.split(options.delimiter, limit);
|
|
7131
7116
|
var skipIndex = -1;
|
|
@@ -7185,7 +7170,7 @@ var require_parse = __commonJS({
|
|
|
7185
7170
|
var obj;
|
|
7186
7171
|
var root = chain[i];
|
|
7187
7172
|
if (root === "[]" && options.parseArrays) {
|
|
7188
|
-
obj = options.allowEmptyArrays && leaf === "" ? [] : [].concat(leaf);
|
|
7173
|
+
obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf);
|
|
7189
7174
|
} else {
|
|
7190
7175
|
obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
7191
7176
|
var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
|
|
@@ -7233,6 +7218,9 @@ var require_parse = __commonJS({
|
|
|
7233
7218
|
keys.push(segment[1]);
|
|
7234
7219
|
}
|
|
7235
7220
|
if (segment) {
|
|
7221
|
+
if (options.strictDepth === true) {
|
|
7222
|
+
throw new RangeError("Input depth exceeded depth option of " + options.depth + " and strictDepth is true");
|
|
7223
|
+
}
|
|
7236
7224
|
keys.push("[" + key.slice(segment.index) + "]");
|
|
7237
7225
|
}
|
|
7238
7226
|
return parseObject(keys, val, options, valuesParsed);
|
|
@@ -7279,6 +7267,7 @@ var require_parse = __commonJS({
|
|
|
7279
7267
|
parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
|
|
7280
7268
|
parseArrays: opts.parseArrays !== false,
|
|
7281
7269
|
plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
|
|
7270
|
+
strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
|
|
7282
7271
|
strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
|
|
7283
7272
|
};
|
|
7284
7273
|
};
|
|
@@ -7996,19 +7985,14 @@ var require_ttl2jsonld = __commonJS({
|
|
|
7996
7985
|
return {};
|
|
7997
7986
|
}, 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
7987
|
var x = {};
|
|
7999
|
-
if (typeof s === "string" && s !== "[]")
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
Object.assign(x, s);
|
|
8003
|
-
if (p)
|
|
8004
|
-
Object.assign(x, p);
|
|
7988
|
+
if (typeof s === "string" && s !== "[]") x["@id"] = s;
|
|
7989
|
+
else if (typeof s === "object") Object.assign(x, s);
|
|
7990
|
+
if (p) Object.assign(x, p);
|
|
8005
7991
|
return [x];
|
|
8006
7992
|
}, peg$c36 = function(s, p) {
|
|
8007
7993
|
var x = {};
|
|
8008
|
-
if (s)
|
|
8009
|
-
|
|
8010
|
-
if (p)
|
|
8011
|
-
Object.assign(x, p);
|
|
7994
|
+
if (s) Object.assign(x, s);
|
|
7995
|
+
if (p) Object.assign(x, p);
|
|
8012
7996
|
return [x];
|
|
8013
7997
|
}, peg$c37 = ";", peg$c38 = peg$literalExpectation(";", false), peg$c39 = function(a, b, e, f) {
|
|
8014
7998
|
var x = {};
|
|
@@ -8020,18 +8004,13 @@ var require_ttl2jsonld = __commonJS({
|
|
|
8020
8004
|
var x = {};
|
|
8021
8005
|
c.unshift(createObject(a, b));
|
|
8022
8006
|
c.forEach((t) => {
|
|
8023
|
-
if (!t)
|
|
8024
|
-
return;
|
|
8007
|
+
if (!t) return;
|
|
8025
8008
|
Object.keys(t).forEach((key) => {
|
|
8026
8009
|
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];
|
|
8010
|
+
if (key === "@type" && val["@id"] !== void 0) val = val["@id"];
|
|
8011
|
+
if (x[key] === void 0) x[key] = val;
|
|
8012
|
+
else if (Array.isArray(x[key])) x[key].push(val);
|
|
8013
|
+
else x[key] = [x[key], val];
|
|
8035
8014
|
});
|
|
8036
8015
|
});
|
|
8037
8016
|
});
|
|
@@ -8056,14 +8035,10 @@ var require_ttl2jsonld = __commonJS({
|
|
|
8056
8035
|
}, peg$c62 = function(a, b) {
|
|
8057
8036
|
return { "@value": a, "@language": b };
|
|
8058
8037
|
}, 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);
|
|
8038
|
+
if (b === "http://www.w3.org/2001/XMLSchema#boolean" && a === "true") return true;
|
|
8039
|
+
if (b === "http://www.w3.org/2001/XMLSchema#boolean" && a === "false") return false;
|
|
8040
|
+
if (b === "http://www.w3.org/2001/XMLSchema#integer") return parseInt(a);
|
|
8041
|
+
if (b === "http://www.w3.org/2001/XMLSchema#double") return parseFloat(a);
|
|
8067
8042
|
const uri = context.resolve(b, true);
|
|
8068
8043
|
if (uri) {
|
|
8069
8044
|
const prefix = b.split(":")[0];
|
|
@@ -8093,14 +8068,10 @@ var require_ttl2jsonld = __commonJS({
|
|
|
8093
8068
|
return a + ":";
|
|
8094
8069
|
}, 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
8070
|
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));
|
|
8071
|
+
if (65536 <= s.codePointAt(0) && s.codePointAt(0) <= 983039) return "a";
|
|
8072
|
+
if (s.length === 1) return s;
|
|
8073
|
+
if (s.length === 6) return String.fromCharCode("0x" + s.substring(2));
|
|
8074
|
+
if (s.length === 10) return String.fromCodePoint("0x" + s.substring(2));
|
|
8104
8075
|
return s;
|
|
8105
8076
|
}).join("");
|
|
8106
8077
|
if (decoded.match(/^[^\u0000-\u0020<>"{}|^`\\]*$/)) {
|
|
@@ -8110,8 +8081,7 @@ var require_ttl2jsonld = __commonJS({
|
|
|
8110
8081
|
} catch (e) {
|
|
8111
8082
|
error2("Invalid IRIREF " + join2);
|
|
8112
8083
|
}
|
|
8113
|
-
} else
|
|
8114
|
-
error2("Invalid IRIREF " + a.join("") + " / " + decoded);
|
|
8084
|
+
} else error2("Invalid IRIREF " + a.join("") + " / " + decoded);
|
|
8115
8085
|
}, peg$c80 = ":", peg$c81 = peg$literalExpectation(":", false), peg$c82 = function(a) {
|
|
8116
8086
|
a = a || "0";
|
|
8117
8087
|
if (context.hasPrefix(a) === false)
|
|
@@ -12447,8 +12417,7 @@ var require_ttl2jsonld = __commonJS({
|
|
|
12447
12417
|
return;
|
|
12448
12418
|
}
|
|
12449
12419
|
const last = context.base[context.base.length - 1];
|
|
12450
|
-
if (last !== uri)
|
|
12451
|
-
context.base.push(new URL(uri, last).toString());
|
|
12420
|
+
if (last !== uri) context.base.push(new URL(uri, last).toString());
|
|
12452
12421
|
},
|
|
12453
12422
|
addPrefix: function(prefix, uri) {
|
|
12454
12423
|
const list = context.data[prefix];
|
|
@@ -12465,61 +12434,49 @@ var require_ttl2jsonld = __commonJS({
|
|
|
12465
12434
|
const prefix = Object.keys(context.data).find((key) => pname.indexOf(key + ":") === 0);
|
|
12466
12435
|
if (prefix !== void 0) {
|
|
12467
12436
|
const list = context.data[prefix];
|
|
12468
|
-
if (list.length === 1 && force !== true && isIRI(list[0].uri))
|
|
12469
|
-
return pname;
|
|
12437
|
+
if (list.length === 1 && force !== true && isIRI(list[0].uri)) return pname;
|
|
12470
12438
|
const uri = list[list.length - 1].uri;
|
|
12471
12439
|
return pname.replace(prefix + ":", uri);
|
|
12472
12440
|
} else {
|
|
12473
12441
|
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;
|
|
12442
|
+
if (!base || pname.match(/^(http:|https:|urn:|file:)/)) return pname;
|
|
12443
|
+
if (pname.indexOf("//") === 0 && base) return base.split("//")[0] + pname;
|
|
12478
12444
|
return new URL(pname, base).toString();
|
|
12479
12445
|
}
|
|
12480
12446
|
},
|
|
12481
12447
|
increment: function(prefix) {
|
|
12482
12448
|
const list = context.data[prefix];
|
|
12483
|
-
if (list !== void 0)
|
|
12484
|
-
list[list.length - 1].count++;
|
|
12449
|
+
if (list !== void 0) list[list.length - 1].count++;
|
|
12485
12450
|
},
|
|
12486
12451
|
decrement: function(prefix) {
|
|
12487
12452
|
const list = context.data[prefix];
|
|
12488
|
-
if (list !== void 0)
|
|
12489
|
-
list[list.length - 1].count--;
|
|
12453
|
+
if (list !== void 0) list[list.length - 1].count--;
|
|
12490
12454
|
},
|
|
12491
12455
|
toJSON: function() {
|
|
12492
12456
|
const root = {};
|
|
12493
12457
|
if (context.base.length > 0) {
|
|
12494
|
-
if (root["@context"] === void 0)
|
|
12495
|
-
root["@context"] = {};
|
|
12458
|
+
if (root["@context"] === void 0) root["@context"] = {};
|
|
12496
12459
|
root["@context"]["@base"] = context.base[0];
|
|
12497
12460
|
}
|
|
12498
12461
|
Object.keys(context.data).forEach((key) => {
|
|
12499
12462
|
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"] = {};
|
|
12463
|
+
if (head.uri === "http://www.w3.org/2001/XMLSchema#" && head.count < 1) return;
|
|
12464
|
+
if (!isIRI(head.uri)) return;
|
|
12465
|
+
if (root["@context"] === void 0) root["@context"] = {};
|
|
12506
12466
|
root["@context"][key] = head.uri;
|
|
12507
12467
|
});
|
|
12508
12468
|
return root;
|
|
12509
12469
|
}
|
|
12510
12470
|
};
|
|
12511
12471
|
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;
|
|
12472
|
+
if (container["@list"] === void 0) return container;
|
|
12473
|
+
if (!force && !container["@list"].find((x) => x["@list"] !== void 0)) return container;
|
|
12516
12474
|
if (container["@list"].length === 0)
|
|
12517
12475
|
return { "@id": "http://www.w3.org/1999/02/22-rdf-syntax-ns#nil" };
|
|
12518
12476
|
var root = {};
|
|
12519
12477
|
var focus = null;
|
|
12520
12478
|
container["@list"].forEach((b) => {
|
|
12521
|
-
if (focus === null)
|
|
12522
|
-
focus = root;
|
|
12479
|
+
if (focus === null) focus = root;
|
|
12523
12480
|
else {
|
|
12524
12481
|
focus["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"] = {};
|
|
12525
12482
|
focus = focus["http://www.w3.org/1999/02/22-rdf-syntax-ns#rest"];
|
|
@@ -13140,13 +13097,11 @@ function _classCallCheck(instance, Constructor) {
|
|
|
13140
13097
|
|
|
13141
13098
|
// ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
13142
13099
|
function toPrimitive(t, r) {
|
|
13143
|
-
if ("object" != _typeof(t) || !t)
|
|
13144
|
-
return t;
|
|
13100
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
13145
13101
|
var e = t[Symbol.toPrimitive];
|
|
13146
13102
|
if (void 0 !== e) {
|
|
13147
13103
|
var i = e.call(t, r || "default");
|
|
13148
|
-
if ("object" != _typeof(i))
|
|
13149
|
-
return i;
|
|
13104
|
+
if ("object" != _typeof(i)) return i;
|
|
13150
13105
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
13151
13106
|
}
|
|
13152
13107
|
return ("string" === r ? String : Number)(t);
|
|
@@ -13164,16 +13119,13 @@ function _defineProperties(target, props) {
|
|
|
13164
13119
|
var descriptor = props[i];
|
|
13165
13120
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
13166
13121
|
descriptor.configurable = true;
|
|
13167
|
-
if ("value" in descriptor)
|
|
13168
|
-
descriptor.writable = true;
|
|
13122
|
+
if ("value" in descriptor) descriptor.writable = true;
|
|
13169
13123
|
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
|
13170
13124
|
}
|
|
13171
13125
|
}
|
|
13172
13126
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
13173
|
-
if (protoProps)
|
|
13174
|
-
|
|
13175
|
-
if (staticProps)
|
|
13176
|
-
_defineProperties(Constructor, staticProps);
|
|
13127
|
+
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
|
|
13128
|
+
if (staticProps) _defineProperties(Constructor, staticProps);
|
|
13177
13129
|
Object.defineProperty(Constructor, "prototype", {
|
|
13178
13130
|
writable: false
|
|
13179
13131
|
});
|
|
@@ -13249,8 +13201,7 @@ function _inherits(subClass, superClass) {
|
|
|
13249
13201
|
Object.defineProperty(subClass, "prototype", {
|
|
13250
13202
|
writable: false
|
|
13251
13203
|
});
|
|
13252
|
-
if (superClass)
|
|
13253
|
-
_setPrototypeOf(subClass, superClass);
|
|
13204
|
+
if (superClass) _setPrototypeOf(subClass, superClass);
|
|
13254
13205
|
}
|
|
13255
13206
|
|
|
13256
13207
|
// ../node_modules/rdflib/esm/class-order.js
|
|
@@ -13507,8 +13458,7 @@ var NamedNode = /* @__PURE__ */ function(_Node) {
|
|
|
13507
13458
|
var str = this.value.split("#")[0];
|
|
13508
13459
|
var p = str.slice(0, -1).lastIndexOf("/");
|
|
13509
13460
|
var q = str.indexOf("//");
|
|
13510
|
-
if (q >= 0 && p < q + 2 || p < 0)
|
|
13511
|
-
return null;
|
|
13461
|
+
if (q >= 0 && p < q + 2 || p < 0) return null;
|
|
13512
13462
|
return new NamedNode3(str.slice(0, p + 1));
|
|
13513
13463
|
}
|
|
13514
13464
|
/**
|
|
@@ -13520,8 +13470,7 @@ var NamedNode = /* @__PURE__ */ function(_Node) {
|
|
|
13520
13470
|
value: function site() {
|
|
13521
13471
|
var str = this.value.split("#")[0];
|
|
13522
13472
|
var p = str.indexOf("//");
|
|
13523
|
-
if (p < 0)
|
|
13524
|
-
throw new Error("This URI does not have a web site part (origin)");
|
|
13473
|
+
if (p < 0) throw new Error("This URI does not have a web site part (origin)");
|
|
13525
13474
|
var q = str.indexOf("/", p + 2);
|
|
13526
13475
|
if (q < 0) {
|
|
13527
13476
|
return new NamedNode3(str.slice(0) + "/");
|
|
@@ -14504,8 +14453,7 @@ function dumpNode(node, options, selfClosing, skipAttributes) {
|
|
|
14504
14453
|
var i;
|
|
14505
14454
|
var out = "";
|
|
14506
14455
|
var noEsc = [false];
|
|
14507
|
-
if (typeof node.nodeType === "undefined")
|
|
14508
|
-
return out;
|
|
14456
|
+
if (typeof node.nodeType === "undefined") return out;
|
|
14509
14457
|
if (node.nodeType === 1) {
|
|
14510
14458
|
if (node.hasAttribute("class") && options && options.classWithChildText && node.matches(options.classWithChildText.class)) {
|
|
14511
14459
|
out += node.querySelector(options.classWithChildText.element).textContent;
|
|
@@ -14515,10 +14463,8 @@ function dumpNode(node, options, selfClosing, skipAttributes) {
|
|
|
14515
14463
|
var attrList = [];
|
|
14516
14464
|
for (i = node.attributes.length - 1; i >= 0; i--) {
|
|
14517
14465
|
var atn = node.attributes[i];
|
|
14518
|
-
if (skipAttributes && skipAttributes.length > 0 && skipAttributes[atn.name])
|
|
14519
|
-
|
|
14520
|
-
if (/^\d+$/.test(atn.name))
|
|
14521
|
-
continue;
|
|
14466
|
+
if (skipAttributes && skipAttributes.length > 0 && skipAttributes[atn.name]) continue;
|
|
14467
|
+
if (/^\d+$/.test(atn.name)) continue;
|
|
14522
14468
|
if (atn.name === "class" && options && options.replaceClassItemWith && atn.value.split(" ").indexOf(options.replaceClassItemWith.source) > -1) {
|
|
14523
14469
|
var re = new RegExp(options.replaceClassItemWith.source, "g");
|
|
14524
14470
|
atn.value = atn.value.replace(re, options.replaceClassItemWith.target).trim();
|
|
@@ -14541,8 +14487,7 @@ function dumpNode(node, options, selfClosing, skipAttributes) {
|
|
|
14541
14487
|
out += ">";
|
|
14542
14488
|
out += ename === "html" ? "\n " : "";
|
|
14543
14489
|
noEsc.push(ename === "style" || ename === "script");
|
|
14544
|
-
for (i = 0; i < node.childNodes.length; i++)
|
|
14545
|
-
out += dumpNode(node.childNodes[i]);
|
|
14490
|
+
for (i = 0; i < node.childNodes.length; i++) out += dumpNode(node.childNodes[i]);
|
|
14546
14491
|
noEsc.pop();
|
|
14547
14492
|
out += ename === "body" ? "</" + ename + ">\n" : "</" + ename + ">";
|
|
14548
14493
|
}
|
|
@@ -14573,12 +14518,9 @@ function heavyCompare(x, y, g, uriMap) {
|
|
|
14573
14518
|
};
|
|
14574
14519
|
var comparison = Object.prototype.hasOwnProperty.call(g, "compareTerms") ? g.compareTerms(x, y) : x.compareTerm(y);
|
|
14575
14520
|
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;
|
|
14521
|
+
if (comparison === 0) return 0;
|
|
14522
|
+
if (signature(x) > signature(y)) return 1;
|
|
14523
|
+
if (signature(x) < signature(y)) return -1;
|
|
14582
14524
|
return comparison;
|
|
14583
14525
|
} else {
|
|
14584
14526
|
if (uriMap && x.uri && y.uri) {
|
|
@@ -14715,8 +14657,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14715
14657
|
value: function fromStr(s) {
|
|
14716
14658
|
if (s[0] === "{") {
|
|
14717
14659
|
var x = this.formulas[s];
|
|
14718
|
-
if (!x)
|
|
14719
|
-
console.log("No formula object for " + s);
|
|
14660
|
+
if (!x) console.log("No formula object for " + s);
|
|
14720
14661
|
return x;
|
|
14721
14662
|
}
|
|
14722
14663
|
return this.store.fromNT(s);
|
|
@@ -14743,15 +14684,11 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14743
14684
|
}, {
|
|
14744
14685
|
key: "setPrefix",
|
|
14745
14686
|
value: function setPrefix(prefix, uri) {
|
|
14746
|
-
if (prefix.slice(0, 7) === "default")
|
|
14747
|
-
|
|
14748
|
-
if (prefix
|
|
14749
|
-
return;
|
|
14750
|
-
if (!prefix || !uri)
|
|
14751
|
-
return;
|
|
14687
|
+
if (prefix.slice(0, 7) === "default") return;
|
|
14688
|
+
if (prefix.slice(0, 2) === "ns") return;
|
|
14689
|
+
if (!prefix || !uri) return;
|
|
14752
14690
|
for (var existingNs in this.prefixes) {
|
|
14753
|
-
if (this.prefixes[existingNs] == prefix)
|
|
14754
|
-
delete this.prefixes[existingNs];
|
|
14691
|
+
if (this.prefixes[existingNs] == prefix) delete this.prefixes[existingNs];
|
|
14755
14692
|
}
|
|
14756
14693
|
this.prefixes[uri] = prefix;
|
|
14757
14694
|
this.namespaces[prefix] = uri;
|
|
@@ -14764,14 +14701,10 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14764
14701
|
}, {
|
|
14765
14702
|
key: "suggestPrefix",
|
|
14766
14703
|
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;
|
|
14704
|
+
if (prefix.slice(0, 7) === "default") return;
|
|
14705
|
+
if (prefix.slice(0, 2) === "ns") return;
|
|
14706
|
+
if (!prefix || !uri) return;
|
|
14707
|
+
if (prefix in this.namespaces || uri in this.prefixes) return;
|
|
14775
14708
|
this.prefixes[uri] = prefix;
|
|
14776
14709
|
this.namespaces[prefix] = uri;
|
|
14777
14710
|
}
|
|
@@ -14805,22 +14738,17 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14805
14738
|
value: function makeUpPrefix(uri) {
|
|
14806
14739
|
var p = uri;
|
|
14807
14740
|
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;
|
|
14741
|
+
if (!this.validPrefix.test(pp)) return false;
|
|
14742
|
+
if (pp === "ns") return false;
|
|
14743
|
+
if (pp in this.namespaces) return false;
|
|
14814
14744
|
this.prefixes[uri] = pp;
|
|
14815
14745
|
this.namespaces[pp] = uri;
|
|
14816
14746
|
return pp;
|
|
14817
14747
|
}
|
|
14818
14748
|
var canUse = canUseMethod.bind(this);
|
|
14819
|
-
if ("#/".indexOf(p[p.length - 1]) >= 0)
|
|
14820
|
-
p = p.slice(0, -1);
|
|
14749
|
+
if ("#/".indexOf(p[p.length - 1]) >= 0) p = p.slice(0, -1);
|
|
14821
14750
|
var slash = p.lastIndexOf("/");
|
|
14822
|
-
if (slash >= 0)
|
|
14823
|
-
p = p.slice(slash + 1);
|
|
14751
|
+
if (slash >= 0) p = p.slice(slash + 1);
|
|
14824
14752
|
var i = 0;
|
|
14825
14753
|
while (i < p.length) {
|
|
14826
14754
|
if (this.prefixchars.indexOf(p[i])) {
|
|
@@ -14830,24 +14758,16 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14830
14758
|
}
|
|
14831
14759
|
}
|
|
14832
14760
|
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);
|
|
14761
|
+
if (p.length < 6 && canUse(p)) return p;
|
|
14762
|
+
if (canUse(p.slice(0, 3))) return p.slice(0, 3);
|
|
14763
|
+
if (canUse(p.slice(0, 2))) return p.slice(0, 2);
|
|
14764
|
+
if (canUse(p.slice(0, 4))) return p.slice(0, 4);
|
|
14765
|
+
if (canUse(p.slice(0, 1))) return p.slice(0, 1);
|
|
14766
|
+
if (canUse(p.slice(0, 5))) return p.slice(0, 5);
|
|
14845
14767
|
if (!this.validPrefix.test(p)) {
|
|
14846
14768
|
p = "n";
|
|
14847
14769
|
}
|
|
14848
|
-
for (var j = 0; ; j++)
|
|
14849
|
-
if (canUse(p.slice(0, 3) + j))
|
|
14850
|
-
return p.slice(0, 3) + j;
|
|
14770
|
+
for (var j = 0; ; j++) if (canUse(p.slice(0, 3) + j)) return p.slice(0, 3) + j;
|
|
14851
14771
|
}
|
|
14852
14772
|
}, {
|
|
14853
14773
|
key: "rootSubjects",
|
|
@@ -14858,8 +14778,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14858
14778
|
for (var i = 0; i < sts.length; i++) {
|
|
14859
14779
|
var st3 = sts[i];
|
|
14860
14780
|
var checkMentions = function checkMentions2(x) {
|
|
14861
|
-
if (!incoming.hasOwnProperty(x))
|
|
14862
|
-
incoming[x] = [];
|
|
14781
|
+
if (!incoming.hasOwnProperty(x)) incoming[x] = [];
|
|
14863
14782
|
incoming[x].push(st3.subject);
|
|
14864
14783
|
};
|
|
14865
14784
|
var st22 = [st3.subject, st3.predicate, st3.object];
|
|
@@ -14874,15 +14793,13 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14874
14793
|
});
|
|
14875
14794
|
checkMentions(sts[i].object);
|
|
14876
14795
|
var ss = subjects[this.toStr(st3.subject)];
|
|
14877
|
-
if (!ss)
|
|
14878
|
-
ss = [];
|
|
14796
|
+
if (!ss) ss = [];
|
|
14879
14797
|
ss.push(st3);
|
|
14880
14798
|
subjects[this.toStr(st3.subject)] = ss;
|
|
14881
14799
|
}
|
|
14882
14800
|
var roots = [];
|
|
14883
14801
|
for (var xNT in subjects) {
|
|
14884
|
-
if (!subjects.hasOwnProperty(xNT))
|
|
14885
|
-
continue;
|
|
14802
|
+
if (!subjects.hasOwnProperty(xNT)) continue;
|
|
14886
14803
|
var y = this.fromStr(xNT);
|
|
14887
14804
|
if (y.termType !== "BlankNode" || !incoming[y] || incoming[y].length !== 1) {
|
|
14888
14805
|
roots.push(y);
|
|
@@ -14985,8 +14902,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
14985
14902
|
}
|
|
14986
14903
|
var spaces = function spaces2(n) {
|
|
14987
14904
|
var s = "";
|
|
14988
|
-
for (var i = 0; i < n; i++)
|
|
14989
|
-
s += " ";
|
|
14905
|
+
for (var i = 0; i < n; i++) s += " ";
|
|
14990
14906
|
return s;
|
|
14991
14907
|
};
|
|
14992
14908
|
var treeToLine = function treeToLine2(tree2) {
|
|
@@ -15009,8 +14925,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15009
14925
|
var treeToString = function treeToString2(tree2, level) {
|
|
15010
14926
|
var str = "";
|
|
15011
14927
|
var lastLength = 1e5;
|
|
15012
|
-
if (level === void 0)
|
|
15013
|
-
level = -1;
|
|
14928
|
+
if (level === void 0) level = -1;
|
|
15014
14929
|
for (var i = 0; i < tree2.length; i++) {
|
|
15015
14930
|
var branch = tree2[i];
|
|
15016
14931
|
if (typeof branch !== "string") {
|
|
@@ -15022,8 +14937,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15022
14937
|
substr = "";
|
|
15023
14938
|
}
|
|
15024
14939
|
}
|
|
15025
|
-
if (substr)
|
|
15026
|
-
lastLength = 1e4;
|
|
14940
|
+
if (substr) lastLength = 1e4;
|
|
15027
14941
|
str += substr;
|
|
15028
14942
|
}
|
|
15029
14943
|
if (typeof branch === "string") {
|
|
@@ -15136,10 +15050,8 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15136
15050
|
str += "@prefix : " + this.explicitURI(this.defaultNamespace) + ".\n";
|
|
15137
15051
|
}
|
|
15138
15052
|
for (var ns3 in this.prefixes) {
|
|
15139
|
-
if (!this.prefixes.hasOwnProperty(ns3))
|
|
15140
|
-
|
|
15141
|
-
if (!this.namespacesUsed[ns3])
|
|
15142
|
-
continue;
|
|
15053
|
+
if (!this.prefixes.hasOwnProperty(ns3)) continue;
|
|
15054
|
+
if (!this.namespacesUsed[ns3]) continue;
|
|
15143
15055
|
str += "@prefix " + this.prefixes[ns3] + ": " + this.explicitURI(ns3) + ".\n";
|
|
15144
15056
|
}
|
|
15145
15057
|
return str + "\n";
|
|
@@ -15167,15 +15079,12 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15167
15079
|
case "http://www.w3.org/2001/XMLSchema#integer":
|
|
15168
15080
|
return val;
|
|
15169
15081
|
case "http://www.w3.org/2001/XMLSchema#decimal":
|
|
15170
|
-
if (val.indexOf(".") < 0)
|
|
15171
|
-
val += ".0";
|
|
15082
|
+
if (val.indexOf(".") < 0) val += ".0";
|
|
15172
15083
|
return val;
|
|
15173
15084
|
case "http://www.w3.org/2001/XMLSchema#double": {
|
|
15174
15085
|
var eNotation = val.toLowerCase().indexOf("e") > 0;
|
|
15175
|
-
if (val.indexOf(".") < 0 && !eNotation)
|
|
15176
|
-
|
|
15177
|
-
if (!eNotation)
|
|
15178
|
-
val += "e0";
|
|
15086
|
+
if (val.indexOf(".") < 0 && !eNotation) val += ".0";
|
|
15087
|
+
if (!eNotation) val += "e0";
|
|
15179
15088
|
return val;
|
|
15180
15089
|
}
|
|
15181
15090
|
case "http://www.w3.org/2001/XMLSchema#boolean":
|
|
@@ -15200,8 +15109,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15200
15109
|
}, {
|
|
15201
15110
|
key: "stringToN3",
|
|
15202
15111
|
value: function stringToN3(str, flags) {
|
|
15203
|
-
if (!flags)
|
|
15204
|
-
flags = "e";
|
|
15112
|
+
if (!flags) flags = "e";
|
|
15205
15113
|
var res = "";
|
|
15206
15114
|
var i, j, k;
|
|
15207
15115
|
var delim;
|
|
@@ -15219,8 +15127,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15219
15127
|
for (i = 0; i < str.length; ) {
|
|
15220
15128
|
forbidden.lastIndex = 0;
|
|
15221
15129
|
var m = forbidden.exec(str.slice(i));
|
|
15222
|
-
if (m == null)
|
|
15223
|
-
break;
|
|
15130
|
+
if (m == null) break;
|
|
15224
15131
|
j = i + forbidden.lastIndex - 1;
|
|
15225
15132
|
res += str.slice(i, j);
|
|
15226
15133
|
var ch = str[j];
|
|
@@ -15270,8 +15177,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15270
15177
|
return ":" + localid;
|
|
15271
15178
|
}
|
|
15272
15179
|
var prefix = this.prefixes[namesp];
|
|
15273
|
-
if (!prefix)
|
|
15274
|
-
prefix = this.makeUpPrefix(namesp);
|
|
15180
|
+
if (!prefix) prefix = this.makeUpPrefix(namesp);
|
|
15275
15181
|
if (prefix) {
|
|
15276
15182
|
this.namespacesUsed[namesp] = true;
|
|
15277
15183
|
return prefix + ":" + localid;
|
|
@@ -15292,8 +15198,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15292
15198
|
var sources = this.store.index[3];
|
|
15293
15199
|
for (var s in sources) {
|
|
15294
15200
|
var source = kb.fromNT(s);
|
|
15295
|
-
if (session && source.equals(session))
|
|
15296
|
-
continue;
|
|
15201
|
+
if (session && source.equals(session)) continue;
|
|
15297
15202
|
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
15203
|
}
|
|
15299
15204
|
kb.statementsMatching(void 0, kb.sym("http://www.w3.org/2007/ont/link#requestedURI")).map(function(st3) {
|
|
@@ -15303,8 +15208,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15303
15208
|
write("}.\n");
|
|
15304
15209
|
});
|
|
15305
15210
|
var metaSources = [];
|
|
15306
|
-
if (session)
|
|
15307
|
-
metaSources.push(session);
|
|
15211
|
+
if (session) metaSources.push(session);
|
|
15308
15212
|
var metadata = [];
|
|
15309
15213
|
metaSources.map(function(source2) {
|
|
15310
15214
|
metadata = metadata.concat(kb.statementsMatching(void 0, void 0, void 0, source2));
|
|
@@ -15322,8 +15226,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15322
15226
|
var liPrefix = "http://www.w3.org/1999/02/22-rdf-syntax-ns#_";
|
|
15323
15227
|
var spaces = function spaces2(n) {
|
|
15324
15228
|
var s = "";
|
|
15325
|
-
for (var i = 0; i < n; i++)
|
|
15326
|
-
s += " ";
|
|
15229
|
+
for (var i = 0; i < n; i++) s += " ";
|
|
15327
15230
|
return s;
|
|
15328
15231
|
};
|
|
15329
15232
|
var XMLtreeToLine = function XMLtreeToLine2(tree3) {
|
|
@@ -15339,8 +15242,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15339
15242
|
var str2 = "";
|
|
15340
15243
|
var line;
|
|
15341
15244
|
var lastLength = 1e5;
|
|
15342
|
-
if (!level)
|
|
15343
|
-
level = 0;
|
|
15245
|
+
if (!level) level = 0;
|
|
15344
15246
|
for (var i = 0; i < tree3.length; i++) {
|
|
15345
15247
|
var branch = tree3[i];
|
|
15346
15248
|
if (typeof branch !== "string") {
|
|
@@ -15352,8 +15254,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15352
15254
|
substr = "";
|
|
15353
15255
|
}
|
|
15354
15256
|
}
|
|
15355
|
-
if (substr)
|
|
15356
|
-
lastLength = 1e4;
|
|
15257
|
+
if (substr) lastLength = 1e4;
|
|
15357
15258
|
str2 += substr;
|
|
15358
15259
|
}
|
|
15359
15260
|
if (typeof branch === "string") {
|
|
@@ -15383,8 +15284,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15383
15284
|
}
|
|
15384
15285
|
var statementListToXMLTree = statementListToXMLTreeMethod.bind(this);
|
|
15385
15286
|
function escapeForXML(str2) {
|
|
15386
|
-
if (typeof str2 === "undefined")
|
|
15387
|
-
return "@@@undefined@@@@";
|
|
15287
|
+
if (typeof str2 === "undefined") return "@@@undefined@@@@";
|
|
15388
15288
|
return str2.replace(/[&<"]/g, function(m) {
|
|
15389
15289
|
switch (m[0]) {
|
|
15390
15290
|
case "&":
|
|
@@ -15480,8 +15380,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15480
15380
|
function propertyXMLTreeMethod(subject, stats) {
|
|
15481
15381
|
var results = [];
|
|
15482
15382
|
var sts2 = stats.subjects[this.toStr(subject)];
|
|
15483
|
-
if (!sts2)
|
|
15484
|
-
return results;
|
|
15383
|
+
if (!sts2) return results;
|
|
15485
15384
|
sts2.sort();
|
|
15486
15385
|
for (var i = 0; i < sts2.length; i++) {
|
|
15487
15386
|
var st3 = sts2[i];
|
|
@@ -15515,8 +15414,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15515
15414
|
if (j < 0 && this.flags.indexOf("/") < 0) {
|
|
15516
15415
|
j = uri.lastIndexOf("/");
|
|
15517
15416
|
}
|
|
15518
|
-
if (j < 0)
|
|
15519
|
-
throw new Error("Cannot make qname out of <" + uri + ">");
|
|
15417
|
+
if (j < 0) throw new Error("Cannot make qname out of <" + uri + ">");
|
|
15520
15418
|
for (var k = j + 1; k < uri.length; k++) {
|
|
15521
15419
|
if (this._notNameChars.indexOf(uri[k]) >= 0) {
|
|
15522
15420
|
throw new Error('Invalid character "' + uri[k] + '" cannot be in XML qname for URI: ' + uri);
|
|
@@ -15528,8 +15426,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15528
15426
|
return localid;
|
|
15529
15427
|
}
|
|
15530
15428
|
var prefix = this.prefixes[namesp];
|
|
15531
|
-
if (!prefix)
|
|
15532
|
-
prefix = this.makeUpPrefix(namesp);
|
|
15429
|
+
if (!prefix) prefix = this.makeUpPrefix(namesp);
|
|
15533
15430
|
namespaceCounts[namesp] = true;
|
|
15534
15431
|
return prefix + ":" + localid;
|
|
15535
15432
|
}
|
|
@@ -15540,8 +15437,7 @@ var Serializer = /* @__PURE__ */ function() {
|
|
|
15540
15437
|
str += ' xmlns="' + escapeForXML(this.defaultNamespace) + '"';
|
|
15541
15438
|
}
|
|
15542
15439
|
for (var ns3 in namespaceCounts) {
|
|
15543
|
-
if (!namespaceCounts.hasOwnProperty(ns3))
|
|
15544
|
-
continue;
|
|
15440
|
+
if (!namespaceCounts.hasOwnProperty(ns3)) continue;
|
|
15545
15441
|
var ns22 = this.base && this.flags.includes("z") ? uri_exports.refTo(this.base, ns3) : ns3;
|
|
15546
15442
|
str += "\n xmlns:" + this.prefixes[ns3] + '="' + escapeForXML(ns22) + '"';
|
|
15547
15443
|
}
|
|
@@ -15586,8 +15482,7 @@ function serialize(target, kb, base, contentType, callback, options) {
|
|
|
15586
15482
|
var documentString = void 0;
|
|
15587
15483
|
try {
|
|
15588
15484
|
var sz = createSerializer(kb);
|
|
15589
|
-
if (opts.flags)
|
|
15590
|
-
sz.setFlags(opts.flags);
|
|
15485
|
+
if (opts.flags) sz.setFlags(opts.flags);
|
|
15591
15486
|
var newSts = kb.statementsMatching(void 0, void 0, void 0, target);
|
|
15592
15487
|
if ("namespaces" in kb) {
|
|
15593
15488
|
sz.suggestNamespaces(kb.namespaces);
|
|
@@ -15666,8 +15561,7 @@ function arrayToStatements(rdfFactory, subject, data) {
|
|
|
15666
15561
|
function ArrayIndexOf(arr, item) {
|
|
15667
15562
|
var i = arguments.length > 2 && arguments[2] !== void 0 ? arguments[2] : 0;
|
|
15668
15563
|
var length = arr.length;
|
|
15669
|
-
if (i < 0)
|
|
15670
|
-
i = length + i;
|
|
15564
|
+
if (i < 0) i = length + i;
|
|
15671
15565
|
for (; i < length; i++) {
|
|
15672
15566
|
if (arr[i] === item) {
|
|
15673
15567
|
return i;
|
|
@@ -15681,14 +15575,12 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
15681
15575
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
15682
15576
|
if (!it) {
|
|
15683
15577
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
15684
|
-
if (it)
|
|
15685
|
-
o = it;
|
|
15578
|
+
if (it) o = it;
|
|
15686
15579
|
var i = 0;
|
|
15687
15580
|
var F = function F2() {
|
|
15688
15581
|
};
|
|
15689
15582
|
return { s: F, n: function n() {
|
|
15690
|
-
if (i >= o.length)
|
|
15691
|
-
return { done: true };
|
|
15583
|
+
if (i >= o.length) return { done: true };
|
|
15692
15584
|
return { done: false, value: o[i++] };
|
|
15693
15585
|
}, e: function e(_e) {
|
|
15694
15586
|
throw _e;
|
|
@@ -15708,32 +15600,23 @@ function _createForOfIteratorHelper(o, allowArrayLike) {
|
|
|
15708
15600
|
err = _e2;
|
|
15709
15601
|
}, f: function f() {
|
|
15710
15602
|
try {
|
|
15711
|
-
if (!normalCompletion && it.return != null)
|
|
15712
|
-
it.return();
|
|
15603
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
15713
15604
|
} finally {
|
|
15714
|
-
if (didErr)
|
|
15715
|
-
throw err;
|
|
15605
|
+
if (didErr) throw err;
|
|
15716
15606
|
}
|
|
15717
15607
|
} };
|
|
15718
15608
|
}
|
|
15719
15609
|
function _unsupportedIterableToArray(o, minLen) {
|
|
15720
|
-
if (!o)
|
|
15721
|
-
|
|
15722
|
-
if (typeof o === "string")
|
|
15723
|
-
return _arrayLikeToArray(o, minLen);
|
|
15610
|
+
if (!o) return;
|
|
15611
|
+
if (typeof o === "string") return _arrayLikeToArray(o, minLen);
|
|
15724
15612
|
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);
|
|
15613
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
15614
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
15615
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen);
|
|
15731
15616
|
}
|
|
15732
15617
|
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];
|
|
15618
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
15619
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
15737
15620
|
return arr2;
|
|
15738
15621
|
}
|
|
15739
15622
|
function _callSuper7(t, o, e) {
|
|
@@ -15947,8 +15830,7 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
15947
15830
|
var v;
|
|
15948
15831
|
bots = [];
|
|
15949
15832
|
for (var _k in types) {
|
|
15950
|
-
if (!types.hasOwnProperty(_k))
|
|
15951
|
-
continue;
|
|
15833
|
+
if (!types.hasOwnProperty(_k)) continue;
|
|
15952
15834
|
v = types[_k];
|
|
15953
15835
|
subs = this.each(void 0, this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"), this.rdfFactory.namedNode(_k));
|
|
15954
15836
|
bottom = true;
|
|
@@ -16052,8 +15934,7 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
16052
15934
|
members = {};
|
|
16053
15935
|
ref = this.transitiveClosure(seeds, this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"), true);
|
|
16054
15936
|
for (var t in ref) {
|
|
16055
|
-
if (!ref.hasOwnProperty(t))
|
|
16056
|
-
continue;
|
|
15937
|
+
if (!ref.hasOwnProperty(t)) continue;
|
|
16057
15938
|
ref1 = this.statementsMatching(void 0, this.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"), this.fromNT(t));
|
|
16058
15939
|
for (var i = 0, len = ref1.length; i < len; i++) {
|
|
16059
15940
|
st3 = ref1[i];
|
|
@@ -16209,11 +16090,9 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
16209
16090
|
};
|
|
16210
16091
|
var sts = self2.statementsMatching(null, null, x, doc).concat(self2.statementsMatching(x, null, null, doc));
|
|
16211
16092
|
sts = sts.filter(function(st3) {
|
|
16212
|
-
if (excludePredicateURIs[st3.predicate.value])
|
|
16213
|
-
return false;
|
|
16093
|
+
if (excludePredicateURIs[st3.predicate.value]) return false;
|
|
16214
16094
|
var hash = st3.toNT();
|
|
16215
|
-
if (doneArcs[hash])
|
|
16216
|
-
return false;
|
|
16095
|
+
if (doneArcs[hash]) return false;
|
|
16217
16096
|
doneArcs[hash] = true;
|
|
16218
16097
|
return true;
|
|
16219
16098
|
});
|
|
@@ -16343,8 +16222,7 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
16343
16222
|
var k, v;
|
|
16344
16223
|
var uris = {};
|
|
16345
16224
|
for (k in t) {
|
|
16346
|
-
if (!t.hasOwnProperty(k))
|
|
16347
|
-
continue;
|
|
16225
|
+
if (!t.hasOwnProperty(k)) continue;
|
|
16348
16226
|
v = t[k];
|
|
16349
16227
|
if (k[0] === "<") {
|
|
16350
16228
|
uris[k.slice(1, -1)] = v;
|
|
@@ -16420,8 +16298,7 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
16420
16298
|
while (true) {
|
|
16421
16299
|
t = function() {
|
|
16422
16300
|
for (var p in agenda) {
|
|
16423
|
-
if (!agenda.hasOwnProperty(p))
|
|
16424
|
-
continue;
|
|
16301
|
+
if (!agenda.hasOwnProperty(p)) continue;
|
|
16425
16302
|
return p;
|
|
16426
16303
|
}
|
|
16427
16304
|
}();
|
|
@@ -16463,8 +16340,7 @@ var Formula = /* @__PURE__ */ function(_Node) {
|
|
|
16463
16340
|
var v;
|
|
16464
16341
|
tops = [];
|
|
16465
16342
|
for (k in types) {
|
|
16466
|
-
if (!types.hasOwnProperty(k))
|
|
16467
|
-
continue;
|
|
16343
|
+
if (!types.hasOwnProperty(k)) continue;
|
|
16468
16344
|
v = types[k];
|
|
16469
16345
|
n = 0;
|
|
16470
16346
|
ref = this.each(this.rdfFactory.namedNode(k), this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"));
|
|
@@ -16529,8 +16405,7 @@ Node2.toJS = function(term2) {
|
|
|
16529
16405
|
if (isCollection(term2)) {
|
|
16530
16406
|
return term2.elements.map(Node2.toJS);
|
|
16531
16407
|
}
|
|
16532
|
-
if (!isLiteral(term2))
|
|
16533
|
-
return term2;
|
|
16408
|
+
if (!isLiteral(term2)) return term2;
|
|
16534
16409
|
if (term2.datatype.equals(ns.xsd("boolean"))) {
|
|
16535
16410
|
return term2.value === "1" || term2.value === "true";
|
|
16536
16411
|
}
|
|
@@ -16935,14 +16810,12 @@ function _createForOfIteratorHelper2(o, allowArrayLike) {
|
|
|
16935
16810
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
16936
16811
|
if (!it) {
|
|
16937
16812
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray2(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
16938
|
-
if (it)
|
|
16939
|
-
o = it;
|
|
16813
|
+
if (it) o = it;
|
|
16940
16814
|
var i = 0;
|
|
16941
16815
|
var F = function F2() {
|
|
16942
16816
|
};
|
|
16943
16817
|
return { s: F, n: function n() {
|
|
16944
|
-
if (i >= o.length)
|
|
16945
|
-
return { done: true };
|
|
16818
|
+
if (i >= o.length) return { done: true };
|
|
16946
16819
|
return { done: false, value: o[i++] };
|
|
16947
16820
|
}, e: function e(_e) {
|
|
16948
16821
|
throw _e;
|
|
@@ -16962,32 +16835,23 @@ function _createForOfIteratorHelper2(o, allowArrayLike) {
|
|
|
16962
16835
|
err = _e2;
|
|
16963
16836
|
}, f: function f() {
|
|
16964
16837
|
try {
|
|
16965
|
-
if (!normalCompletion && it.return != null)
|
|
16966
|
-
it.return();
|
|
16838
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
16967
16839
|
} finally {
|
|
16968
|
-
if (didErr)
|
|
16969
|
-
throw err;
|
|
16840
|
+
if (didErr) throw err;
|
|
16970
16841
|
}
|
|
16971
16842
|
} };
|
|
16972
16843
|
}
|
|
16973
16844
|
function _unsupportedIterableToArray2(o, minLen) {
|
|
16974
|
-
if (!o)
|
|
16975
|
-
|
|
16976
|
-
if (typeof o === "string")
|
|
16977
|
-
return _arrayLikeToArray2(o, minLen);
|
|
16845
|
+
if (!o) return;
|
|
16846
|
+
if (typeof o === "string") return _arrayLikeToArray2(o, minLen);
|
|
16978
16847
|
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);
|
|
16848
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
16849
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
16850
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray2(o, minLen);
|
|
16985
16851
|
}
|
|
16986
16852
|
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];
|
|
16853
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
16854
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
16991
16855
|
return arr2;
|
|
16992
16856
|
}
|
|
16993
16857
|
var RDF = Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#");
|
|
@@ -17064,11 +16928,9 @@ function substituteNillsInDoc(store, doc) {
|
|
|
17064
16928
|
function convertFirstRestNil(store, doc) {
|
|
17065
16929
|
function preceding(ele, listSoFar, trash) {
|
|
17066
16930
|
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));
|
|
16931
|
+
if (rests.length !== 1) throw new Error("Bad list structure: no rest at ".concat(ele));
|
|
17069
16932
|
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));
|
|
16933
|
+
if (firsts.length !== 1) throw new Error("Bad list structure: rest but ".concat(firsts.length, " firsts at ").concat(ele));
|
|
17072
16934
|
var value = firsts[0].object;
|
|
17073
16935
|
var total = [value].concat(listSoFar);
|
|
17074
16936
|
var totalTrash = trash.concat(rests).concat(firsts);
|
|
@@ -17079,19 +16941,16 @@ function convertFirstRestNil(store, doc) {
|
|
|
17079
16941
|
substituteInDoc(store, newList, ele, doc);
|
|
17080
16942
|
return;
|
|
17081
16943
|
}
|
|
17082
|
-
if (pres.length !== 1)
|
|
17083
|
-
throw new Error("Bad list structure: ".concat(pres.length, " pres at ").concat(ele));
|
|
16944
|
+
if (pres.length !== 1) throw new Error("Bad list structure: ".concat(pres.length, " pres at ").concat(ele));
|
|
17084
16945
|
var pre = pres[0].subject;
|
|
17085
|
-
if (pre.termType !== "BlankNode")
|
|
17086
|
-
throw new Error("Bad list element node ".concat(pre, " type: ").concat(pre.termType, " "));
|
|
16946
|
+
if (pre.termType !== "BlankNode") throw new Error("Bad list element node ".concat(pre, " type: ").concat(pre.termType, " "));
|
|
17087
16947
|
preceding(pre, total, totalTrash);
|
|
17088
16948
|
return;
|
|
17089
16949
|
}
|
|
17090
16950
|
substituteNillsInDoc(store, doc);
|
|
17091
16951
|
var tails = store.statementsMatching(null, RDF("rest"), RDF("nil"), doc);
|
|
17092
16952
|
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, " "));
|
|
16953
|
+
if (tail.subject.termType !== "BlankNode") throw new Error("Bad list element node ".concat(tail.subject, " type: ").concat(tail.subject.termType, " "));
|
|
17095
16954
|
preceding(tail.subject, [], []);
|
|
17096
16955
|
});
|
|
17097
16956
|
}
|
|
@@ -17148,18 +17007,15 @@ var pyjslib_List = function pyjslib_List2(theList) {
|
|
|
17148
17007
|
return theList;
|
|
17149
17008
|
};
|
|
17150
17009
|
var pyjslib_Dict = function pyjslib_Dict2(listOfPairs) {
|
|
17151
|
-
if (listOfPairs.length > 0)
|
|
17152
|
-
throw "missing.js: oops nnonempty dict not imp";
|
|
17010
|
+
if (listOfPairs.length > 0) throw "missing.js: oops nnonempty dict not imp";
|
|
17153
17011
|
return [];
|
|
17154
17012
|
};
|
|
17155
17013
|
var pyjslib_len = function pyjslib_len2(s) {
|
|
17156
17014
|
return s.length;
|
|
17157
17015
|
};
|
|
17158
17016
|
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);
|
|
17017
|
+
if (typeof str.slice == "undefined") throw "@@ mising.js: No .slice function for " + str + " of type " + _typeof(str);
|
|
17018
|
+
if (typeof j == "undefined" || j == null) return str.slice(i);
|
|
17163
17019
|
return str.slice(i, j);
|
|
17164
17020
|
};
|
|
17165
17021
|
var StopIteration = Error("dummy error stop iteration");
|
|
@@ -17167,8 +17023,7 @@ var pyjslib_Iterator = function pyjslib_Iterator2(theList) {
|
|
|
17167
17023
|
this.last = 0;
|
|
17168
17024
|
this.li = theList;
|
|
17169
17025
|
this.next = function() {
|
|
17170
|
-
if (this.last == this.li.length)
|
|
17171
|
-
throw StopIteration;
|
|
17026
|
+
if (this.last == this.li.length) throw StopIteration;
|
|
17172
17027
|
return this.li[this.last++];
|
|
17173
17028
|
};
|
|
17174
17029
|
return this;
|
|
@@ -17177,23 +17032,19 @@ var string_find = function string_find2(str, s) {
|
|
|
17177
17032
|
return str.indexOf(s);
|
|
17178
17033
|
};
|
|
17179
17034
|
var assertFudge = function assertFudge2(condition, desc) {
|
|
17180
|
-
if (condition)
|
|
17181
|
-
|
|
17182
|
-
if (desc)
|
|
17183
|
-
throw "python Assertion failed: " + desc;
|
|
17035
|
+
if (condition) return;
|
|
17036
|
+
if (desc) throw "python Assertion failed: " + desc;
|
|
17184
17037
|
throw "(python) Assertion failed.";
|
|
17185
17038
|
};
|
|
17186
17039
|
var stringFromCharCode = function stringFromCharCode2(uesc) {
|
|
17187
17040
|
return String.fromCharCode(uesc);
|
|
17188
17041
|
};
|
|
17189
17042
|
String.prototype.encode = function(encoding) {
|
|
17190
|
-
if (encoding != "utf-8")
|
|
17191
|
-
throw "UTF8_converter: can only do utf-8";
|
|
17043
|
+
if (encoding != "utf-8") throw "UTF8_converter: can only do utf-8";
|
|
17192
17044
|
return Utf8.encode(this);
|
|
17193
17045
|
};
|
|
17194
17046
|
String.prototype.decode = function(encoding) {
|
|
17195
|
-
if (encoding != "utf-8")
|
|
17196
|
-
throw "UTF8_converter: can only do utf-8";
|
|
17047
|
+
if (encoding != "utf-8") throw "UTF8_converter: can only do utf-8";
|
|
17197
17048
|
return this;
|
|
17198
17049
|
};
|
|
17199
17050
|
var uripath_join = function uripath_join2(base, given) {
|
|
@@ -17231,20 +17082,13 @@ var n3parser_default = createSinkParser;
|
|
|
17231
17082
|
var SinkParser = /* @__PURE__ */ function() {
|
|
17232
17083
|
function SinkParser2(store, openFormula, thisDoc, baseURI, genPrefix, metaURI, flags, why) {
|
|
17233
17084
|
_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;
|
|
17085
|
+
if (typeof openFormula == "undefined") openFormula = null;
|
|
17086
|
+
if (typeof thisDoc == "undefined") thisDoc = "";
|
|
17087
|
+
if (typeof baseURI == "undefined") baseURI = null;
|
|
17088
|
+
if (typeof genPrefix == "undefined") genPrefix = "";
|
|
17089
|
+
if (typeof metaURI == "undefined") metaURI = null;
|
|
17090
|
+
if (typeof flags == "undefined") flags = "";
|
|
17091
|
+
if (typeof why == "undefined") why = null;
|
|
17248
17092
|
this._bindings = new pyjslib_Dict([]);
|
|
17249
17093
|
this._flags = flags;
|
|
17250
17094
|
if (thisDoc != "") {
|
|
@@ -17668,8 +17512,7 @@ var SinkParser = /* @__PURE__ */ function() {
|
|
|
17668
17512
|
}, {
|
|
17669
17513
|
key: "node",
|
|
17670
17514
|
value: function node(str, i, res, subjectAlready) {
|
|
17671
|
-
if (typeof subjectAlready == "undefined")
|
|
17672
|
-
subjectAlready = null;
|
|
17515
|
+
if (typeof subjectAlready == "undefined") subjectAlready = null;
|
|
17673
17516
|
var subj = subjectAlready;
|
|
17674
17517
|
var j = this.skipSpace(str, i);
|
|
17675
17518
|
if (j < 0) {
|
|
@@ -18560,7 +18403,7 @@ function listToCollection(kb, obj) {
|
|
|
18560
18403
|
}
|
|
18561
18404
|
function jsonldParser(str, kb, base, callback) {
|
|
18562
18405
|
var baseString = base && Object.prototype.hasOwnProperty.call(base, "termType") ? base.value : base;
|
|
18563
|
-
return import("./jsonld-
|
|
18406
|
+
return import("./jsonld-ECVURSS6.js").then(function(jsonld) {
|
|
18564
18407
|
return jsonld.flatten(JSON.parse(str), null, {
|
|
18565
18408
|
base: baseString
|
|
18566
18409
|
});
|
|
@@ -18771,6 +18614,7 @@ var N3Lexer = class {
|
|
|
18771
18614
|
}
|
|
18772
18615
|
break;
|
|
18773
18616
|
}
|
|
18617
|
+
// Fall through in case the type is an IRI
|
|
18774
18618
|
case "<":
|
|
18775
18619
|
if (match = this._unescapedIri.exec(input))
|
|
18776
18620
|
type = "IRI", value = match[1];
|
|
@@ -18836,6 +18680,7 @@ var N3Lexer = class {
|
|
|
18836
18680
|
matchLength = 1;
|
|
18837
18681
|
break;
|
|
18838
18682
|
}
|
|
18683
|
+
// Fall through to numerical case (could be a decimal dot)
|
|
18839
18684
|
case "0":
|
|
18840
18685
|
case "1":
|
|
18841
18686
|
case "2":
|
|
@@ -19027,8 +18872,7 @@ var N3Lexer = class {
|
|
|
19027
18872
|
const tokens = [];
|
|
19028
18873
|
let error2;
|
|
19029
18874
|
this._tokenizeToEnd((e, t) => e ? error2 = e : tokens.push(t), true);
|
|
19030
|
-
if (error2)
|
|
19031
|
-
throw error2;
|
|
18875
|
+
if (error2) throw error2;
|
|
19032
18876
|
return tokens;
|
|
19033
18877
|
}
|
|
19034
18878
|
} else {
|
|
@@ -19349,19 +19193,23 @@ var N3Parser = class {
|
|
|
19349
19193
|
// ### `_readInTopContext` reads a token when in the top context
|
|
19350
19194
|
_readInTopContext(token) {
|
|
19351
19195
|
switch (token.type) {
|
|
19196
|
+
// If an EOF token arrives in the top context, signal that we're done
|
|
19352
19197
|
case "eof":
|
|
19353
19198
|
if (this._graph !== null)
|
|
19354
19199
|
return this._error("Unclosed graph", token);
|
|
19355
19200
|
delete this._prefixes._;
|
|
19356
19201
|
return this._callback(null, null, this._prefixes);
|
|
19202
|
+
// It could be a prefix declaration
|
|
19357
19203
|
case "PREFIX":
|
|
19358
19204
|
this._sparqlStyle = true;
|
|
19359
19205
|
case "@prefix":
|
|
19360
19206
|
return this._readPrefix;
|
|
19207
|
+
// It could be a base declaration
|
|
19361
19208
|
case "BASE":
|
|
19362
19209
|
this._sparqlStyle = true;
|
|
19363
19210
|
case "@base":
|
|
19364
19211
|
return this._readBaseIRI;
|
|
19212
|
+
// It could be a graph
|
|
19365
19213
|
case "{":
|
|
19366
19214
|
if (this._supportsNamedGraphs) {
|
|
19367
19215
|
this._graph = "";
|
|
@@ -19371,6 +19219,7 @@ var N3Parser = class {
|
|
|
19371
19219
|
case "GRAPH":
|
|
19372
19220
|
if (this._supportsNamedGraphs)
|
|
19373
19221
|
return this._readNamedGraphLabel;
|
|
19222
|
+
// Otherwise, the next token must be a subject
|
|
19374
19223
|
default:
|
|
19375
19224
|
return this._readSubject(token);
|
|
19376
19225
|
}
|
|
@@ -19379,6 +19228,7 @@ var N3Parser = class {
|
|
|
19379
19228
|
_readEntity(token, quantifier) {
|
|
19380
19229
|
let value;
|
|
19381
19230
|
switch (token.type) {
|
|
19231
|
+
// Read a relative or absolute IRI
|
|
19382
19232
|
case "IRI":
|
|
19383
19233
|
case "typeIRI":
|
|
19384
19234
|
const iri = this._resolveIRI(token.value);
|
|
@@ -19386,6 +19236,7 @@ var N3Parser = class {
|
|
|
19386
19236
|
return this._error("Invalid IRI", token);
|
|
19387
19237
|
value = this._namedNode(iri);
|
|
19388
19238
|
break;
|
|
19239
|
+
// Read a prefixed name
|
|
19389
19240
|
case "type":
|
|
19390
19241
|
case "prefixed":
|
|
19391
19242
|
const prefix = this._prefixes[token.prefix];
|
|
@@ -19393,12 +19244,15 @@ var N3Parser = class {
|
|
|
19393
19244
|
return this._error(`Undefined prefix "${token.prefix}:"`, token);
|
|
19394
19245
|
value = this._namedNode(prefix + token.value);
|
|
19395
19246
|
break;
|
|
19247
|
+
// Read a blank node
|
|
19396
19248
|
case "blank":
|
|
19397
19249
|
value = this._blankNode(this._prefixes[token.prefix] + token.value);
|
|
19398
19250
|
break;
|
|
19251
|
+
// Read a variable
|
|
19399
19252
|
case "var":
|
|
19400
19253
|
value = this._variable(token.value.substr(1));
|
|
19401
19254
|
break;
|
|
19255
|
+
// Everything else is not an entity
|
|
19402
19256
|
default:
|
|
19403
19257
|
return this._error(`Expected entity but got ${token.type}`, token);
|
|
19404
19258
|
}
|
|
@@ -19702,14 +19556,15 @@ var N3Parser = class {
|
|
|
19702
19556
|
_completeLiteral(token) {
|
|
19703
19557
|
let literal4 = this._literal(this._literalValue);
|
|
19704
19558
|
switch (token.type) {
|
|
19559
|
+
// Create a datatyped literal
|
|
19705
19560
|
case "type":
|
|
19706
19561
|
case "typeIRI":
|
|
19707
19562
|
const datatype = this._readEntity(token);
|
|
19708
|
-
if (datatype === void 0)
|
|
19709
|
-
return;
|
|
19563
|
+
if (datatype === void 0) return;
|
|
19710
19564
|
literal4 = this._literal(this._literalValue, datatype);
|
|
19711
19565
|
token = null;
|
|
19712
19566
|
break;
|
|
19567
|
+
// Create a language-tagged string
|
|
19713
19568
|
case "langcode":
|
|
19714
19569
|
literal4 = this._literal(this._literalValue, token.value);
|
|
19715
19570
|
token = null;
|
|
@@ -19751,24 +19606,28 @@ var N3Parser = class {
|
|
|
19751
19606
|
let next, graph3 = this._graph;
|
|
19752
19607
|
const subject = this._subject, inversePredicate = this._inversePredicate;
|
|
19753
19608
|
switch (token.type) {
|
|
19609
|
+
// A closing brace ends a graph
|
|
19754
19610
|
case "}":
|
|
19755
19611
|
if (this._graph === null)
|
|
19756
19612
|
return this._error("Unexpected graph closing", token);
|
|
19757
19613
|
if (this._n3Mode)
|
|
19758
19614
|
return this._readFormulaTail(token);
|
|
19759
19615
|
this._graph = null;
|
|
19616
|
+
// A dot just ends the statement, without sharing anything with the next
|
|
19760
19617
|
case ".":
|
|
19761
19618
|
this._subject = null;
|
|
19762
19619
|
next = this._contextStack.length ? this._readSubject : this._readInTopContext;
|
|
19763
|
-
if (inversePredicate)
|
|
19764
|
-
this._inversePredicate = false;
|
|
19620
|
+
if (inversePredicate) this._inversePredicate = false;
|
|
19765
19621
|
break;
|
|
19622
|
+
// Semicolon means the subject is shared; predicate and object are different
|
|
19766
19623
|
case ";":
|
|
19767
19624
|
next = this._readPredicate;
|
|
19768
19625
|
break;
|
|
19626
|
+
// Comma means both the subject and predicate are shared; the object is different
|
|
19769
19627
|
case ",":
|
|
19770
19628
|
next = this._readObject;
|
|
19771
19629
|
break;
|
|
19630
|
+
// {| means that the current triple is annotated with predicate-object pairs.
|
|
19772
19631
|
case "{|":
|
|
19773
19632
|
if (!this._supportsRDFStar)
|
|
19774
19633
|
return this._error("Unexpected RDF* syntax", token);
|
|
@@ -19776,6 +19635,7 @@ var N3Parser = class {
|
|
|
19776
19635
|
this._subject = this._quad(subject, predicate, object, this.DEFAULTGRAPH);
|
|
19777
19636
|
next = this._readPredicate;
|
|
19778
19637
|
break;
|
|
19638
|
+
// |} means that the current quoted triple in annotation syntax is finalized.
|
|
19779
19639
|
case "|}":
|
|
19780
19640
|
if (this._subject.termType !== "Quad")
|
|
19781
19641
|
return this._error("Unexpected asserted triple closing", token);
|
|
@@ -19802,9 +19662,11 @@ var N3Parser = class {
|
|
|
19802
19662
|
_readBlankNodePunctuation(token) {
|
|
19803
19663
|
let next;
|
|
19804
19664
|
switch (token.type) {
|
|
19665
|
+
// Semicolon means the subject is shared; predicate and object are different
|
|
19805
19666
|
case ";":
|
|
19806
19667
|
next = this._readPredicate;
|
|
19807
19668
|
break;
|
|
19669
|
+
// Comma means both the subject and predicate are shared; the object is different
|
|
19808
19670
|
case ",":
|
|
19809
19671
|
next = this._readObject;
|
|
19810
19672
|
break;
|
|
@@ -19927,10 +19789,13 @@ var N3Parser = class {
|
|
|
19927
19789
|
// ### `_readPath` reads a potential path
|
|
19928
19790
|
_readPath(token) {
|
|
19929
19791
|
switch (token.type) {
|
|
19792
|
+
// Forward path
|
|
19930
19793
|
case "!":
|
|
19931
19794
|
return this._readForwardPath;
|
|
19795
|
+
// Backward path
|
|
19932
19796
|
case "^":
|
|
19933
19797
|
return this._readBackwardPath;
|
|
19798
|
+
// Not a path; resume reading where we left off
|
|
19934
19799
|
default:
|
|
19935
19800
|
const stack = this._contextStack, parent = stack.length && stack[stack.length - 1];
|
|
19936
19801
|
if (parent && parent.type === "item") {
|
|
@@ -20036,12 +19901,16 @@ var N3Parser = class {
|
|
|
20036
19901
|
if (!iri.length)
|
|
20037
19902
|
return this._base;
|
|
20038
19903
|
switch (iri[0]) {
|
|
19904
|
+
// Resolve relative fragment IRIs against the base IRI
|
|
20039
19905
|
case "#":
|
|
20040
19906
|
return this._base + iri;
|
|
19907
|
+
// Resolve relative query string IRIs by replacing the query string
|
|
20041
19908
|
case "?":
|
|
20042
19909
|
return this._base.replace(/(?:\?.*)?$/, iri);
|
|
19910
|
+
// Resolve root-relative IRIs at the root of the base IRI
|
|
20043
19911
|
case "/":
|
|
20044
19912
|
return (iri[1] === "/" ? this._baseScheme : this._baseRoot) + this._removeDotSegments(iri);
|
|
19913
|
+
// Resolve all other IRIs at the base IRI's path
|
|
20045
19914
|
default:
|
|
20046
19915
|
return /^[^/:]*:/.test(iri) ? null : this._removeDotSegments(this._basePath + iri);
|
|
20047
19916
|
}
|
|
@@ -20054,6 +19923,7 @@ var N3Parser = class {
|
|
|
20054
19923
|
let result = "", i = -1, pathStart = -1, segmentStart = 0, next = "/";
|
|
20055
19924
|
while (i < length) {
|
|
20056
19925
|
switch (next) {
|
|
19926
|
+
// The path starts with the first slash after the authority
|
|
20057
19927
|
case ":":
|
|
20058
19928
|
if (pathStart < 0) {
|
|
20059
19929
|
if (iri[++i] === "/" && iri[++i] === "/")
|
|
@@ -20061,22 +19931,27 @@ var N3Parser = class {
|
|
|
20061
19931
|
i = pathStart;
|
|
20062
19932
|
}
|
|
20063
19933
|
break;
|
|
19934
|
+
// Don't modify a query string or fragment
|
|
20064
19935
|
case "?":
|
|
20065
19936
|
case "#":
|
|
20066
19937
|
i = length;
|
|
20067
19938
|
break;
|
|
19939
|
+
// Handle '/.' or '/..' path segments
|
|
20068
19940
|
case "/":
|
|
20069
19941
|
if (iri[i + 1] === ".") {
|
|
20070
19942
|
next = iri[++i + 1];
|
|
20071
19943
|
switch (next) {
|
|
19944
|
+
// Remove a '/.' segment
|
|
20072
19945
|
case "/":
|
|
20073
19946
|
result += iri.substring(segmentStart, i - 1);
|
|
20074
19947
|
segmentStart = i + 1;
|
|
20075
19948
|
break;
|
|
19949
|
+
// Remove a trailing '/.' segment
|
|
20076
19950
|
case void 0:
|
|
20077
19951
|
case "?":
|
|
20078
19952
|
case "#":
|
|
20079
19953
|
return result + iri.substring(segmentStart, i) + iri.substr(i + 1);
|
|
19954
|
+
// Remove a '/..' segment
|
|
20080
19955
|
case ".":
|
|
20081
19956
|
next = iri[++i + 1];
|
|
20082
19957
|
if (next === void 0 || next === "/" || next === "?" || next === "#") {
|
|
@@ -20113,8 +19988,7 @@ var N3Parser = class {
|
|
|
20113
19988
|
this._lexer.tokenize(input).every((token) => {
|
|
20114
19989
|
return this._readCallback = this._readCallback(token);
|
|
20115
19990
|
});
|
|
20116
|
-
if (error2)
|
|
20117
|
-
throw error2;
|
|
19991
|
+
if (error2) throw error2;
|
|
20118
19992
|
return quads;
|
|
20119
19993
|
}
|
|
20120
19994
|
this._callback = quadCallback;
|
|
@@ -21011,8 +20885,7 @@ var RDFaProcessor = /* @__PURE__ */ function() {
|
|
|
21011
20885
|
key: "toRDFNodeObject",
|
|
21012
20886
|
value: function toRDFNodeObject(x) {
|
|
21013
20887
|
var _this = this;
|
|
21014
|
-
if (typeof x === "undefined")
|
|
21015
|
-
return void 0;
|
|
20888
|
+
if (typeof x === "undefined") return void 0;
|
|
21016
20889
|
if (typeof x === "string") {
|
|
21017
20890
|
if (x.substring(0, 2) === "_:") {
|
|
21018
20891
|
if (typeof this.blankNodes[x.substring(2)] === "undefined") {
|
|
@@ -21299,10 +21172,8 @@ var RDFParser = /* @__PURE__ */ function() {
|
|
|
21299
21172
|
if (el.localName) {
|
|
21300
21173
|
result = result + el.localName;
|
|
21301
21174
|
} else if (el.nodeName) {
|
|
21302
|
-
if (el.nodeName.indexOf(":") >= 0)
|
|
21303
|
-
|
|
21304
|
-
else
|
|
21305
|
-
result = result + el.nodeName;
|
|
21175
|
+
if (el.nodeName.indexOf(":") >= 0) result = result + el.nodeName.split(":")[1];
|
|
21176
|
+
else result = result + el.nodeName;
|
|
21306
21177
|
}
|
|
21307
21178
|
return result;
|
|
21308
21179
|
}.bind(this);
|
|
@@ -21485,8 +21356,7 @@ var RDFParser = /* @__PURE__ */ function() {
|
|
|
21485
21356
|
if (attrs[x].nodeName.substr(0, 3) === "xml") {
|
|
21486
21357
|
if (attrs[x].name.slice(0, 6) === "xmlns:") {
|
|
21487
21358
|
var uri = attrs[x].nodeValue;
|
|
21488
|
-
if (this.base)
|
|
21489
|
-
uri = join(uri, this.base);
|
|
21359
|
+
if (this.base) uri = join(uri, this.base);
|
|
21490
21360
|
this.store.setPrefixForURI(attrs[x].name.slice(6), uri);
|
|
21491
21361
|
}
|
|
21492
21362
|
element.removeAttributeNode(attrs[x]);
|
|
@@ -21683,14 +21553,12 @@ function _createForOfIteratorHelper3(o, allowArrayLike) {
|
|
|
21683
21553
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
21684
21554
|
if (!it) {
|
|
21685
21555
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray3(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
21686
|
-
if (it)
|
|
21687
|
-
o = it;
|
|
21556
|
+
if (it) o = it;
|
|
21688
21557
|
var i = 0;
|
|
21689
21558
|
var F = function F2() {
|
|
21690
21559
|
};
|
|
21691
21560
|
return { s: F, n: function n() {
|
|
21692
|
-
if (i >= o.length)
|
|
21693
|
-
return { done: true };
|
|
21561
|
+
if (i >= o.length) return { done: true };
|
|
21694
21562
|
return { done: false, value: o[i++] };
|
|
21695
21563
|
}, e: function e(_e) {
|
|
21696
21564
|
throw _e;
|
|
@@ -21710,32 +21578,23 @@ function _createForOfIteratorHelper3(o, allowArrayLike) {
|
|
|
21710
21578
|
err = _e2;
|
|
21711
21579
|
}, f: function f() {
|
|
21712
21580
|
try {
|
|
21713
|
-
if (!normalCompletion && it.return != null)
|
|
21714
|
-
it.return();
|
|
21581
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
21715
21582
|
} finally {
|
|
21716
|
-
if (didErr)
|
|
21717
|
-
throw err;
|
|
21583
|
+
if (didErr) throw err;
|
|
21718
21584
|
}
|
|
21719
21585
|
} };
|
|
21720
21586
|
}
|
|
21721
21587
|
function _unsupportedIterableToArray3(o, minLen) {
|
|
21722
|
-
if (!o)
|
|
21723
|
-
|
|
21724
|
-
if (typeof o === "string")
|
|
21725
|
-
return _arrayLikeToArray3(o, minLen);
|
|
21588
|
+
if (!o) return;
|
|
21589
|
+
if (typeof o === "string") return _arrayLikeToArray3(o, minLen);
|
|
21726
21590
|
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);
|
|
21591
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
21592
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
21593
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray3(o, minLen);
|
|
21733
21594
|
}
|
|
21734
21595
|
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];
|
|
21596
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
21597
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
21739
21598
|
return arr2;
|
|
21740
21599
|
}
|
|
21741
21600
|
function _callSuper8(t, o, e) {
|
|
@@ -22290,42 +22149,41 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
22290
22149
|
var _this3 = this;
|
|
22291
22150
|
var pendingPromise;
|
|
22292
22151
|
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;
|
|
22152
|
+
while (1) switch (_context.prev = _context.next) {
|
|
22153
|
+
case 0:
|
|
22154
|
+
_context.t0 = !options.force;
|
|
22155
|
+
if (!_context.t0) {
|
|
22156
|
+
_context.next = 5;
|
|
22312
22157
|
break;
|
|
22313
|
-
|
|
22314
|
-
|
|
22315
|
-
|
|
22316
|
-
|
|
22317
|
-
|
|
22318
|
-
|
|
22319
|
-
|
|
22320
|
-
|
|
22321
|
-
|
|
22322
|
-
|
|
22323
|
-
|
|
22324
|
-
|
|
22325
|
-
|
|
22326
|
-
|
|
22327
|
-
|
|
22328
|
-
|
|
22158
|
+
}
|
|
22159
|
+
_context.next = 4;
|
|
22160
|
+
return this.fetchQueue[originalUri];
|
|
22161
|
+
case 4:
|
|
22162
|
+
_context.t0 = _context.sent;
|
|
22163
|
+
case 5:
|
|
22164
|
+
if (!_context.t0) {
|
|
22165
|
+
_context.next = 9;
|
|
22166
|
+
break;
|
|
22167
|
+
}
|
|
22168
|
+
pendingPromise = this.fetchQueue[originalUri];
|
|
22169
|
+
_context.next = 12;
|
|
22170
|
+
break;
|
|
22171
|
+
case 9:
|
|
22172
|
+
pendingPromise = Promise.race([this.setRequestTimeout(uri, options), this.fetchUri(uri, options)]);
|
|
22173
|
+
this.fetchQueue[originalUri] = pendingPromise;
|
|
22174
|
+
this.cleanupFetchRequest(originalUri, void 0, this.timeout);
|
|
22175
|
+
case 12:
|
|
22176
|
+
return _context.abrupt("return", pendingPromise.then(function(x) {
|
|
22177
|
+
if (uri in _this3.timeouts) {
|
|
22178
|
+
_this3.timeouts[uri].forEach(clearTimeout);
|
|
22179
|
+
delete _this3.timeouts[uri];
|
|
22180
|
+
}
|
|
22181
|
+
return x;
|
|
22182
|
+
}));
|
|
22183
|
+
case 13:
|
|
22184
|
+
case "end":
|
|
22185
|
+
return _context.stop();
|
|
22186
|
+
}
|
|
22329
22187
|
}, _callee, this);
|
|
22330
22188
|
}));
|
|
22331
22189
|
function pendingFetchPromise(_x, _x2, _x3) {
|
|
@@ -22576,8 +22434,7 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
22576
22434
|
}, {
|
|
22577
22435
|
key: "linkData",
|
|
22578
22436
|
value: function linkData(originalUri, rel, uri, why, reverse) {
|
|
22579
|
-
if (!uri)
|
|
22580
|
-
return;
|
|
22437
|
+
if (!uri) return;
|
|
22581
22438
|
var kb = this.store;
|
|
22582
22439
|
var predicate;
|
|
22583
22440
|
var obj = kb.rdfFactory.namedNode(join(uri, originalUri.value));
|
|
@@ -22606,15 +22463,13 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
22606
22463
|
var linkexp = /<[^>]*>\s*(\s*;\s*[^()<>@,;:"/[\]?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*")))*(,|$)/g;
|
|
22607
22464
|
var paramexp = /[^\(\)<>@,;:"\/\[\]\?={} \t]+=(([^\(\)<>@,;:"\/\[\]\?={} \t]+)|("[^"]*"))/g;
|
|
22608
22465
|
var matches = linkHeader.match(linkexp);
|
|
22609
|
-
if (matches == null)
|
|
22610
|
-
return;
|
|
22466
|
+
if (matches == null) return;
|
|
22611
22467
|
for (var i = 0; i < matches.length; i++) {
|
|
22612
22468
|
var split = matches[i].split(">");
|
|
22613
22469
|
var href = split[0].substring(1);
|
|
22614
22470
|
var ps = split[1];
|
|
22615
22471
|
var s = ps.match(paramexp);
|
|
22616
|
-
if (s == null)
|
|
22617
|
-
return;
|
|
22472
|
+
if (s == null) return;
|
|
22618
22473
|
for (var j = 0; j < s.length; j++) {
|
|
22619
22474
|
var p = s[j];
|
|
22620
22475
|
var paramsplit = p.split("=");
|
|
@@ -22718,51 +22573,50 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
22718
22573
|
var _createIfNotExists = _asyncToGenerator(/* @__PURE__ */ import_regenerator.default.mark(function _callee2(doc) {
|
|
22719
22574
|
var contentType, data, fetcher3, response, _args2 = arguments;
|
|
22720
22575
|
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;
|
|
22576
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
22577
|
+
case 0:
|
|
22578
|
+
contentType = _args2.length > 1 && _args2[1] !== void 0 ? _args2[1] : TurtleContentType;
|
|
22579
|
+
data = _args2.length > 2 && _args2[2] !== void 0 ? _args2[2] : "";
|
|
22580
|
+
fetcher3 = this;
|
|
22581
|
+
_context2.prev = 3;
|
|
22582
|
+
_context2.next = 6;
|
|
22583
|
+
return fetcher3.load(doc);
|
|
22584
|
+
case 6:
|
|
22585
|
+
response = _context2.sent;
|
|
22586
|
+
_context2.next = 26;
|
|
22587
|
+
break;
|
|
22588
|
+
case 9:
|
|
22589
|
+
_context2.prev = 9;
|
|
22590
|
+
_context2.t0 = _context2["catch"](3);
|
|
22591
|
+
if (!(_context2.t0.response.status === 404)) {
|
|
22592
|
+
_context2.next = 25;
|
|
22750
22593
|
break;
|
|
22751
|
-
|
|
22752
|
-
|
|
22753
|
-
|
|
22754
|
-
|
|
22755
|
-
|
|
22756
|
-
|
|
22757
|
-
|
|
22758
|
-
|
|
22759
|
-
|
|
22760
|
-
|
|
22761
|
-
|
|
22762
|
-
|
|
22763
|
-
|
|
22764
|
-
|
|
22765
|
-
|
|
22594
|
+
}
|
|
22595
|
+
_context2.prev = 12;
|
|
22596
|
+
_context2.next = 15;
|
|
22597
|
+
return fetcher3.webOperation("PUT", doc.value, {
|
|
22598
|
+
data,
|
|
22599
|
+
contentType
|
|
22600
|
+
});
|
|
22601
|
+
case 15:
|
|
22602
|
+
response = _context2.sent;
|
|
22603
|
+
_context2.next = 21;
|
|
22604
|
+
break;
|
|
22605
|
+
case 18:
|
|
22606
|
+
_context2.prev = 18;
|
|
22607
|
+
_context2.t1 = _context2["catch"](12);
|
|
22608
|
+
throw _context2.t1;
|
|
22609
|
+
case 21:
|
|
22610
|
+
delete fetcher3.requested[doc.value];
|
|
22611
|
+
return _context2.abrupt("return", response);
|
|
22612
|
+
case 25:
|
|
22613
|
+
throw _context2.t0;
|
|
22614
|
+
case 26:
|
|
22615
|
+
return _context2.abrupt("return", response);
|
|
22616
|
+
case 27:
|
|
22617
|
+
case "end":
|
|
22618
|
+
return _context2.stop();
|
|
22619
|
+
}
|
|
22766
22620
|
}, _callee2, this, [[3, 9], [12, 18]]);
|
|
22767
22621
|
}));
|
|
22768
22622
|
function createIfNotExists(_x4) {
|
|
@@ -22850,11 +22704,9 @@ var Fetcher = /* @__PURE__ */ function() {
|
|
|
22850
22704
|
}
|
|
22851
22705
|
} else {
|
|
22852
22706
|
var msg2 = "Web error: " + response.status;
|
|
22853
|
-
if (response.statusText)
|
|
22854
|
-
msg2 += " (" + response.statusText + ")";
|
|
22707
|
+
if (response.statusText) msg2 += " (" + response.statusText + ")";
|
|
22855
22708
|
msg2 += " on " + method + " of <" + uri + ">";
|
|
22856
|
-
if (response.responseText)
|
|
22857
|
-
msg2 += ": " + response.responseText;
|
|
22709
|
+
if (response.responseText) msg2 += ": " + response.responseText;
|
|
22858
22710
|
var e2 = new Error(msg2);
|
|
22859
22711
|
e2.response = response;
|
|
22860
22712
|
reject(e2);
|
|
@@ -23466,8 +23318,7 @@ var rdflib_data_factory_default = RDFlibDataFactory;
|
|
|
23466
23318
|
// ../node_modules/rdflib/esm/index.js
|
|
23467
23319
|
var boundDataFactory = {};
|
|
23468
23320
|
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);
|
|
23321
|
+
if (typeof rdflib_data_factory_default[name] === "function") boundDataFactory[name] = rdflib_data_factory_default[name].bind(rdflib_data_factory_default);
|
|
23471
23322
|
}
|
|
23472
23323
|
var name;
|
|
23473
23324
|
var fetcher2 = boundDataFactory.fetcher;
|
|
@@ -23511,14 +23362,12 @@ function _createForOfIteratorHelper4(o, allowArrayLike) {
|
|
|
23511
23362
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
23512
23363
|
if (!it) {
|
|
23513
23364
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray4(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
23514
|
-
if (it)
|
|
23515
|
-
o = it;
|
|
23365
|
+
if (it) o = it;
|
|
23516
23366
|
var i = 0;
|
|
23517
23367
|
var F = function F2() {
|
|
23518
23368
|
};
|
|
23519
23369
|
return { s: F, n: function n() {
|
|
23520
|
-
if (i >= o.length)
|
|
23521
|
-
return { done: true };
|
|
23370
|
+
if (i >= o.length) return { done: true };
|
|
23522
23371
|
return { done: false, value: o[i++] };
|
|
23523
23372
|
}, e: function e(_e) {
|
|
23524
23373
|
throw _e;
|
|
@@ -23538,32 +23387,23 @@ function _createForOfIteratorHelper4(o, allowArrayLike) {
|
|
|
23538
23387
|
err = _e2;
|
|
23539
23388
|
}, f: function f() {
|
|
23540
23389
|
try {
|
|
23541
|
-
if (!normalCompletion && it.return != null)
|
|
23542
|
-
it.return();
|
|
23390
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
23543
23391
|
} finally {
|
|
23544
|
-
if (didErr)
|
|
23545
|
-
throw err;
|
|
23392
|
+
if (didErr) throw err;
|
|
23546
23393
|
}
|
|
23547
23394
|
} };
|
|
23548
23395
|
}
|
|
23549
23396
|
function _unsupportedIterableToArray4(o, minLen) {
|
|
23550
|
-
if (!o)
|
|
23551
|
-
|
|
23552
|
-
if (typeof o === "string")
|
|
23553
|
-
return _arrayLikeToArray4(o, minLen);
|
|
23397
|
+
if (!o) return;
|
|
23398
|
+
if (typeof o === "string") return _arrayLikeToArray4(o, minLen);
|
|
23554
23399
|
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);
|
|
23400
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
23401
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
23402
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray4(o, minLen);
|
|
23561
23403
|
}
|
|
23562
23404
|
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];
|
|
23405
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
23406
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
23567
23407
|
return arr2;
|
|
23568
23408
|
}
|
|
23569
23409
|
function _callSuper9(t, o, e) {
|
|
@@ -23702,8 +23542,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23702
23542
|
function doPatch(onDonePatch) {
|
|
23703
23543
|
if (patch["delete"]) {
|
|
23704
23544
|
ds = patch["delete"];
|
|
23705
|
-
if (binding)
|
|
23706
|
-
ds = ds.substitute(binding);
|
|
23545
|
+
if (binding) ds = ds.substitute(binding);
|
|
23707
23546
|
ds = ds.statements;
|
|
23708
23547
|
var bad = [];
|
|
23709
23548
|
var ds2 = ds.map(function(st3) {
|
|
@@ -23724,8 +23563,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23724
23563
|
}
|
|
23725
23564
|
if (patch["insert"]) {
|
|
23726
23565
|
ds = patch["insert"];
|
|
23727
|
-
if (binding)
|
|
23728
|
-
ds = ds.substitute(binding);
|
|
23566
|
+
if (binding) ds = ds.substitute(binding);
|
|
23729
23567
|
ds = ds.statements;
|
|
23730
23568
|
ds.map(function(st3) {
|
|
23731
23569
|
st3.graph = target;
|
|
@@ -23766,8 +23604,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23766
23604
|
}, {
|
|
23767
23605
|
key: "declareExistential",
|
|
23768
23606
|
value: function declareExistential(x) {
|
|
23769
|
-
if (!this._existentialVariables)
|
|
23770
|
-
this._existentialVariables = [];
|
|
23607
|
+
if (!this._existentialVariables) this._existentialVariables = [];
|
|
23771
23608
|
this._existentialVariables.push(x);
|
|
23772
23609
|
return x;
|
|
23773
23610
|
}
|
|
@@ -23910,6 +23747,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23910
23747
|
return new BlankNode(term2.value);
|
|
23911
23748
|
case CollectionTermType:
|
|
23912
23749
|
return term2;
|
|
23750
|
+
// non-RDF/JS type, should just need to cast
|
|
23913
23751
|
case DefaultGraphTermType:
|
|
23914
23752
|
return new DefaultGraph();
|
|
23915
23753
|
case EmptyTermType:
|
|
@@ -24018,8 +23856,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24018
23856
|
}, {
|
|
24019
23857
|
key: "copyTo",
|
|
24020
23858
|
value: function copyTo(template, target, flags) {
|
|
24021
|
-
if (!flags)
|
|
24022
|
-
flags = [];
|
|
23859
|
+
if (!flags) flags = [];
|
|
24023
23860
|
var statList = this.statementsMatching(template);
|
|
24024
23861
|
if (ArrayIndexOf(flags, "two-direction") !== -1) {
|
|
24025
23862
|
statList.concat(this.statementsMatching(void 0, void 0, template));
|
|
@@ -24032,6 +23869,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24032
23869
|
break;
|
|
24033
23870
|
case "Literal":
|
|
24034
23871
|
case "BlankNode":
|
|
23872
|
+
// @ts-ignore Collections can appear here
|
|
24035
23873
|
case "Collection":
|
|
24036
23874
|
this.add(target, st3.predicate, st3.object.copy(this));
|
|
24037
23875
|
}
|
|
@@ -24117,8 +23955,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24117
23955
|
}, {
|
|
24118
23956
|
key: "newExistential",
|
|
24119
23957
|
value: function newExistential(uri) {
|
|
24120
|
-
if (!uri)
|
|
24121
|
-
return this.bnode();
|
|
23958
|
+
if (!uri) return this.bnode();
|
|
24122
23959
|
var x = this.sym(uri);
|
|
24123
23960
|
return this.declareExistential(x);
|
|
24124
23961
|
}
|
|
@@ -24151,8 +23988,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24151
23988
|
key: "newUniversal",
|
|
24152
23989
|
value: function newUniversal(uri) {
|
|
24153
23990
|
var x = this.sym(uri);
|
|
24154
|
-
if (!this._universalVariables)
|
|
24155
|
-
this._universalVariables = [];
|
|
23991
|
+
if (!this._universalVariables) this._universalVariables = [];
|
|
24156
23992
|
this._universalVariables.push(x);
|
|
24157
23993
|
return x;
|
|
24158
23994
|
}
|
|
@@ -24172,8 +24008,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24172
24008
|
value: function nextSymbol(doc) {
|
|
24173
24009
|
for (var i = 0; ; i++) {
|
|
24174
24010
|
var uri = doc.value + "#n" + i;
|
|
24175
|
-
if (!this.mentionsURI(uri))
|
|
24176
|
-
return this.sym(uri);
|
|
24011
|
+
if (!this.mentionsURI(uri)) return this.sym(uri);
|
|
24177
24012
|
}
|
|
24178
24013
|
}
|
|
24179
24014
|
/**
|
|
@@ -24298,12 +24133,9 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24298
24133
|
value: function removeMany(subj, pred, obj, why, limit) {
|
|
24299
24134
|
var sts = this.statementsMatching(subj, pred, obj, why, false);
|
|
24300
24135
|
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]);
|
|
24136
|
+
for (var i = 0; i < sts.length; i++) statements.push(sts[i]);
|
|
24137
|
+
if (limit) statements = statements.slice(0, limit);
|
|
24138
|
+
for (i = 0; i < statements.length; i++) this.remove(statements[i]);
|
|
24307
24139
|
}
|
|
24308
24140
|
/**
|
|
24309
24141
|
* Remove all matching statements
|
|
@@ -24420,11 +24252,9 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24420
24252
|
return true;
|
|
24421
24253
|
}
|
|
24422
24254
|
var x1 = this.canon(x);
|
|
24423
|
-
if (!x1)
|
|
24424
|
-
return false;
|
|
24255
|
+
if (!x1) return false;
|
|
24425
24256
|
var y1 = this.canon(y);
|
|
24426
|
-
if (!y1)
|
|
24427
|
-
return false;
|
|
24257
|
+
if (!y1) return false;
|
|
24428
24258
|
return x1.value === y1.value;
|
|
24429
24259
|
}
|
|
24430
24260
|
}, {
|
|
@@ -24437,8 +24267,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24437
24267
|
return;
|
|
24438
24268
|
}
|
|
24439
24269
|
for (var existingPrefix in this.namespaces) {
|
|
24440
|
-
if (this.namespaces[existingPrefix] == nsuri)
|
|
24441
|
-
delete this.namespaces[existingPrefix];
|
|
24270
|
+
if (this.namespaces[existingPrefix] == nsuri) delete this.namespaces[existingPrefix];
|
|
24442
24271
|
}
|
|
24443
24272
|
this.namespaces[prefix] = nsuri;
|
|
24444
24273
|
}
|
|
@@ -24515,8 +24344,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24515
24344
|
}
|
|
24516
24345
|
if (st3 != null) {
|
|
24517
24346
|
results.push(st3);
|
|
24518
|
-
if (justOne)
|
|
24519
|
-
break;
|
|
24347
|
+
if (justOne) break;
|
|
24520
24348
|
}
|
|
24521
24349
|
}
|
|
24522
24350
|
return results;
|
|
@@ -24530,8 +24358,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
24530
24358
|
value: function uris(term2) {
|
|
24531
24359
|
var cterm = this.canon(term2);
|
|
24532
24360
|
var terms = this.aliases[this.id(cterm)];
|
|
24533
|
-
if (!cterm.value)
|
|
24534
|
-
return [];
|
|
24361
|
+
if (!cterm.value) return [];
|
|
24535
24362
|
var res = [cterm.value];
|
|
24536
24363
|
if (terms) {
|
|
24537
24364
|
for (var i = 0; i < terms.length; i++) {
|
|
@@ -24565,14 +24392,12 @@ function _createForOfIteratorHelper5(o, allowArrayLike) {
|
|
|
24565
24392
|
var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"];
|
|
24566
24393
|
if (!it) {
|
|
24567
24394
|
if (Array.isArray(o) || (it = _unsupportedIterableToArray5(o)) || allowArrayLike && o && typeof o.length === "number") {
|
|
24568
|
-
if (it)
|
|
24569
|
-
o = it;
|
|
24395
|
+
if (it) o = it;
|
|
24570
24396
|
var i = 0;
|
|
24571
24397
|
var F = function F2() {
|
|
24572
24398
|
};
|
|
24573
24399
|
return { s: F, n: function n() {
|
|
24574
|
-
if (i >= o.length)
|
|
24575
|
-
return { done: true };
|
|
24400
|
+
if (i >= o.length) return { done: true };
|
|
24576
24401
|
return { done: false, value: o[i++] };
|
|
24577
24402
|
}, e: function e(_e) {
|
|
24578
24403
|
throw _e;
|
|
@@ -24592,32 +24417,23 @@ function _createForOfIteratorHelper5(o, allowArrayLike) {
|
|
|
24592
24417
|
err = _e2;
|
|
24593
24418
|
}, f: function f() {
|
|
24594
24419
|
try {
|
|
24595
|
-
if (!normalCompletion && it.return != null)
|
|
24596
|
-
it.return();
|
|
24420
|
+
if (!normalCompletion && it.return != null) it.return();
|
|
24597
24421
|
} finally {
|
|
24598
|
-
if (didErr)
|
|
24599
|
-
throw err;
|
|
24422
|
+
if (didErr) throw err;
|
|
24600
24423
|
}
|
|
24601
24424
|
} };
|
|
24602
24425
|
}
|
|
24603
24426
|
function _unsupportedIterableToArray5(o, minLen) {
|
|
24604
|
-
if (!o)
|
|
24605
|
-
|
|
24606
|
-
if (typeof o === "string")
|
|
24607
|
-
return _arrayLikeToArray5(o, minLen);
|
|
24427
|
+
if (!o) return;
|
|
24428
|
+
if (typeof o === "string") return _arrayLikeToArray5(o, minLen);
|
|
24608
24429
|
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);
|
|
24430
|
+
if (n === "Object" && o.constructor) n = o.constructor.name;
|
|
24431
|
+
if (n === "Map" || n === "Set") return Array.from(o);
|
|
24432
|
+
if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray5(o, minLen);
|
|
24615
24433
|
}
|
|
24616
24434
|
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];
|
|
24435
|
+
if (len == null || len > arr.length) len = arr.length;
|
|
24436
|
+
for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];
|
|
24621
24437
|
return arr2;
|
|
24622
24438
|
}
|
|
24623
24439
|
var UpdateManager = /* @__PURE__ */ function() {
|
|
@@ -24713,34 +24529,33 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24713
24529
|
var _kb$fetcher2;
|
|
24714
24530
|
var initial, final;
|
|
24715
24531
|
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
|
-
}
|
|
24532
|
+
while (1) switch (_context.prev = _context.next) {
|
|
24533
|
+
case 0:
|
|
24534
|
+
if (uri) {
|
|
24535
|
+
_context.next = 2;
|
|
24536
|
+
break;
|
|
24537
|
+
}
|
|
24538
|
+
return _context.abrupt("return", false);
|
|
24539
|
+
case 2:
|
|
24540
|
+
if (!kb) {
|
|
24541
|
+
kb = this.store;
|
|
24542
|
+
}
|
|
24543
|
+
initial = this.editable(uri, kb);
|
|
24544
|
+
if (!(initial !== void 0)) {
|
|
24545
|
+
_context.next = 6;
|
|
24546
|
+
break;
|
|
24547
|
+
}
|
|
24548
|
+
return _context.abrupt("return", initial);
|
|
24549
|
+
case 6:
|
|
24550
|
+
_context.next = 8;
|
|
24551
|
+
return (_kb$fetcher2 = kb.fetcher) === null || _kb$fetcher2 === void 0 ? void 0 : _kb$fetcher2.load(uri);
|
|
24552
|
+
case 8:
|
|
24553
|
+
final = this.editable(uri, kb);
|
|
24554
|
+
return _context.abrupt("return", final);
|
|
24555
|
+
case 10:
|
|
24556
|
+
case "end":
|
|
24557
|
+
return _context.stop();
|
|
24558
|
+
}
|
|
24744
24559
|
}, _callee, this);
|
|
24745
24560
|
}));
|
|
24746
24561
|
function checkEditable(_x, _x2) {
|
|
@@ -24775,8 +24590,7 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24775
24590
|
var _response2 = kb.any(request, this.ns.link("response"), null, meta);
|
|
24776
24591
|
if (_response2 !== void 0) {
|
|
24777
24592
|
var outOfDate = kb.anyJS(_response2, this.ns.link("outOfDate"), null, meta);
|
|
24778
|
-
if (outOfDate)
|
|
24779
|
-
continue;
|
|
24593
|
+
if (outOfDate) continue;
|
|
24780
24594
|
var wacAllow = kb.anyValue(_response2, this.ns.httph("wac-allow"));
|
|
24781
24595
|
if (wacAllow) {
|
|
24782
24596
|
var _iterator2 = _createForOfIteratorHelper5(wacAllow.split(",")), _step2;
|
|
@@ -24798,12 +24612,9 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24798
24612
|
if (acceptPatch.length) {
|
|
24799
24613
|
for (var i = 0; i < acceptPatch.length; i++) {
|
|
24800
24614
|
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";
|
|
24615
|
+
if (method.indexOf("text/n3") >= 0) return "N3PATCH";
|
|
24616
|
+
if (method.indexOf("application/sparql-update") >= 0) return "SPARQL";
|
|
24617
|
+
if (method.indexOf("application/sparql-update-single-match") >= 0) return "SPARQL";
|
|
24807
24618
|
}
|
|
24808
24619
|
}
|
|
24809
24620
|
var authorVia = kb.each(_response2, this.ns.httph("ms-author-via"));
|
|
@@ -24819,10 +24630,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24819
24630
|
}
|
|
24820
24631
|
}
|
|
24821
24632
|
if (!this.isHttpUri(uri)) {
|
|
24822
|
-
if (!wacAllow)
|
|
24823
|
-
|
|
24824
|
-
else
|
|
24825
|
-
return "LOCALFILE";
|
|
24633
|
+
if (!wacAllow) return false;
|
|
24634
|
+
else return "LOCALFILE";
|
|
24826
24635
|
}
|
|
24827
24636
|
var status = kb.each(_response2, this.ns.http("status"));
|
|
24828
24637
|
if (status.length) {
|
|
@@ -24959,8 +24768,7 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24959
24768
|
value: function bnodeContext1(x, source) {
|
|
24960
24769
|
for (var depth = 0; depth < 3; depth++) {
|
|
24961
24770
|
var con = this.bnodeContext2(x, source, depth);
|
|
24962
|
-
if (con !== null)
|
|
24963
|
-
return con;
|
|
24771
|
+
if (con !== null) return con;
|
|
24964
24772
|
}
|
|
24965
24773
|
return this.store.connectedStatements(x, source);
|
|
24966
24774
|
}
|
|
@@ -24984,8 +24792,7 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
24984
24792
|
this.cacheIfps();
|
|
24985
24793
|
for (var i = 0; i < bnodes.length; i++) {
|
|
24986
24794
|
var bnode = bnodes[i];
|
|
24987
|
-
if (!this.mentioned(bnode))
|
|
24988
|
-
continue;
|
|
24795
|
+
if (!this.mentioned(bnode)) continue;
|
|
24989
24796
|
context = context.concat(this.bnodeContext1(bnode, doc));
|
|
24990
24797
|
}
|
|
24991
24798
|
}
|
|
@@ -25075,8 +24882,7 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25075
24882
|
var query = this.contextWhere(this.statementContext(st0));
|
|
25076
24883
|
if (st3 instanceof Array) {
|
|
25077
24884
|
var stText = "";
|
|
25078
|
-
for (var i = 0; i < st3.length; i++)
|
|
25079
|
-
stText += st3[i] + "\n";
|
|
24885
|
+
for (var i = 0; i < st3.length; i++) stText += st3[i] + "\n";
|
|
25080
24886
|
query += "INSERT DATA { " + stText + " }\n";
|
|
25081
24887
|
} else {
|
|
25082
24888
|
query += "INSERT DATA { " + this.anonymize(st3.subject) + " " + this.anonymize(st3.predicate) + " " + this.anonymize(st3.object) + " . }\n";
|
|
@@ -25090,8 +24896,7 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25090
24896
|
var query = this.contextWhere(this.statementContext(st0));
|
|
25091
24897
|
if (st3 instanceof Array) {
|
|
25092
24898
|
var stText = "";
|
|
25093
|
-
for (var i = 0; i < st3.length; i++)
|
|
25094
|
-
stText += st3[i] + "\n";
|
|
24899
|
+
for (var i = 0; i < st3.length; i++) stText += st3[i] + "\n";
|
|
25095
24900
|
query += "DELETE DATA { " + stText + " }\n";
|
|
25096
24901
|
} else {
|
|
25097
24902
|
query += "DELETE DATA { " + this.anonymize(st3.subject) + " " + this.anonymize(st3.predicate) + " " + this.anonymize(st3.object) + " . }\n";
|
|
@@ -25138,8 +24943,7 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25138
24943
|
key: "getUpdatesVia",
|
|
25139
24944
|
value: function getUpdatesVia(doc) {
|
|
25140
24945
|
var linkHeaders = this.store.fetcher.getHeader(doc, "updates-via");
|
|
25141
|
-
if (!linkHeaders || !linkHeaders.length)
|
|
25142
|
-
return null;
|
|
24946
|
+
if (!linkHeaders || !linkHeaders.length) return null;
|
|
25143
24947
|
return linkHeaders[0].trim();
|
|
25144
24948
|
}
|
|
25145
24949
|
}, {
|
|
@@ -25287,8 +25091,7 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25287
25091
|
docs.forEach(function(doc) {
|
|
25288
25092
|
if (!uniqueDocs.find(function(uniqueDoc) {
|
|
25289
25093
|
return uniqueDoc.equals(doc);
|
|
25290
|
-
}))
|
|
25291
|
-
uniqueDocs.push(doc);
|
|
25094
|
+
})) uniqueDocs.push(doc);
|
|
25292
25095
|
});
|
|
25293
25096
|
var updates = uniqueDocs.map(function(doc) {
|
|
25294
25097
|
return thisUpdater.update(deletions.filter(function(st3) {
|
|
@@ -25340,8 +25143,7 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25340
25143
|
query += " } \n";
|
|
25341
25144
|
}
|
|
25342
25145
|
if (is.length) {
|
|
25343
|
-
if (ds.length)
|
|
25344
|
-
query += " ; ";
|
|
25146
|
+
if (ds.length) query += " ; ";
|
|
25345
25147
|
query += "INSERT DATA { ";
|
|
25346
25148
|
for (var _i7 = 0; _i7 < is.length; _i7++) {
|
|
25347
25149
|
query += this.nTriples(is[_i7]) + "\n";
|
|
@@ -25473,10 +25275,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25473
25275
|
} else if (protocol2.indexOf("SPARQL") >= 0 || protocol2.indexOf("N3PATCH") >= 0) {
|
|
25474
25276
|
var isSparql = protocol2.indexOf("SPARQL") >= 0;
|
|
25475
25277
|
var bnodes = [];
|
|
25476
|
-
if (ds.length)
|
|
25477
|
-
|
|
25478
|
-
if (is.length)
|
|
25479
|
-
bnodes = bnodes.concat(this.statementArrayBnodes(is));
|
|
25278
|
+
if (ds.length) bnodes = this.statementArrayBnodes(ds);
|
|
25279
|
+
if (is.length) bnodes = bnodes.concat(this.statementArrayBnodes(is));
|
|
25480
25280
|
var context = this.bnodeContext(bnodes, doc);
|
|
25481
25281
|
var query = isSparql ? this.constructSparqlUpdateQuery(ds, is, context) : this.constructN3PatchQuery(ds, is, context);
|
|
25482
25282
|
options.contentType = isSparql ? "application/sparql-update" : "text/n3";
|
|
@@ -25605,8 +25405,7 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25605
25405
|
options.body = this.serialize(doc.value, newSts, contentType);
|
|
25606
25406
|
options.contentType = contentType;
|
|
25607
25407
|
kb.fetcher.webOperation("PUT", doc.value, options).then(function(response) {
|
|
25608
|
-
if (!response.ok)
|
|
25609
|
-
return callbackFunction(doc.value, false, response.error);
|
|
25408
|
+
if (!response.ok) return callbackFunction(doc.value, false, response.error);
|
|
25610
25409
|
for (var _i12 = 0; _i12 < ds.length; _i12++) {
|
|
25611
25410
|
kb.remove(ds[_i12]);
|
|
25612
25411
|
}
|
|
@@ -25640,6 +25439,7 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25640
25439
|
case "text/n3":
|
|
25641
25440
|
case "text/turtle":
|
|
25642
25441
|
case "application/x-turtle":
|
|
25442
|
+
// Legacy
|
|
25643
25443
|
case "application/n3":
|
|
25644
25444
|
documentString = sz.statementsToN3(data);
|
|
25645
25445
|
break;
|
|
@@ -25707,10 +25507,8 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25707
25507
|
callbackFunction(false, "Non-HTTP error reloading data: " + body, response);
|
|
25708
25508
|
} else {
|
|
25709
25509
|
var elapsedTimeMs = Date.now() - startTime;
|
|
25710
|
-
if (!doc.reloadTimeTotal)
|
|
25711
|
-
|
|
25712
|
-
if (!doc.reloadTimeCount)
|
|
25713
|
-
doc.reloadTimeCount = 0;
|
|
25510
|
+
if (!doc.reloadTimeTotal) doc.reloadTimeTotal = 0;
|
|
25511
|
+
if (!doc.reloadTimeCount) doc.reloadTimeCount = 0;
|
|
25714
25512
|
doc.reloadTimeTotal += elapsedTimeMs;
|
|
25715
25513
|
doc.reloadTimeCount += 1;
|
|
25716
25514
|
callbackFunction(true);
|