@pod-os/elements 0.41.0-rc.7fd1609.0 → 0.41.0-rc.90eb79e.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.
Files changed (25) hide show
  1. package/dist/cjs/{index-BP03J2RA.js → index-Bc4gZgPG.js} +75 -246
  2. package/dist/cjs/{jsonld-V2RB47OZ-B6QDxKa1.js → jsonld-V2RB47OZ-JAbnY92y.js} +1 -1
  3. package/dist/cjs/pos-add-literal-value_3.cjs.entry.js +1 -1
  4. package/dist/cjs/pos-add-new-thing_32.cjs.entry.js +1 -1
  5. package/dist/cjs/pos-add-relation.cjs.entry.js +1 -1
  6. package/dist/cjs/pos-container-contents.cjs.entry.js +1 -1
  7. package/dist/cjs/pos-subjects.cjs.entry.js +1 -1
  8. package/dist/components/index2.js +1 -1
  9. package/dist/elements/elements.esm.js +1 -1
  10. package/dist/elements/{p-f9c10964.entry.js → p-2ee1efdb.entry.js} +1 -1
  11. package/dist/elements/{p-1e0bd264.entry.js → p-57d32176.entry.js} +1 -1
  12. package/dist/elements/p-BXBNVUZ5.js +67 -0
  13. package/dist/elements/{p-DqO-cIHe.js → p-DuW6UWKz.js} +1 -1
  14. package/dist/elements/{p-3ef3a9a9.entry.js → p-a8628eb4.entry.js} +1 -1
  15. package/dist/elements/{p-d31c55b9.entry.js → p-ed1d9d77.entry.js} +1 -1
  16. package/dist/elements/{p-5506bf9a.entry.js → p-f6da714c.entry.js} +1 -1
  17. package/dist/esm/{index-CMbRpNym.js → index-LnGgDqFG.js} +75 -246
  18. package/dist/esm/{jsonld-V2RB47OZ-zn531VHn.js → jsonld-V2RB47OZ-DFmZ008Y.js} +1 -1
  19. package/dist/esm/pos-add-literal-value_3.entry.js +1 -1
  20. package/dist/esm/pos-add-new-thing_32.entry.js +1 -1
  21. package/dist/esm/pos-add-relation.entry.js +1 -1
  22. package/dist/esm/pos-container-contents.entry.js +1 -1
  23. package/dist/esm/pos-subjects.entry.js +1 -1
  24. package/package.json +2 -2
  25. package/dist/elements/p-sVi8GCz5.js +0 -67
@@ -22140,7 +22140,7 @@ function listToCollection(kb, obj) {
22140
22140
  }
22141
22141
  async function jsonldParser(str, kb, base2) {
22142
22142
  const baseString = base2 && Object.prototype.hasOwnProperty.call(base2, "termType") ? base2.value : base2;
22143
- const jsonld = await Promise.resolve().then(function () { return require('./jsonld-V2RB47OZ-B6QDxKa1.js'); });
22143
+ const jsonld = await Promise.resolve().then(function () { return require('./jsonld-V2RB47OZ-JAbnY92y.js'); });
22144
22144
  const flattened = await jsonld.default.flatten(JSON.parse(str), null, {
22145
22145
  base: baseString
22146
22146
  });
@@ -22188,10 +22188,10 @@ function createStatement(kb, id4, property4, value7, base2) {
22188
22188
  return kb.rdfFactory.quad(id4, predicate4, object8, kb.rdfFactory.namedNode(base2));
22189
22189
  }
22190
22190
 
22191
- // node_modules/n3/src/N3Lexer.js
22191
+ // ../node_modules/n3/src/N3Lexer.js
22192
22192
  var import_buffer = __toESM(require_buffer());
22193
22193
 
22194
- // node_modules/n3/src/IRIs.js
22194
+ // ../node_modules/n3/src/IRIs.js
22195
22195
  var RDF2 = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
22196
22196
  var XSD = "http://www.w3.org/2001/XMLSchema#";
22197
22197
  var SWAP = "http://www.w3.org/2000/10/swap/";
@@ -22208,9 +22208,7 @@ var IRIs_default = {
22208
22208
  nil: `${RDF2}nil`,
22209
22209
  first: `${RDF2}first`,
22210
22210
  rest: `${RDF2}rest`,
22211
- langString: `${RDF2}langString`,
22212
- dirLangString: `${RDF2}dirLangString`,
22213
- reifies: `${RDF2}reifies`
22211
+ langString: `${RDF2}langString`
22214
22212
  },
22215
22213
  owl: {
22216
22214
  sameAs: "http://www.w3.org/2002/07/owl#sameAs"
@@ -22225,7 +22223,7 @@ var IRIs_default = {
22225
22223
  }
22226
22224
  };
22227
22225
 
22228
- // node_modules/n3/src/N3Lexer.js
22226
+ // ../node_modules/n3/src/N3Lexer.js
22229
22227
  var { xsd } = IRIs_default;
22230
22228
  var escapeSequence = /\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g;
22231
22229
  var escapeReplacements = {
@@ -22263,7 +22261,6 @@ var lineModeRegExps = {
22263
22261
  _unescapedIri: true,
22264
22262
  _simpleQuotedString: true,
22265
22263
  _langcode: true,
22266
- _dircode: true,
22267
22264
  _blank: true,
22268
22265
  _newline: true,
22269
22266
  _comment: true,
@@ -22277,16 +22274,15 @@ var N3Lexer = class {
22277
22274
  this._unescapedIri = /^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/;
22278
22275
  this._simpleQuotedString = /^"([^"\\\r\n]*)"(?=[^"])/;
