@openhps/rdf 0.1.11 → 0.1.14

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 (48) hide show
  1. package/.eslintrc.js +39 -0
  2. package/.prettierrc.js +8 -0
  3. package/commitlint.config.js +1 -0
  4. package/dist/cjs/index.serialization.d.ts +1 -0
  5. package/dist/cjs/index.serialization.js +14 -0
  6. package/dist/cjs/index.serialization.js.map +1 -1
  7. package/dist/cjs/rdf/InternalRDFSerializer.js +7 -1
  8. package/dist/cjs/rdf/InternalRDFSerializer.js.map +1 -1
  9. package/dist/esm/index.serialization.d.ts +1 -0
  10. package/dist/esm/index.serialization.js +2 -0
  11. package/dist/esm/index.serialization.js.map +1 -1
  12. package/dist/esm/rdf/InternalRDFSerializer.js +7 -1
  13. package/dist/esm/rdf/InternalRDFSerializer.js.map +1 -1
  14. package/dist/types/index.serialization.d.ts +1 -0
  15. package/dist/web/openhps-rdf.all.es.js +14 -2
  16. package/dist/web/openhps-rdf.all.es.js.map +1 -1
  17. package/dist/web/openhps-rdf.all.es.min.js +1 -1
  18. package/dist/web/openhps-rdf.all.es.min.js.map +1 -1
  19. package/dist/web/openhps-rdf.all.js +12 -1
  20. package/dist/web/openhps-rdf.all.js.map +1 -1
  21. package/dist/web/openhps-rdf.all.min.js +1 -1
  22. package/dist/web/openhps-rdf.all.min.js.map +1 -1
  23. package/dist/web/openhps-rdf.serialization.es.js +1816 -5
  24. package/dist/web/openhps-rdf.serialization.es.js.map +1 -1
  25. package/dist/web/openhps-rdf.serialization.es.min.js +1 -1
  26. package/dist/web/openhps-rdf.serialization.es.min.js.LICENSE.txt +2 -0
  27. package/dist/web/openhps-rdf.serialization.es.min.js.map +1 -1
  28. package/dist/web/openhps-rdf.serialization.js +1819 -4
  29. package/dist/web/openhps-rdf.serialization.js.map +1 -1
  30. package/dist/web/openhps-rdf.serialization.min.js +1 -1
  31. package/dist/web/openhps-rdf.serialization.min.js.LICENSE.txt +2 -0
  32. package/dist/web/openhps-rdf.serialization.min.js.map +1 -1
  33. package/dist/web/openhps-rdf.sparql.es.js +7 -1
  34. package/dist/web/openhps-rdf.sparql.es.js.map +1 -1
  35. package/dist/web/openhps-rdf.sparql.es.min.js +1 -1
  36. package/dist/web/openhps-rdf.sparql.es.min.js.map +1 -1
  37. package/dist/web/openhps-rdf.sparql.js +7 -1
  38. package/dist/web/openhps-rdf.sparql.js.map +1 -1
  39. package/dist/web/openhps-rdf.sparql.min.js +1 -1
  40. package/dist/web/openhps-rdf.sparql.min.js.map +1 -1
  41. package/package.json +4 -2
  42. package/serialization.d.ts +1 -0
  43. package/serialization.js +1 -0
  44. package/src/index.serialization.ts +1 -0
  45. package/src/rdf/InternalRDFSerializer.ts +8 -1
  46. package/vocab.d.ts +1 -0
  47. package/vocab.js +1 -0
  48. package/webpack.config.js +87 -0
@@ -286,7 +286,7 @@ class InternalRDFSerializer extends _openhps_core__WEBPACK_IMPORTED_MODULE_0__.S
286
286
  [Set, this.serializeSet.bind(this)],
287
287
  ]);
288
288
  }
289
- convertSingleValue(sourceObject, typeDescriptor, memberName, memberOptions, serializerOptions) {
289
+ convertSingleValue(sourceObject, typeDescriptor, memberName, memberOptions, serializerOptions = {}) {
290
290
  if (this.retrievePreserveNull(memberOptions) && sourceObject === null) {
291
291
  return null;
292
292
  }
@@ -362,6 +362,12 @@ class InternalRDFSerializer extends _openhps_core__WEBPACK_IMPORTED_MODULE_0__.S
362
362
  thing = (0,_utils__WEBPACK_IMPORTED_MODULE_2__.mergeDeep)(thing, options.serializer(sourceObject, serializerOptions.rdf.baseUri));
363
363
  }
364
364
  thing.termType = thing.value.startsWith('http') ? 'NamedNode' : 'BlankNode';
365
+ if (serializerOptions.root === undefined) {
366
+ serializerOptions.root = thing;
367
+ }
368
+ else if (serializerOptions.root.value === thing.value) {
369
+ return undefined;
370
+ }
365
371
  metadata.dataMembers.forEach((member) => {
366
372
  const rootMember = rootMetadata.dataMembers.get(member.key);
367
373
  const memberOptions = member.options && member.options.rdf
@@ -15307,14 +15313,18 @@ const RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',
15307
15313
  "use strict";
15308
15314
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15309
15315
  /* harmony export */ "BlankNode": () => (/* binding */ BlankNode),
15316
+ /* harmony export */ "DefaultGraph": () => (/* binding */ DefaultGraph),
15310
15317
  /* harmony export */ "Literal": () => (/* binding */ Literal),
15311
15318
  /* harmony export */ "NamedNode": () => (/* binding */ NamedNode),
15319
+ /* harmony export */ "Quad": () => (/* binding */ Quad),
15312
15320
  /* harmony export */ "Term": () => (/* binding */ Term),
15321
+ /* harmony export */ "Triple": () => (/* binding */ Quad),
15322
+ /* harmony export */ "Variable": () => (/* binding */ Variable),
15313
15323
  /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
15314
15324
  /* harmony export */ "termFromId": () => (/* binding */ termFromId),
15315
15325
  /* harmony export */ "termToId": () => (/* binding */ termToId)
15316
15326
  /* harmony export */ });
15317
- /* unused harmony exports Variable, DefaultGraph, Quad, Triple, escapeQuotes, unescapeQuotes */
15327
+ /* unused harmony exports escapeQuotes, unescapeQuotes */
15318
15328
  /* harmony import */ var _IRIs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./IRIs */ "./node_modules/n3/src/IRIs.js");
15319
15329
  /* harmony import */ var _N3Util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./N3Util */ "./node_modules/n3/src/N3Util.js");
15320
15330
  // N3.js implementations of the RDF/JS core data types
@@ -15700,6 +15710,1600 @@ function quad(subject, predicate, object, graph) {
15700
15710
  }
15701
15711
 
15702
15712
 
