@pod-os/core 0.12.1-7d2693a.0 → 0.12.1-a4967bb.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-GBIS3SJI.js → chunk-7VQUARYZ.js} +60 -1
- package/dist/{dist-TVYD2Q5S.js → dist-F3EUFQHU.js} +227 -193
- package/dist/index.js +336 -82
- package/lib/index.js +786 -378
- package/package.json +16 -16
- package/types/Store.spec.d.ts +0 -1
- package/types/thing/Thing.d.ts +2 -0
- package/types/thing/labelFromUri.d.ts +1 -0
- package/types/thing/labelFromUri.spec.d.ts +1 -0
|
@@ -1736,6 +1736,8 @@ var require_dom = __commonJS({
|
|
|
1736
1736
|
return buf.push("<?", node.target, " ", node.data, "?>");
|
|
1737
1737
|
case ENTITY_REFERENCE_NODE:
|
|
1738
1738
|
return buf.push("&", node.nodeName, ";");
|
|
1739
|
+
//case ENTITY_NODE:
|
|
1740
|
+
//case NOTATION_NODE:
|
|
1739
1741
|
default:
|
|
1740
1742
|
buf.push("??", node.nodeName);
|
|
1741
1743
|
}
|
|
@@ -1746,6 +1748,11 @@ var require_dom = __commonJS({
|
|
|
1746
1748
|
case ELEMENT_NODE:
|
|
1747
1749
|
node2 = node.cloneNode(false);
|
|
1748
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
|
+
//}
|
|
1749
1756
|
case DOCUMENT_FRAGMENT_NODE:
|
|
1750
1757
|
break;
|
|
1751
1758
|
case ATTRIBUTE_NODE:
|
|
@@ -4148,6 +4155,7 @@ var require_sax = __commonJS({
|
|
|
4148
4155
|
}
|
|
4149
4156
|
end++;
|
|
4150
4157
|
break;
|
|
4158
|
+
// end elment
|
|
4151
4159
|
case "?":
|
|
4152
4160
|
locator && position(tagStart);
|
|
4153
4161
|
end = parseInstruction(source, tagStart, domBuilder);
|
|
@@ -4283,6 +4291,7 @@ var require_sax = __commonJS({
|
|
|
4283
4291
|
case S_ATTR_SPACE:
|
|
4284
4292
|
el.closed = true;
|
|
4285
4293
|
break;
|
|
4294
|
+
//case S_EQ:
|
|
4286
4295
|
default:
|
|
4287
4296
|
throw new Error("attribute invalid close char('/')");
|
|
4288
4297
|
}
|
|
@@ -4301,7 +4310,9 @@ var require_sax = __commonJS({
|
|
|
4301
4310
|
case S_TAG_SPACE:
|
|
4302
4311
|
case S_TAG_CLOSE:
|
|
4303
4312
|
break;
|
|
4313
|
+
//normal
|
|
4304
4314
|
case S_ATTR_NOQUOT_VALUE:
|
|
4315
|
+
//Compatible state
|
|
4305
4316
|
case S_ATTR:
|
|
4306
4317
|
value = source.slice(start, p);
|
|
4307
4318
|
if (value.slice(-1) === "/") {
|
|
@@ -4326,6 +4337,7 @@ var require_sax = __commonJS({
|
|
|
4326
4337
|
throw new Error("attribute value missed!!");
|
|
4327
4338
|
}
|
|
4328
4339
|
return p;
|
|
4340
|
+
/*xml space '\x20' | #x9 | #xD | #xA; */
|
|
4329
4341
|
case "\x80":
|
|
4330
4342
|
c = " ";
|
|
4331
4343
|
default:
|
|
@@ -4349,6 +4361,9 @@ var require_sax = __commonJS({
|
|
|
4349
4361
|
}
|
|
4350
4362
|
} else {
|
|
4351
4363
|
switch (s) {
|
|
4364
|
+
//case S_TAG:void();break;
|
|
4365
|
+
//case S_ATTR:void();break;
|
|
4366
|
+
//case S_ATTR_NOQUOT_VALUE:void();break;
|
|
4352
4367
|
case S_ATTR_SPACE:
|
|
4353
4368
|
var tagName = el.tagName;
|
|
4354
4369
|
if (!NAMESPACE.isHTML(currentNSMap[""]) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {
|
|
@@ -7076,6 +7091,7 @@ var require_parse = __commonJS({
|
|
|
7076
7091
|
parameterLimit: 1e3,
|
|
7077
7092
|
parseArrays: true,
|
|
7078
7093
|
plainObjects: false,
|
|
7094
|
+
strictDepth: false,
|
|
7079
7095
|
strictNullHandling: false
|
|
7080
7096
|
};
|
|
7081
7097
|
var interpretNumericEntities = function(str) {
|
|
@@ -7094,6 +7110,7 @@ var require_parse = __commonJS({
|
|
|
7094
7110
|
var parseValues = function parseQueryStringValues(str, options) {
|
|
7095
7111
|
var obj = { __proto__: null };
|
|
7096
7112
|
var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\?/, "") : str;
|
|
7113
|
+
cleanStr = cleanStr.replace(/%5B/gi, "[").replace(/%5D/gi, "]");
|
|
7097
7114
|
var limit = options.parameterLimit === Infinity ? void 0 : options.parameterLimit;
|
|
7098
7115
|
var parts = cleanStr.split(options.delimiter, limit);
|
|
7099
7116
|
var skipIndex = -1;
|
|
@@ -7153,7 +7170,7 @@ var require_parse = __commonJS({
|
|
|
7153
7170
|
var obj;
|
|
7154
7171
|
var root = chain[i];
|
|
7155
7172
|
if (root === "[]" && options.parseArrays) {
|
|
7156
|
-
obj = options.allowEmptyArrays && leaf === "" ? [] : [].concat(leaf);
|
|
7173
|
+
obj = options.allowEmptyArrays && (leaf === "" || options.strictNullHandling && leaf === null) ? [] : [].concat(leaf);
|
|
7157
7174
|
} else {
|
|
7158
7175
|
obj = options.plainObjects ? /* @__PURE__ */ Object.create(null) : {};
|
|
7159
7176
|
var cleanRoot = root.charAt(0) === "[" && root.charAt(root.length - 1) === "]" ? root.slice(1, -1) : root;
|
|
@@ -7201,6 +7218,9 @@ var require_parse = __commonJS({
|
|
|
7201
7218
|
keys.push(segment[1]);
|
|
7202
7219
|
}
|
|
7203
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
|
+
}
|
|
7204
7224
|
keys.push("[" + key.slice(segment.index) + "]");
|
|
7205
7225
|
}
|
|
7206
7226
|
return parseObject(keys, val, options, valuesParsed);
|
|
@@ -7247,6 +7267,7 @@ var require_parse = __commonJS({
|
|
|
7247
7267
|
parameterLimit: typeof opts.parameterLimit === "number" ? opts.parameterLimit : defaults.parameterLimit,
|
|
7248
7268
|
parseArrays: opts.parseArrays !== false,
|
|
7249
7269
|
plainObjects: typeof opts.plainObjects === "boolean" ? opts.plainObjects : defaults.plainObjects,
|
|
7270
|
+
strictDepth: typeof opts.strictDepth === "boolean" ? !!opts.strictDepth : defaults.strictDepth,
|
|
7250
7271
|
strictNullHandling: typeof opts.strictNullHandling === "boolean" ? opts.strictNullHandling : defaults.strictNullHandling
|
|
7251
7272
|
};
|
|
7252
7273
|
};
|
|
@@ -18593,6 +18614,7 @@ var N3Lexer = class {
|
|
|
18593
18614
|
}
|
|
18594
18615
|
break;
|
|
18595
18616
|
}
|
|
18617
|
+
// Fall through in case the type is an IRI
|
|
18596
18618
|
case "<":
|
|
18597
18619
|
if (match = this._unescapedIri.exec(input))
|
|
18598
18620
|
type = "IRI", value = match[1];
|
|
@@ -18658,6 +18680,7 @@ var N3Lexer = class {
|
|
|
18658
18680
|
matchLength = 1;
|
|
18659
18681
|
break;
|
|
18660
18682
|
}
|
|
18683
|
+
// Fall through to numerical case (could be a decimal dot)
|
|
18661
18684
|
case "0":
|
|
18662
18685
|
case "1":
|
|
18663
18686
|
case "2":
|
|
@@ -19170,19 +19193,23 @@ var N3Parser = class {
|
|
|
19170
19193
|
// ### `_readInTopContext` reads a token when in the top context
|
|
19171
19194
|
_readInTopContext(token) {
|
|
19172
19195
|
switch (token.type) {
|
|
19196
|
+
// If an EOF token arrives in the top context, signal that we're done
|
|
19173
19197
|
case "eof":
|
|
19174
19198
|
if (this._graph !== null)
|
|
19175
19199
|
return this._error("Unclosed graph", token);
|
|
19176
19200
|
delete this._prefixes._;
|
|
19177
19201
|
return this._callback(null, null, this._prefixes);
|
|
19202
|
+
// It could be a prefix declaration
|
|
19178
19203
|
case "PREFIX":
|
|
19179
19204
|
this._sparqlStyle = true;
|
|
19180
19205
|
case "@prefix":
|
|
19181
19206
|
return this._readPrefix;
|
|
19207
|
+
// It could be a base declaration
|
|
19182
19208
|
case "BASE":
|
|
19183
19209
|
this._sparqlStyle = true;
|
|
19184
19210
|
case "@base":
|
|
19185
19211
|
return this._readBaseIRI;
|
|
19212
|
+
// It could be a graph
|
|
19186
19213
|
case "{":
|
|
19187
19214
|
if (this._supportsNamedGraphs) {
|
|
19188
19215
|
this._graph = "";
|
|
@@ -19192,6 +19219,7 @@ var N3Parser = class {
|
|
|
19192
19219
|
case "GRAPH":
|
|
19193
19220
|
if (this._supportsNamedGraphs)
|
|
19194
19221
|
return this._readNamedGraphLabel;
|
|
19222
|
+
// Otherwise, the next token must be a subject
|
|
19195
19223
|
default:
|
|
19196
19224
|
return this._readSubject(token);
|
|
19197
19225
|
}
|
|
@@ -19200,6 +19228,7 @@ var N3Parser = class {
|
|
|
19200
19228
|
_readEntity(token, quantifier) {
|
|
19201
19229
|
let value;
|
|
19202
19230
|
switch (token.type) {
|
|
19231
|
+
// Read a relative or absolute IRI
|
|
19203
19232
|
case "IRI":
|
|
19204
19233
|
case "typeIRI":
|
|
19205
19234
|
const iri = this._resolveIRI(token.value);
|
|
@@ -19207,6 +19236,7 @@ var N3Parser = class {
|
|
|
19207
19236
|
return this._error("Invalid IRI", token);
|
|
19208
19237
|
value = this._namedNode(iri);
|
|
19209
19238
|
break;
|
|
19239
|
+
// Read a prefixed name
|
|
19210
19240
|
case "type":
|
|
19211
19241
|
case "prefixed":
|
|
19212
19242
|
const prefix = this._prefixes[token.prefix];
|
|
@@ -19214,12 +19244,15 @@ var N3Parser = class {
|
|
|
19214
19244
|
return this._error(`Undefined prefix "${token.prefix}:"`, token);
|
|
19215
19245
|
value = this._namedNode(prefix + token.value);
|
|
19216
19246
|
break;
|
|
19247
|
+
// Read a blank node
|
|
19217
19248
|
case "blank":
|
|
19218
19249
|
value = this._blankNode(this._prefixes[token.prefix] + token.value);
|
|
19219
19250
|
break;
|
|
19251
|
+
// Read a variable
|
|
19220
19252
|
case "var":
|
|
19221
19253
|
value = this._variable(token.value.substr(1));
|
|
19222
19254
|
break;
|
|
19255
|
+
// Everything else is not an entity
|
|
19223
19256
|
default:
|
|
19224
19257
|
return this._error(`Expected entity but got ${token.type}`, token);
|
|
19225
19258
|
}
|
|
@@ -19523,6 +19556,7 @@ var N3Parser = class {
|
|
|
19523
19556
|
_completeLiteral(token) {
|
|
19524
19557
|
let literal4 = this._literal(this._literalValue);
|
|
19525
19558
|
switch (token.type) {
|
|
19559
|
+
// Create a datatyped literal
|
|
19526
19560
|
case "type":
|
|
19527
19561
|
case "typeIRI":
|
|
19528
19562
|
const datatype = this._readEntity(token);
|
|
@@ -19530,6 +19564,7 @@ var N3Parser = class {
|
|
|
19530
19564
|
literal4 = this._literal(this._literalValue, datatype);
|
|
19531
19565
|
token = null;
|
|
19532
19566
|
break;
|
|
19567
|
+
// Create a language-tagged string
|
|
19533
19568
|
case "langcode":
|
|
19534
19569
|
literal4 = this._literal(this._literalValue, token.value);
|
|
19535
19570
|
token = null;
|
|
@@ -19571,23 +19606,28 @@ var N3Parser = class {
|
|
|
19571
19606
|
let next, graph3 = this._graph;
|
|
19572
19607
|
const subject = this._subject, inversePredicate = this._inversePredicate;
|
|
19573
19608
|
switch (token.type) {
|
|
19609
|
+
// A closing brace ends a graph
|
|
19574
19610
|
case "}":
|
|
19575
19611
|
if (this._graph === null)
|
|
19576
19612
|
return this._error("Unexpected graph closing", token);
|
|
19577
19613
|
if (this._n3Mode)
|
|
19578
19614
|
return this._readFormulaTail(token);
|
|
19579
19615
|
this._graph = null;
|
|
19616
|
+
// A dot just ends the statement, without sharing anything with the next
|
|
19580
19617
|
case ".":
|
|
19581
19618
|
this._subject = null;
|
|
19582
19619
|
next = this._contextStack.length ? this._readSubject : this._readInTopContext;
|
|
19583
19620
|
if (inversePredicate) this._inversePredicate = false;
|
|
19584
19621
|
break;
|
|
19622
|
+
// Semicolon means the subject is shared; predicate and object are different
|
|
19585
19623
|
case ";":
|
|
19586
19624
|
next = this._readPredicate;
|
|
19587
19625
|
break;
|
|
19626
|
+
// Comma means both the subject and predicate are shared; the object is different
|
|
19588
19627
|
case ",":
|
|
19589
19628
|
next = this._readObject;
|
|
19590
19629
|
break;
|
|
19630
|
+
// {| means that the current triple is annotated with predicate-object pairs.
|
|
19591
19631
|
case "{|":
|
|
19592
19632
|
if (!this._supportsRDFStar)
|
|
19593
19633
|
return this._error("Unexpected RDF* syntax", token);
|
|
@@ -19595,6 +19635,7 @@ var N3Parser = class {
|
|
|
19595
19635
|
this._subject = this._quad(subject, predicate, object, this.DEFAULTGRAPH);
|
|
19596
19636
|
next = this._readPredicate;
|
|
19597
19637
|
break;
|
|
19638
|
+
// |} means that the current quoted triple in annotation syntax is finalized.
|
|
19598
19639
|
case "|}":
|
|
19599
19640
|
if (this._subject.termType !== "Quad")
|
|
19600
19641
|
return this._error("Unexpected asserted triple closing", token);
|
|
@@ -19621,9 +19662,11 @@ var N3Parser = class {
|
|
|
19621
19662
|
_readBlankNodePunctuation(token) {
|
|
19622
19663
|
let next;
|
|
19623
19664
|
switch (token.type) {
|
|
19665
|
+
// Semicolon means the subject is shared; predicate and object are different
|
|
19624
19666
|
case ";":
|
|
19625
19667
|
next = this._readPredicate;
|
|
19626
19668
|
break;
|
|
19669
|
+
// Comma means both the subject and predicate are shared; the object is different
|
|
19627
19670
|
case ",":
|
|
19628
19671
|
next = this._readObject;
|
|
19629
19672
|
break;
|
|
@@ -19746,10 +19789,13 @@ var N3Parser = class {
|
|
|
19746
19789
|
// ### `_readPath` reads a potential path
|
|
19747
19790
|
_readPath(token) {
|
|
19748
19791
|
switch (token.type) {
|
|
19792
|
+
// Forward path
|
|
19749
19793
|
case "!":
|
|
19750
19794
|
return this._readForwardPath;
|
|
19795
|
+
// Backward path
|
|
19751
19796
|
case "^":
|
|
19752
19797
|
return this._readBackwardPath;
|
|
19798
|
+
// Not a path; resume reading where we left off
|
|
19753
19799
|
default:
|
|
19754
19800
|
const stack = this._contextStack, parent = stack.length && stack[stack.length - 1];
|
|
19755
19801
|
if (parent && parent.type === "item") {
|
|
@@ -19855,12 +19901,16 @@ var N3Parser = class {
|
|
|
19855
19901
|
if (!iri.length)
|
|
19856
19902
|
return this._base;
|
|
19857
19903
|
switch (iri[0]) {
|
|
19904
|
+
// Resolve relative fragment IRIs against the base IRI
|
|
19858
19905
|
case "#":
|
|
19859
19906
|
return this._base + iri;
|
|
19907
|
+
// Resolve relative query string IRIs by replacing the query string
|
|
19860
19908
|
case "?":
|
|
19861
19909
|
return this._base.replace(/(?:\?.*)?$/, iri);
|
|
19910
|
+
// Resolve root-relative IRIs at the root of the base IRI
|
|
19862
19911
|
case "/":
|
|
19863
19912
|
return (iri[1] === "/" ? this._baseScheme : this._baseRoot) + this._removeDotSegments(iri);
|
|
19913
|
+
// Resolve all other IRIs at the base IRI's path
|
|
19864
19914
|
default:
|
|
19865
19915
|
return /^[^/:]*:/.test(iri) ? null : this._removeDotSegments(this._basePath + iri);
|
|
19866
19916
|
}
|
|
@@ -19873,6 +19923,7 @@ var N3Parser = class {
|
|
|
19873
19923
|
let result = "", i = -1, pathStart = -1, segmentStart = 0, next = "/";
|
|
19874
19924
|
while (i < length) {
|
|
19875
19925
|
switch (next) {
|
|
19926
|
+
// The path starts with the first slash after the authority
|
|
19876
19927
|
case ":":
|
|
19877
19928
|
if (pathStart < 0) {
|
|
19878
19929
|
if (iri[++i] === "/" && iri[++i] === "/")
|
|
@@ -19880,22 +19931,27 @@ var N3Parser = class {
|
|
|
19880
19931
|
i = pathStart;
|
|
19881
19932
|
}
|
|
19882
19933
|
break;
|
|
19934
|
+
// Don't modify a query string or fragment
|
|
19883
19935
|
case "?":
|
|
19884
19936
|
case "#":
|
|
19885
19937
|
i = length;
|
|
19886
19938
|
break;
|
|
19939
|
+
// Handle '/.' or '/..' path segments
|
|
19887
19940
|
case "/":
|
|
19888
19941
|
if (iri[i + 1] === ".") {
|
|
19889
19942
|
next = iri[++i + 1];
|
|
19890
19943
|
switch (next) {
|
|
19944
|
+
// Remove a '/.' segment
|
|
19891
19945
|
case "/":
|
|
19892
19946
|
result += iri.substring(segmentStart, i - 1);
|
|
19893
19947
|
segmentStart = i + 1;
|
|
19894
19948
|
break;
|
|
19949
|
+
// Remove a trailing '/.' segment
|
|
19895
19950
|
case void 0:
|
|
19896
19951
|
case "?":
|
|
19897
19952
|
case "#":
|
|
19898
19953
|
return result + iri.substring(segmentStart, i) + iri.substr(i + 1);
|
|
19954
|
+
// Remove a '/..' segment
|
|
19899
19955
|
case ".":
|
|
19900
19956
|
next = iri[++i + 1];
|
|
19901
19957
|
if (next === void 0 || next === "/" || next === "?" || next === "#") {
|
|
@@ -23691,6 +23747,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23691
23747
|
return new BlankNode(term2.value);
|
|
23692
23748
|
case CollectionTermType:
|
|
23693
23749
|
return term2;
|
|
23750
|
+
// non-RDF/JS type, should just need to cast
|
|
23694
23751
|
case DefaultGraphTermType:
|
|
23695
23752
|
return new DefaultGraph();
|
|
23696
23753
|
case EmptyTermType:
|
|
@@ -23812,6 +23869,7 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
|
|
|
23812
23869
|
break;
|
|
23813
23870
|
case "Literal":
|
|
23814
23871
|
case "BlankNode":
|
|
23872
|
+
// @ts-ignore Collections can appear here
|
|
23815
23873
|
case "Collection":
|
|
23816
23874
|
this.add(target, st3.predicate, st3.object.copy(this));
|
|
23817
23875
|
}
|
|
@@ -25381,6 +25439,7 @@ var UpdateManager = /* @__PURE__ */ function() {
|
|
|
25381
25439
|
case "text/n3":
|
|
25382
25440
|
case "text/turtle":
|
|
25383
25441
|
case "application/x-turtle":
|
|
25442
|
+
// Legacy
|
|
25384
25443
|
case "application/n3":
|
|
25385
25444
|
documentString = sz.statementsToN3(data);
|
|
25386
25445
|
break;
|