22279
22276
  this._simpleApostropheString = /^'([^'\\\r\n]*)'(?=[^'])/;
22280
- this._langcode = /^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9])/i;
22281
- this._dircode = /^--(ltr)|(rtl)/;
22277
+ this._langcode = /^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i;
22282
22278
  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<])/;
22283
22279
  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#()\[\]\{\}"'<>]))/;
22284
22280
  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#()\[\]\{\}"'<>])/;
22285
22281
  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#()\[\]\{\}"'<>]))/;
22286
22282
  this._number = /^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/;
22287
22283
  this._boolean = /^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/;
22288
- this._atKeyword = /^@[a-z]+(?=[\s#<:])/i;
22289
- this._keyword = /^(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<])/i;
22284
+ this._keyword = /^@[a-z]+(?=[\s#<:])/i;
22285
+ this._sparqlKeyword = /^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i;
22290
22286
  this._shortPredicates = /^a(?=[\s#()\[\]\{\}"'<>])/;
22291
22287
  this._newline = /^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/;
22292
22288
  this._comment = /#([^\n\r]*)/;
@@ -22360,9 +22356,7 @@ var N3Lexer = class {
22360
22356
  if (value7 === null || illegalIriChars.test(value7))
22361
22357
  return reportSyntaxError(this);
22362
22358
  type5 = "IRI";
22363
- } else if (input2.length > 2 && input2[1] === "<" && input2[2] === "(")
22364
- type5 = "<<(", matchLength = 3;
22365
- else if (!this._lineMode && input2.length > (inputFinished ? 1 : 2) && input2[1] === "<")
22359
+ } else if (input2.length > 1 && input2[1] === "<")
22366
22360
  type5 = "<<", matchLength = 2;
22367
22361
  else if (this._n3Mode && input2.length > 1 && input2[1] === "=") {
22368
22362
  matchLength = 2;
@@ -22411,9 +22405,9 @@ var N3Lexer = class {
22411
22405
  type5 = "var", value7 = match[0];
22412
22406
  break;
22413
22407
  case "@":
22414
- if (this._previousMarker === "literal" && (match = this._langcode.exec(input2)) && match[1] !== "version")
22408
+ if (this._previousMarker === "literal" && (match = this._langcode.exec(input2)))
22415
22409
  type5 = "langcode", value7 = match[1];
22416
- else if (match = this._atKeyword.exec(input2))
22410
+ else if (match = this._keyword.exec(input2))
22417
22411
  type5 = match[0];
22418
22412
  break;
22419
22413
  case ".":
@@ -22435,11 +22429,6 @@ var N3Lexer = class {
22435
22429
  case "9":
22436
22430
  case "+":
22437
22431
  case "-":
22438
- if (input2[1] === "-") {
22439
- if (this._previousMarker === "langcode" && (match = this._dircode.exec(input2)))
22440
- type5 = "dircode", matchLength = 2, value7 = match[1] || match[2], matchLength = value7.length + 2;
22441
- break;
22442
- }
22443
22432
  if (match = this._number.exec(input2) || inputFinished && (match = this._number.exec(`${input2} `))) {
22444
22433
  type5 = "literal", value7 = match[0];
22445
22434
  prefix3 = typeof match[1] === "string" ? xsd.double : typeof match[2] === "string" ? xsd.decimal : xsd.integer;
@@ -22451,9 +22440,7 @@ var N3Lexer = class {
22451
22440
  case "P":
22452
22441
  case "G":
22453
22442
  case "g":
22454
- case "V":
22455
- case "v":
22456
- if (match = this._keyword.exec(input2))
22443
+ if (match = this._sparqlKeyword.exec(input2))
22457
22444
  type5 = match[0].toUpperCase();
22458
22445
  else
22459
22446
  inconclusive = true;
@@ -22483,21 +22470,13 @@ var N3Lexer = class {
22483
22470
  case "!":
22484
22471
  if (!this._n3Mode)
22485
22472
  break;
22486
- case ")":
22487
- if (!inputFinished && (input2.length === 1 || input2.length === 2 && input2[1] === ">")) {
22488
- break;
22489
- }
22490
- if (input2.length > 2 && input2[1] === ">" && input2[2] === ">") {
22491
- type5 = ")>>", matchLength = 3;
22492
- break;
22493
- }
22494
22473
  case ",":
22495
22474
  case ";":
22496
22475
  case "[":
22497
22476
  case "]":
22498
22477
  case "(":
22478
+ case ")":
22499
22479
  case "}":
22500
- case "~":
22501
22480
  if (!this._lineMode) {
22502
22481
  matchLength = 1;
22503
22482
  type5 = firstChar;
@@ -22662,7 +22641,7 @@ var N3Lexer = class {
22662
22641
  }
22663
22642
  };
22664
22643
 
22665
- // node_modules/n3/src/N3DataFactory.js
22644
+ // ../node_modules/n3/src/N3DataFactory.js
22666
22645
  var { rdf: rdf2, xsd: xsd2 } = IRIs_default;
22667
22646
  var DEFAULTGRAPH;
22668
22647
  var _blankNodeCounter = 0;
@@ -22724,15 +22703,7 @@ var Literal2 = class _Literal extends Term {
22724
22703
  get language() {
22725
22704
  const id4 = this.id;
22726
22705
  let atPos = id4.lastIndexOf('"') + 1;
22727
- const dirPos = id4.lastIndexOf("--");
22728
- return atPos < id4.length && id4[atPos++] === "@" ? (dirPos > atPos ? id4.substr(0, dirPos) : id4).substr(atPos).toLowerCase() : "";
22729
- }
22730
- // ### The direction of this literal
22731
- get direction() {
22732
- const id4 = this.id;
22733
- const endPos = id4.lastIndexOf('"');
22734
- const dirPos = id4.lastIndexOf("--");
22735
- return dirPos > endPos && dirPos + 2 < id4.length ? id4.substr(dirPos + 2).toLowerCase() : "";
22706
+ return atPos < id4.length && id4[atPos++] === "@" ? id4.substr(atPos).toLowerCase() : "";
22736
22707
  }
22737
22708
  // ### The datatype IRI of this literal
22738
22709
  get datatype() {
@@ -22743,22 +22714,21 @@ var Literal2 = class _Literal extends Term {
22743
22714
  const id4 = this.id, dtPos = id4.lastIndexOf('"') + 1;
22744
22715
  const char = dtPos < id4.length ? id4[dtPos] : "";
22745
22716
  return char === "^" ? id4.substr(dtPos + 2) : (
22746
- // If "@" follows, return rdf:langString or rdf:dirLangString; xsd:string otherwise
22747
- char !== "@" ? xsd2.string : id4.indexOf("--", dtPos) > 0 ? rdf2.dirLangString : rdf2.langString
22717
+ // If "@" follows, return rdf:langString; xsd:string otherwise
22718
+ char !== "@" ? xsd2.string : rdf2.langString
22748
22719
  );
22749
22720
  }
22750
22721
  // ### Returns whether this object represents the same term as the other
22751
22722
  equals(other2) {
22752
22723
  if (other2 instanceof _Literal)
22753
22724
  return this.id === other2.id;
22754
- 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;
22725
+ return !!other2 && !!other2.datatype && this.termType === other2.termType && this.value === other2.value && this.language === other2.language && this.datatype.value === other2.datatype.value;
22755
22726
  }
22756
22727
  toJSON() {
22757
22728
  return {
22758
22729
  termType: this.termType,
22759
22730
  value: this.value,
22760
22731
  language: this.language,
22761
- direction: this.direction,
22762
22732
  datatype: { termType: "NamedNode", value: this.datatypeString }
22763
22733
  };
22764
22734
  }
@@ -22852,9 +22822,6 @@ function blankNode(name9) {
22852
22822
  function literal(value7, languageOrDataType) {
22853
22823
  if (typeof languageOrDataType === "string")
22854
22824
  return new Literal2(`"${value7}"@${languageOrDataType.toLowerCase()}`);
22855
- if (languageOrDataType !== void 0 && !("termType" in languageOrDataType)) {
22856
- return new Literal2(`"${value7}"@${languageOrDataType.language.toLowerCase()}${languageOrDataType.direction ? `--${languageOrDataType.direction.toLowerCase()}` : ""}`);
22857
- }
22858
22825
  let datatype3 = languageOrDataType ? languageOrDataType.value : "";
22859
22826
  if (datatype3 === "") {
22860
22827
  if (typeof value7 === "boolean")
@@ -22908,9 +22875,9 @@ function fromQuad(inQuad) {
22908
22875
  return quad(fromTerm(inQuad.subject), fromTerm(inQuad.predicate), fromTerm(inQuad.object), fromTerm(inQuad.graph));
22909
22876
  }
22910
22877
 
22911
- // node_modules/n3/src/N3Parser.js
22878
+ // ../node_modules/n3/src/N3Parser.js
22912
22879
  var blankNodePrefix = 0;
22913
- var N3Parser = class _N3Parser {
22880
+ var N3Parser = class {
22914
22881
  constructor(options) {
22915
22882
  this._contextStack = [];
22916
22883
  this._graph = null;
@@ -22922,6 +22889,7 @@ var N3Parser = class _N3Parser {
22922
22889
  this._readPredicateOrNamedGraph = this._readPredicate;
22923
22890
  this._supportsQuads = !(isTurtle || isTriG || isNTriples || isN3);
22924
22891
  this._isImpliedBy = options.isImpliedBy;
22892
+ this._supportsRDFStar = format4 === "" || /star|\*$/.test(format4);
22925
22893
  if (isLineMode)
22926
22894
  this._resolveRelativeIRI = (iri) => {
22927
22895
  return null;
@@ -22929,8 +22897,6 @@ var N3Parser = class _N3Parser {
22929
22897
  this._blankNodePrefix = typeof options.blankNodePrefix !== "string" ? "" : options.blankNodePrefix.replace(/^(?!_:)/, "_:");
22930
22898
  this._lexer = options.lexer || new N3Lexer({ lineMode: isLineMode, n3: isN3, isImpliedBy: this._isImpliedBy });
22931
22899
  this._explicitQuantifiers = !!options.explicitQuantifiers;
22932
- this._parseUnsupportedVersions = !!options.parseUnsupportedVersions;
22933
- this._version = options.version;
22934
22900
  }
22935
22901
  // ## Static class methods
22936
22902
  // ### `_resetBlankNodePrefix` restarts blank node prefix identification
@@ -22990,12 +22956,6 @@ var N3Parser = class _N3Parser {
22990
22956
  this._quantified = context4.quantified;
22991
22957
  }
22992
22958
  }
22993
- // ### `_readBeforeTopContext` is called once only at the start of parsing.
22994
- _readBeforeTopContext(token2) {
22995
- if (this._version && !this._isValidVersion(this._version))
22996
- return this._error(`Detected unsupported version as media type parameter: "${this._version}"`, token2);
22997
- return this._readInTopContext(token2);
22998
- }
22999
22959
  // ### `_readInTopContext` reads a token when in the top context
23000
22960
  _readInTopContext(token2) {
23001
22961
  switch (token2.type) {
@@ -23015,11 +22975,6 @@ var N3Parser = class _N3Parser {
23015
22975
  this._sparqlStyle = true;
23016
22976
  case "@base":
23017
22977
  return this._readBaseIRI;
23018
- // It could be a version declaration
23019
- case "VERSION":
23020
- this._sparqlStyle = true;
23021
- case "@version":
23022
- return this._readVersion;
23023
22978
  // It could be a graph
23024
22979
  case "{":
23025
22980
  if (this._supportsNamedGraphs) {
@@ -23085,10 +23040,6 @@ var N3Parser = class _N3Parser {
23085
23040
  );
23086
23041
  return this._readBlankNodeHead;
23087
23042
  case "(":
23088
- const stack = this._contextStack, parent4 = stack.length && stack[stack.length - 1];
23089
- if (parent4.type === "<<") {
23090
- return this._error("Unexpected list in reified triple", token2);
23091
- }
23092
23043
  this._saveContext("list", this._graph, this.RDF_NIL, null, null);
23093
23044
  this._subject = null;
23094
23045
  return this._readListItem;
@@ -23128,13 +23079,9 @@ var N3Parser = class _N3Parser {
23128
23079
  } else
23129
23080
  this._subject = this._factory.literal(token2.value, this._factory.namedNode(token2.prefix));
23130
23081
  break;
23131
- case "<<(":
23132
- if (!this._n3Mode)
23133
- return this._error("Disallowed triple term as subject", token2);
23134
- this._saveContext("<<(", this._graph, null, null, null);
23135
- this._graph = null;
23136
- return this._readSubject;
23137
23082
  case "<<":
23083
+ if (!this._supportsRDFStar)
23084
+ return this._error("Unexpected RDF-star syntax", token2);
23138
23085
  this._saveContext("<<", this._graph, null, null, null);
23139
23086
  this._graph = null;
23140
23087
  return this._readSubject;
@@ -23158,7 +23105,6 @@ var N3Parser = class _N3Parser {
23158
23105
  case ".":
23159
23106
  case "]":
23160
23107
  case "}":
23161
- case "|}":
23162
23108
  if (this._predicate === null)
23163
23109
  return this._error(`Unexpected ${type5}`, token2);
23164
23110
  this._subject = null;
@@ -23183,7 +23129,6 @@ var N3Parser = class _N3Parser {
23183
23129
  if ((this._predicate = this._readEntity(token2)) === void 0)
23184
23130
  return;
23185
23131
  }
23186
- this._validAnnotation = true;
23187
23132
  return this._readObject;
23188
23133
  }
23189
23134
  // ### `_readObject` reads a quad's object
@@ -23206,10 +23151,6 @@ var N3Parser = class _N3Parser {
23206
23151
  );
23207
23152
  return this._readBlankNodeHead;
23208
23153
  case "(":
23209
- const stack = this._contextStack, parent4 = stack.length && stack[stack.length - 1];
23210
- if (parent4.type === "<<") {
23211
- return this._error("Unexpected list in reified triple", token2);
23212
- }
23213
23154
  this._saveContext("list", this._graph, this._subject, this._predicate, this.RDF_NIL);
23214
23155
  this._subject = null;
23215
23156
  return this._readListItem;
@@ -23224,11 +23165,9 @@ var N3Parser = class _N3Parser {
23224
23165
  this._graph = this._factory.blankNode()
23225
23166
  );
23226
23167
  return this._readSubject;
23227
- case "<<(":
23228
- this._saveContext("<<(", this._graph, this._subject, this._predicate, null);
23229
- this._graph = null;
23230
- return this._readSubject;
23231
23168
  case "<<":
23169
+ if (!this._supportsRDFStar)
23170
+ return this._error("Unexpected RDF-star syntax", token2);
23232
23171
  this._saveContext("<<", this._graph, this._subject, this._predicate, null);
23233
23172
  this._graph = null;
23234
23173
  return this._readSubject;
@@ -23257,10 +23196,6 @@ var N3Parser = class _N3Parser {
23257
23196
  this._subject = null;
23258
23197
  return this._readBlankNodeTail(token2);
23259
23198
  } else {
23260
- const stack = this._contextStack, parentParent = stack.length > 1 && stack[stack.length - 2];
23261
- if (parentParent.type === "<<") {
23262
- return this._error("Unexpected compound blank node expression in reified triple", token2);
23263
- }
23264
23199
  this._predicate = null;
23265
23200
  return this._readPredicate(token2);
23266
23201
  }
@@ -23351,19 +23286,12 @@ var N3Parser = class _N3Parser {
23351
23286
  this._graph = this._factory.blankNode()
23352
23287
  );
23353
23288
  return this._readSubject;
23354
- case "<<":
23355
- this._saveContext("<<", this._graph, null, null, null);
23356
- this._graph = null;
23357
- next4 = this._readSubject;
23358
- break;
23359
23289
  default:
23360
23290
  if ((item4 = this._readEntity(token2)) === void 0)
23361
23291
  return;
23362
23292
  }
23363
23293
  if (list === null)
23364
23294
  this._subject = list = this._factory.blankNode();
23365
- if (token2.type === "<<")
23366
- stack[stack.length - 1].subject = this._subject;
23367
23295
  if (previousList === null) {
23368
23296
  if (parent4.predicate === null)
23369
23297
  parent4.subject = list;
@@ -23391,73 +23319,43 @@ var N3Parser = class _N3Parser {
23391
23319
  return this._completeObjectLiteral(token2, true);
23392
23320
  }
23393
23321
  // ### `_completeLiteral` completes a literal with an optional datatype or language
23394
- _completeLiteral(token2, component2) {
23322
+ _completeLiteral(token2) {
23395
23323
  let literal4 = this._factory.literal(this._literalValue);
23396
- let readCb;
23397
23324
  switch (token2.type) {
23398
23325
  // Create a datatyped literal
23399
23326
  case "type":
23400
23327
  case "typeIRI":
23401
23328
  const datatype3 = this._readEntity(token2);
23402
23329
  if (datatype3 === void 0) return;
23403
- if (datatype3.value === IRIs_default.rdf.langString || datatype3.value === IRIs_default.rdf.dirLangString) {
23404
- return this._error("Detected illegal (directional) languaged-tagged string with explicit datatype", token2);
23405
- }
23406
23330
  literal4 = this._factory.literal(this._literalValue, datatype3);
23407
23331
  token2 = null;
23408
23332
  break;
23409
23333
  // Create a language-tagged string
23410
23334
  case "langcode":
23411
- if (token2.value.split("-").some((t) => t.length > 8))
23412
- return this._error("Detected language tag with subtag longer than 8 characters", token2);
23413
23335
  literal4 = this._factory.literal(this._literalValue, token2.value);
23414
- this._literalLanguage = token2.value;
23415
23336
  token2 = null;
23416
- readCb = this._readDirCode.bind(this, component2);
23417
23337
  break;
23418
23338
  }
23419
- return { token: token2, literal: literal4, readCb };
23420
- }
23421
- _readDirCode(component2, listItem, token2) {
23422
- if (token2.type === "dircode") {
23423
- const term3 = this._factory.literal(this._literalValue, { language: this._literalLanguage, direction: token2.value });
23424
- if (component2 === "subject")
23425
- this._subject = term3;
23426
- else
23427
- this._object = term3;
23428
- this._literalLanguage = void 0;
23429
- token2 = null;
23430
- }
23431
- if (component2 === "subject")
23432
- return token2 === null ? this._readPredicateOrNamedGraph : this._readPredicateOrNamedGraph(token2);
23433
- return this._completeObjectLiteralPost(token2, listItem);
23339
+ return { token: token2, literal: literal4 };
23434
23340
  }
23435
23341
  // Completes a literal in subject position
23436
23342
  _completeSubjectLiteral(token2) {
23437
- const completed2 = this._completeLiteral(token2, "subject");
23438
- this._subject = completed2.literal;
23439
- if (completed2.readCb)
23440
- return completed2.readCb.bind(this, false);
23343
+ this._subject = this._completeLiteral(token2).literal;
23441
23344
  return this._readPredicateOrNamedGraph;
23442
23345
  }
23443
23346
  // Completes a literal in object position
23444
23347
  _completeObjectLiteral(token2, listItem) {
23445
- const completed2 = this._completeLiteral(token2, "object");
23348
+ const completed2 = this._completeLiteral(token2);
23446
23349
  if (!completed2)
23447
23350
  return;
23448
23351
  this._object = completed2.literal;
23449
- if (completed2.readCb)
23450
- return completed2.readCb.bind(this, listItem);
23451
- return this._completeObjectLiteralPost(completed2.token, listItem);
23452
- }
23453
- _completeObjectLiteralPost(token2, listItem) {
23454
23352
  if (listItem)
23455
23353
  this._emit(this._subject, this.RDF_FIRST, this._object, this._graph);
23456
- if (token2 === null)
23354
+ if (completed2.token === null)
23457
23355
  return this._getContextEndReader();
23458
23356
  else {
23459
23357
  this._readCallback = this._getContextEndReader();
23460
- return this._readCallback(token2);
23358
+ return this._readCallback(completed2.token);
23461
23359
  }
23462
23360
  }
23463
23361
  // ### `_readFormulaTail` reads the end of a formula
@@ -23471,7 +23369,7 @@ var N3Parser = class _N3Parser {
23471
23369
  }
23472
23370
  // ### `_readPunctuation` reads punctuation between quads or quad parts
23473
23371
  _readPunctuation(token2) {
23474
- let next4, graph3 = this._graph, startingAnnotation = false;
23372
+ let next4, graph3 = this._graph;
23475
23373
  const subject8 = this._subject, inversePredicate = this._inversePredicate;
23476
23374
  switch (token2.type) {
23477
23375
  // A closing brace ends a graph
@@ -23484,7 +23382,6 @@ var N3Parser = class _N3Parser {
23484
23382
  // A dot just ends the statement, without sharing anything with the next
23485
23383
  case ".":
23486
23384
  this._subject = null;
23487
- this._tripleTerm = null;
23488
23385
  next4 = this._contextStack.length ? this._readSubject : this._readInTopContext;
23489
23386
  if (inversePredicate) this._inversePredicate = false;
23490
23387
  break;
@@ -23496,26 +23393,19 @@ var N3Parser = class _N3Parser {
23496
23393
  case ",":
23497
23394
  next4 = this._readObject;
23498
23395
  break;
23499
- // ~ is allowed in the annotation syntax
23500
- case "~":
23501
- next4 = this._readReifierInAnnotation;
23502
- startingAnnotation = true;
23503
- break;
23504
23396
  // {| means that the current triple is annotated with predicate-object pairs.
23505
23397
  case "{|":
23506
- this._subject = this._readTripleTerm();
23507
- this._validAnnotation = false;
23508
- startingAnnotation = true;
23398
+ if (!this._supportsRDFStar)
23399
+ return this._error("Unexpected RDF-star syntax", token2);
23400
+ const predicate4 = this._predicate, object8 = this._object;
23401
+ this._subject = this._factory.quad(subject8, predicate4, object8, this.DEFAULTGRAPH);
23509
23402
  next4 = this._readPredicate;
23510
23403
  break;
23511
- // |} means that the current reified triple in annotation syntax is finalized.
23404
+ // |} means that the current quoted triple in annotation syntax is finalized.
23512
23405
  case "|}":
23513
- if (!this._annotation)
23514
- return this._error("Unexpected annotation syntax closing", token2);
23515
- if (!this._validAnnotation)
23516
- return this._error("Annotation block can not be empty", token2);
23406
+ if (this._subject.termType !== "Quad")
23407
+ return this._error("Unexpected asserted triple closing", token2);
23517
23408
  this._subject = null;
23518
- this._annotation = false;
23519
23409
  next4 = this._readPunctuation;
23520
23410
  break;
23521
23411
  default:
@@ -23525,16 +23415,13 @@ var N3Parser = class _N3Parser {
23525
23415
  }
23526
23416
  return this._error(`Expected punctuation to follow "${this._object.id}"`, token2);
23527
23417
  }
23528
- if (subject8 !== null && (!startingAnnotation || startingAnnotation && !this._annotation)) {
23418
+ if (subject8 !== null) {
23529
23419
  const predicate4 = this._predicate, object8 = this._object;
23530
23420
  if (!inversePredicate)
23531
23421
  this._emit(subject8, predicate4, object8, graph3);
23532
23422
  else
23533
23423
  this._emit(object8, predicate4, subject8, graph3);
23534
23424
  }
23535
- if (startingAnnotation) {
23536
- this._annotation = true;
23537
- }
23538
23425
  return next4;
23539
23426
  }
23540
23427
  // ### `_readBlankNodePunctuation` reads punctuation in a blank node
@@ -23585,21 +23472,6 @@ var N3Parser = class _N3Parser {
23585
23472
  this._setBase(iri);
23586
23473
  return this._readDeclarationPunctuation;
23587
23474
  }
23588
- // ### `_isValidVersion` checks if the given version is valid for this parser to handle.
23589
- _isValidVersion(version6) {
23590
- return this._parseUnsupportedVersions || _N3Parser.SUPPORTED_VERSIONS.includes(version6);
23591
- }
23592
- // ### `_readVersion` reads version string declaration
23593
- _readVersion(token2) {
23594
- if (token2.type !== "literal")
23595
- return this._error("Expected literal to follow version declaration", token2);
23596
- if (token2.end - token2.start !== token2.value.length + 2)
23597
- return this._error("Version declarations must use single quotes", token2);
23598
- this._versionCallback(token2.value);
23599
- if (!this._isValidVersion(token2.value))
23600
- return this._error(`Detected unsupported version: "${token2.value}"`, token2);
23601
- return this._readDeclarationPunctuation;
23602
- }
23603
23475
  // ### `_readNamedGraphLabel` reads the label of a named graph
23604
23476
  _readNamedGraphLabel(token2) {
23605
23477
  switch (token2.type) {
@@ -23726,17 +23598,26 @@ var N3Parser = class _N3Parser {
23726
23598
  this._emit(subject8, predicate4, object8, this._graph);
23727
23599
  return this._readPath;
23728
23600
  }
23729
- // ### `_readTripleTermTail` reads the end of a triple term
23730
- _readTripleTermTail(token2) {
23731
- if (token2.type !== ")>>")
23732
- return this._error(`Expected )>> but got ${token2.type}`, token2);
23601
+ // ### `_readRDFStarTailOrGraph` reads the graph of a nested RDF-star quad or the end of a nested RDF-star triple
23602
+ _readRDFStarTailOrGraph(token2) {
23603
+ if (token2.type !== ">>") {
23604
+ if (this._supportsQuads && this._graph === null && (this._graph = this._readEntity(token2)) !== void 0)
23605
+ return this._readRDFStarTail;
23606
+ return this._error(`Expected >> to follow "${this._object.id}"`, token2);
23607
+ }
23608
+ return this._readRDFStarTail(token2);
23609
+ }
23610
+ // ### `_readRDFStarTail` reads the end of a nested RDF-star triple
23611
+ _readRDFStarTail(token2) {
23612
+ if (token2.type !== ">>")
23613
+ return this._error(`Expected >> but got ${token2.type}`, token2);
23733
23614
  const quad3 = this._factory.quad(
23734
23615
  this._subject,
23735
23616
  this._predicate,
23736
23617
  this._object,
23737
23618
  this._graph || this.DEFAULTGRAPH
23738
23619
  );
23739
- this._restoreContext("<<(", token2);
23620
+ this._restoreContext("<<", token2);
23740
23621
  if (this._subject === null) {
23741
23622
  this._subject = quad3;
23742
23623
  return this._readPredicate;
@@ -23745,63 +23626,6 @@ var N3Parser = class _N3Parser {
23745
23626
  return this._getContextEndReader();
23746
23627
  }
23747
23628
  }
23748
- // ### `_readReifiedTripleTailOrReifier` reads a reifier or the end of a nested reified triple
23749
- _readReifiedTripleTailOrReifier(token2) {
23750
- if (token2.type === "~") {
23751
- return this._readReifier;
23752
- }
23753
- return this._readReifiedTripleTail(token2);
23754
- }
23755
- // ### `_readReifiedTripleTail` reads the end of a nested reified triple
23756
- _readReifiedTripleTail(token2) {
23757
- if (token2.type !== ">>")
23758
- return this._error(`Expected >> but got ${token2.type}`, token2);
23759
- this._tripleTerm = null;
23760
- const reifier = this._readTripleTerm();
23761
- this._restoreContext("<<", token2);
23762
- const stack = this._contextStack, parent4 = stack.length && stack[stack.length - 1];
23763
- if (parent4 && parent4.type === "list") {
23764
- this._emit(this._subject, this.RDF_FIRST, reifier, this._graph);
23765
- return this._getContextEndReader();
23766
- } else if (this._subject === null) {
23767
- this._subject = reifier;
23768
- return this._readPredicateOrReifierTripleEnd;
23769
- } else {
23770
- this._object = reifier;
23771
- return this._getContextEndReader();
23772
- }
23773
- }
23774
- _readPredicateOrReifierTripleEnd(token2) {
23775
- if (token2.type === ".") {
23776
- this._subject = null;
23777
- return this._readPunctuation(token2);
23778
- }
23779
- return this._readPredicate(token2);
23780
- }
23781
- // ### `_readReifier` reads the triple term identifier after a tilde when in a reifying triple.
23782
- _readReifier(token2) {
23783
- this._reifier = this._readEntity(token2);
23784
- return this._readReifiedTripleTail;
23785
- }
23786
- // ### `_readReifier` reads the optional triple term identifier after a tilde when in annotation syntax.
23787
- _readReifierInAnnotation(token2) {
23788
- if (token2.type === "IRI" || token2.type === "typeIRI" || token2.type === "type" || token2.type === "prefixed" || token2.type === "blank" || token2.type === "var") {
23789
- this._reifier = this._readEntity(token2);
23790
- return this._readPunctuation;
23791
- }
23792
- this._readTripleTerm();
23793
- this._subject = null;
23794
- return this._readPunctuation(token2);
23795
- }
23796
- _readTripleTerm() {
23797
- const stack = this._contextStack, parent4 = stack.length && stack[stack.length - 1];
23798
- const parentGraph = parent4 ? parent4.graph : void 0;
23799
- const reifier = this._reifier || this._factory.blankNode();
23800
- this._reifier = null;
23801
- this._tripleTerm = this._tripleTerm || this._factory.quad(this._subject, this._predicate, this._object);
23802
- this._emit(reifier, this.RDF_REIFIES, this._tripleTerm, parentGraph || this.DEFAULTGRAPH);
23803
- return reifier;
23804
- }
23805
23629
  // ### `_getContextEndReader` gets the next reader function at the end of a context
23806
23630
  _getContextEndReader() {
23807
23631
  const contextStack = this._contextStack;
@@ -23814,10 +23638,8 @@ var N3Parser = class _N3Parser {
23814
23638
  return this._readListItem;
23815
23639
  case "formula":
23816
23640
  return this._readFormulaTail;
23817
- case "<<(":
23818
- return this._readTripleTermTail;
23819
23641
  case "<<":
23820
- return this._readReifiedTripleTailOrReifier;
23642
+ return this._readRDFStarTailOrGraph;
23821
23643
  }
23822
23644
  }
23823
23645
  // ### `_emit` sends a quad through the callback
@@ -23915,24 +23737,21 @@ var N3Parser = class _N3Parser {
23915
23737
  }
23916
23738
  // ## Public methods
23917
23739
  // ### `parse` parses the N3 input and emits each parsed quad through the onQuad callback.
23918
- parse(input2, quadCallback, prefixCallback, versionCallback) {
23919
- let onQuad, onPrefix, onComment, onVersion;
23920
- if (quadCallback && (quadCallback.onQuad || quadCallback.onPrefix || quadCallback.onComment || quadCallback.onVersion)) {
23740
+ parse(input2, quadCallback, prefixCallback) {
23741
+ let onQuad, onPrefix, onComment;
23742
+ if (quadCallback && (quadCallback.onQuad || quadCallback.onPrefix || quadCallback.onComment)) {
23921
23743
  onQuad = quadCallback.onQuad;
23922
23744
  onPrefix = quadCallback.onPrefix;
23923
23745
  onComment = quadCallback.onComment;
23924
- onVersion = quadCallback.onVersion;
23925
23746
  } else {
23926
23747
  onQuad = quadCallback;
23927
23748
  onPrefix = prefixCallback;
23928
- onVersion = versionCallback;
23929
23749
  }
23930
- this._readCallback = this._readBeforeTopContext;
23750
+ this._readCallback = this._readInTopContext;
23931
23751
  this._sparqlStyle = false;
23932
23752
  this._prefixes = /* @__PURE__ */ Object.create(null);
23933
23753
  this._prefixes._ = this._blankNodePrefix ? this._blankNodePrefix.substr(2) : `b${blankNodePrefix++}_`;
23934
23754
  this._prefixCallback = onPrefix || noop2;
23935
- this._versionCallback = onVersion || noop2;
23936
23755
  this._inversePredicate = false;
23937
23756
  this._quantified = /* @__PURE__ */ Object.create(null);
23938
23757
  if (!onQuad) {
@@ -23978,7 +23797,6 @@ function initDataFactory(parser, factory) {
23978
23797
  parser.RDF_FIRST = factory.namedNode(IRIs_default.rdf.first);
23979
23798
  parser.RDF_REST = factory.namedNode(IRIs_default.rdf.rest);
23980
23799
  parser.RDF_NIL = factory.namedNode(IRIs_default.rdf.nil);
23981
- parser.RDF_REIFIES = factory.namedNode(IRIs_default.rdf.reifies);
23982
23800
  parser.N3_FORALL = factory.namedNode(IRIs_default.r.forAll);
23983
23801
  parser.N3_FORSOME = factory.namedNode(IRIs_default.r.forSome);
23984
23802
  parser.ABBREVIATIONS = {
@@ -23989,11 +23807,6 @@ function initDataFactory(parser, factory) {
23989
23807
  };
23990
23808
  parser.QUANTIFIERS_GRAPH = factory.namedNode("urn:n3:quantifiers");
23991
23809
  }
23992
- N3Parser.SUPPORTED_VERSIONS = [
23993
- "1.2",
23994
- "1.2-basic",
23995
- "1.1"
23996
- ];
23997
23810
  initDataFactory(N3Parser.prototype, N3DataFactory_default);
23998
23811
 
23999
23812
  // node_modules/rdflib/esm/rdfaparser.js
@@ -28128,6 +27941,9 @@ var Thing = class {
28128
27941
  var LdpContainer = class extends Thing {
28129
27942
  constructor(uri6, store, editable = false) {
28130
27943
  super(uri6, store, editable);
27944
+ this.uri = uri6;
27945
+ this.store = store;
27946
+ this.editable = editable;
28131
27947
  }
28132
27948
  /**
28133
27949
  * Resources that the LDP Container contains
@@ -28265,6 +28081,8 @@ var WebIdProfile = class extends Thing {
28265
28081
  constructor(webId, store, editable = false) {
28266
28082
  super(webId, store, editable);
28267
28083
  this.webId = webId;
28084
+ this.store = store;
28085
+ this.editable = editable;
28268
28086
  this.profileQuery = this.store.profileQuery(this.webId);
28269
28087
  }
28270
28088
  /**
@@ -28405,6 +28223,9 @@ var SearchIndex = class {
28405
28223
  var RdfDocument = class extends Thing {
28406
28224
  constructor(uri6, store, editable = false) {
28407
28225
  super(uri6, store, editable);
28226
+ this.uri = uri6;
28227
+ this.store = store;
28228
+ this.editable = editable;
28408
28229
  }
28409
28230
  subjects() {
28410
28231
  const matches = this.store.statementsMatching(
@@ -28426,6 +28247,9 @@ var RdfDocument = class extends Thing {
28426
28247
  var LabelIndex = class extends RdfDocument {
28427
28248
  constructor(uri6, store, editable = false) {
28428
28249
  super(uri6, store, editable);
28250
+ this.uri = uri6;
28251
+ this.store = store;
28252
+ this.editable = editable;
28429
28253
  }
28430
28254
  /**
28431
28255
  * Returns the URIs and labels for all the things listed in the document.
@@ -50262,6 +50086,8 @@ function listKnownTerms() {
50262
50086
  // src/uri/UriService.ts
50263
50087
  var import_slugify = __toESM(require_slugify(), 1);
50264
50088
  var UriService = class {
50089
+ // We expect to use the store for calculating the uris for things
50090
+ // e.g. looking up locations in type index
50265
50091
  constructor(store) {
50266
50092
  this.store = store;
50267
50093
  }
@@ -50464,6 +50290,9 @@ function proposeAppsFor(thing) {
50464
50290
  var TypeIndex2 = class extends Thing {
50465
50291
  constructor(uri6, store, editable = false) {
50466
50292
  super(uri6, store, editable);
50293
+ this.uri = uri6;
50294
+ this.store = store;
50295
+ this.editable = editable;
50467
50296
  }
50468
50297
  listAll() {
50469
50298
  const forClassStatements = this.store.statementsMatching(