15713
+ /***/ }),
15714
+
15715
+ /***/ "./node_modules/n3/src/N3Lexer.js":
15716
+ /*!****************************************!*\
15717
+ !*** ./node_modules/n3/src/N3Lexer.js ***!
15718
+ \****************************************/
15719
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
15720
+
15721
+ "use strict";
15722
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
15723
+ /* harmony export */ "default": () => (/* binding */ N3Lexer)
15724
+ /* harmony export */ });
15725
+ /* harmony import */ var _IRIs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./IRIs */ "./node_modules/n3/src/IRIs.js");
15726
+ /* harmony import */ var queue_microtask__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! queue-microtask */ "./node_modules/queue-microtask/index.js");
15727
+ /* harmony import */ var queue_microtask__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(queue_microtask__WEBPACK_IMPORTED_MODULE_0__);
15728
+ // **N3Lexer** tokenizes N3 documents.
15729
+
15730
+
15731
+
15732
+ const { xsd } = _IRIs__WEBPACK_IMPORTED_MODULE_1__["default"];
15733
+
15734
+ // Regular expression and replacement string to escape N3 strings
15735
+ const escapeSequence = /\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\([^])/g;
15736
+ const escapeReplacements = {
15737
+ '\\': '\\', "'": "'", '"': '"',
15738
+ 'n': '\n', 'r': '\r', 't': '\t', 'f': '\f', 'b': '\b',
15739
+ '_': '_', '~': '~', '.': '.', '-': '-', '!': '!', '$': '$', '&': '&',
15740
+ '(': '(', ')': ')', '*': '*', '+': '+', ',': ',', ';': ';', '=': '=',
15741
+ '/': '/', '?': '?', '#': '#', '@': '@', '%': '%',
15742
+ };
15743
+ const illegalIriChars = /[\x00-\x20<>\\"\{\}\|\^\`]/;
15744
+
15745
+ const lineModeRegExps = {
15746
+ _iri: true,
15747
+ _unescapedIri: true,
15748
+ _simpleQuotedString: true,
15749
+ _langcode: true,
15750
+ _blank: true,
15751
+ _newline: true,
15752
+ _comment: true,
15753
+ _whitespace: true,
15754
+ _endOfFile: true,
15755
+ };
15756
+ const invalidRegExp = /$0^/;
15757
+
15758
+ // ## Constructor
15759
+ class N3Lexer {
15760
+ constructor(options) {
15761
+ // ## Regular expressions
15762
+ // It's slightly faster to have these as properties than as in-scope variables
15763
+ this._iri = /^<((?:[^ <>{}\\]|\\[uU])+)>[ \t]*/; // IRI with escape sequences; needs sanity check after unescaping
15764
+ this._unescapedIri = /^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>[ \t]*/; // IRI without escape sequences; no unescaping
15765
+ this._simpleQuotedString = /^"([^"\\\r\n]*)"(?=[^"])/; // string without escape sequences
15766
+ this._simpleApostropheString = /^'([^'\\\r\n]*)'(?=[^'])/;
15767
+ this._langcode = /^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i;
15768
+ 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<])/;
15769
+ 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#()\[\]\{\}"'<>]))/;
15770
+ 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#()\[\]\{\}"'<>])/;
15771
+ 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#()\[\]\{\}"'<>]))/;
15772
+ this._number = /^[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?|\d*(\.)?)\d+(?=\.?[,;:\s#()\[\]\{\}"'<>])/;
15773
+ this._boolean = /^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<>])/;
15774
+ this._keyword = /^@[a-z]+(?=[\s#<:])/i;
15775
+ this._sparqlKeyword = /^(?:PREFIX|BASE|GRAPH)(?=[\s#<])/i;
15776
+ this._shortPredicates = /^a(?=[\s#()\[\]\{\}"'<>])/;
15777
+ this._newline = /^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/;
15778
+ this._comment = /#([^\n\r]*)/;
15779
+ this._whitespace = /^[ \t]+/;
15780
+ this._endOfFile = /^(?:#[^\n\r]*)?$/;
15781
+ options = options || {};
15782
+
15783
+ // In line mode (N-Triples or N-Quads), only simple features may be parsed
15784
+ if (this._lineMode = !!options.lineMode) {
15785
+ this._n3Mode = false;
15786
+ // Don't tokenize special literals
15787
+ for (const key in this) {
15788
+ if (!(key in lineModeRegExps) && this[key] instanceof RegExp)
15789
+ this[key] = invalidRegExp;
15790
+ }
15791
+ }
15792
+ // When not in line mode, enable N3 functionality by default
15793
+ else {
15794
+ this._n3Mode = options.n3 !== false;
15795
+ }
15796
+ // Don't output comment tokens by default
15797
+ this._comments = !!options.comments;
15798
+ // Cache the last tested closing position of long literals
15799
+ this._literalClosingPos = 0;
15800
+ }
15801
+
15802
+ // ## Private methods
15803
+
15804
+ // ### `_tokenizeToEnd` tokenizes as for as possible, emitting tokens through the callback
15805
+ _tokenizeToEnd(callback, inputFinished) {
15806
+ // Continue parsing as far as possible; the loop will return eventually
15807
+ let input = this._input;
15808
+ let currentLineLength = input.length;
15809
+ while (true) {
15810
+ // Count and skip whitespace lines
15811
+ let whiteSpaceMatch, comment;
15812
+ while (whiteSpaceMatch = this._newline.exec(input)) {
15813
+ // Try to find a comment
15814
+ if (this._comments && (comment = this._comment.exec(whiteSpaceMatch[0])))
15815
+ emitToken('comment', comment[1], '', this._line, whiteSpaceMatch[0].length);
15816
+ // Advance the input
15817
+ input = input.substr(whiteSpaceMatch[0].length, input.length);
15818
+ currentLineLength = input.length;
15819
+ this._line++;
15820
+ }
15821
+ // Skip whitespace on current line
15822
+ if (!whiteSpaceMatch && (whiteSpaceMatch = this._whitespace.exec(input)))
15823
+ input = input.substr(whiteSpaceMatch[0].length, input.length);
15824
+
15825
+ // Stop for now if we're at the end
15826
+ if (this._endOfFile.test(input)) {
15827
+ // If the input is finished, emit EOF
15828
+ if (inputFinished) {
15829
+ // Try to find a final comment
15830
+ if (this._comments && (comment = this._comment.exec(input)))
15831
+ emitToken('comment', comment[1], '', this._line, input.length);
15832
+ input = null;
15833
+ emitToken('eof', '', '', this._line, 0);
15834
+ }
15835
+ return this._input = input;
15836
+ }
15837
+
15838
+ // Look for specific token types based on the first character
15839
+ const line = this._line, firstChar = input[0];
15840
+ let type = '', value = '', prefix = '',
15841
+ match = null, matchLength = 0, inconclusive = false;
15842
+ switch (firstChar) {
15843
+ case '^':
15844
+ // We need at least 3 tokens lookahead to distinguish ^^<IRI> and ^^pre:fixed
15845
+ if (input.length < 3)
15846
+ break;
15847
+ // Try to match a type
15848
+ else if (input[1] === '^') {
15849
+ this._previousMarker = '^^';
15850
+ // Move to type IRI or prefixed name
15851
+ input = input.substr(2);
15852
+ if (input[0] !== '<') {
15853
+ inconclusive = true;
15854
+ break;
15855
+ }
15856
+ }
15857
+ // If no type, it must be a path expression
15858
+ else {
15859
+ if (this._n3Mode) {
15860
+ matchLength = 1;
15861
+ type = '^';
15862
+ }
15863
+ break;
15864
+ }
15865
+ // Fall through in case the type is an IRI
15866
+ case '<':
15867
+ // Try to find a full IRI without escape sequences
15868
+ if (match = this._unescapedIri.exec(input))
15869
+ type = 'IRI', value = match[1];
15870
+ // Try to find a full IRI with escape sequences
15871
+ else if (match = this._iri.exec(input)) {
15872
+ value = this._unescape(match[1]);
15873
+ if (value === null || illegalIriChars.test(value))
15874
+ return reportSyntaxError(this);
15875
+ type = 'IRI';
15876
+ }
15877
+ // Try to find a nested triple
15878
+ else if (input.length > 1 && input[1] === '<')
15879
+ type = '<<', matchLength = 2;
15880
+ // Try to find a backwards implication arrow
15881
+ else if (this._n3Mode && input.length > 1 && input[1] === '=')
15882
+ type = 'inverse', matchLength = 2, value = '>';
15883
+ break;
15884
+
15885
+ case '>':
15886
+ if (input.length > 1 && input[1] === '>')
15887
+ type = '>>', matchLength = 2;
15888
+ break;
15889
+
15890
+ case '_':
15891
+ // Try to find a blank node. Since it can contain (but not end with) a dot,
15892
+ // we always need a non-dot character before deciding it is a blank node.
15893
+ // Therefore, try inserting a space if we're at the end of the input.
15894
+ if ((match = this._blank.exec(input)) ||
15895
+ inputFinished && (match = this._blank.exec(`${input} `)))
15896
+ type = 'blank', prefix = '_', value = match[1];
15897
+ break;
15898
+
15899
+ case '"':
15900
+ // Try to find a literal without escape sequences
15901
+ if (match = this._simpleQuotedString.exec(input))
15902
+ value = match[1];
15903
+ // Try to find a literal wrapped in three pairs of quotes
15904
+ else {
15905
+ ({ value, matchLength } = this._parseLiteral(input));
15906
+ if (value === null)
15907
+ return reportSyntaxError(this);
15908
+ }
15909
+ if (match !== null || matchLength !== 0) {
15910
+ type = 'literal';
15911
+ this._literalClosingPos = 0;
15912
+ }
15913
+ break;
15914
+
15915
+ case "'":
15916
+ if (!this._lineMode) {
15917
+ // Try to find a literal without escape sequences
15918
+ if (match = this._simpleApostropheString.exec(input))
15919
+ value = match[1];
15920
+ // Try to find a literal wrapped in three pairs of quotes
15921
+ else {
15922
+ ({ value, matchLength } = this._parseLiteral(input));
15923
+ if (value === null)
15924
+ return reportSyntaxError(this);
15925
+ }
15926
+ if (match !== null || matchLength !== 0) {
15927
+ type = 'literal';
15928
+ this._literalClosingPos = 0;
15929
+ }
15930
+ }
15931
+ break;
15932
+
15933
+ case '?':
15934
+ // Try to find a variable
15935
+ if (this._n3Mode && (match = this._variable.exec(input)))
15936
+ type = 'var', value = match[0];
15937
+ break;
15938
+
15939
+ case '@':
15940
+ // Try to find a language code
15941
+ if (this._previousMarker === 'literal' && (match = this._langcode.exec(input)))
15942
+ type = 'langcode', value = match[1];
15943
+ // Try to find a keyword
15944
+ else if (match = this._keyword.exec(input))
15945
+ type = match[0];
15946
+ break;
15947
+
15948
+ case '.':
15949
+ // Try to find a dot as punctuation
15950
+ if (input.length === 1 ? inputFinished : (input[1] < '0' || input[1] > '9')) {
15951
+ type = '.';
15952
+ matchLength = 1;
15953
+ break;
15954
+ }
15955
+ // Fall through to numerical case (could be a decimal dot)
15956
+
15957
+ case '0':
15958
+ case '1':
15959
+ case '2':
15960
+ case '3':
15961
+ case '4':
15962
+ case '5':
15963
+ case '6':
15964
+ case '7':
15965
+ case '8':
15966
+ case '9':
15967
+ case '+':
15968
+ case '-':
15969
+ // Try to find a number. Since it can contain (but not end with) a dot,
15970
+ // we always need a non-dot character before deciding it is a number.
15971
+ // Therefore, try inserting a space if we're at the end of the input.
15972
+ if (match = this._number.exec(input) ||
15973
+ inputFinished && (match = this._number.exec(`${input} `))) {
15974
+ type = 'literal', value = match[0];
15975
+ prefix = (typeof match[1] === 'string' ? xsd.double :
15976
+ (typeof match[2] === 'string' ? xsd.decimal : xsd.integer));
15977
+ }
15978
+ break;
15979
+
15980
+ case 'B':
15981
+ case 'b':
15982
+ case 'p':
15983
+ case 'P':
15984
+ case 'G':
15985
+ case 'g':
15986
+ // Try to find a SPARQL-style keyword
15987
+ if (match = this._sparqlKeyword.exec(input))
15988
+ type = match[0].toUpperCase();
15989
+ else
15990
+ inconclusive = true;
15991
+ break;
15992
+
15993
+ case 'f':
15994
+ case 't':
15995
+ // Try to match a boolean
15996
+ if (match = this._boolean.exec(input))
15997
+ type = 'literal', value = match[0], prefix = xsd.boolean;
15998
+ else
15999
+ inconclusive = true;
16000
+ break;
16001
+
16002
+ case 'a':
16003
+ // Try to find an abbreviated predicate
16004
+ if (match = this._shortPredicates.exec(input))
16005
+ type = 'abbreviation', value = 'a';
16006
+ else
16007
+ inconclusive = true;
16008
+ break;
16009
+
16010
+ case '=':
16011
+ // Try to find an implication arrow or equals sign
16012
+ if (this._n3Mode && input.length > 1) {
16013
+ type = 'abbreviation';
16014
+ if (input[1] !== '>')
16015
+ matchLength = 1, value = '=';
16016
+ else
16017
+ matchLength = 2, value = '>';
16018
+ }
16019
+ break;
16020
+
16021
+ case '!':
16022
+ if (!this._n3Mode)
16023
+ break;
16024
+ case ',':
16025
+ case ';':
16026
+ case '[':
16027
+ case ']':
16028
+ case '(':
16029
+ case ')':
16030
+ case '{':
16031
+ case '}':
16032
+ if (!this._lineMode) {
16033
+ matchLength = 1;
16034
+ type = firstChar;
16035
+ }
16036
+ break;
16037
+
16038
+ default:
16039
+ inconclusive = true;
16040
+ }
16041
+
16042
+ // Some first characters do not allow an immediate decision, so inspect more
16043
+ if (inconclusive) {
16044
+ // Try to find a prefix
16045
+ if ((this._previousMarker === '@prefix' || this._previousMarker === 'PREFIX') &&
16046
+ (match = this._prefix.exec(input)))
16047
+ type = 'prefix', value = match[1] || '';
16048
+ // Try to find a prefixed name. Since it can contain (but not end with) a dot,
16049
+ // we always need a non-dot character before deciding it is a prefixed name.
16050
+ // Therefore, try inserting a space if we're at the end of the input.
16051
+ else if ((match = this._prefixed.exec(input)) ||
16052
+ inputFinished && (match = this._prefixed.exec(`${input} `)))
16053
+ type = 'prefixed', prefix = match[1] || '', value = this._unescape(match[2]);
16054
+ }
16055
+
16056
+ // A type token is special: it can only be emitted after an IRI or prefixed name is read
16057
+ if (this._previousMarker === '^^') {
16058
+ switch (type) {
16059
+ case 'prefixed': type = 'type'; break;
16060
+ case 'IRI': type = 'typeIRI'; break;
16061
+ default: type = '';
16062
+ }
16063
+ }
16064
+
16065
+ // What if nothing of the above was found?
16066
+ if (!type) {
16067
+ // We could be in streaming mode, and then we just wait for more input to arrive.
16068
+ // Otherwise, a syntax error has occurred in the input.
16069
+ // One exception: error on an unaccounted linebreak (= not inside a triple-quoted literal).
16070
+ if (inputFinished || (!/^'''|^"""/.test(input) && /\n|\r/.test(input)))
16071
+ return reportSyntaxError(this);
16072
+ else
16073
+ return this._input = input;
16074
+ }
16075
+
16076
+ // Emit the parsed token
16077
+ const length = matchLength || match[0].length;
16078
+ const token = emitToken(type, value, prefix, line, length);
16079
+ this.previousToken = token;
16080
+ this._previousMarker = type;
16081
+
16082
+ // Advance to next part to tokenize
16083
+ input = input.substr(length, input.length);
16084
+ }
16085
+
16086
+ // Emits the token through the callback
16087
+ function emitToken(type, value, prefix, line, length) {
16088
+ const start = input ? currentLineLength - input.length : currentLineLength;
16089
+ const end = start + length;
16090
+ const token = { type, value, prefix, line, start, end };
16091
+ callback(null, token);
16092
+ return token;
16093
+ }
16094
+ // Signals the syntax error through the callback
16095
+ function reportSyntaxError(self) { callback(self._syntaxError(/^\S*/.exec(input)[0])); }
16096
+ }
16097
+
16098
+ // ### `_unescape` replaces N3 escape codes by their corresponding characters
16099
+ _unescape(item) {
16100
+ let invalid = false;
16101
+ const replaced = item.replace(escapeSequence, (sequence, unicode4, unicode8, escapedChar) => {
16102
+ // 4-digit unicode character
16103
+ if (typeof unicode4 === 'string')
16104
+ return String.fromCharCode(Number.parseInt(unicode4, 16));
16105
+ // 8-digit unicode character
16106
+ if (typeof unicode8 === 'string') {
16107
+ let charCode = Number.parseInt(unicode8, 16);
16108
+ return charCode <= 0xFFFF ? String.fromCharCode(Number.parseInt(unicode8, 16)) :
16109
+ String.fromCharCode(0xD800 + ((charCode -= 0x10000) >> 10), 0xDC00 + (charCode & 0x3FF));
16110
+ }
16111
+ // fixed escape sequence
16112
+ if (escapedChar in escapeReplacements)
16113
+ return escapeReplacements[escapedChar];
16114
+ // invalid escape sequence
16115
+ invalid = true;
16116
+ return '';
16117
+ });
16118
+ return invalid ? null : replaced;
16119
+ }
16120
+
16121
+ // ### `_parseLiteral` parses a literal into an unescaped value
16122
+ _parseLiteral(input) {
16123
+ // Ensure we have enough lookahead to identify triple-quoted strings
16124
+ if (input.length >= 3) {
16125
+ // Identify the opening quote(s)
16126
+ const opening = input.match(/^(?:"""|"|'''|'|)/)[0];
16127
+ const openingLength = opening.length;
16128
+
16129
+ // Find the next candidate closing quotes
16130
+ let closingPos = Math.max(this._literalClosingPos, openingLength);
16131
+ while ((closingPos = input.indexOf(opening, closingPos)) > 0) {
16132
+ // Count backslashes right before the closing quotes
16133
+ let backslashCount = 0;
16134
+ while (input[closingPos - backslashCount - 1] === '\\')
16135
+ backslashCount++;
16136
+
16137
+ // An even number of backslashes (in particular 0)
16138
+ // means these are actual, non-escaped closing quotes
16139
+ if (backslashCount % 2 === 0) {
16140
+ // Extract and unescape the value
16141
+ const raw = input.substring(openingLength, closingPos);
16142
+ const lines = raw.split(/\r\n|\r|\n/).length - 1;
16143
+ const matchLength = closingPos + openingLength;
16144
+ // Only triple-quoted strings can be multi-line
16145
+ if (openingLength === 1 && lines !== 0 ||
16146
+ openingLength === 3 && this._lineMode)
16147
+ break;
16148
+ this._line += lines;
16149
+ return { value: this._unescape(raw), matchLength };
16150
+ }
16151
+ closingPos++;
16152
+ }
16153
+ this._literalClosingPos = input.length - openingLength + 1;
16154
+ }
16155
+ return { value: '', matchLength: 0 };
16156
+ }
16157
+
16158
+ // ### `_syntaxError` creates a syntax error for the given issue
16159
+ _syntaxError(issue) {
16160
+ this._input = null;
16161
+ const err = new Error(`Unexpected "${issue}" on line ${this._line}.`);
16162
+ err.context = {
16163
+ token: undefined,
16164
+ line: this._line,
16165
+ previousToken: this.previousToken,
16166
+ };
16167
+ return err;
16168
+ }
16169
+
16170
+ // ### Strips off any starting UTF BOM mark.
16171
+ _readStartingBom(input) {
16172
+ return input.startsWith('\ufeff') ? input.substr(1) : input;
16173
+ }
16174
+
16175
+ // ## Public methods
16176
+
16177
+ // ### `tokenize` starts the transformation of an N3 document into an array of tokens.
16178
+ // The input can be a string or a stream.
16179
+ tokenize(input, callback) {
16180
+ this._line = 1;
16181
+
16182
+ // If the input is a string, continuously emit tokens through the callback until the end
16183
+ if (typeof input === 'string') {
16184
+ this._input = this._readStartingBom(input);
16185
+ // If a callback was passed, asynchronously call it
16186
+ if (typeof callback === 'function')
16187
+ queue_microtask__WEBPACK_IMPORTED_MODULE_0___default()(() => this._tokenizeToEnd(callback, true));
16188
+ // If no callback was passed, tokenize synchronously and return
16189
+ else {
16190
+ const tokens = [];
16191
+ let error;
16192
+ this._tokenizeToEnd((e, t) => e ? (error = e) : tokens.push(t), true);
16193
+ if (error) throw error;
16194
+ return tokens;
16195
+ }
16196
+ }
16197
+ // Otherwise, the input must be a stream
16198
+ else {
16199
+ this._pendingBuffer = null;
16200
+ if (typeof input.setEncoding === 'function')
16201
+ input.setEncoding('utf8');
16202
+ // Adds the data chunk to the buffer and parses as far as possible
16203
+ input.on('data', data => {
16204
+ if (this._input !== null && data.length !== 0) {
16205
+ // Prepend any previous pending writes
16206
+ if (this._pendingBuffer) {
16207
+ data = Buffer.concat([this._pendingBuffer, data]);
16208
+ this._pendingBuffer = null;
16209
+ }
16210
+ // Hold if the buffer ends in an incomplete unicode sequence
16211
+ if (data[data.length - 1] & 0x80) {
16212
+ this._pendingBuffer = data;
16213
+ }
16214
+ // Otherwise, tokenize as far as possible
16215
+ else {
16216
+ // Only read a BOM at the start
16217
+ if (typeof this._input === 'undefined')
16218
+ this._input = this._readStartingBom(typeof data === 'string' ? data : data.toString());
16219
+ else
16220
+ this._input += data;
16221
+ this._tokenizeToEnd(callback, false);
16222
+ }
16223
+ }
16224
+ });
16225
+ // Parses until the end
16226
+ input.on('end', () => {
16227
+ if (typeof this._input === 'string')
16228
+ this._tokenizeToEnd(callback, true);
16229
+ });
16230
+ input.on('error', callback);
16231
+ }
16232
+ }
16233
+ }
16234
+
16235
+
16236
+ /***/ }),
16237
+
16238
+ /***/ "./node_modules/n3/src/N3Parser.js":
16239
+ /*!*****************************************!*\
16240
+ !*** ./node_modules/n3/src/N3Parser.js ***!
16241
+ \*****************************************/
16242
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16243
+
16244
+ "use strict";
16245
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16246
+ /* harmony export */ "default": () => (/* binding */ N3Parser)
16247
+ /* harmony export */ });
16248
+ /* harmony import */ var _N3Lexer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./N3Lexer */ "./node_modules/n3/src/N3Lexer.js");
16249
+ /* harmony import */ var _N3DataFactory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./N3DataFactory */ "./node_modules/n3/src/N3DataFactory.js");
16250
+ /* harmony import */ var _IRIs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./IRIs */ "./node_modules/n3/src/IRIs.js");
16251
+ // **N3Parser** parses N3 documents.
16252
+
16253
+
16254
+
16255
+
16256
+ let blankNodePrefix = 0;
16257
+
16258
+ // ## Constructor
16259
+ class N3Parser {
16260
+ constructor(options) {
16261
+ this._contextStack = [];
16262
+ this._graph = null;
16263
+
16264
+ // Set the document IRI
16265
+ options = options || {};
16266
+ this._setBase(options.baseIRI);
16267
+ options.factory && initDataFactory(this, options.factory);
16268
+
16269
+ // Set supported features depending on the format
16270
+ const format = (typeof options.format === 'string') ?
16271
+ options.format.match(/\w*$/)[0].toLowerCase() : '',
16272
+ isTurtle = /turtle/.test(format), isTriG = /trig/.test(format),
16273
+ isNTriples = /triple/.test(format), isNQuads = /quad/.test(format),
16274
+ isN3 = this._n3Mode = /n3/.test(format),
16275
+ isLineMode = isNTriples || isNQuads;
16276
+ if (!(this._supportsNamedGraphs = !(isTurtle || isN3)))
16277
+ this._readPredicateOrNamedGraph = this._readPredicate;
16278
+ // Support triples in other graphs
16279
+ this._supportsQuads = !(isTurtle || isTriG || isNTriples || isN3);
16280
+ // Support nesting of triples
16281
+ this._supportsRDFStar = format === '' || /star|\*$/.test(format);
16282
+ // Disable relative IRIs in N-Triples or N-Quads mode
16283
+ if (isLineMode)
16284
+ this._resolveRelativeIRI = iri => { return null; };
16285
+ this._blankNodePrefix = typeof options.blankNodePrefix !== 'string' ? '' :
16286
+ options.blankNodePrefix.replace(/^(?!_:)/, '_:');
16287
+ this._lexer = options.lexer || new _N3Lexer__WEBPACK_IMPORTED_MODULE_0__["default"]({ lineMode: isLineMode, n3: isN3 });
16288
+ // Disable explicit quantifiers by default
16289
+ this._explicitQuantifiers = !!options.explicitQuantifiers;
16290
+ }
16291
+
16292
+ // ## Static class methods
16293
+
16294
+ // ### `_resetBlankNodePrefix` restarts blank node prefix identification
16295
+ static _resetBlankNodePrefix() {
16296
+ blankNodePrefix = 0;
16297
+ }
16298
+
16299
+ // ## Private methods
16300
+
16301
+ // ### `_setBase` sets the base IRI to resolve relative IRIs
16302
+ _setBase(baseIRI) {
16303
+ if (!baseIRI) {
16304
+ this._base = '';
16305
+ this._basePath = '';
16306
+ }
16307
+ else {
16308
+ // Remove fragment if present
16309
+ const fragmentPos = baseIRI.indexOf('#');
16310
+ if (fragmentPos >= 0)
16311
+ baseIRI = baseIRI.substr(0, fragmentPos);
16312
+ // Set base IRI and its components
16313
+ this._base = baseIRI;
16314
+ this._basePath = baseIRI.indexOf('/') < 0 ? baseIRI :
16315
+ baseIRI.replace(/[^\/?]*(?:\?.*)?$/, '');
16316
+ baseIRI = baseIRI.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i);
16317
+ this._baseRoot = baseIRI[0];
16318
+ this._baseScheme = baseIRI[1];
16319
+ }
16320
+ }
16321
+
16322
+ // ### `_saveContext` stores the current parsing context
16323
+ // when entering a new scope (list, blank node, formula)
16324
+ _saveContext(type, graph, subject, predicate, object) {
16325
+ const n3Mode = this._n3Mode;
16326
+ this._contextStack.push({
16327
+ subject: subject, predicate: predicate, object: object,
16328
+ graph: graph, type: type,
16329
+ inverse: n3Mode ? this._inversePredicate : false,
16330
+ blankPrefix: n3Mode ? this._prefixes._ : '',
16331
+ quantified: n3Mode ? this._quantified : null,
16332
+ });
16333
+ // The settings below only apply to N3 streams
16334
+ if (n3Mode) {
16335
+ // Every new scope resets the predicate direction
16336
+ this._inversePredicate = false;
16337
+ // In N3, blank nodes are scoped to a formula
16338
+ // (using a dot as separator, as a blank node label cannot start with it)
16339
+ this._prefixes._ = (this._graph ? `${this._graph.id.substr(2)}.` : '.');
16340
+ // Quantifiers are scoped to a formula
16341
+ this._quantified = Object.create(this._quantified);
16342
+ }
16343
+ }
16344
+
16345
+ // ### `_restoreContext` restores the parent context
16346
+ // when leaving a scope (list, blank node, formula)
16347
+ _restoreContext() {
16348
+ const context = this._contextStack.pop(), n3Mode = this._n3Mode;
16349
+ this._subject = context.subject;
16350
+ this._predicate = context.predicate;
16351
+ this._object = context.object;
16352
+ this._graph = context.graph;
16353
+ // The settings below only apply to N3 streams
16354
+ if (n3Mode) {
16355
+ this._inversePredicate = context.inverse;
16356
+ this._prefixes._ = context.blankPrefix;
16357
+ this._quantified = context.quantified;
16358
+ }
16359
+ }
16360
+
16361
+ // ### `_readInTopContext` reads a token when in the top context
16362
+ _readInTopContext(token) {
16363
+ switch (token.type) {
16364
+ // If an EOF token arrives in the top context, signal that we're done
16365
+ case 'eof':
16366
+ if (this._graph !== null)
16367
+ return this._error('Unclosed graph', token);
16368
+ delete this._prefixes._;
16369
+ return this._callback(null, null, this._prefixes);
16370
+ // It could be a prefix declaration
16371
+ case 'PREFIX':
16372
+ this._sparqlStyle = true;
16373
+ case '@prefix':
16374
+ return this._readPrefix;
16375
+ // It could be a base declaration
16376
+ case 'BASE':
16377
+ this._sparqlStyle = true;
16378
+ case '@base':
16379
+ return this._readBaseIRI;
16380
+ // It could be a graph
16381
+ case '{':
16382
+ if (this._supportsNamedGraphs) {
16383
+ this._graph = '';
16384
+ this._subject = null;
16385
+ return this._readSubject;
16386
+ }
16387
+ case 'GRAPH':
16388
+ if (this._supportsNamedGraphs)
16389
+ return this._readNamedGraphLabel;
16390
+ // Otherwise, the next token must be a subject
16391
+ default:
16392
+ return this._readSubject(token);
16393
+ }
16394
+ }
16395
+
16396
+ // ### `_readEntity` reads an IRI, prefixed name, blank node, or variable
16397
+ _readEntity(token, quantifier) {
16398
+ let value;
16399
+ switch (token.type) {
16400
+ // Read a relative or absolute IRI
16401
+ case 'IRI':
16402
+ case 'typeIRI':
16403
+ const iri = this._resolveIRI(token.value);
16404
+ if (iri === null)
16405
+ return this._error('Invalid IRI', token);
16406
+ value = this._namedNode(iri);
16407
+ break;
16408
+ // Read a prefixed name
16409
+ case 'type':
16410
+ case 'prefixed':
16411
+ const prefix = this._prefixes[token.prefix];
16412
+ if (prefix === undefined)
16413
+ return this._error(`Undefined prefix "${token.prefix}:"`, token);
16414
+ value = this._namedNode(prefix + token.value);
16415
+ break;
16416
+ // Read a blank node
16417
+ case 'blank':
16418
+ value = this._blankNode(this._prefixes[token.prefix] + token.value);
16419
+ break;
16420
+ // Read a variable
16421
+ case 'var':
16422
+ value = this._variable(token.value.substr(1));
16423
+ break;
16424
+ // Everything else is not an entity
16425
+ default:
16426
+ return this._error(`Expected entity but got ${token.type}`, token);
16427
+ }
16428
+ // In N3 mode, replace the entity if it is quantified
16429
+ if (!quantifier && this._n3Mode && (value.id in this._quantified))
16430
+ value = this._quantified[value.id];
16431
+ return value;
16432
+ }
16433
+
16434
+ // ### `_readSubject` reads a quad's subject
16435
+ _readSubject(token) {
16436
+ this._predicate = null;
16437
+ switch (token.type) {
16438
+ case '[':
16439
+ // Start a new quad with a new blank node as subject
16440
+ this._saveContext('blank', this._graph,
16441
+ this._subject = this._blankNode(), null, null);
16442
+ return this._readBlankNodeHead;
16443
+ case '(':
16444
+ // Start a new list
16445
+ this._saveContext('list', this._graph, this.RDF_NIL, null, null);
16446
+ this._subject = null;
16447
+ return this._readListItem;
16448
+ case '{':
16449
+ // Start a new formula
16450
+ if (!this._n3Mode)
16451
+ return this._error('Unexpected graph', token);
16452
+ this._saveContext('formula', this._graph,
16453
+ this._graph = this._blankNode(), null, null);
16454
+ return this._readSubject;
16455
+ case '}':
16456
+ // No subject; the graph in which we are reading is closed instead
16457
+ return this._readPunctuation(token);
16458
+ case '@forSome':
16459
+ if (!this._n3Mode)
16460
+ return this._error('Unexpected "@forSome"', token);
16461
+ this._subject = null;
16462
+ this._predicate = this.N3_FORSOME;
16463
+ this._quantifier = this._blankNode;
16464
+ return this._readQuantifierList;
16465
+ case '@forAll':
16466
+ if (!this._n3Mode)
16467
+ return this._error('Unexpected "@forAll"', token);
16468
+ this._subject = null;
16469
+ this._predicate = this.N3_FORALL;
16470
+ this._quantifier = this._variable;
16471
+ return this._readQuantifierList;
16472
+ case 'literal':
16473
+ if (!this._n3Mode)
16474
+ return this._error('Unexpected literal', token);
16475
+
16476
+ if (token.prefix.length === 0) {
16477
+ this._literalValue = token.value;
16478
+ return this._completeSubjectLiteral;
16479
+ }
16480
+ else
16481
+ this._subject = this._literal(token.value, this._namedNode(token.prefix));
16482
+
16483
+ break;
16484
+ case '<<':
16485
+ if (!this._supportsRDFStar)
16486
+ return this._error('Unexpected RDF* syntax', token);
16487
+ this._saveContext('<<', this._graph, null, null, null);
16488
+ this._graph = null;
16489
+ return this._readSubject;
16490
+ default:
16491
+ // Read the subject entity
16492
+ if ((this._subject = this._readEntity(token)) === undefined)
16493
+ return;
16494
+ // In N3 mode, the subject might be a path
16495
+ if (this._n3Mode)
16496
+ return this._getPathReader(this._readPredicateOrNamedGraph);
16497
+ }
16498
+
16499
+ // The next token must be a predicate,
16500
+ // or, if the subject was actually a graph IRI, a named graph
16501
+ return this._readPredicateOrNamedGraph;
16502
+ }
16503
+
16504
+ // ### `_readPredicate` reads a quad's predicate
16505
+ _readPredicate(token) {
16506
+ const type = token.type;
16507
+ switch (type) {
16508
+ case 'inverse':
16509
+ this._inversePredicate = true;
16510
+ case 'abbreviation':
16511
+ this._predicate = this.ABBREVIATIONS[token.value];
16512
+ break;
16513
+ case '.':
16514
+ case ']':
16515
+ case '}':
16516
+ // Expected predicate didn't come, must have been trailing semicolon
16517
+ if (this._predicate === null)
16518
+ return this._error(`Unexpected ${type}`, token);
16519
+ this._subject = null;
16520
+ return type === ']' ? this._readBlankNodeTail(token) : this._readPunctuation(token);
16521
+ case ';':
16522
+ // Additional semicolons can be safely ignored
16523
+ return this._predicate !== null ? this._readPredicate :
16524
+ this._error('Expected predicate but got ;', token);
16525
+ case '[':
16526
+ if (this._n3Mode) {
16527
+ // Start a new quad with a new blank node as subject
16528
+ this._saveContext('blank', this._graph, this._subject,
16529
+ this._subject = this._blankNode(), null);
16530
+ return this._readBlankNodeHead;
16531
+ }
16532
+ case 'blank':
16533
+ if (!this._n3Mode)
16534
+ return this._error('Disallowed blank node as predicate', token);
16535
+ default:
16536
+ if ((this._predicate = this._readEntity(token)) === undefined)
16537
+ return;
16538
+ }
16539
+ // The next token must be an object
16540
+ return this._readObject;
16541
+ }
16542
+
16543
+ // ### `_readObject` reads a quad's object
16544
+ _readObject(token) {
16545
+ switch (token.type) {
16546
+ case 'literal':
16547
+ // Regular literal, can still get a datatype or language
16548
+ if (token.prefix.length === 0) {
16549
+ this._literalValue = token.value;
16550
+ return this._readDataTypeOrLang;
16551
+ }
16552
+ // Pre-datatyped string literal (prefix stores the datatype)
16553
+ else
16554
+ this._object = this._literal(token.value, this._namedNode(token.prefix));
16555
+ break;
16556
+ case '[':
16557
+ // Start a new quad with a new blank node as subject
16558
+ this._saveContext('blank', this._graph, this._subject, this._predicate,
16559
+ this._subject = this._blankNode());
16560
+ return this._readBlankNodeHead;
16561
+ case '(':
16562
+ // Start a new list
16563
+ this._saveContext('list', this._graph, this._subject, this._predicate, this.RDF_NIL);
16564
+ this._subject = null;
16565
+ return this._readListItem;
16566
+ case '{':
16567
+ // Start a new formula
16568
+ if (!this._n3Mode)
16569
+ return this._error('Unexpected graph', token);
16570
+ this._saveContext('formula', this._graph, this._subject, this._predicate,
16571
+ this._graph = this._blankNode());
16572
+ return this._readSubject;
16573
+ case '<<':
16574
+ if (!this._supportsRDFStar)
16575
+ return this._error('Unexpected RDF* syntax', token);
16576
+ this._saveContext('<<', this._graph, this._subject, this._predicate, null);
16577
+ this._graph = null;
16578
+ return this._readSubject;
16579
+ default:
16580
+ // Read the object entity
16581
+ if ((this._object = this._readEntity(token)) === undefined)
16582
+ return;
16583
+ // In N3 mode, the object might be a path
16584
+ if (this._n3Mode)
16585
+ return this._getPathReader(this._getContextEndReader());
16586
+ }
16587
+ return this._getContextEndReader();
16588
+ }
16589
+
16590
+ // ### `_readPredicateOrNamedGraph` reads a quad's predicate, or a named graph
16591
+ _readPredicateOrNamedGraph(token) {
16592
+ return token.type === '{' ? this._readGraph(token) : this._readPredicate(token);
16593
+ }
16594
+
16595
+ // ### `_readGraph` reads a graph
16596
+ _readGraph(token) {
16597
+ if (token.type !== '{')
16598
+ return this._error(`Expected graph but got ${token.type}`, token);
16599
+ // The "subject" we read is actually the GRAPH's label
16600
+ this._graph = this._subject, this._subject = null;
16601
+ return this._readSubject;
16602
+ }
16603
+
16604
+ // ### `_readBlankNodeHead` reads the head of a blank node
16605
+ _readBlankNodeHead(token) {
16606
+ if (token.type === ']') {
16607
+ this._subject = null;
16608
+ return this._readBlankNodeTail(token);
16609
+ }
16610
+ else {
16611
+ this._predicate = null;
16612
+ return this._readPredicate(token);
16613
+ }
16614
+ }
16615
+
16616
+ // ### `_readBlankNodeTail` reads the end of a blank node
16617
+ _readBlankNodeTail(token) {
16618
+ if (token.type !== ']')
16619
+ return this._readBlankNodePunctuation(token);
16620
+
16621
+ // Store blank node quad
16622
+ if (this._subject !== null)
16623
+ this._emit(this._subject, this._predicate, this._object, this._graph);
16624
+
16625
+ // Restore the parent context containing this blank node
16626
+ const empty = this._predicate === null;
16627
+ this._restoreContext();
16628
+ // If the blank node was the object, restore previous context and read punctuation
16629
+ if (this._object !== null)
16630
+ return this._getContextEndReader();
16631
+ // If the blank node was the predicate, continue reading the object
16632
+ else if (this._predicate !== null)
16633
+ return this._readObject;
16634
+ // If the blank node was the subject, continue reading the predicate
16635
+ else
16636
+ // If the blank node was empty, it could be a named graph label
16637
+ return empty ? this._readPredicateOrNamedGraph : this._readPredicateAfterBlank;
16638
+ }
16639
+
16640
+ // ### `_readPredicateAfterBlank` reads a predicate after an anonymous blank node
16641
+ _readPredicateAfterBlank(token) {
16642
+ switch (token.type) {
16643
+ case '.':
16644
+ case '}':
16645
+ // No predicate is coming if the triple is terminated here
16646
+ this._subject = null;
16647
+ return this._readPunctuation(token);
16648
+ default:
16649
+ return this._readPredicate(token);
16650
+ }
16651
+ }
16652
+
16653
+ // ### `_readListItem` reads items from a list
16654
+ _readListItem(token) {
16655
+ let item = null, // The item of the list
16656
+ list = null, // The list itself
16657
+ next = this._readListItem; // The next function to execute
16658
+ const previousList = this._subject, // The previous list that contains this list
16659
+ stack = this._contextStack, // The stack of parent contexts
16660
+ parent = stack[stack.length - 1]; // The parent containing the current list
16661
+
16662
+ switch (token.type) {
16663
+ case '[':
16664
+ // Stack the current list quad and start a new quad with a blank node as subject
16665
+ this._saveContext('blank', this._graph,
16666
+ list = this._blankNode(), this.RDF_FIRST,
16667
+ this._subject = item = this._blankNode());
16668
+ next = this._readBlankNodeHead;
16669
+ break;
16670
+ case '(':
16671
+ // Stack the current list quad and start a new list
16672
+ this._saveContext('list', this._graph,
16673
+ list = this._blankNode(), this.RDF_FIRST, this.RDF_NIL);
16674
+ this._subject = null;
16675
+ break;
16676
+ case ')':
16677
+ // Closing the list; restore the parent context
16678
+ this._restoreContext();
16679
+ // If this list is contained within a parent list, return the membership quad here.
16680
+ // This will be `<parent list element> rdf:first <this list>.`.
16681
+ if (stack.length !== 0 && stack[stack.length - 1].type === 'list')
16682
+ this._emit(this._subject, this._predicate, this._object, this._graph);
16683
+ // Was this list the parent's subject?
16684
+ if (this._predicate === null) {
16685
+ // The next token is the predicate
16686
+ next = this._readPredicate;
16687
+ // No list tail if this was an empty list
16688
+ if (this._subject === this.RDF_NIL)
16689
+ return next;
16690
+ }
16691
+ // The list was in the parent context's object
16692
+ else {
16693
+ next = this._getContextEndReader();
16694
+ // No list tail if this was an empty list
16695
+ if (this._object === this.RDF_NIL)
16696
+ return next;
16697
+ }
16698
+ // Close the list by making the head nil
16699
+ list = this.RDF_NIL;
16700
+ break;
16701
+ case 'literal':
16702
+ // Regular literal, can still get a datatype or language
16703
+ if (token.prefix.length === 0) {
16704
+ this._literalValue = token.value;
16705
+ next = this._readListItemDataTypeOrLang;
16706
+ }
16707
+ // Pre-datatyped string literal (prefix stores the datatype)
16708
+ else {
16709
+ item = this._literal(token.value, this._namedNode(token.prefix));
16710
+ next = this._getContextEndReader();
16711
+ }
16712
+ break;
16713
+ case '{':
16714
+ // Start a new formula
16715
+ if (!this._n3Mode)
16716
+ return this._error('Unexpected graph', token);
16717
+ this._saveContext('formula', this._graph, this._subject, this._predicate,
16718
+ this._graph = this._blankNode());
16719
+ return this._readSubject;
16720
+ default:
16721
+ if ((item = this._readEntity(token)) === undefined)
16722
+ return;
16723
+ }
16724
+
16725
+ // Create a new blank node if no item head was assigned yet
16726
+ if (list === null)
16727
+ this._subject = list = this._blankNode();
16728
+
16729
+ // Is this the first element of the list?
16730
+ if (previousList === null) {
16731
+ // This list is either the subject or the object of its parent
16732
+ if (parent.predicate === null)
16733
+ parent.subject = list;
16734
+ else
16735
+ parent.object = list;
16736
+ }
16737
+ else {
16738
+ // Continue the previous list with the current list
16739
+ this._emit(previousList, this.RDF_REST, list, this._graph);
16740
+ }
16741
+ // If an item was read, add it to the list
16742
+ if (item !== null) {
16743
+ // In N3 mode, the item might be a path
16744
+ if (this._n3Mode && (token.type === 'IRI' || token.type === 'prefixed')) {
16745
+ // Create a new context to add the item's path
16746
+ this._saveContext('item', this._graph, list, this.RDF_FIRST, item);
16747
+ this._subject = item, this._predicate = null;
16748
+ // _readPath will restore the context and output the item
16749
+ return this._getPathReader(this._readListItem);
16750
+ }
16751
+ // Output the item
16752
+ this._emit(list, this.RDF_FIRST, item, this._graph);
16753
+ }
16754
+ return next;
16755
+ }
16756
+
16757
+ // ### `_readDataTypeOrLang` reads an _optional_ datatype or language
16758
+ _readDataTypeOrLang(token) {
16759
+ return this._completeObjectLiteral(token, false);
16760
+ }
16761
+
16762
+
16763
+ // ### `_readListItemDataTypeOrLang` reads an _optional_ datatype or language in a list
16764
+ _readListItemDataTypeOrLang(token) {
16765
+ return this._completeObjectLiteral(token, true);
16766
+ }
16767
+
16768
+ // ### `_completeLiteral` completes a literal with an optional datatype or language
16769
+ _completeLiteral(token) {
16770
+ // Create a simple string literal by default
16771
+ let literal = this._literal(this._literalValue);
16772
+
16773
+ switch (token.type) {
16774
+ // Create a datatyped literal
16775
+ case 'type':
16776
+ case 'typeIRI':
16777
+ const datatype = this._readEntity(token);
16778
+ if (datatype === undefined) return; // No datatype means an error occurred
16779
+ literal = this._literal(this._literalValue, datatype);
16780
+ token = null;
16781
+ break;
16782
+ // Create a language-tagged string
16783
+ case 'langcode':
16784
+ literal = this._literal(this._literalValue, token.value);
16785
+ token = null;
16786
+ break;
16787
+ }
16788
+
16789
+ return { token, literal };
16790
+ }
16791
+
16792
+ // Completes a literal in subject position
16793
+ _completeSubjectLiteral(token) {
16794
+ this._subject = this._completeLiteral(token).literal;
16795
+ return this._readPredicateOrNamedGraph;
16796
+ }
16797
+
16798
+ // Completes a literal in object position
16799
+ _completeObjectLiteral(token, listItem) {
16800
+ const completed = this._completeLiteral(token);
16801
+ if (!completed)
16802
+ return;
16803
+ this._object = completed.literal;
16804
+
16805
+ // If this literal was part of a list, write the item
16806
+ // (we could also check the context stack, but passing in a flag is faster)
16807
+ if (listItem)
16808
+ this._emit(this._subject, this.RDF_FIRST, this._object, this._graph);
16809
+ // If the token was consumed, continue with the rest of the input
16810
+ if (completed.token === null)
16811
+ return this._getContextEndReader();
16812
+ // Otherwise, consume the token now
16813
+ else {
16814
+ this._readCallback = this._getContextEndReader();
16815
+ return this._readCallback(completed.token);
16816
+ }
16817
+ }
16818
+
16819
+ // ### `_readFormulaTail` reads the end of a formula
16820
+ _readFormulaTail(token) {
16821
+ if (token.type !== '}')
16822
+ return this._readPunctuation(token);
16823
+
16824
+ // Store the last quad of the formula
16825
+ if (this._subject !== null)
16826
+ this._emit(this._subject, this._predicate, this._object, this._graph);
16827
+
16828
+ // Restore the parent context containing this formula
16829
+ this._restoreContext();
16830
+ // If the formula was the subject, continue reading the predicate.
16831
+ // If the formula was the object, read punctuation.
16832
+ return this._object === null ? this._readPredicate : this._getContextEndReader();
16833
+ }
16834
+
16835
+ // ### `_readPunctuation` reads punctuation between quads or quad parts
16836
+ _readPunctuation(token) {
16837
+ let next, graph = this._graph;
16838
+ const subject = this._subject, inversePredicate = this._inversePredicate;
16839
+ switch (token.type) {
16840
+ // A closing brace ends a graph
16841
+ case '}':
16842
+ if (this._graph === null)
16843
+ return this._error('Unexpected graph closing', token);
16844
+ if (this._n3Mode)
16845
+ return this._readFormulaTail(token);
16846
+ this._graph = null;
16847
+ // A dot just ends the statement, without sharing anything with the next
16848
+ case '.':
16849
+ this._subject = null;
16850
+ next = this._contextStack.length ? this._readSubject : this._readInTopContext;
16851
+ if (inversePredicate) this._inversePredicate = false;
16852
+ break;
16853
+ // Semicolon means the subject is shared; predicate and object are different
16854
+ case ';':
16855
+ next = this._readPredicate;
16856
+ break;
16857
+ // Comma means both the subject and predicate are shared; the object is different
16858
+ case ',':
16859
+ next = this._readObject;
16860
+ break;
16861
+ default:
16862
+ // An entity means this is a quad (only allowed if not already inside a graph)
16863
+ if (this._supportsQuads && this._graph === null && (graph = this._readEntity(token)) !== undefined) {
16864
+ next = this._readQuadPunctuation;
16865
+ break;
16866
+ }
16867
+ return this._error(`Expected punctuation to follow "${this._object.id}"`, token);
16868
+ }
16869
+ // A quad has been completed now, so return it
16870
+ if (subject !== null) {
16871
+ const predicate = this._predicate, object = this._object;
16872
+ if (!inversePredicate)
16873
+ this._emit(subject, predicate, object, graph);
16874
+ else
16875
+ this._emit(object, predicate, subject, graph);
16876
+ }
16877
+ return next;
16878
+ }
16879
+
16880
+ // ### `_readBlankNodePunctuation` reads punctuation in a blank node
16881
+ _readBlankNodePunctuation(token) {
16882
+ let next;
16883
+ switch (token.type) {
16884
+ // Semicolon means the subject is shared; predicate and object are different
16885
+ case ';':
16886
+ next = this._readPredicate;
16887
+ break;
16888
+ // Comma means both the subject and predicate are shared; the object is different
16889
+ case ',':
16890
+ next = this._readObject;
16891
+ break;
16892
+ default:
16893
+ return this._error(`Expected punctuation to follow "${this._object.id}"`, token);
16894
+ }
16895
+ // A quad has been completed now, so return it
16896
+ this._emit(this._subject, this._predicate, this._object, this._graph);
16897
+ return next;
16898
+ }
16899
+
16900
+ // ### `_readQuadPunctuation` reads punctuation after a quad
16901
+ _readQuadPunctuation(token) {
16902
+ if (token.type !== '.')
16903
+ return this._error('Expected dot to follow quad', token);
16904
+ return this._readInTopContext;
16905
+ }
16906
+
16907
+ // ### `_readPrefix` reads the prefix of a prefix declaration
16908
+ _readPrefix(token) {
16909
+ if (token.type !== 'prefix')
16910
+ return this._error('Expected prefix to follow @prefix', token);
16911
+ this._prefix = token.value;
16912
+ return this._readPrefixIRI;
16913
+ }
16914
+
16915
+ // ### `_readPrefixIRI` reads the IRI of a prefix declaration
16916
+ _readPrefixIRI(token) {
16917
+ if (token.type !== 'IRI')
16918
+ return this._error(`Expected IRI to follow prefix "${this._prefix}:"`, token);
16919
+ const prefixNode = this._readEntity(token);
16920
+ this._prefixes[this._prefix] = prefixNode.value;
16921
+ this._prefixCallback(this._prefix, prefixNode);
16922
+ return this._readDeclarationPunctuation;
16923
+ }
16924
+
16925
+ // ### `_readBaseIRI` reads the IRI of a base declaration
16926
+ _readBaseIRI(token) {
16927
+ const iri = token.type === 'IRI' && this._resolveIRI(token.value);
16928
+ if (!iri)
16929
+ return this._error('Expected valid IRI to follow base declaration', token);
16930
+ this._setBase(iri);
16931
+ return this._readDeclarationPunctuation;
16932
+ }
16933
+
16934
+ // ### `_readNamedGraphLabel` reads the label of a named graph
16935
+ _readNamedGraphLabel(token) {
16936
+ switch (token.type) {
16937
+ case 'IRI':
16938
+ case 'blank':
16939
+ case 'prefixed':
16940
+ return this._readSubject(token), this._readGraph;
16941
+ case '[':
16942
+ return this._readNamedGraphBlankLabel;
16943
+ default:
16944
+ return this._error('Invalid graph label', token);
16945
+ }
16946
+ }
16947
+
16948
+ // ### `_readNamedGraphLabel` reads a blank node label of a named graph
16949
+ _readNamedGraphBlankLabel(token) {
16950
+ if (token.type !== ']')
16951
+ return this._error('Invalid graph label', token);
16952
+ this._subject = this._blankNode();
16953
+ return this._readGraph;
16954
+ }
16955
+
16956
+ // ### `_readDeclarationPunctuation` reads the punctuation of a declaration
16957
+ _readDeclarationPunctuation(token) {
16958
+ // SPARQL-style declarations don't have punctuation
16959
+ if (this._sparqlStyle) {
16960
+ this._sparqlStyle = false;
16961
+ return this._readInTopContext(token);
16962
+ }
16963
+
16964
+ if (token.type !== '.')
16965
+ return this._error('Expected declaration to end with a dot', token);
16966
+ return this._readInTopContext;
16967
+ }
16968
+
16969
+ // Reads a list of quantified symbols from a @forSome or @forAll statement
16970
+ _readQuantifierList(token) {
16971
+ let entity;
16972
+ switch (token.type) {
16973
+ case 'IRI':
16974
+ case 'prefixed':
16975
+ if ((entity = this._readEntity(token, true)) !== undefined)
16976
+ break;
16977
+ default:
16978
+ return this._error(`Unexpected ${token.type}`, token);
16979
+ }
16980
+ // Without explicit quantifiers, map entities to a quantified entity
16981
+ if (!this._explicitQuantifiers)
16982
+ this._quantified[entity.id] = this._quantifier(this._blankNode().value);
16983
+ // With explicit quantifiers, output the reified quantifier
16984
+ else {
16985
+ // If this is the first item, start a new quantifier list
16986
+ if (this._subject === null)
16987
+ this._emit(this._graph || this.DEFAULTGRAPH, this._predicate,
16988
+ this._subject = this._blankNode(), this.QUANTIFIERS_GRAPH);
16989
+ // Otherwise, continue the previous list
16990
+ else
16991
+ this._emit(this._subject, this.RDF_REST,
16992
+ this._subject = this._blankNode(), this.QUANTIFIERS_GRAPH);
16993
+ // Output the list item
16994
+ this._emit(this._subject, this.RDF_FIRST, entity, this.QUANTIFIERS_GRAPH);
16995
+ }
16996
+ return this._readQuantifierPunctuation;
16997
+ }
16998
+
16999
+ // Reads punctuation from a @forSome or @forAll statement
17000
+ _readQuantifierPunctuation(token) {
17001
+ // Read more quantifiers
17002
+ if (token.type === ',')
17003
+ return this._readQuantifierList;
17004
+ // End of the quantifier list
17005
+ else {
17006
+ // With explicit quantifiers, close the quantifier list
17007
+ if (this._explicitQuantifiers) {
17008
+ this._emit(this._subject, this.RDF_REST, this.RDF_NIL, this.QUANTIFIERS_GRAPH);
17009
+ this._subject = null;
17010
+ }
17011
+ // Read a dot
17012
+ this._readCallback = this._getContextEndReader();
17013
+ return this._readCallback(token);
17014
+ }
17015
+ }
17016
+
17017
+ // ### `_getPathReader` reads a potential path and then resumes with the given function
17018
+ _getPathReader(afterPath) {
17019
+ this._afterPath = afterPath;
17020
+ return this._readPath;
17021
+ }
17022
+
17023
+ // ### `_readPath` reads a potential path
17024
+ _readPath(token) {
17025
+ switch (token.type) {
17026
+ // Forward path
17027
+ case '!': return this._readForwardPath;
17028
+ // Backward path
17029
+ case '^': return this._readBackwardPath;
17030
+ // Not a path; resume reading where we left off
17031
+ default:
17032
+ const stack = this._contextStack, parent = stack.length && stack[stack.length - 1];
17033
+ // If we were reading a list item, we still need to output it
17034
+ if (parent && parent.type === 'item') {
17035
+ // The list item is the remaining subejct after reading the path
17036
+ const item = this._subject;
17037
+ // Switch back to the context of the list
17038
+ this._restoreContext();
17039
+ // Output the list item
17040
+ this._emit(this._subject, this.RDF_FIRST, item, this._graph);
17041
+ }
17042
+ return this._afterPath(token);
17043
+ }
17044
+ }
17045
+
17046
+ // ### `_readForwardPath` reads a '!' path
17047
+ _readForwardPath(token) {
17048
+ let subject, predicate;
17049
+ const object = this._blankNode();
17050
+ // The next token is the predicate
17051
+ if ((predicate = this._readEntity(token)) === undefined)
17052
+ return;
17053
+ // If we were reading a subject, replace the subject by the path's object
17054
+ if (this._predicate === null)
17055
+ subject = this._subject, this._subject = object;
17056
+ // If we were reading an object, replace the subject by the path's object
17057
+ else
17058
+ subject = this._object, this._object = object;
17059
+ // Emit the path's current quad and read its next section
17060
+ this._emit(subject, predicate, object, this._graph);
17061
+ return this._readPath;
17062
+ }
17063
+
17064
+ // ### `_readBackwardPath` reads a '^' path
17065
+ _readBackwardPath(token) {
17066
+ const subject = this._blankNode();
17067
+ let predicate, object;
17068
+ // The next token is the predicate
17069
+ if ((predicate = this._readEntity(token)) === undefined)
17070
+ return;
17071
+ // If we were reading a subject, replace the subject by the path's subject
17072
+ if (this._predicate === null)
17073
+ object = this._subject, this._subject = subject;
17074
+ // If we were reading an object, replace the subject by the path's subject
17075
+ else
17076
+ object = this._object, this._object = subject;
17077
+ // Emit the path's current quad and read its next section
17078
+ this._emit(subject, predicate, object, this._graph);
17079
+ return this._readPath;
17080
+ }
17081
+
17082
+ // ### `_readRDFStarTailOrGraph` reads the graph of a nested RDF* quad or the end of a nested RDF* triple
17083
+ _readRDFStarTailOrGraph(token) {
17084
+ if (token.type !== '>>') {
17085
+ // An entity means this is a quad (only allowed if not already inside a graph)
17086
+ if (this._supportsQuads && this._graph === null && (this._graph = this._readEntity(token)) !== undefined)
17087
+ return this._readRDFStarTail;
17088
+ return this._error(`Expected >> to follow "${this._object.id}"`, token);
17089
+ }
17090
+ return this._readRDFStarTail(token);
17091
+ }
17092
+
17093
+ // ### `_readRDFStarTail` reads the end of a nested RDF* triple
17094
+ _readRDFStarTail(token) {
17095
+ if (token.type !== '>>')
17096
+ return this._error(`Expected >> but got ${token.type}`, token);
17097
+ // Read the quad and restore the previous context
17098
+ const quad = this._quad(this._subject, this._predicate, this._object,
17099
+ this._graph || this.DEFAULTGRAPH);
17100
+ this._restoreContext();
17101
+ // If the triple was the subject, continue by reading the predicate.
17102
+ if (this._subject === null) {
17103
+ this._subject = quad;
17104
+ return this._readPredicate;
17105
+ }
17106
+ // If the triple was the object, read context end.
17107
+ else {
17108
+ this._object = quad;
17109
+ return this._getContextEndReader();
17110
+ }
17111
+ }
17112
+
17113
+ // ### `_getContextEndReader` gets the next reader function at the end of a context
17114
+ _getContextEndReader() {
17115
+ const contextStack = this._contextStack;
17116
+ if (!contextStack.length)
17117
+ return this._readPunctuation;
17118
+
17119
+ switch (contextStack[contextStack.length - 1].type) {
17120
+ case 'blank':
17121
+ return this._readBlankNodeTail;
17122
+ case 'list':
17123
+ return this._readListItem;
17124
+ case 'formula':
17125
+ return this._readFormulaTail;
17126
+ case '<<':
17127
+ return this._readRDFStarTailOrGraph;
17128
+ }
17129
+ }
17130
+
17131
+ // ### `_emit` sends a quad through the callback
17132
+ _emit(subject, predicate, object, graph) {
17133
+ this._callback(null, this._quad(subject, predicate, object, graph || this.DEFAULTGRAPH));
17134
+ }
17135
+
17136
+ // ### `_error` emits an error message through the callback
17137
+ _error(message, token) {
17138
+ const err = new Error(`${message} on line ${token.line}.`);
17139
+ err.context = {
17140
+ token: token,
17141
+ line: token.line,
17142
+ previousToken: this._lexer.previousToken,
17143
+ };
17144
+ this._callback(err);
17145
+ this._callback = noop;
17146
+ }
17147
+
17148
+ // ### `_resolveIRI` resolves an IRI against the base path
17149
+ _resolveIRI(iri) {
17150
+ return /^[a-z][a-z0-9+.-]*:/i.test(iri) ? iri : this._resolveRelativeIRI(iri);
17151
+ }
17152
+
17153
+ // ### `_resolveRelativeIRI` resolves an IRI against the base path,
17154
+ // assuming that a base path has been set and that the IRI is indeed relative
17155
+ _resolveRelativeIRI(iri) {
17156
+ // An empty relative IRI indicates the base IRI
17157
+ if (!iri.length)
17158
+ return this._base;
17159
+ // Decide resolving strategy based in the first character
17160
+ switch (iri[0]) {
17161
+ // Resolve relative fragment IRIs against the base IRI
17162
+ case '#': return this._base + iri;
17163
+ // Resolve relative query string IRIs by replacing the query string
17164
+ case '?': return this._base.replace(/(?:\?.*)?$/, iri);
17165
+ // Resolve root-relative IRIs at the root of the base IRI
17166
+ case '/':
17167
+ // Resolve scheme-relative IRIs to the scheme
17168
+ return (iri[1] === '/' ? this._baseScheme : this._baseRoot) + this._removeDotSegments(iri);
17169
+ // Resolve all other IRIs at the base IRI's path
17170
+ default:
17171
+ // Relative IRIs cannot contain a colon in the first path segment
17172
+ return (/^[^/:]*:/.test(iri)) ? null : this._removeDotSegments(this._basePath + iri);
17173
+ }
17174
+ }
17175
+
17176
+ // ### `_removeDotSegments` resolves './' and '../' path segments in an IRI as per RFC3986
17177
+ _removeDotSegments(iri) {
17178
+ // Don't modify the IRI if it does not contain any dot segments
17179
+ if (!/(^|\/)\.\.?($|[/#?])/.test(iri))
17180
+ return iri;
17181
+
17182
+ // Start with an imaginary slash before the IRI in order to resolve trailing './' and '../'
17183
+ const length = iri.length;
17184
+ let result = '', i = -1, pathStart = -1, segmentStart = 0, next = '/';
17185
+
17186
+ while (i < length) {
17187
+ switch (next) {
17188
+ // The path starts with the first slash after the authority
17189
+ case ':':
17190
+ if (pathStart < 0) {
17191
+ // Skip two slashes before the authority
17192
+ if (iri[++i] === '/' && iri[++i] === '/')
17193
+ // Skip to slash after the authority
17194
+ while ((pathStart = i + 1) < length && iri[pathStart] !== '/')
17195
+ i = pathStart;
17196
+ }
17197
+ break;
17198
+ // Don't modify a query string or fragment
17199
+ case '?':
17200
+ case '#':
17201
+ i = length;
17202
+ break;
17203
+ // Handle '/.' or '/..' path segments
17204
+ case '/':
17205
+ if (iri[i + 1] === '.') {
17206
+ next = iri[++i + 1];
17207
+ switch (next) {
17208
+ // Remove a '/.' segment
17209
+ case '/':
17210
+ result += iri.substring(segmentStart, i - 1);
17211
+ segmentStart = i + 1;
17212
+ break;
17213
+ // Remove a trailing '/.' segment
17214
+ case undefined:
17215
+ case '?':
17216
+ case '#':
17217
+ return result + iri.substring(segmentStart, i) + iri.substr(i + 1);
17218
+ // Remove a '/..' segment
17219
+ case '.':
17220
+ next = iri[++i + 1];
17221
+ if (next === undefined || next === '/' || next === '?' || next === '#') {
17222
+ result += iri.substring(segmentStart, i - 2);
17223
+ // Try to remove the parent path from result
17224
+ if ((segmentStart = result.lastIndexOf('/')) >= pathStart)
17225
+ result = result.substr(0, segmentStart);
17226
+ // Remove a trailing '/..' segment
17227
+ if (next !== '/')
17228
+ return `${result}/${iri.substr(i + 1)}`;
17229
+ segmentStart = i + 1;
17230
+ }
17231
+ }
17232
+ }
17233
+ }
17234
+ next = iri[++i];
17235
+ }
17236
+ return result + iri.substring(segmentStart);
17237
+ }
17238
+
17239
+ // ## Public methods
17240
+
17241
+ // ### `parse` parses the N3 input and emits each parsed quad through the callback
17242
+ parse(input, quadCallback, prefixCallback) {
17243
+ // The read callback is the next function to be executed when a token arrives.
17244
+ // We start reading in the top context.
17245
+ this._readCallback = this._readInTopContext;
17246
+ this._sparqlStyle = false;
17247
+ this._prefixes = Object.create(null);
17248
+ this._prefixes._ = this._blankNodePrefix ? this._blankNodePrefix.substr(2)
17249
+ : `b${blankNodePrefix++}_`;
17250
+ this._prefixCallback = prefixCallback || noop;
17251
+ this._inversePredicate = false;
17252
+ this._quantified = Object.create(null);
17253
+
17254
+ // Parse synchronously if no quad callback is given
17255
+ if (!quadCallback) {
17256
+ const quads = [];
17257
+ let error;
17258
+ this._callback = (e, t) => { e ? (error = e) : t && quads.push(t); };
17259
+ this._lexer.tokenize(input).every(token => {
17260
+ return this._readCallback = this._readCallback(token);
17261
+ });
17262
+ if (error) throw error;
17263
+ return quads;
17264
+ }
17265
+
17266
+ // Parse asynchronously otherwise, executing the read callback when a token arrives
17267
+ this._callback = quadCallback;
17268
+ this._lexer.tokenize(input, (error, token) => {
17269
+ if (error !== null)
17270
+ this._callback(error), this._callback = noop;
17271
+ else if (this._readCallback)
17272
+ this._readCallback = this._readCallback(token);
17273
+ });
17274
+ }
17275
+ }
17276
+
17277
+ // The empty function
17278
+ function noop() {}
17279
+
17280
+ // Initializes the parser with the given data factory
17281
+ function initDataFactory(parser, factory) {
17282
+ // Set factory methods
17283
+ const namedNode = factory.namedNode;
17284
+ parser._namedNode = namedNode;
17285
+ parser._blankNode = factory.blankNode;
17286
+ parser._literal = factory.literal;
17287
+ parser._variable = factory.variable;
17288
+ parser._quad = factory.quad;
17289
+ parser.DEFAULTGRAPH = factory.defaultGraph();
17290
+
17291
+ // Set common named nodes
17292
+ parser.RDF_FIRST = namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_1__["default"].rdf.first);
17293
+ parser.RDF_REST = namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_1__["default"].rdf.rest);
17294
+ parser.RDF_NIL = namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_1__["default"].rdf.nil);
17295
+ parser.N3_FORALL = namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_1__["default"].r.forAll);
17296
+ parser.N3_FORSOME = namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_1__["default"].r.forSome);
17297
+ parser.ABBREVIATIONS = {
17298
+ 'a': namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_1__["default"].rdf.type),
17299
+ '=': namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_1__["default"].owl.sameAs),
17300
+ '>': namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_1__["default"].log.implies),
17301
+ };
17302
+ parser.QUANTIFIERS_GRAPH = namedNode('urn:n3:quantifiers');
17303
+ }
17304
+ initDataFactory(N3Parser.prototype, _N3DataFactory__WEBPACK_IMPORTED_MODULE_2__["default"]);
17305
+
17306
+
15703
17307
  /***/ }),
