@pod-os/elements 0.40.0 → 0.41.0-rc.27b005a.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/cjs/{index-Bc4gZgPG.js → index-BK2Q5l1p.js} +262 -83
- package/dist/cjs/{jsonld-V2RB47OZ-JAbnY92y.js → jsonld-V2RB47OZ-CFDz64pR.js} +1 -1
- package/dist/cjs/pos-add-literal-value_3.cjs.entry.js +1 -1
- package/dist/cjs/pos-add-new-thing_32.cjs.entry.js +1 -1
- package/dist/cjs/pos-add-relation.cjs.entry.js +1 -1
- package/dist/cjs/pos-container-contents.cjs.entry.js +1 -1
- package/dist/cjs/pos-markdown-document.cjs.entry.js +410 -120
- package/dist/cjs/pos-subjects.cjs.entry.js +1 -1
- package/dist/components/index2.js +1 -1
- package/dist/components/pos-markdown-document2.js +1 -1
- package/dist/elements/elements.esm.js +1 -1
- package/dist/elements/{p-f6da714c.entry.js → p-00f8d4ed.entry.js} +1 -1
- package/dist/elements/p-05d22c0b.entry.js +1 -0
- package/dist/elements/{p-2ee1efdb.entry.js → p-33dde993.entry.js} +1 -1
- package/dist/elements/{p-DuW6UWKz.js → p-C4h87eQU.js} +1 -1
- package/dist/elements/p-QvyFA_FG.js +67 -0
- package/dist/elements/{p-ed1d9d77.entry.js → p-bf331b7e.entry.js} +1 -1
- package/dist/elements/{p-57d32176.entry.js → p-f836f544.entry.js} +1 -1
- package/dist/elements/{p-a8628eb4.entry.js → p-fad783a9.entry.js} +1 -1
- package/dist/esm/{index-LnGgDqFG.js → index-UpPIXo80.js} +262 -83
- package/dist/esm/{jsonld-V2RB47OZ-DFmZ008Y.js → jsonld-V2RB47OZ-D-RJLZDt.js} +1 -1
- package/dist/esm/pos-add-literal-value_3.entry.js +1 -1
- package/dist/esm/pos-add-new-thing_32.entry.js +1 -1
- package/dist/esm/pos-add-relation.entry.js +1 -1
- package/dist/esm/pos-container-contents.entry.js +1 -1
- package/dist/esm/pos-markdown-document.entry.js +410 -120
- package/dist/esm/pos-subjects.entry.js +1 -1
- package/dist/jest-setup.js +20 -0
- package/package.json +10 -10
- package/dist/elements/p-BXBNVUZ5.js +0 -67
- package/dist/elements/p-d6e9d178.entry.js +0 -1
|
@@ -13769,8 +13769,8 @@ function __generator(thisArg, body) {
|
|
|
13769
13769
|
var _ = { label: 0, sent: function() {
|
|
13770
13770
|
if (t[0] & 1) throw t[1];
|
|
13771
13771
|
return t[1];
|
|
13772
|
-
}, trys: [], ops: [] }, f, y, t, g;
|
|
13773
|
-
return g =
|
|
13772
|
+
}, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13773
|
+
return g.next = verb2(0), g["throw"] = verb2(1), g["return"] = verb2(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() {
|
|
13774
13774
|
return this;
|
|
13775
13775
|
}), g;
|
|
13776
13776
|
function verb2(n2) {
|
|
@@ -13877,16 +13877,24 @@ function __await(v2) {
|
|
|
13877
13877
|
function __asyncGenerator(thisArg, _arguments, generator3) {
|
|
13878
13878
|
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
13879
13879
|
var g = generator3.apply(thisArg, _arguments || []), i, q = [];
|
|
13880
|
-
return i =
|
|
13880
|
+
return i = Object.create((typeof AsyncIterator === "function" ? AsyncIterator : Object).prototype), verb2("next"), verb2("throw"), verb2("return", awaitReturn), i[Symbol.asyncIterator] = function() {
|
|
13881
13881
|
return this;
|
|
13882
13882
|
}, i;
|
|
13883
|
-
function
|
|
13884
|
-
|
|
13885
|
-
return
|
|
13886
|
-
q.push([n2, v2, a, b]) > 1 || resume(n2, v2);
|
|
13887
|
-
});
|
|
13883
|
+
function awaitReturn(f) {
|
|
13884
|
+
return function(v2) {
|
|
13885
|
+
return Promise.resolve(v2).then(f, reject);
|
|
13888
13886
|
};
|
|
13889
13887
|
}
|
|
13888
|
+
function verb2(n2, f) {
|
|
13889
|
+
if (g[n2]) {
|
|
13890
|
+
i[n2] = function(v2) {
|
|
13891
|
+
return new Promise(function(a, b) {
|
|
13892
|
+
q.push([n2, v2, a, b]) > 1 || resume(n2, v2);
|
|
13893
|
+
});
|
|
13894
|
+
};
|
|
13895
|
+
if (f) i[n2] = f(i[n2]);
|
|
13896
|
+
}
|
|
13897
|
+
}
|
|
13890
13898
|
function resume(n2, v2) {
|
|
13891
13899
|
try {
|
|
13892
13900
|
step4(g[n2](v2));
|
|
@@ -22138,7 +22146,7 @@ function listToCollection(kb, obj) {
|
|
|
22138
22146
|
}
|
|
22139
22147
|
async function jsonldParser(str, kb, base2) {
|
|
22140
22148
|
const baseString = base2 && Object.prototype.hasOwnProperty.call(base2, "termType") ? base2.value : base2;
|
|
22141
|
-
const jsonld = await import('./jsonld-V2RB47OZ-
|
|
22149
|
+
const jsonld = await import('./jsonld-V2RB47OZ-D-RJLZDt.js');
|
|
22142
22150
|
const flattened = await jsonld.default.flatten(JSON.parse(str), null, {
|
|
22143
22151
|
base: baseString
|
|
22144
22152
|
});
|
|
@@ -22186,10 +22194,10 @@ function createStatement(kb, id4, property4, value7, base2) {
|
|
|
22186
22194
|
return kb.rdfFactory.quad(id4, predicate4, object8, kb.rdfFactory.namedNode(base2));
|
|
22187
22195
|
}
|
|
22188
22196
|
|
|
22189
|
-
//
|
|
22197
|
+
// node_modules/n3/src/N3Lexer.js
|
|
22190
22198
|
var import_buffer = __toESM(require_buffer());
|
|
22191
22199
|
|
|
22192
|
-
//
|
|
22200
|
+
// node_modules/n3/src/IRIs.js
|
|
22193
22201
|
var RDF2 = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
|
|
22194
22202
|
var XSD = "http://www.w3.org/2001/XMLSchema#";
|
|
22195
22203
|
var SWAP = "http://www.w3.org/2000/10/swap/";
|
|
@@ -22206,7 +22214,9 @@ var IRIs_default = {
|
|
|
22206
22214
|
nil: `${RDF2}nil`,
|
|
22207
22215
|
first: `${RDF2}first`,
|
|
22208
22216
|
rest: `${RDF2}rest`,
|
|
22209
|
-
langString: `${RDF2}langString
|
|
22217
|
+
langString: `${RDF2}langString`,
|
|
22218
|
+
dirLangString: `${RDF2}dirLangString`,
|
|
22219
|
+
reifies: `${RDF2}reifies`
|
|
22210
22220
|
},
|
|
22211
22221
|
owl: {
|
|
22212
22222
|
sameAs: "http://www.w3.org/2002/07/owl#sameAs"
|
|
@@ -22221,7 +22231,7 @@ var IRIs_default = {
|
|
|
22221
22231
|
}
|
|
22222
22232
|
};
|
|
22223
22233
|
|
|
22224
|
-
//
|
|
22234
|
+
// node_modules/n3/src/N3Lexer.js
|
|
22225
22235
|
var { xsd } = IRIs_default;
|
|
22226
22236
|
var escapeSequence = /\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g;
|
|
22227
22237
|
var escapeReplacements = {
|
|
@@ -22259,6 +22269,7 @@ var lineModeRegExps = {
|
|
|
22259
22269
|
_unescapedIri: true,
|
|
22260
22270
|
_simpleQuotedString: true,
|
|
22261
22271
|
_langcode: true,
|
|
22272
|
+
_dircode: true,
|
|
22262
22273
|
_blank: true,
|
|
22263
22274
|
_newline: true,
|
|
22264
22275
|
_comment: true,
|
|
@@ -22272,15 +22283,16 @@ var N3Lexer = class {
|
|
|
22272
22283
|
this._unescapedIri = /^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/;
|
|
22273
22284
|
this._simpleQuotedString = /^"([^"\\\r\n]*)"(?=[^"])/;
|
|
22274
22285
|
this._simpleApostropheString = /^'([^'\\\r\n]*)'(?=[^'])/;
|
|
22275
|
-
this._langcode = /^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9
|
|
22286
|
+
this._langcode = /^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9])/i;
|
|
22287
|
+
this._dircode = /^--(ltr)|(rtl)/;
|
|
22276
22288
|
this._prefix = /^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:(?=[#\s<])/;
|
|
22277
22289
|
this._prefixed = /^((?:[A-Za-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)?:((?:(?:[0-:A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])(?:(?:[\.\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~])*(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff]|%[0-9a-fA-F]{2}|\\[!#-\/;=?\-@_~]))?)?)(?:[ \t]+|(?=\.?[,;!\^\s#()\[\]\{\}"'<>]))/;
|
|
22278
22290
|
this._variable = /^\?(?:(?:[A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:[\-0-:A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?=[.,;!\^\s#()\[\]\{\}"'<>])/;
|
|
22279
22291
|
this._blank = /^_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:\s#()\[\]\{\}"'<>]))/;
|
|
22280
22292
|
this._number = /^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/;
|
|
22281
22293
|
this._boolean = /^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/;
|
|
22282
|
-
this.
|
|
22283
|
-
this.
|
|
22294
|
+
this._atKeyword = /^@[a-z]+(?=[\s#<:])/i;
|
|
22295
|
+
this._keyword = /^(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<])/i;
|
|
22284
22296
|
this._shortPredicates = /^a(?=[\s#()\[\]\{\}"'<>])/;
|
|
22285
22297
|
this._newline = /^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/;
|
|
22286
22298
|
this._comment = /#([^\n\r]*)/;
|
|
@@ -22354,7 +22366,9 @@ var N3Lexer = class {
|
|
|
22354
22366
|
if (value7 === null || illegalIriChars.test(value7))
|
|
22355
22367
|
return reportSyntaxError(this);
|
|
22356
22368
|
type5 = "IRI";
|
|
22357
|
-
} else if (input2.length >
|
|
22369
|
+
} else if (input2.length > 2 && input2[1] === "<" && input2[2] === "(")
|
|
22370
|
+
type5 = "<<(", matchLength = 3;
|
|
22371
|
+
else if (!this._lineMode && input2.length > (inputFinished ? 1 : 2) && input2[1] === "<")
|
|
22358
22372
|
type5 = "<<", matchLength = 2;
|
|
22359
22373
|
else if (this._n3Mode && input2.length > 1 && input2[1] === "=") {
|
|
22360
22374
|
matchLength = 2;
|
|
@@ -22403,9 +22417,9 @@ var N3Lexer = class {
|
|
|
22403
22417
|
type5 = "var", value7 = match[0];
|
|
22404
22418
|
break;
|
|
22405
22419
|
case "@":
|
|
22406
|
-
if (this._previousMarker === "literal" && (match = this._langcode.exec(input2)))
|
|
22420
|
+
if (this._previousMarker === "literal" && (match = this._langcode.exec(input2)) && match[1] !== "version")
|
|
22407
22421
|
type5 = "langcode", value7 = match[1];
|
|
22408
|
-
else if (match = this.
|
|
22422
|
+
else if (match = this._atKeyword.exec(input2))
|
|
22409
22423
|
type5 = match[0];
|
|
22410
22424
|
break;
|
|
22411
22425
|
case ".":
|
|
@@ -22427,6 +22441,11 @@ var N3Lexer = class {
|
|
|
22427
22441
|
case "9":
|
|
22428
22442
|
case "+":
|
|
22429
22443
|
case "-":
|
|
22444
|
+
if (input2[1] === "-") {
|
|
22445
|
+
if (this._previousMarker === "langcode" && (match = this._dircode.exec(input2)))
|
|
22446
|
+
type5 = "dircode", matchLength = 2, value7 = match[1] || match[2], matchLength = value7.length + 2;
|
|
22447
|
+
break;
|
|
22448
|
+
}
|
|
22430
22449
|
if (match = this._number.exec(input2) || inputFinished && (match = this._number.exec(`${input2} `))) {
|
|
22431
22450
|
type5 = "literal", value7 = match[0];
|
|
22432
22451
|
prefix3 = typeof match[1] === "string" ? xsd.double : typeof match[2] === "string" ? xsd.decimal : xsd.integer;
|
|
@@ -22438,7 +22457,9 @@ var N3Lexer = class {
|
|
|
22438
22457
|
case "P":
|
|
22439
22458
|
case "G":
|
|
22440
22459
|
case "g":
|
|
22441
|
-
|
|
22460
|
+
case "V":
|
|
22461
|
+
case "v":
|
|
22462
|
+
if (match = this._keyword.exec(input2))
|
|
22442
22463
|
type5 = match[0].toUpperCase();
|
|
22443
22464
|
else
|
|
22444
22465
|
inconclusive = true;
|
|
@@ -22468,13 +22489,21 @@ var N3Lexer = class {
|
|
|
22468
22489
|
case "!":
|
|
22469
22490
|
if (!this._n3Mode)
|
|
22470
22491
|
break;
|
|
22492
|
+
case ")":
|
|
22493
|
+
if (!inputFinished && (input2.length === 1 || input2.length === 2 && input2[1] === ">")) {
|
|
22494
|
+
break;
|
|
22495
|
+
}
|
|
22496
|
+
if (input2.length > 2 && input2[1] === ">" && input2[2] === ">") {
|
|
22497
|
+
type5 = ")>>", matchLength = 3;
|
|
22498
|
+
break;
|
|
22499
|
+
}
|
|
22471
22500
|
case ",":
|
|
22472
22501
|
case ";":
|
|
22473
22502
|
case "[":
|
|
22474
22503
|
case "]":
|
|
22475
22504
|
case "(":
|
|
22476
|
-
case ")":
|
|
22477
22505
|
case "}":
|
|
22506
|
+
case "~":
|
|
22478
22507
|
if (!this._lineMode) {
|
|
22479
22508
|
matchLength = 1;
|
|
22480
22509
|
type5 = firstChar;
|
|
@@ -22639,7 +22668,7 @@ var N3Lexer = class {
|
|
|
22639
22668
|
}
|
|
22640
22669
|
};
|
|
22641
22670
|
|
|
22642
|
-
//
|
|
22671
|
+
// node_modules/n3/src/N3DataFactory.js
|
|
22643
22672
|
var { rdf: rdf2, xsd: xsd2 } = IRIs_default;
|
|
22644
22673
|
var DEFAULTGRAPH;
|
|
22645
22674
|
var _blankNodeCounter = 0;
|
|
@@ -22701,7 +22730,15 @@ var Literal2 = class _Literal extends Term {
|
|
|
22701
22730
|
get language() {
|
|
22702
22731
|
const id4 = this.id;
|
|
22703
22732
|
let atPos = id4.lastIndexOf('"') + 1;
|
|
22704
|
-
|
|
22733
|
+
const dirPos = id4.lastIndexOf("--");
|
|
22734
|
+
return atPos < id4.length && id4[atPos++] === "@" ? (dirPos > atPos ? id4.substr(0, dirPos) : id4).substr(atPos).toLowerCase() : "";
|
|
22735
|
+
}
|
|
22736
|
+
// ### The direction of this literal
|
|
22737
|
+
get direction() {
|
|
22738
|
+
const id4 = this.id;
|
|
22739
|
+
const endPos = id4.lastIndexOf('"');
|
|
22740
|
+
const dirPos = id4.lastIndexOf("--");
|
|
22741
|
+
return dirPos > endPos && dirPos + 2 < id4.length ? id4.substr(dirPos + 2).toLowerCase() : "";
|
|
22705
22742
|
}
|
|
22706
22743
|
// ### The datatype IRI of this literal
|
|
22707
22744
|
get datatype() {
|
|
@@ -22712,21 +22749,22 @@ var Literal2 = class _Literal extends Term {
|
|
|
22712
22749
|
const id4 = this.id, dtPos = id4.lastIndexOf('"') + 1;
|
|
22713
22750
|
const char = dtPos < id4.length ? id4[dtPos] : "";
|
|
22714
22751
|
return char === "^" ? id4.substr(dtPos + 2) : (
|
|
22715
|
-
// If "@" follows, return rdf:langString; xsd:string otherwise
|
|
22716
|
-
char !== "@" ? xsd2.string : rdf2.langString
|
|
22752
|
+
// If "@" follows, return rdf:langString or rdf:dirLangString; xsd:string otherwise
|
|
22753
|
+
char !== "@" ? xsd2.string : id4.indexOf("--", dtPos) > 0 ? rdf2.dirLangString : rdf2.langString
|
|
22717
22754
|
);
|
|
22718
22755
|
}
|
|
22719
22756
|
// ### Returns whether this object represents the same term as the other
|
|
22720
22757
|
equals(other2) {
|
|
22721
22758
|
if (other2 instanceof _Literal)
|
|
22722
22759
|
return this.id === other2.id;
|
|
22723
|
-
return !!other2 && !!other2.datatype && this.termType === other2.termType && this.value === other2.value && this.language === other2.language && this.datatype.value === other2.datatype.value;
|
|
22760
|
+
return !!other2 && !!other2.datatype && this.termType === other2.termType && this.value === other2.value && this.language === other2.language && (this.direction === other2.direction || this.direction === "" && !other2.direction) && this.datatype.value === other2.datatype.value;
|
|
22724
22761
|
}
|
|
22725
22762
|
toJSON() {
|
|
22726
22763
|
return {
|
|
22727
22764
|
termType: this.termType,
|
|
22728
22765
|
value: this.value,
|
|
22729
22766
|
language: this.language,
|
|
22767
|
+
direction: this.direction,
|
|
22730
22768
|
datatype: { termType: "NamedNode", value: this.datatypeString }
|
|
22731
22769
|
};
|
|
22732
22770
|
}
|
|
@@ -22820,6 +22858,9 @@ function blankNode(name9) {
|
|
|
22820
22858
|
function literal(value7, languageOrDataType) {
|
|
22821
22859
|
if (typeof languageOrDataType === "string")
|
|
22822
22860
|
return new Literal2(`"${value7}"@${languageOrDataType.toLowerCase()}`);
|
|
22861
|
+
if (languageOrDataType !== void 0 && !("termType" in languageOrDataType)) {
|
|
22862
|
+
return new Literal2(`"${value7}"@${languageOrDataType.language.toLowerCase()}${languageOrDataType.direction ? `--${languageOrDataType.direction.toLowerCase()}` : ""}`);
|
|
22863
|
+
}
|
|
22823
22864
|
let datatype3 = languageOrDataType ? languageOrDataType.value : "";
|
|
22824
22865
|
if (datatype3 === "") {
|
|
22825
22866
|
if (typeof value7 === "boolean")
|
|
@@ -22873,9 +22914,9 @@ function fromQuad(inQuad) {
|
|
|
22873
22914
|
return quad(fromTerm(inQuad.subject), fromTerm(inQuad.predicate), fromTerm(inQuad.object), fromTerm(inQuad.graph));
|
|
22874
22915
|
}
|
|
22875
22916
|
|
|
22876
|
-
//
|
|
22917
|
+
// node_modules/n3/src/N3Parser.js
|
|
22877
22918
|
var blankNodePrefix = 0;
|
|
22878
|
-
var N3Parser = class {
|
|
22919
|
+
var N3Parser = class _N3Parser {
|
|
22879
22920
|
constructor(options) {
|
|
22880
22921
|
this._contextStack = [];
|
|
22881
22922
|
this._graph = null;
|
|
@@ -22887,7 +22928,6 @@ var N3Parser = class {
|
|
|
22887
22928
|
this._readPredicateOrNamedGraph = this._readPredicate;
|
|
22888
22929
|
this._supportsQuads = !(isTurtle || isTriG || isNTriples || isN3);
|
|
22889
22930
|
this._isImpliedBy = options.isImpliedBy;
|
|
22890
|
-
this._supportsRDFStar = format4 === "" || /star|\*$/.test(format4);
|
|
22891
22931
|
if (isLineMode)
|
|
22892
22932
|
this._resolveRelativeIRI = (iri) => {
|
|
22893
22933
|
return null;
|
|
@@ -22895,6 +22935,8 @@ var N3Parser = class {
|
|
|
22895
22935
|
this._blankNodePrefix = typeof options.blankNodePrefix !== "string" ? "" : options.blankNodePrefix.replace(/^(?!_:)/, "_:");
|
|
22896
22936
|
this._lexer = options.lexer || new N3Lexer({ lineMode: isLineMode, n3: isN3, isImpliedBy: this._isImpliedBy });
|
|
22897
22937
|
this._explicitQuantifiers = !!options.explicitQuantifiers;
|
|
22938
|
+
this._parseUnsupportedVersions = !!options.parseUnsupportedVersions;
|
|
22939
|
+
this._version = options.version;
|
|
22898
22940
|
}
|
|
22899
22941
|
// ## Static class methods
|
|
22900
22942
|
// ### `_resetBlankNodePrefix` restarts blank node prefix identification
|
|
@@ -22954,6 +22996,12 @@ var N3Parser = class {
|
|
|
22954
22996
|
this._quantified = context4.quantified;
|
|
22955
22997
|
}
|
|
22956
22998
|
}
|
|
22999
|
+
// ### `_readBeforeTopContext` is called once only at the start of parsing.
|
|
23000
|
+
_readBeforeTopContext(token2) {
|
|
23001
|
+
if (this._version && !this._isValidVersion(this._version))
|
|
23002
|
+
return this._error(`Detected unsupported version as media type parameter: "${this._version}"`, token2);
|
|
23003
|
+
return this._readInTopContext(token2);
|
|
23004
|
+
}
|
|
22957
23005
|
// ### `_readInTopContext` reads a token when in the top context
|
|
22958
23006
|
_readInTopContext(token2) {
|
|
22959
23007
|
switch (token2.type) {
|
|
@@ -22973,6 +23021,11 @@ var N3Parser = class {
|
|
|
22973
23021
|
this._sparqlStyle = true;
|
|
22974
23022
|
case "@base":
|
|
22975
23023
|
return this._readBaseIRI;
|
|
23024
|
+
// It could be a version declaration
|
|
23025
|
+
case "VERSION":
|
|
23026
|
+
this._sparqlStyle = true;
|
|
23027
|
+
case "@version":
|
|
23028
|
+
return this._readVersion;
|
|
22976
23029
|
// It could be a graph
|
|
22977
23030
|
case "{":
|
|
22978
23031
|
if (this._supportsNamedGraphs) {
|
|
@@ -23038,6 +23091,10 @@ var N3Parser = class {
|
|
|
23038
23091
|
);
|
|
23039
23092
|
return this._readBlankNodeHead;
|
|
23040
23093
|
case "(":
|
|
23094
|
+
const stack = this._contextStack, parent4 = stack.length && stack[stack.length - 1];
|
|
23095
|
+
if (parent4.type === "<<") {
|
|
23096
|
+
return this._error("Unexpected list in reified triple", token2);
|
|
23097
|
+
}
|
|
23041
23098
|
this._saveContext("list", this._graph, this.RDF_NIL, null, null);
|
|
23042
23099
|
this._subject = null;
|
|
23043
23100
|
return this._readListItem;
|
|
@@ -23077,9 +23134,13 @@ var N3Parser = class {
|
|
|
23077
23134
|
} else
|
|
23078
23135
|
this._subject = this._factory.literal(token2.value, this._factory.namedNode(token2.prefix));
|
|
23079
23136
|
break;
|
|
23137
|
+
case "<<(":
|
|
23138
|
+
if (!this._n3Mode)
|
|
23139
|
+
return this._error("Disallowed triple term as subject", token2);
|
|
23140
|
+
this._saveContext("<<(", this._graph, null, null, null);
|
|
23141
|
+
this._graph = null;
|
|
23142
|
+
return this._readSubject;
|
|
23080
23143
|
case "<<":
|
|
23081
|
-
if (!this._supportsRDFStar)
|
|
23082
|
-
return this._error("Unexpected RDF-star syntax", token2);
|
|
23083
23144
|
this._saveContext("<<", this._graph, null, null, null);
|
|
23084
23145
|
this._graph = null;
|
|
23085
23146
|
return this._readSubject;
|
|
@@ -23103,6 +23164,7 @@ var N3Parser = class {
|
|
|
23103
23164
|
case ".":
|
|
23104
23165
|
case "]":
|
|
23105
23166
|
case "}":
|
|
23167
|
+
case "|}":
|
|
23106
23168
|
if (this._predicate === null)
|
|
23107
23169
|
return this._error(`Unexpected ${type5}`, token2);
|
|
23108
23170
|
this._subject = null;
|
|
@@ -23127,6 +23189,7 @@ var N3Parser = class {
|
|
|
23127
23189
|
if ((this._predicate = this._readEntity(token2)) === void 0)
|
|
23128
23190
|
return;
|
|
23129
23191
|
}
|
|
23192
|
+
this._validAnnotation = true;
|
|
23130
23193
|
return this._readObject;
|
|
23131
23194
|
}
|
|
23132
23195
|
// ### `_readObject` reads a quad's object
|
|
@@ -23149,6 +23212,10 @@ var N3Parser = class {
|
|
|
23149
23212
|
);
|
|
23150
23213
|
return this._readBlankNodeHead;
|
|
23151
23214
|
case "(":
|
|
23215
|
+
const stack = this._contextStack, parent4 = stack.length && stack[stack.length - 1];
|
|
23216
|
+
if (parent4.type === "<<") {
|
|
23217
|
+
return this._error("Unexpected list in reified triple", token2);
|
|
23218
|
+
}
|
|
23152
23219
|
this._saveContext("list", this._graph, this._subject, this._predicate, this.RDF_NIL);
|
|
23153
23220
|
this._subject = null;
|
|
23154
23221
|
return this._readListItem;
|
|
@@ -23163,9 +23230,11 @@ var N3Parser = class {
|
|
|
23163
23230
|
this._graph = this._factory.blankNode()
|
|
23164
23231
|
);
|
|
23165
23232
|
return this._readSubject;
|
|
23233
|
+
case "<<(":
|
|
23234
|
+
this._saveContext("<<(", this._graph, this._subject, this._predicate, null);
|
|
23235
|
+
this._graph = null;
|
|
23236
|
+
return this._readSubject;
|
|
23166
23237
|
case "<<":
|
|
23167
|
-
if (!this._supportsRDFStar)
|
|
23168
|
-
return this._error("Unexpected RDF-star syntax", token2);
|
|
23169
23238
|
this._saveContext("<<", this._graph, this._subject, this._predicate, null);
|
|
23170
23239
|
this._graph = null;
|
|
23171
23240
|
return this._readSubject;
|
|
@@ -23194,6 +23263,10 @@ var N3Parser = class {
|
|
|
23194
23263
|
this._subject = null;
|
|
23195
23264
|
return this._readBlankNodeTail(token2);
|
|
23196
23265
|
} else {
|
|
23266
|
+
const stack = this._contextStack, parentParent = stack.length > 1 && stack[stack.length - 2];
|
|
23267
|
+
if (parentParent.type === "<<") {
|
|
23268
|
+
return this._error("Unexpected compound blank node expression in reified triple", token2);
|
|
23269
|
+
}
|
|
23197
23270
|
this._predicate = null;
|
|
23198
23271
|
return this._readPredicate(token2);
|
|
23199
23272
|
}
|
|
@@ -23284,12 +23357,19 @@ var N3Parser = class {
|
|
|
23284
23357
|
this._graph = this._factory.blankNode()
|
|
23285
23358
|
);
|
|
23286
23359
|
return this._readSubject;
|
|
23360
|
+
case "<<":
|
|
23361
|
+
this._saveContext("<<", this._graph, null, null, null);
|
|
23362
|
+
this._graph = null;
|
|
23363
|
+
next4 = this._readSubject;
|
|
23364
|
+
break;
|
|
23287
23365
|
default:
|
|
23288
23366
|
if ((item4 = this._readEntity(token2)) === void 0)
|
|
23289
23367
|
return;
|
|
23290
23368
|
}
|
|
23291
23369
|
if (list === null)
|
|
23292
23370
|
this._subject = list = this._factory.blankNode();
|
|
23371
|
+
if (token2.type === "<<")
|
|
23372
|
+
stack[stack.length - 1].subject = this._subject;
|
|
23293
23373
|
if (previousList === null) {
|
|
23294
23374
|
if (parent4.predicate === null)
|
|
23295
23375
|
parent4.subject = list;
|
|
@@ -23317,43 +23397,73 @@ var N3Parser = class {
|
|
|
23317
23397
|
return this._completeObjectLiteral(token2, true);
|
|
23318
23398
|
}
|
|
23319
23399
|
// ### `_completeLiteral` completes a literal with an optional datatype or language
|
|
23320
|
-
_completeLiteral(token2) {
|
|
23400
|
+
_completeLiteral(token2, component2) {
|
|
23321
23401
|
let literal4 = this._factory.literal(this._literalValue);
|
|
23402
|
+
let readCb;
|
|
23322
23403
|
switch (token2.type) {
|
|
23323
23404
|
// Create a datatyped literal
|
|
23324
23405
|
case "type":
|
|
23325
23406
|
case "typeIRI":
|
|
23326
23407
|
const datatype3 = this._readEntity(token2);
|
|
23327
23408
|
if (datatype3 === void 0) return;
|
|
23409
|
+
if (datatype3.value === IRIs_default.rdf.langString || datatype3.value === IRIs_default.rdf.dirLangString) {
|
|
23410
|
+
return this._error("Detected illegal (directional) languaged-tagged string with explicit datatype", token2);
|
|
23411
|
+
}
|
|
23328
23412
|
literal4 = this._factory.literal(this._literalValue, datatype3);
|
|
23329
23413
|
token2 = null;
|
|
23330
23414
|
break;
|
|
23331
23415
|
// Create a language-tagged string
|
|
23332
23416
|
case "langcode":
|
|
23417
|
+
if (token2.value.split("-").some((t) => t.length > 8))
|
|
23418
|
+
return this._error("Detected language tag with subtag longer than 8 characters", token2);
|
|
23333
23419
|
literal4 = this._factory.literal(this._literalValue, token2.value);
|
|
23420
|
+
this._literalLanguage = token2.value;
|
|
23334
23421
|
token2 = null;
|
|
23422
|
+
readCb = this._readDirCode.bind(this, component2);
|
|
23335
23423
|
break;
|
|
23336
23424
|
}
|
|
23337
|
-
return { token: token2, literal: literal4 };
|
|
23425
|
+
return { token: token2, literal: literal4, readCb };
|
|
23426
|
+
}
|
|
23427
|
+
_readDirCode(component2, listItem, token2) {
|
|
23428
|
+
if (token2.type === "dircode") {
|
|
23429
|
+
const term3 = this._factory.literal(this._literalValue, { language: this._literalLanguage, direction: token2.value });
|
|
23430
|
+
if (component2 === "subject")
|
|
23431
|
+
this._subject = term3;
|
|
23432
|
+
else
|
|
23433
|
+
this._object = term3;
|
|
23434
|
+
this._literalLanguage = void 0;
|
|
23435
|
+
token2 = null;
|
|
23436
|
+
}
|
|
23437
|
+
if (component2 === "subject")
|
|
23438
|
+
return token2 === null ? this._readPredicateOrNamedGraph : this._readPredicateOrNamedGraph(token2);
|
|
23439
|
+
return this._completeObjectLiteralPost(token2, listItem);
|
|
23338
23440
|
}
|
|
23339
23441
|
// Completes a literal in subject position
|
|
23340
23442
|
_completeSubjectLiteral(token2) {
|
|
23341
|
-
|
|
23443
|
+
const completed2 = this._completeLiteral(token2, "subject");
|
|
23444
|
+
this._subject = completed2.literal;
|
|
23445
|
+
if (completed2.readCb)
|
|
23446
|
+
return completed2.readCb.bind(this, false);
|
|
23342
23447
|
return this._readPredicateOrNamedGraph;
|
|
23343
23448
|
}
|
|
23344
23449
|
// Completes a literal in object position
|
|
23345
23450
|
_completeObjectLiteral(token2, listItem) {
|
|
23346
|
-
const completed2 = this._completeLiteral(token2);
|
|
23451
|
+
const completed2 = this._completeLiteral(token2, "object");
|
|
23347
23452
|
if (!completed2)
|
|
23348
23453
|
return;
|
|
23349
23454
|
this._object = completed2.literal;
|
|
23455
|
+
if (completed2.readCb)
|
|
23456
|
+
return completed2.readCb.bind(this, listItem);
|
|
23457
|
+
return this._completeObjectLiteralPost(completed2.token, listItem);
|
|
23458
|
+
}
|
|
23459
|
+
_completeObjectLiteralPost(token2, listItem) {
|
|
23350
23460
|
if (listItem)
|
|
23351
23461
|
this._emit(this._subject, this.RDF_FIRST, this._object, this._graph);
|
|
23352
|
-
if (
|
|
23462
|
+
if (token2 === null)
|
|
23353
23463
|
return this._getContextEndReader();
|
|
23354
23464
|
else {
|
|
23355
23465
|
this._readCallback = this._getContextEndReader();
|
|
23356
|
-
return this._readCallback(
|
|
23466
|
+
return this._readCallback(token2);
|
|
23357
23467
|
}
|
|
23358
23468
|
}
|
|
23359
23469
|
// ### `_readFormulaTail` reads the end of a formula
|
|
@@ -23367,7 +23477,7 @@ var N3Parser = class {
|
|
|
23367
23477
|
}
|
|
23368
23478
|
// ### `_readPunctuation` reads punctuation between quads or quad parts
|
|
23369
23479
|
_readPunctuation(token2) {
|
|
23370
|
-
let next4, graph3 = this._graph;
|
|
23480
|
+
let next4, graph3 = this._graph, startingAnnotation = false;
|
|
23371
23481
|
const subject8 = this._subject, inversePredicate = this._inversePredicate;
|
|
23372
23482
|
switch (token2.type) {
|
|
23373
23483
|
// A closing brace ends a graph
|
|
@@ -23380,6 +23490,7 @@ var N3Parser = class {
|
|
|
23380
23490
|
// A dot just ends the statement, without sharing anything with the next
|
|
23381
23491
|
case ".":
|
|
23382
23492
|
this._subject = null;
|
|
23493
|
+
this._tripleTerm = null;
|
|
23383
23494
|
next4 = this._contextStack.length ? this._readSubject : this._readInTopContext;
|
|
23384
23495
|
if (inversePredicate) this._inversePredicate = false;
|
|
23385
23496
|
break;
|
|
@@ -23391,19 +23502,26 @@ var N3Parser = class {
|
|
|
23391
23502
|
case ",":
|
|
23392
23503
|
next4 = this._readObject;
|
|
23393
23504
|
break;
|
|
23505
|
+
// ~ is allowed in the annotation syntax
|
|
23506
|
+
case "~":
|
|
23507
|
+
next4 = this._readReifierInAnnotation;
|
|
23508
|
+
startingAnnotation = true;
|
|
23509
|
+
break;
|
|
23394
23510
|
// {| means that the current triple is annotated with predicate-object pairs.
|
|
23395
23511
|
case "{|":
|
|
23396
|
-
|
|
23397
|
-
|
|
23398
|
-
|
|
23399
|
-
this._subject = this._factory.quad(subject8, predicate4, object8, this.DEFAULTGRAPH);
|
|
23512
|
+
this._subject = this._readTripleTerm();
|
|
23513
|
+
this._validAnnotation = false;
|
|
23514
|
+
startingAnnotation = true;
|
|
23400
23515
|
next4 = this._readPredicate;
|
|
23401
23516
|
break;
|
|
23402
|
-
// |} means that the current
|
|
23517
|
+
// |} means that the current reified triple in annotation syntax is finalized.
|
|
23403
23518
|
case "|}":
|
|
23404
|
-
if (this.
|
|
23405
|
-
return this._error("Unexpected
|
|
23519
|
+
if (!this._annotation)
|
|
23520
|
+
return this._error("Unexpected annotation syntax closing", token2);
|
|
23521
|
+
if (!this._validAnnotation)
|
|
23522
|
+
return this._error("Annotation block can not be empty", token2);
|
|
23406
23523
|
this._subject = null;
|
|
23524
|
+
this._annotation = false;
|
|
23407
23525
|
next4 = this._readPunctuation;
|
|
23408
23526
|
break;
|
|
23409
23527
|
default:
|
|
@@ -23413,13 +23531,16 @@ var N3Parser = class {
|
|
|
23413
23531
|
}
|
|
23414
23532
|
return this._error(`Expected punctuation to follow "${this._object.id}"`, token2);
|
|
23415
23533
|
}
|
|
23416
|
-
if (subject8 !== null) {
|
|
23534
|
+
if (subject8 !== null && (!startingAnnotation || startingAnnotation && !this._annotation)) {
|
|
23417
23535
|
const predicate4 = this._predicate, object8 = this._object;
|
|
23418
23536
|
if (!inversePredicate)
|
|
23419
23537
|
this._emit(subject8, predicate4, object8, graph3);
|
|
23420
23538
|
else
|
|
23421
23539
|
this._emit(object8, predicate4, subject8, graph3);
|
|
23422
23540
|
}
|
|
23541
|
+
if (startingAnnotation) {
|
|
23542
|
+
this._annotation = true;
|
|
23543
|
+
}
|
|
23423
23544
|
return next4;
|
|
23424
23545
|
}
|
|
23425
23546
|
// ### `_readBlankNodePunctuation` reads punctuation in a blank node
|
|
@@ -23470,6 +23591,21 @@ var N3Parser = class {
|
|
|
23470
23591
|
this._setBase(iri);
|
|
23471
23592
|
return this._readDeclarationPunctuation;
|
|
23472
23593
|
}
|
|
23594
|
+
// ### `_isValidVersion` checks if the given version is valid for this parser to handle.
|
|
23595
|
+
_isValidVersion(version6) {
|
|
23596
|
+
return this._parseUnsupportedVersions || _N3Parser.SUPPORTED_VERSIONS.includes(version6);
|
|
23597
|
+
}
|
|
23598
|
+
// ### `_readVersion` reads version string declaration
|
|
23599
|
+
_readVersion(token2) {
|
|
23600
|
+
if (token2.type !== "literal")
|
|
23601
|
+
return this._error("Expected literal to follow version declaration", token2);
|
|
23602
|
+
if (token2.end - token2.start !== token2.value.length + 2)
|
|
23603
|
+
return this._error("Version declarations must use single quotes", token2);
|
|
23604
|
+
this._versionCallback(token2.value);
|
|
23605
|
+
if (!this._isValidVersion(token2.value))
|
|
23606
|
+
return this._error(`Detected unsupported version: "${token2.value}"`, token2);
|
|
23607
|
+
return this._readDeclarationPunctuation;
|
|
23608
|
+
}
|
|
23473
23609
|
// ### `_readNamedGraphLabel` reads the label of a named graph
|
|
23474
23610
|
_readNamedGraphLabel(token2) {
|
|
23475
23611
|
switch (token2.type) {
|
|
@@ -23596,26 +23732,17 @@ var N3Parser = class {
|
|
|
23596
23732
|
this._emit(subject8, predicate4, object8, this._graph);
|
|
23597
23733
|
return this._readPath;
|
|
23598
23734
|
}
|
|
23599
|
-
// ### `
|
|
23600
|
-
|
|
23601
|
-
if (token2.type !== ">>")
|
|
23602
|
-
|
|
23603
|
-
return this._readRDFStarTail;
|
|
23604
|
-
return this._error(`Expected >> to follow "${this._object.id}"`, token2);
|
|
23605
|
-
}
|
|
23606
|
-
return this._readRDFStarTail(token2);
|
|
23607
|
-
}
|
|
23608
|
-
// ### `_readRDFStarTail` reads the end of a nested RDF-star triple
|
|
23609
|
-
_readRDFStarTail(token2) {
|
|
23610
|
-
if (token2.type !== ">>")
|
|
23611
|
-
return this._error(`Expected >> but got ${token2.type}`, token2);
|
|
23735
|
+
// ### `_readTripleTermTail` reads the end of a triple term
|
|
23736
|
+
_readTripleTermTail(token2) {
|
|
23737
|
+
if (token2.type !== ")>>")
|
|
23738
|
+
return this._error(`Expected )>> but got ${token2.type}`, token2);
|
|
23612
23739
|
const quad3 = this._factory.quad(
|
|
23613
23740
|
this._subject,
|
|
23614
23741
|
this._predicate,
|
|
23615
23742
|
this._object,
|
|
23616
23743
|
this._graph || this.DEFAULTGRAPH
|
|
23617
23744
|
);
|
|
23618
|
-
this._restoreContext("<<", token2);
|
|
23745
|
+
this._restoreContext("<<(", token2);
|
|
23619
23746
|
if (this._subject === null) {
|
|
23620
23747
|
this._subject = quad3;
|
|
23621
23748
|
return this._readPredicate;
|
|
@@ -23624,6 +23751,63 @@ var N3Parser = class {
|
|
|
23624
23751
|
return this._getContextEndReader();
|
|
23625
23752
|
}
|
|
23626
23753
|
}
|
|
23754
|
+
// ### `_readReifiedTripleTailOrReifier` reads a reifier or the end of a nested reified triple
|
|
23755
|
+
_readReifiedTripleTailOrReifier(token2) {
|
|
23756
|
+
if (token2.type === "~") {
|
|
23757
|
+
return this._readReifier;
|
|
23758
|
+
}
|
|
23759
|
+
return this._readReifiedTripleTail(token2);
|
|
23760
|
+
}
|
|
23761
|
+
// ### `_readReifiedTripleTail` reads the end of a nested reified triple
|
|
23762
|
+
_readReifiedTripleTail(token2) {
|
|
23763
|
+
if (token2.type !== ">>")
|
|
23764
|
+
return this._error(`Expected >> but got ${token2.type}`, token2);
|
|
23765
|
+
this._tripleTerm = null;
|
|
23766
|
+
const reifier = this._readTripleTerm();
|
|
23767
|
+
this._restoreContext("<<", token2);
|
|
23768
|
+
const stack = this._contextStack, parent4 = stack.length && stack[stack.length - 1];
|
|
23769
|
+
if (parent4 && parent4.type === "list") {
|
|
23770
|
+
this._emit(this._subject, this.RDF_FIRST, reifier, this._graph);
|
|
23771
|
+
return this._getContextEndReader();
|
|
23772
|
+
} else if (this._subject === null) {
|
|
23773
|
+
this._subject = reifier;
|
|
23774
|
+
return this._readPredicateOrReifierTripleEnd;
|
|
23775
|
+
} else {
|
|
23776
|
+
this._object = reifier;
|
|
23777
|
+
return this._getContextEndReader();
|
|
23778
|
+
}
|
|
23779
|
+
}
|
|
23780
|
+
_readPredicateOrReifierTripleEnd(token2) {
|
|
23781
|
+
if (token2.type === ".") {
|
|
23782
|
+
this._subject = null;
|
|
23783
|
+
return this._readPunctuation(token2);
|
|
23784
|
+
}
|
|
23785
|
+
return this._readPredicate(token2);
|
|
23786
|
+
}
|
|
23787
|
+
// ### `_readReifier` reads the triple term identifier after a tilde when in a reifying triple.
|
|
23788
|
+
_readReifier(token2) {
|
|
23789
|
+
this._reifier = this._readEntity(token2);
|
|
23790
|
+
return this._readReifiedTripleTail;
|
|
23791
|
+
}
|
|
23792
|
+
// ### `_readReifier` reads the optional triple term identifier after a tilde when in annotation syntax.
|
|
23793
|
+
_readReifierInAnnotation(token2) {
|
|
23794
|
+
if (token2.type === "IRI" || token2.type === "typeIRI" || token2.type === "type" || token2.type === "prefixed" || token2.type === "blank" || token2.type === "var") {
|
|
23795
|
+
this._reifier = this._readEntity(token2);
|
|
23796
|
+
return this._readPunctuation;
|
|
23797
|
+
}
|
|
23798
|
+
this._readTripleTerm();
|
|
23799
|
+
this._subject = null;
|
|
23800
|
+
return this._readPunctuation(token2);
|
|
23801
|
+
}
|
|
23802
|
+
_readTripleTerm() {
|
|
23803
|
+
const stack = this._contextStack, parent4 = stack.length && stack[stack.length - 1];
|
|
23804
|
+
const parentGraph = parent4 ? parent4.graph : void 0;
|
|
23805
|
+
const reifier = this._reifier || this._factory.blankNode();
|
|
23806
|
+
this._reifier = null;
|
|
23807
|
+
this._tripleTerm = this._tripleTerm || this._factory.quad(this._subject, this._predicate, this._object);
|
|
23808
|
+
this._emit(reifier, this.RDF_REIFIES, this._tripleTerm, parentGraph || this.DEFAULTGRAPH);
|
|
23809
|
+
return reifier;
|
|
23810
|
+
}
|
|
23627
23811
|
// ### `_getContextEndReader` gets the next reader function at the end of a context
|
|
23628
23812
|
_getContextEndReader() {
|
|
23629
23813
|
const contextStack = this._contextStack;
|
|
@@ -23636,8 +23820,10 @@ var N3Parser = class {
|
|
|
23636
23820
|
return this._readListItem;
|
|
23637
23821
|
case "formula":
|
|
23638
23822
|
return this._readFormulaTail;
|
|
23823
|
+
case "<<(":
|
|
23824
|
+
return this._readTripleTermTail;
|
|
23639
23825
|
case "<<":
|
|
23640
|
-
return this.
|
|
23826
|
+
return this._readReifiedTripleTailOrReifier;
|
|
23641
23827
|
}
|
|
23642
23828
|
}
|
|
23643
23829
|
// ### `_emit` sends a quad through the callback
|
|
@@ -23735,21 +23921,24 @@ var N3Parser = class {
|
|
|
23735
23921
|
}
|
|
23736
23922
|
// ## Public methods
|
|
23737
23923
|
// ### `parse` parses the N3 input and emits each parsed quad through the onQuad callback.
|
|
23738
|
-
parse(input2, quadCallback, prefixCallback) {
|
|
23739
|
-
let onQuad, onPrefix, onComment;
|
|
23740
|
-
if (quadCallback && (quadCallback.onQuad || quadCallback.onPrefix || quadCallback.onComment)) {
|
|
23924
|
+
parse(input2, quadCallback, prefixCallback, versionCallback) {
|
|
23925
|
+
let onQuad, onPrefix, onComment, onVersion;
|
|
23926
|
+
if (quadCallback && (quadCallback.onQuad || quadCallback.onPrefix || quadCallback.onComment || quadCallback.onVersion)) {
|
|
23741
23927
|
onQuad = quadCallback.onQuad;
|
|
23742
23928
|
onPrefix = quadCallback.onPrefix;
|
|
23743
23929
|
onComment = quadCallback.onComment;
|
|
23930
|
+
onVersion = quadCallback.onVersion;
|
|
23744
23931
|
} else {
|
|
23745
23932
|
onQuad = quadCallback;
|
|
23746
23933
|
onPrefix = prefixCallback;
|
|
23934
|
+
onVersion = versionCallback;
|
|
23747
23935
|
}
|
|
23748
|
-
this._readCallback = this.
|
|
23936
|
+
this._readCallback = this._readBeforeTopContext;
|
|
23749
23937
|
this._sparqlStyle = false;
|
|
23750
23938
|
this._prefixes = /* @__PURE__ */ Object.create(null);
|
|
23751
23939
|
this._prefixes._ = this._blankNodePrefix ? this._blankNodePrefix.substr(2) : `b${blankNodePrefix++}_`;
|
|
23752
23940
|
this._prefixCallback = onPrefix || noop2;
|
|
23941
|
+
this._versionCallback = onVersion || noop2;
|
|
23753
23942
|
this._inversePredicate = false;
|
|
23754
23943
|
this._quantified = /* @__PURE__ */ Object.create(null);
|
|
23755
23944
|
if (!onQuad) {
|
|
@@ -23795,6 +23984,7 @@ function initDataFactory(parser, factory) {
|
|
|
23795
23984
|
parser.RDF_FIRST = factory.namedNode(IRIs_default.rdf.first);
|
|
23796
23985
|
parser.RDF_REST = factory.namedNode(IRIs_default.rdf.rest);
|
|
23797
23986
|
parser.RDF_NIL = factory.namedNode(IRIs_default.rdf.nil);
|
|
23987
|
+
parser.RDF_REIFIES = factory.namedNode(IRIs_default.rdf.reifies);
|
|
23798
23988
|
parser.N3_FORALL = factory.namedNode(IRIs_default.r.forAll);
|
|
23799
23989
|
parser.N3_FORSOME = factory.namedNode(IRIs_default.r.forSome);
|
|
23800
23990
|
parser.ABBREVIATIONS = {
|
|
@@ -23805,6 +23995,11 @@ function initDataFactory(parser, factory) {
|
|
|
23805
23995
|
};
|
|
23806
23996
|
parser.QUANTIFIERS_GRAPH = factory.namedNode("urn:n3:quantifiers");
|
|
23807
23997
|
}
|
|
23998
|
+
N3Parser.SUPPORTED_VERSIONS = [
|
|
23999
|
+
"1.2",
|
|
24000
|
+
"1.2-basic",
|
|
24001
|
+
"1.1"
|
|
24002
|
+
];
|
|
23808
24003
|
initDataFactory(N3Parser.prototype, N3DataFactory_default);
|
|
23809
24004
|
|
|
23810
24005
|
// node_modules/rdflib/esm/rdfaparser.js
|
|
@@ -27939,9 +28134,6 @@ var Thing = class {
|
|
|
27939
28134
|
var LdpContainer = class extends Thing {
|
|
27940
28135
|
constructor(uri6, store, editable = false) {
|
|
27941
28136
|
super(uri6, store, editable);
|
|
27942
|
-
this.uri = uri6;
|
|
27943
|
-
this.store = store;
|
|
27944
|
-
this.editable = editable;
|
|
27945
28137
|
}
|
|
27946
28138
|
/**
|
|
27947
28139
|
* Resources that the LDP Container contains
|
|
@@ -28079,8 +28271,6 @@ var WebIdProfile = class extends Thing {
|
|
|
28079
28271
|
constructor(webId, store, editable = false) {
|
|
28080
28272
|
super(webId, store, editable);
|
|
28081
28273
|
this.webId = webId;
|
|
28082
|
-
this.store = store;
|
|
28083
|
-
this.editable = editable;
|
|
28084
28274
|
this.profileQuery = this.store.profileQuery(this.webId);
|
|
28085
28275
|
}
|
|
28086
28276
|
/**
|
|
@@ -28221,9 +28411,6 @@ var SearchIndex = class {
|
|
|
28221
28411
|
var RdfDocument = class extends Thing {
|
|
28222
28412
|
constructor(uri6, store, editable = false) {
|
|
28223
28413
|
super(uri6, store, editable);
|
|
28224
|
-
this.uri = uri6;
|
|
28225
|
-
this.store = store;
|
|
28226
|
-
this.editable = editable;
|
|
28227
28414
|
}
|
|
28228
28415
|
subjects() {
|
|
28229
28416
|
const matches = this.store.statementsMatching(
|
|
@@ -28245,9 +28432,6 @@ var RdfDocument = class extends Thing {
|
|
|
28245
28432
|
var LabelIndex = class extends RdfDocument {
|
|
28246
28433
|
constructor(uri6, store, editable = false) {
|
|
28247
28434
|
super(uri6, store, editable);
|
|
28248
|
-
this.uri = uri6;
|
|
28249
|
-
this.store = store;
|
|
28250
|
-
this.editable = editable;
|
|
28251
28435
|
}
|
|
28252
28436
|
/**
|
|
28253
28437
|
* Returns the URIs and labels for all the things listed in the document.
|
|
@@ -50084,8 +50268,6 @@ function listKnownTerms() {
|
|
|
50084
50268
|
// src/uri/UriService.ts
|
|
50085
50269
|
var import_slugify = __toESM(require_slugify(), 1);
|
|
50086
50270
|
var UriService = class {
|
|
50087
|
-
// We expect to use the store for calculating the uris for things
|
|
50088
|
-
// e.g. looking up locations in type index
|
|
50089
50271
|
constructor(store) {
|
|
50090
50272
|
this.store = store;
|
|
50091
50273
|
}
|
|
@@ -50288,9 +50470,6 @@ function proposeAppsFor(thing) {
|
|
|
50288
50470
|
var TypeIndex2 = class extends Thing {
|
|
50289
50471
|
constructor(uri6, store, editable = false) {
|
|
50290
50472
|
super(uri6, store, editable);
|
|
50291
|
-
this.uri = uri6;
|
|
50292
|
-
this.store = store;
|
|
50293
|
-
this.editable = editable;
|
|
50294
50473
|
}
|
|
50295
50474
|
listAll() {
|
|
50296
50475
|
const forClassStatements = this.store.statementsMatching(
|