15704
17308
 
15705
17309
  /***/ "./node_modules/n3/src/N3Store.js":
@@ -16542,6 +18146,109 @@ class DatasetCoreAndReadableStream extends readable_stream__WEBPACK_IMPORTED_MOD
16542
18146
  }
16543
18147
 
16544
18148
 
18149
+ /***/ }),
18150
+
18151
+ /***/ "./node_modules/n3/src/N3StreamParser.js":
18152
+ /*!***********************************************!*\
18153
+ !*** ./node_modules/n3/src/N3StreamParser.js ***!
18154
+ \***********************************************/
18155
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18156
+
18157
+ "use strict";
18158
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18159
+ /* harmony export */ "default": () => (/* binding */ N3StreamParser)
18160
+ /* harmony export */ });
18161
+ /* harmony import */ var _N3Parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./N3Parser */ "./node_modules/n3/src/N3Parser.js");
18162
+ /* harmony import */ var readable_stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! readable-stream */ "./node_modules/readable-stream/readable-browser.js");
18163
+ /* harmony import */ var readable_stream__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(readable_stream__WEBPACK_IMPORTED_MODULE_0__);
18164
+ // **N3StreamParser** parses a text stream into a quad stream.
18165
+
18166
+
18167
+
18168
+ // ## Constructor
18169
+ class N3StreamParser extends readable_stream__WEBPACK_IMPORTED_MODULE_0__.Transform {
18170
+ constructor(options) {
18171
+ super({ decodeStrings: true });
18172
+ this._readableState.objectMode = true;
18173
+
18174
+ // Set up parser with dummy stream to obtain `data` and `end` callbacks
18175
+ const parser = new _N3Parser__WEBPACK_IMPORTED_MODULE_1__["default"](options);
18176
+ let onData, onEnd;
18177
+ parser.parse({
18178
+ on: (event, callback) => {
18179
+ switch (event) {
18180
+ case 'data': onData = callback; break;
18181
+ case 'end': onEnd = callback; break;
18182
+ }
18183
+ },
18184
+ },
18185
+ // Handle quads by pushing them down the pipeline
18186
+ (error, quad) => { error && this.emit('error', error) || quad && this.push(quad); },
18187
+ // Emit prefixes through the `prefix` event
18188
+ (prefix, uri) => { this.emit('prefix', prefix, uri); }
18189
+ );
18190
+
18191
+ // Implement Transform methods through parser callbacks
18192
+ this._transform = (chunk, encoding, done) => { onData(chunk); done(); };
18193
+ this._flush = done => { onEnd(); done(); };
18194
+ }
18195
+
18196
+ // ### Parses a stream of strings
18197
+ import(stream) {
18198
+ stream.on('data', chunk => { this.write(chunk); });
18199
+ stream.on('end', () => { this.end(); });
18200
+ stream.on('error', error => { this.emit('error', error); });
18201
+ return this;
18202
+ }
18203
+ }
18204
+
18205
+
18206
+ /***/ }),
18207
+
18208
+ /***/ "./node_modules/n3/src/N3StreamWriter.js":
18209
+ /*!***********************************************!*\
18210
+ !*** ./node_modules/n3/src/N3StreamWriter.js ***!
18211
+ \***********************************************/
18212
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18213
+
18214
+ "use strict";
18215
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18216
+ /* harmony export */ "default": () => (/* binding */ N3StreamWriter)
18217
+ /* harmony export */ });
18218
+ /* harmony import */ var readable_stream__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! readable-stream */ "./node_modules/readable-stream/readable-browser.js");
18219
+ /* harmony import */ var readable_stream__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(readable_stream__WEBPACK_IMPORTED_MODULE_0__);
18220
+ /* harmony import */ var _N3Writer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./N3Writer */ "./node_modules/n3/src/N3Writer.js");
18221
+ // **N3StreamWriter** serializes a quad stream into a text stream.
18222
+
18223
+
18224
+
18225
+ // ## Constructor
18226
+ class N3StreamWriter extends readable_stream__WEBPACK_IMPORTED_MODULE_0__.Transform {
18227
+ constructor(options) {
18228
+ super({ encoding: 'utf8', writableObjectMode: true });
18229
+
18230
+ // Set up writer with a dummy stream object
18231
+ const writer = this._writer = new _N3Writer__WEBPACK_IMPORTED_MODULE_1__["default"]({
18232
+ write: (quad, encoding, callback) => { this.push(quad); callback && callback(); },
18233
+ end: callback => { this.push(null); callback && callback(); },
18234
+ }, options);
18235
+
18236
+ // Implement Transform methods on top of writer
18237
+ this._transform = (quad, encoding, done) => { writer.addQuad(quad, done); };
18238
+ this._flush = done => { writer.end(done); };
18239
+ }
18240
+
18241
+ // ### Serializes a stream of quads
18242
+ import(stream) {
18243
+ stream.on('data', quad => { this.write(quad); });
18244
+ stream.on('end', () => { this.end(); });
18245
+ stream.on('error', error => { this.emit('error', error); });
18246
+ stream.on('prefix', (prefix, iri) => { this._writer.addPrefix(prefix, iri); });
18247
+ return this;
18248
+ }
18249
+ }
18250
+
18251
+
16545
18252
  /***/ }),
16546
18253
 
16547
18254
  /***/ "./node_modules/n3/src/N3Util.js":
@@ -16551,10 +18258,17 @@ class DatasetCoreAndReadableStream extends readable_stream__WEBPACK_IMPORTED_MOD
16551
18258
  /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
16552
18259
 
16553
18260
  "use strict";
18261
+ __webpack_require__.r(__webpack_exports__);
16554
18262
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
16555
- /* harmony export */ "isDefaultGraph": () => (/* binding */ isDefaultGraph)
18263
+ /* harmony export */ "inDefaultGraph": () => (/* binding */ inDefaultGraph),
18264
+ /* harmony export */ "isBlankNode": () => (/* binding */ isBlankNode),
18265
+ /* harmony export */ "isDefaultGraph": () => (/* binding */ isDefaultGraph),
18266
+ /* harmony export */ "isLiteral": () => (/* binding */ isLiteral),
18267
+ /* harmony export */ "isNamedNode": () => (/* binding */ isNamedNode),
18268
+ /* harmony export */ "isVariable": () => (/* binding */ isVariable),
18269
+ /* harmony export */ "prefix": () => (/* binding */ prefix),
18270
+ /* harmony export */ "prefixes": () => (/* binding */ prefixes)
16556
18271
  /* harmony export */ });
16557
- /* unused harmony exports isNamedNode, isBlankNode, isLiteral, isVariable, inDefaultGraph, prefix, prefixes */
16558
18272
  /* harmony import */ var _N3DataFactory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./N3DataFactory */ "./node_modules/n3/src/N3DataFactory.js");
16559
18273
  // **N3Util** provides N3 utility functions.
16560
18274
 
@@ -17040,6 +18754,103 @@ function escapeRegex(regex) {
17040
18754
  }
17041
18755
 
17042
18756
 
18757
+ /***/ }),
18758
+
18759
+ /***/ "./node_modules/n3/src/index.js":
18760
+ /*!**************************************!*\
18761
+ !*** ./node_modules/n3/src/index.js ***!
18762
+ \**************************************/
18763
+ /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
18764
+
18765
+ "use strict";
18766
+ __webpack_require__.r(__webpack_exports__);
18767
+ /* harmony export */ __webpack_require__.d(__webpack_exports__, {
18768
+ /* harmony export */ "BlankNode": () => (/* reexport safe */ _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.BlankNode),
18769
+ /* harmony export */ "DataFactory": () => (/* reexport safe */ _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["default"]),
18770
+ /* harmony export */ "DefaultGraph": () => (/* reexport safe */ _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.DefaultGraph),
18771
+ /* harmony export */ "Lexer": () => (/* reexport safe */ _N3Lexer__WEBPACK_IMPORTED_MODULE_0__["default"]),
18772
+ /* harmony export */ "Literal": () => (/* reexport safe */ _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.Literal),
18773
+ /* harmony export */ "NamedNode": () => (/* reexport safe */ _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.NamedNode),
18774
+ /* harmony export */ "Parser": () => (/* reexport safe */ _N3Parser__WEBPACK_IMPORTED_MODULE_1__["default"]),
18775
+ /* harmony export */ "Quad": () => (/* reexport safe */ _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.Quad),
18776
+ /* harmony export */ "Store": () => (/* reexport safe */ _N3Store__WEBPACK_IMPORTED_MODULE_3__["default"]),
18777
+ /* harmony export */ "StreamParser": () => (/* reexport safe */ _N3StreamParser__WEBPACK_IMPORTED_MODULE_4__["default"]),
18778
+ /* harmony export */ "StreamWriter": () => (/* reexport safe */ _N3StreamWriter__WEBPACK_IMPORTED_MODULE_5__["default"]),
18779
+ /* harmony export */ "Term": () => (/* reexport safe */ _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.Term),
18780
+ /* harmony export */ "Triple": () => (/* reexport safe */ _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.Triple),
18781
+ /* harmony export */ "Util": () => (/* reexport module object */ _N3Util__WEBPACK_IMPORTED_MODULE_6__),
18782
+ /* harmony export */ "Variable": () => (/* reexport safe */ _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.Variable),
18783
+ /* harmony export */ "Writer": () => (/* reexport safe */ _N3Writer__WEBPACK_IMPORTED_MODULE_2__["default"]),
18784
+ /* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__),
18785
+ /* harmony export */ "termFromId": () => (/* reexport safe */ _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.termFromId),
18786
+ /* harmony export */ "termToId": () => (/* reexport safe */ _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.termToId)
18787
+ /* harmony export */ });
18788
+ /* harmony import */ var _N3Lexer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./N3Lexer */ "./node_modules/n3/src/N3Lexer.js");
18789
+ /* harmony import */ var _N3Parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./N3Parser */ "./node_modules/n3/src/N3Parser.js");
18790
+ /* harmony import */ var _N3Writer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./N3Writer */ "./node_modules/n3/src/N3Writer.js");
18791
+ /* harmony import */ var _N3Store__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./N3Store */ "./node_modules/n3/src/N3Store.js");
18792
+ /* harmony import */ var _N3StreamParser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./N3StreamParser */ "./node_modules/n3/src/N3StreamParser.js");
18793
+ /* harmony import */ var _N3StreamWriter__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./N3StreamWriter */ "./node_modules/n3/src/N3StreamWriter.js");
18794
+ /* harmony import */ var _N3Util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./N3Util */ "./node_modules/n3/src/N3Util.js");
18795
+ /* harmony import */ var _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./N3DataFactory */ "./node_modules/n3/src/N3DataFactory.js");
18796
+
18797
+
18798
+
18799
+
18800
+
18801
+
18802
+
18803
+
18804
+
18805
+
18806
+ // Named exports
18807
+
18808
+
18809
+ // Export all named exports as a default object for backward compatibility
18810
+ /* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({
18811
+ Lexer: _N3Lexer__WEBPACK_IMPORTED_MODULE_0__["default"],
18812
+ Parser: _N3Parser__WEBPACK_IMPORTED_MODULE_1__["default"],
18813
+ Writer: _N3Writer__WEBPACK_IMPORTED_MODULE_2__["default"],
18814
+ Store: _N3Store__WEBPACK_IMPORTED_MODULE_3__["default"],
18815
+ StreamParser: _N3StreamParser__WEBPACK_IMPORTED_MODULE_4__["default"],
18816
+ StreamWriter: _N3StreamWriter__WEBPACK_IMPORTED_MODULE_5__["default"],
18817
+ Util: _N3Util__WEBPACK_IMPORTED_MODULE_6__,
18818
+
18819
+ DataFactory: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__["default"],
18820
+
18821
+ Term: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.Term,
18822
+ NamedNode: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.NamedNode,
18823
+ Literal: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.Literal,
18824
+ BlankNode: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.BlankNode,
18825
+ Variable: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.Variable,
18826
+ DefaultGraph: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.DefaultGraph,
18827
+ Quad: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.Quad,
18828
+ Triple: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.Triple,
18829
+
18830
+ termFromId: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.termFromId,
18831
+ termToId: _N3DataFactory__WEBPACK_IMPORTED_MODULE_7__.termToId,
18832
+ });
18833
+
18834
+
18835
+ /***/ }),
18836
+
18837
+ /***/ "./node_modules/queue-microtask/index.js":
18838
+ /*!***********************************************!*\
18839
+ !*** ./node_modules/queue-microtask/index.js ***!
18840
+ \***********************************************/
18841
+ /***/ ((module, __unused_webpack_exports, __webpack_require__) => {
18842
+
18843
+ /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
18844
+ let promise
18845
+
18846
+ module.exports = typeof queueMicrotask === 'function'
18847
+ ? queueMicrotask.bind(typeof window !== 'undefined' ? window : __webpack_require__.g)
18848
+ // reuse resolved promise, and allocate it lazily
18849
+ : cb => (promise || (promise = Promise.resolve()))
18850
+ .then(cb)
18851
+ .catch(err => setTimeout(() => { throw err }, 0))
18852
+
18853
+
17043
18854
  /***/ }),
17044
18855
 
17045
18856
  /***/ "./node_modules/readable-stream/errors-browser.js":
@@ -20861,12 +22672,16 @@ var __webpack_exports__ = {};
20861
22672
  \*****************************************/
20862
22673
  __webpack_require__.r(__webpack_exports__);
20863
22674
  /* harmony export */ __webpack_require__.d(__webpack_exports__, {
22675
+ /* harmony export */ "N3": () => (/* reexport module object */ n3__WEBPACK_IMPORTED_MODULE_2__),
20864
22676
  /* harmony export */ "RDFSerializer": () => (/* reexport safe */ _rdf__WEBPACK_IMPORTED_MODULE_0__.RDFSerializer),
20865
22677
  /* harmony export */ "SerializableNamedNode": () => (/* reexport safe */ _rdf__WEBPACK_IMPORTED_MODULE_0__.SerializableNamedNode),
20866
22678
  /* harmony export */ "xsd": () => (/* reexport safe */ _decorators__WEBPACK_IMPORTED_MODULE_1__.xsd)
20867
22679
  /* harmony export */ });
20868
22680
  /* harmony import */ var _rdf__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rdf */ "./dist/esm/rdf/index.js");
20869
22681
  /* harmony import */ var _decorators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./decorators */ "./dist/esm/decorators/index.js");
22682
+ /* harmony import */ var n3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! n3 */ "./node_modules/n3/src/index.js");
22683
+
22684
+
20870
22685
 
20871
22686
 
20872
22687