@faubulous/mentor-rdf 0.3.2 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9,6 +9,60 @@
9
9
  /******/ (() => { // webpackBootstrap
10
10
  /******/ var __webpack_modules__ = ({
11
11
 
12
+ /***/ "./node_modules/@babel/runtime/helpers/esm/defineProperty.js"
13
+ /*!*******************************************************************!*\
14
+ !*** ./node_modules/@babel/runtime/helpers/esm/defineProperty.js ***!
15
+ \*******************************************************************/
16
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
17
+
18
+ "use strict";
19
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _defineProperty)\n/* harmony export */ });\n/* harmony import */ var _toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./toPropertyKey.js */ \"./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js\");\n\nfunction _defineProperty(e, r, t) {\n return (r = (0,_toPropertyKey_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/@babel/runtime/helpers/esm/defineProperty.js?\n}");
20
+
21
+ /***/ },
22
+
23
+ /***/ "./node_modules/@babel/runtime/helpers/esm/toPrimitive.js"
24
+ /*!****************************************************************!*\
25
+ !*** ./node_modules/@babel/runtime/helpers/esm/toPrimitive.js ***!
26
+ \****************************************************************/
27
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
28
+
29
+ "use strict";
30
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ toPrimitive)\n/* harmony export */ });\n/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ \"./node_modules/@babel/runtime/helpers/esm/typeof.js\");\n\nfunction toPrimitive(t, r) {\n if (\"object\" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/@babel/runtime/helpers/esm/toPrimitive.js?\n}");
31
+
32
+ /***/ },
33
+
34
+ /***/ "./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js"
35
+ /*!******************************************************************!*\
36
+ !*** ./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js ***!
37
+ \******************************************************************/
38
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
39
+
40
+ "use strict";
41
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ toPropertyKey)\n/* harmony export */ });\n/* harmony import */ var _typeof_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./typeof.js */ \"./node_modules/@babel/runtime/helpers/esm/typeof.js\");\n/* harmony import */ var _toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./toPrimitive.js */ \"./node_modules/@babel/runtime/helpers/esm/toPrimitive.js\");\n\n\nfunction toPropertyKey(t) {\n var i = (0,_toPrimitive_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(t, \"string\");\n return \"symbol\" == (0,_typeof_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(i) ? i : i + \"\";\n}\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/@babel/runtime/helpers/esm/toPropertyKey.js?\n}");
42
+
43
+ /***/ },
44
+
45
+ /***/ "./node_modules/@babel/runtime/helpers/esm/typeof.js"
46
+ /*!***********************************************************!*\
47
+ !*** ./node_modules/@babel/runtime/helpers/esm/typeof.js ***!
48
+ \***********************************************************/
49
+ (__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) {
50
+
51
+ "use strict";
52
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ _typeof)\n/* harmony export */ });\nfunction _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/@babel/runtime/helpers/esm/typeof.js?\n}");
53
+
54
+ /***/ },
55
+
56
+ /***/ "./node_modules/@frogcat/ttl2jsonld/ttl2jsonld.js"
57
+ /*!********************************************************!*\
58
+ !*** ./node_modules/@frogcat/ttl2jsonld/ttl2jsonld.js ***!
59
+ \********************************************************/
60
+ (module, exports) {
61
+
62
+ eval("{var __WEBPACK_AMD_DEFINE_FACTORY__, __WEBPACK_AMD_DEFINE_ARRAY__, __WEBPACK_AMD_DEFINE_RESULT__;/*\n * Generated by PEG.js 0.10.0.\n *\n * http://pegjs.org/\n */\n(function(root, factory) {\n if (true) {\n !(__WEBPACK_AMD_DEFINE_ARRAY__ = [], __WEBPACK_AMD_DEFINE_FACTORY__ = (factory),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ = (typeof __WEBPACK_AMD_DEFINE_FACTORY__ === 'function' ?\n\t\t(__WEBPACK_AMD_DEFINE_FACTORY__.apply(exports, __WEBPACK_AMD_DEFINE_ARRAY__)) : __WEBPACK_AMD_DEFINE_FACTORY__),\n\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n } else // removed by dead control flow\n{}\n})(this, function() {\n \"use strict\";\n\n function peg$subclass(child, parent) {\n function ctor() { this.constructor = child; }\n ctor.prototype = parent.prototype;\n child.prototype = new ctor();\n }\n\n function peg$SyntaxError(message, expected, found, location) {\n this.message = message;\n this.expected = expected;\n this.found = found;\n this.location = location;\n this.name = \"SyntaxError\";\n\n if (typeof Error.captureStackTrace === \"function\") {\n Error.captureStackTrace(this, peg$SyntaxError);\n }\n }\n\n peg$subclass(peg$SyntaxError, Error);\n\n peg$SyntaxError.buildMessage = function(expected, found) {\n var DESCRIBE_EXPECTATION_FNS = {\n literal: function(expectation) {\n return \"\\\"\" + literalEscape(expectation.text) + \"\\\"\";\n },\n\n \"class\": function(expectation) {\n var escapedParts = \"\",\n i;\n\n for (i = 0; i < expectation.parts.length; i++) {\n escapedParts += expectation.parts[i] instanceof Array\n ? classEscape(expectation.parts[i][0]) + \"-\" + classEscape(expectation.parts[i][1])\n : classEscape(expectation.parts[i]);\n }\n\n return \"[\" + (expectation.inverted ? \"^\" : \"\") + escapedParts + \"]\";\n },\n\n any: function(expectation) {\n return \"any character\";\n },\n\n end: function(expectation) {\n return \"end of input\";\n },\n\n other: function(expectation) {\n return expectation.description;\n }\n };\n\n function hex(ch) {\n return ch.charCodeAt(0).toString(16).toUpperCase();\n }\n\n function literalEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\"/g, '\\\\\"')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function classEscape(s) {\n return s\n .replace(/\\\\/g, '\\\\\\\\')\n .replace(/\\]/g, '\\\\]')\n .replace(/\\^/g, '\\\\^')\n .replace(/-/g, '\\\\-')\n .replace(/\\0/g, '\\\\0')\n .replace(/\\t/g, '\\\\t')\n .replace(/\\n/g, '\\\\n')\n .replace(/\\r/g, '\\\\r')\n .replace(/[\\x00-\\x0F]/g, function(ch) { return '\\\\x0' + hex(ch); })\n .replace(/[\\x10-\\x1F\\x7F-\\x9F]/g, function(ch) { return '\\\\x' + hex(ch); });\n }\n\n function describeExpectation(expectation) {\n return DESCRIBE_EXPECTATION_FNS[expectation.type](expectation);\n }\n\n function describeExpected(expected) {\n var descriptions = new Array(expected.length),\n i, j;\n\n for (i = 0; i < expected.length; i++) {\n descriptions[i] = describeExpectation(expected[i]);\n }\n\n descriptions.sort();\n\n if (descriptions.length > 0) {\n for (i = 1, j = 1; i < descriptions.length; i++) {\n if (descriptions[i - 1] !== descriptions[i]) {\n descriptions[j] = descriptions[i];\n j++;\n }\n }\n descriptions.length = j;\n }\n\n switch (descriptions.length) {\n case 1:\n return descriptions[0];\n\n case 2:\n return descriptions[0] + \" or \" + descriptions[1];\n\n default:\n return descriptions.slice(0, -1).join(\", \")\n + \", or \"\n + descriptions[descriptions.length - 1];\n }\n }\n\n function describeFound(found) {\n return found ? \"\\\"\" + literalEscape(found) + \"\\\"\" : \"end of input\";\n }\n\n return \"Expected \" + describeExpected(expected) + \" but \" + describeFound(found) + \" found.\";\n };\n\n function peg$parse(input, options) {\n options = options !== void 0 ? options : {};\n\n var peg$FAILED = {},\n\n peg$startRuleFunctions = { turtleDoc: peg$parseturtleDoc },\n peg$startRuleFunction = peg$parseturtleDoc,\n\n peg$c0 = function(statements) {\n var jsonld = context.toJSON();\n jsonld[\"@graph\"] = [];\n statements.filter(a=>Array.isArray(a)).forEach(a=>{\n a.forEach(b=>{\n jsonld[\"@graph\"].push(b);\n });\n });\n\n if(jsonld[\"@graph\"].length===1){\n Object.assign(jsonld,jsonld[\"@graph\"][0]);\n delete jsonld[\"@graph\"];\n }\n\n return jsonld;\n },\n peg$c1 = \"\\uFEFF\",\n peg$c2 = peg$literalExpectation(\"\\uFEFF\", false),\n peg$c3 = \".\",\n peg$c4 = peg$literalExpectation(\".\", false),\n peg$c5 = function(a) {return a;},\n peg$c6 = \"#\",\n peg$c7 = peg$literalExpectation(\"#\", false),\n peg$c8 = /^[^\\n]/,\n peg$c9 = peg$classExpectation([\"\\n\"], true, false),\n peg$c10 = \"\\n\",\n peg$c11 = peg$literalExpectation(\"\\n\", false),\n peg$c12 = function(a) {return a.join(\"\");},\n peg$c13 = \"@prefix\",\n peg$c14 = peg$literalExpectation(\"@prefix\", false),\n peg$c15 = function(a, b) {\n context.addPrefix(a===\"\" ? \"0\" : a,b);\n return {};\n },\n peg$c16 = \"@base\",\n peg$c17 = peg$literalExpectation(\"@base\", false),\n peg$c18 = function(a) {\n context.addBase(a);\n return {};\n },\n peg$c19 = /^[Bb]/,\n peg$c20 = peg$classExpectation([\"B\", \"b\"], false, false),\n peg$c21 = /^[Aa]/,\n peg$c22 = peg$classExpectation([\"A\", \"a\"], false, false),\n peg$c23 = /^[Ss]/,\n peg$c24 = peg$classExpectation([\"S\", \"s\"], false, false),\n peg$c25 = /^[Ee]/,\n peg$c26 = peg$classExpectation([\"E\", \"e\"], false, false),\n peg$c27 = /^[Pp]/,\n peg$c28 = peg$classExpectation([\"P\", \"p\"], false, false),\n peg$c29 = /^[Rr]/,\n peg$c30 = peg$classExpectation([\"R\", \"r\"], false, false),\n peg$c31 = /^[Ff]/,\n peg$c32 = peg$classExpectation([\"F\", \"f\"], false, false),\n peg$c33 = /^[Ii]/,\n peg$c34 = peg$classExpectation([\"I\", \"i\"], false, false),\n peg$c35 = /^[Xx]/,\n peg$c36 = peg$classExpectation([\"X\", \"x\"], false, false),\n peg$c37 = function(s, p) {\n var x = {};\n if(typeof s==='string' && s!=='[]') x[\"@id\"] = s;\n else if(typeof s==='object') Object.assign(x,s);\n if(p) Object.assign(x,p);\n return [x];\n },\n peg$c38 = function(s, p) {\n var x = {};\n if(s) Object.assign(x,s);\n if(p) Object.assign(x,p);\n return [x];\n },\n peg$c39 = \";\",\n peg$c40 = peg$literalExpectation(\";\", false),\n peg$c41 = function(a, b, e, f) {var x={};x[e]=f;return x;},\n peg$c42 = function(a, b, d) {return d;},\n peg$c43 = function(a, b, c) {\n var x = {};\n c.unshift(createObject(a,b));\n c.forEach(t=>{\n if(!t) return;\n Object.keys(t).forEach(key=>{\n t[key].forEach(val=>{\n if(key===\"@type\" && val[\"@id\"]!==undefined) val = val[\"@id\"];\n if(x[key]===undefined) x[key] = val;\n else if(Array.isArray(x[key])) x[key].push(val);\n else x[key] = [x[key],val];\n });\n });\n });\n return x;\n },\n peg$c44 = \",\",\n peg$c45 = peg$literalExpectation(\",\", false),\n peg$c46 = function(a, c) {return c;},\n peg$c47 = function(a, b) {\n b.unshift(a);\n return b;\n },\n peg$c48 = \"a\",\n peg$c49 = peg$literalExpectation(\"a\", false),\n peg$c50 = function() {return '@type';},\n peg$c51 = function(a) {return expandList(a,true);},\n peg$c52 = function(a) {return expandList(a,false);},\n peg$c53 = function(a) {return a===\"[]\" ? {} : {\"@id\":a};},\n peg$c54 = function(a) {return {\"@id\":a};},\n peg$c55 = \"[\",\n peg$c56 = peg$literalExpectation(\"[\", false),\n peg$c57 = \"]\",\n peg$c58 = peg$literalExpectation(\"]\", false),\n peg$c59 = \"(\",\n peg$c60 = peg$literalExpectation(\"(\", false),\n peg$c61 = \")\",\n peg$c62 = peg$literalExpectation(\")\", false),\n peg$c63 = function(a) {return {\"@list\":a};},\n peg$c64 = function(a, b) {return {\"@value\":a,\"@language\":b};},\n peg$c65 = \"^^\",\n peg$c66 = peg$literalExpectation(\"^^\", false),\n peg$c67 = function(a, b) {\n if(b===\"http://www.w3.org/2001/XMLSchema#boolean\" && a===\"true\") return true;\n if(b===\"http://www.w3.org/2001/XMLSchema#boolean\" && a===\"false\") return false;\n if(b===\"http://www.w3.org/2001/XMLSchema#integer\") return parseInt(a);\n if(b===\"http://www.w3.org/2001/XMLSchema#double\") return parseFloat(a);\n\n const uri = context.resolve(b,true);\n if(uri){\n const prefix = b.split(\":\")[0];\n if(uri===\"http://www.w3.org/2001/XMLSchema#boolean\" && a===\"true\"){\n context.decrement(prefix);\n return true;\n }\n if(uri===\"http://www.w3.org/2001/XMLSchema#boolean\" && a===\"false\"){\n context.decrement(prefix);\n return false;\n }\n if(uri===\"http://www.w3.org/2001/XMLSchema#integer\"){\n context.decrement(prefix);\n return parseInt(a);\n }\n if(uri===\"http://www.w3.org/2001/XMLSchema#double\"){\n context.decrement(prefix);\n return parseFloat(a);\n }\n }\n return {\"@value\":a,\"@type\":b};\n },\n peg$c68 = \"true\",\n peg$c69 = peg$literalExpectation(\"true\", false),\n peg$c70 = function() {return true;},\n peg$c71 = \"false\",\n peg$c72 = peg$literalExpectation(\"false\", false),\n peg$c73 = function() {return false;},\n peg$c74 = function(a) {return a+\":\";},\n peg$c75 = \"<\",\n peg$c76 = peg$literalExpectation(\"<\", false),\n peg$c77 = /^[^\\0- <>\"{}|\\^`\\\\]/,\n peg$c78 = peg$classExpectation([[\"\\0\", \" \"], \"<\", \">\", \"\\\"\", \"{\", \"}\", \"|\", \"^\", \"`\", \"\\\\\"], true, false),\n peg$c79 = \">\",\n peg$c80 = peg$literalExpectation(\">\", false),\n peg$c81 = function(a) {\n const decoded = a.map(s=> {\n if(0x10000 <= s.codePointAt(0) && s.codePointAt(0) <= 0xeffff) return 'a';\n if(s.length===1) return s;\n if(s.length===6) return String.fromCharCode(\"0x\"+s.substring(2));\n if(s.length===10) return String.fromCodePoint(\"0x\"+s.substring(2));\n return s;\n }).join(\"\");\n if(decoded.match(/^[^\\u0000-\\u0020<>\"{}|^`\\\\]*$/)){\n var join = a.join(\"\");\n try{\n return context.resolve(join);\n }catch(e){\n error(\"Invalid IRIREF \"+join);\n }\n }\n else error(\"Invalid IRIREF \"+a.join(\"\")+\" / \"+decoded);\n },\n peg$c82 = \":\",\n peg$c83 = peg$literalExpectation(\":\", false),\n peg$c84 = function(a) {\n a = a || \"0\";\n if(context.hasPrefix(a)===false)\n error(\"undefined prefix \"+a);\n return a;\n },\n peg$c85 = function(a) {return (a||\"\");},\n peg$c86 = function(a, b) {\n context.increment(a);\n return context.resolve(a+\":\"+b);\n },\n peg$c87 = \"_:\",\n peg$c88 = peg$literalExpectation(\"_:\", false),\n peg$c89 = /^[0-9]/,\n peg$c90 = peg$classExpectation([[\"0\", \"9\"]], false, false),\n peg$c91 = \"@\",\n peg$c92 = peg$literalExpectation(\"@\", false),\n peg$c93 = /^[a-zA-Z]/,\n peg$c94 = peg$classExpectation([[\"a\", \"z\"], [\"A\", \"Z\"]], false, false),\n peg$c95 = \"-\",\n peg$c96 = peg$literalExpectation(\"-\", false),\n peg$c97 = /^[a-zA-Z0-9]/,\n peg$c98 = peg$classExpectation([[\"a\", \"z\"], [\"A\", \"Z\"], [\"0\", \"9\"]], false, false),\n peg$c99 = function(a, s) {return '-'+s.join(\"\");},\n peg$c100 = function(a, b) {return a.join(\"\")+b.join(\"\");},\n peg$c101 = /^[+\\-]/,\n peg$c102 = peg$classExpectation([\"+\", \"-\"], false, false),\n peg$c103 = function(a) {\n if(a.match(/^[0+][0-9]+$/))\n return {\n \"@value\" : a,\n \"@type\" : \"http://www.w3.org/2001/XMLSchema#integer\"\n };\n return parseInt(a);\n },\n peg$c104 = function(a) {\n return {\n \"@value\" : a,\n \"@type\" : \"http://www.w3.org/2001/XMLSchema#decimal\"\n }\n },\n peg$c105 = function(a) {\n return {\n \"@value\" : a,\n \"@type\" : \"http://www.w3.org/2001/XMLSchema#double\"\n };\n },\n peg$c106 = /^[eE]/,\n peg$c107 = peg$classExpectation([\"e\", \"E\"], false, false),\n peg$c108 = \"\\\"\",\n peg$c109 = peg$literalExpectation(\"\\\"\", false),\n peg$c110 = /^[^\"\\\\\\n\\r]/,\n peg$c111 = peg$classExpectation([\"\\\"\", \"\\\\\", \"\\n\", \"\\r\"], true, false),\n peg$c112 = \"'\",\n peg$c113 = peg$literalExpectation(\"'\", false),\n peg$c114 = /^[^'\\\\\\n\\r]/,\n peg$c115 = peg$classExpectation([\"'\", \"\\\\\", \"\\n\", \"\\r\"], true, false),\n peg$c116 = \"'''\",\n peg$c117 = peg$literalExpectation(\"'''\", false),\n peg$c118 = /^[^'\\\\]/,\n peg$c119 = peg$classExpectation([\"'\", \"\\\\\"], true, false),\n peg$c120 = \"''\",\n peg$c121 = peg$literalExpectation(\"''\", false),\n peg$c122 = function(head, a) {return \"''\"+a.join(\"\");},\n peg$c123 = function(head, a) {return \"'\" +a.join(\"\");},\n peg$c124 = function(head, body) {return head.join(\"\")+body.join(\"\");},\n peg$c125 = \"\\\"\\\"\\\"\",\n peg$c126 = peg$literalExpectation(\"\\\"\\\"\\\"\", false),\n peg$c127 = /^[^\"\\\\]/,\n peg$c128 = peg$classExpectation([\"\\\"\", \"\\\\\"], true, false),\n peg$c129 = \"\\\"\\\"\",\n peg$c130 = peg$literalExpectation(\"\\\"\\\"\", false),\n peg$c131 = function(head, a) {return '\"\"'+a.join(\"\");},\n peg$c132 = function(head, a) {return '\"' +a.join(\"\");},\n peg$c133 = \"\\\\U\",\n peg$c134 = peg$literalExpectation(\"\\\\U\", false),\n peg$c135 = function(hex) {\n return String.fromCodePoint(parseInt(hex.join(\"\"),16));\n },\n peg$c136 = \"\\\\u\",\n peg$c137 = peg$literalExpectation(\"\\\\u\", false),\n peg$c138 = function(hex) {\n return String.fromCharCode(parseInt(hex.join(\"\"),16));\n },\n peg$c139 = \"\\\\t\",\n peg$c140 = peg$literalExpectation(\"\\\\t\", false),\n peg$c141 = function() {return '\\t';},\n peg$c142 = \"\\\\b\",\n peg$c143 = peg$literalExpectation(\"\\\\b\", false),\n peg$c144 = function() {return '\\b';},\n peg$c145 = \"\\\\n\",\n peg$c146 = peg$literalExpectation(\"\\\\n\", false),\n peg$c147 = function() {return '\\n';},\n peg$c148 = \"\\\\r\",\n peg$c149 = peg$literalExpectation(\"\\\\r\", false),\n peg$c150 = function() {return '\\r';},\n peg$c151 = \"\\\\f\",\n peg$c152 = peg$literalExpectation(\"\\\\f\", false),\n peg$c153 = function() {return '\\f';},\n peg$c154 = \"\\\\\\\"\",\n peg$c155 = peg$literalExpectation(\"\\\\\\\"\", false),\n peg$c156 = function() {return '\"';},\n peg$c157 = \"\\\\'\",\n peg$c158 = peg$literalExpectation(\"\\\\'\", false),\n peg$c159 = function() {return \"'\";},\n peg$c160 = \"\\\\\\\\\",\n peg$c161 = peg$literalExpectation(\"\\\\\\\\\", false),\n peg$c162 = function() {return '\\\\';},\n peg$c163 = /^[ \\t\\r\\n]/,\n peg$c164 = peg$classExpectation([\" \", \"\\t\", \"\\r\", \"\\n\"], false, false),\n peg$c165 = function() {return \"[]\";},\n peg$c166 = /^[\\uD800-\\uDBFF]/,\n peg$c167 = peg$classExpectation([[\"\\uD800\", \"\\uDBFF\"]], false, false),\n peg$c168 = /^[\\uDC00-\\uDFFF]/,\n peg$c169 = peg$classExpectation([[\"\\uDC00\", \"\\uDFFF\"]], false, false),\n peg$c170 = function(a, b) {return a+b;},\n peg$c171 = /^[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]/,\n peg$c172 = peg$classExpectation([[\"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\"]], false, false),\n peg$c173 = \"_\",\n peg$c174 = peg$literalExpectation(\"_\", false),\n peg$c175 = \"\\xB7\",\n peg$c176 = peg$literalExpectation(\"\\xB7\", false),\n peg$c177 = /^[\\u0300-\\u036F]/,\n peg$c178 = peg$classExpectation([[\"\\u0300\", \"\\u036F\"]], false, false),\n peg$c179 = /^[\\u203F-\\u2040]/,\n peg$c180 = peg$classExpectation([[\"\\u203F\", \"\\u2040\"]], false, false),\n peg$c181 = function(head, body, a, b) {return a.join(\"\")+b.join(\"\");},\n peg$c182 = function(head, body, tail) {return head+body.join(\"\")+tail.join(\"\");},\n peg$c183 = \"%\",\n peg$c184 = peg$literalExpectation(\"%\", false),\n peg$c185 = /^[0-9A-Fa-f]/,\n peg$c186 = peg$classExpectation([[\"0\", \"9\"], [\"A\", \"F\"], [\"a\", \"f\"]], false, false),\n peg$c187 = \"\\\\\",\n peg$c188 = peg$literalExpectation(\"\\\\\", false),\n peg$c189 = /^[_~.!$&'()*+,;=\\/?#@%\\-]/,\n peg$c190 = peg$classExpectation([\"_\", \"~\", \".\", \"!\", \"$\", \"&\", \"'\", \"(\", \")\", \"*\", \"+\", \",\", \";\", \"=\", \"/\", \"?\", \"#\", \"@\", \"%\", \"-\"], false, false),\n\n peg$currPos = 0,\n peg$savedPos = 0,\n peg$posDetailsCache = [{ line: 1, column: 1 }],\n peg$maxFailPos = 0,\n peg$maxFailExpected = [],\n peg$silentFails = 0,\n\n peg$result;\n\n if (\"startRule\" in options) {\n if (!(options.startRule in peg$startRuleFunctions)) {\n throw new Error(\"Can't start parsing from rule \\\"\" + options.startRule + \"\\\".\");\n }\n\n peg$startRuleFunction = peg$startRuleFunctions[options.startRule];\n }\n\n function text() {\n return input.substring(peg$savedPos, peg$currPos);\n }\n\n function location() {\n return peg$computeLocation(peg$savedPos, peg$currPos);\n }\n\n function expected(description, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildStructuredError(\n [peg$otherExpectation(description)],\n input.substring(peg$savedPos, peg$currPos),\n location\n );\n }\n\n function error(message, location) {\n location = location !== void 0 ? location : peg$computeLocation(peg$savedPos, peg$currPos)\n\n throw peg$buildSimpleError(message, location);\n }\n\n function peg$literalExpectation(text, ignoreCase) {\n return { type: \"literal\", text: text, ignoreCase: ignoreCase };\n }\n\n function peg$classExpectation(parts, inverted, ignoreCase) {\n return { type: \"class\", parts: parts, inverted: inverted, ignoreCase: ignoreCase };\n }\n\n function peg$anyExpectation() {\n return { type: \"any\" };\n }\n\n function peg$endExpectation() {\n return { type: \"end\" };\n }\n\n function peg$otherExpectation(description) {\n return { type: \"other\", description: description };\n }\n\n function peg$computePosDetails(pos) {\n var details = peg$posDetailsCache[pos], p;\n\n if (details) {\n return details;\n } else {\n p = pos - 1;\n while (!peg$posDetailsCache[p]) {\n p--;\n }\n\n details = peg$posDetailsCache[p];\n details = {\n line: details.line,\n column: details.column\n };\n\n while (p < pos) {\n if (input.charCodeAt(p) === 10) {\n details.line++;\n details.column = 1;\n } else {\n details.column++;\n }\n\n p++;\n }\n\n peg$posDetailsCache[pos] = details;\n return details;\n }\n }\n\n function peg$computeLocation(startPos, endPos) {\n var startPosDetails = peg$computePosDetails(startPos),\n endPosDetails = peg$computePosDetails(endPos);\n\n return {\n start: {\n offset: startPos,\n line: startPosDetails.line,\n column: startPosDetails.column\n },\n end: {\n offset: endPos,\n line: endPosDetails.line,\n column: endPosDetails.column\n }\n };\n }\n\n function peg$fail(expected) {\n if (peg$currPos < peg$maxFailPos) { return; }\n\n if (peg$currPos > peg$maxFailPos) {\n peg$maxFailPos = peg$currPos;\n peg$maxFailExpected = [];\n }\n\n peg$maxFailExpected.push(expected);\n }\n\n function peg$buildSimpleError(message, location) {\n return new peg$SyntaxError(message, null, null, location);\n }\n\n function peg$buildStructuredError(expected, found, location) {\n return new peg$SyntaxError(\n peg$SyntaxError.buildMessage(expected, found),\n expected,\n found,\n location\n );\n }\n\n function peg$parseturtleDoc() {\n var s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseBOM();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseBOM();\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parsestatement();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parsestatement();\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseIGNORE();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseIGNORE();\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c0(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseBOM() {\n var s0;\n\n if (input.charCodeAt(peg$currPos) === 65279) {\n s0 = peg$c1;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c2); }\n }\n\n return s0;\n }\n\n function peg$parsestatement() {\n var s0, s1, s2, s3;\n\n s0 = peg$parsedirective();\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsetriples();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseIGNORE();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseIGNORE();\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s3 = peg$c3;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s1);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseCOMMENT() {\n var s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 35) {\n s1 = peg$c6;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c7); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c8.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c9); }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c8.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c9); }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 10) {\n s3 = peg$c10;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c11); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c12(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseIGNORE() {\n var s0;\n\n s0 = peg$parseWS();\n if (s0 === peg$FAILED) {\n s0 = peg$parseCOMMENT();\n }\n\n return s0;\n }\n\n function peg$parsedirective() {\n var s0;\n\n s0 = peg$parseprefixID();\n if (s0 === peg$FAILED) {\n s0 = peg$parsebase();\n if (s0 === peg$FAILED) {\n s0 = peg$parsesparqlPrefix();\n if (s0 === peg$FAILED) {\n s0 = peg$parsesparqlBase();\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseprefixID() {\n var s0, s1, s2, s3, s4, s5, s6, s7, s8;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n if (input.substr(peg$currPos, 7) === peg$c13) {\n s2 = peg$c13;\n peg$currPos += 7;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c14); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseIGNORE();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseIGNORE();\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parsePNAME_NS_NO_CHECK();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parseIGNORE();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseIGNORE();\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseIRIREF();\n if (s6 !== peg$FAILED) {\n s7 = [];\n s8 = peg$parseIGNORE();\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n s8 = peg$parseIGNORE();\n }\n if (s7 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s8 = peg$c3;\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s8 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c15(s4, s6);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsebase() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c16) {\n s2 = peg$c16;\n peg$currPos += 5;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c17); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseIGNORE();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseIGNORE();\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parseIRIREF();\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parseIGNORE();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseIGNORE();\n }\n if (s5 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s6 = peg$c3;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c18(s4);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsesparqlBase() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n if (peg$c19.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c20); }\n }\n if (s2 !== peg$FAILED) {\n if (peg$c21.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c22); }\n }\n if (s3 !== peg$FAILED) {\n if (peg$c23.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c24); }\n }\n if (s4 !== peg$FAILED) {\n if (peg$c25.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c26); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n s7 = peg$parseIGNORE();\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$parseIGNORE();\n }\n if (s6 !== peg$FAILED) {\n s7 = peg$parseIRIREF();\n if (s7 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c18(s7);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsesparqlPrefix() {\n var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n if (peg$c27.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c28); }\n }\n if (s2 !== peg$FAILED) {\n if (peg$c29.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c30); }\n }\n if (s3 !== peg$FAILED) {\n if (peg$c25.test(input.charAt(peg$currPos))) {\n s4 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c26); }\n }\n if (s4 !== peg$FAILED) {\n if (peg$c31.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c32); }\n }\n if (s5 !== peg$FAILED) {\n if (peg$c33.test(input.charAt(peg$currPos))) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c34); }\n }\n if (s6 !== peg$FAILED) {\n if (peg$c35.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c36); }\n }\n if (s7 !== peg$FAILED) {\n s8 = [];\n s9 = peg$parseIGNORE();\n while (s9 !== peg$FAILED) {\n s8.push(s9);\n s9 = peg$parseIGNORE();\n }\n if (s8 !== peg$FAILED) {\n s9 = peg$parsePNAME_NS_NO_CHECK();\n if (s9 !== peg$FAILED) {\n s10 = [];\n s11 = peg$parseIGNORE();\n while (s11 !== peg$FAILED) {\n s10.push(s11);\n s11 = peg$parseIGNORE();\n }\n if (s10 !== peg$FAILED) {\n s11 = peg$parseIRIREF();\n if (s11 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c15(s9, s11);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsetriples() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parsesubject();\n if (s1 !== peg$FAILED) {\n s2 = peg$parsepredicateObjectList();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c37(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseblankNodePropertyList();\n if (s1 !== peg$FAILED) {\n s2 = peg$parsepredicateObjectList();\n if (s2 === peg$FAILED) {\n s2 = null;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c38(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsepredicateObjectList() {\n var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;\n\n s0 = peg$currPos;\n s1 = peg$parseverb();\n if (s1 !== peg$FAILED) {\n s2 = peg$parseobjectList();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$currPos;\n s5 = [];\n s6 = peg$parseIGNORE();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseIGNORE();\n }\n if (s5 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 59) {\n s6 = peg$c39;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c40); }\n }\n if (s6 !== peg$FAILED) {\n s7 = peg$currPos;\n s8 = peg$parseverb();\n if (s8 !== peg$FAILED) {\n s9 = peg$parseobjectList();\n if (s9 !== peg$FAILED) {\n peg$savedPos = s7;\n s8 = peg$c41(s1, s2, s8, s9);\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n if (s7 === peg$FAILED) {\n s7 = null;\n }\n if (s7 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c42(s1, s2, s7);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = [];\n s6 = peg$parseIGNORE();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseIGNORE();\n }\n if (s5 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 59) {\n s6 = peg$c39;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c40); }\n }\n if (s6 !== peg$FAILED) {\n s7 = peg$currPos;\n s8 = peg$parseverb();\n if (s8 !== peg$FAILED) {\n s9 = peg$parseobjectList();\n if (s9 !== peg$FAILED) {\n peg$savedPos = s7;\n s8 = peg$c41(s1, s2, s8, s9);\n s7 = s8;\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n } else {\n peg$currPos = s7;\n s7 = peg$FAILED;\n }\n if (s7 === peg$FAILED) {\n s7 = null;\n }\n if (s7 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c42(s1, s2, s7);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c43(s1, s2, s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseobjectList() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = peg$parseobject();\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$currPos;\n s4 = [];\n s5 = peg$parseIGNORE();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseIGNORE();\n }\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c44;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c45); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseobject();\n if (s6 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c46(s1, s6);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$currPos;\n s4 = [];\n s5 = peg$parseIGNORE();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseIGNORE();\n }\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 44) {\n s5 = peg$c44;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c45); }\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseobject();\n if (s6 !== peg$FAILED) {\n peg$savedPos = s3;\n s4 = peg$c46(s1, s6);\n s3 = s4;\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n } else {\n peg$currPos = s3;\n s3 = peg$FAILED;\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c47(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseverb() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parsepredicate();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 97) {\n s2 = peg$c48;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c49); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c50();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsesubject() {\n var s0, s1;\n\n s0 = peg$currPos;\n s1 = peg$parsecollection();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c51(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$parseBlankNode();\n if (s0 === peg$FAILED) {\n s0 = peg$parseiri();\n }\n }\n\n return s0;\n }\n\n function peg$parsepredicate() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseiri();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseobject() {\n var s0, s1;\n\n s0 = peg$parseliteral();\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsecollection();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c52(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseBlankNode();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c53(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseblankNodePropertyList();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s1);\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parseiri();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c54(s1);\n }\n s0 = s1;\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseliteral() {\n var s0;\n\n s0 = peg$parseRDFLiteral();\n if (s0 === peg$FAILED) {\n s0 = peg$parseNumericLiteral();\n if (s0 === peg$FAILED) {\n s0 = peg$parseBooleanLiteral();\n }\n }\n\n return s0;\n }\n\n function peg$parseblankNodePropertyList() {\n var s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 91) {\n s2 = peg$c55;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c56); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parsepredicateObjectList();\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseIGNORE();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseIGNORE();\n }\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 93) {\n s5 = peg$c57;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c58); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsecollection() {\n var s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 40) {\n s2 = peg$c59;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c60); }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseobject();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseobject();\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parseIGNORE();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parseIGNORE();\n }\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 41) {\n s5 = peg$c61;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c62); }\n }\n if (s5 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c63(s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseNumericLiteral() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseDOUBLE();\n if (s2 === peg$FAILED) {\n s2 = peg$parseDECIMAL();\n if (s2 === peg$FAILED) {\n s2 = peg$parseINTEGER();\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseRDFLiteral() {\n var s0, s1, s2, s3, s4, s5, s6;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseString();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseIGNORE();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseIGNORE();\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$parseLANGTAG();\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c64(s2, s4);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseString();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parseIGNORE();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parseIGNORE();\n }\n if (s3 !== peg$FAILED) {\n if (input.substr(peg$currPos, 2) === peg$c65) {\n s4 = peg$c65;\n peg$currPos += 2;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c66); }\n }\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$parseIGNORE();\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$parseIGNORE();\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseiri();\n if (s6 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c67(s2, s6);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseString();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseBooleanLiteral() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n if (input.substr(peg$currPos, 4) === peg$c68) {\n s2 = peg$c68;\n peg$currPos += 4;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c69); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c70();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n if (input.substr(peg$currPos, 5) === peg$c71) {\n s2 = peg$c71;\n peg$currPos += 5;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c72); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c73();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseString() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseSTRING_LITERAL_LONG_SINGLE_QUOTE();\n if (s2 === peg$FAILED) {\n s2 = peg$parseSTRING_LITERAL_LONG_QUOTE();\n if (s2 === peg$FAILED) {\n s2 = peg$parseSTRING_LITERAL_SINGLE_QUOTE();\n if (s2 === peg$FAILED) {\n s2 = peg$parseSTRING_LITERAL_QUOTE();\n }\n }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseiri() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseIRIREF();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parsePrefixedName();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parsePrefixedName() {\n var s0, s1;\n\n s0 = peg$parsePNAME_LN();\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = peg$parsePNAME_NS();\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c74(s1);\n }\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseBlankNode() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseBLANK_NODE_LABEL();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n s1 = [];\n s2 = peg$parseIGNORE();\n while (s2 !== peg$FAILED) {\n s1.push(s2);\n s2 = peg$parseIGNORE();\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$parseANON();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseIRIREF() {\n var s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 60) {\n s1 = peg$c75;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c76); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c77.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c78); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parseUCHAR();\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c77.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c78); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parseUCHAR();\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 62) {\n s3 = peg$c79;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c80); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c81(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsePNAME_NS() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parsePN_PREFIX();\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s2 = peg$c82;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c83); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c84(s1);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsePNAME_NS_NO_CHECK() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parsePN_PREFIX();\n if (s1 === peg$FAILED) {\n s1 = null;\n }\n if (s1 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s2 = peg$c82;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c83); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c85(s1);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsePNAME_LN() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n s1 = peg$parsePNAME_NS();\n if (s1 !== peg$FAILED) {\n s2 = peg$parsePN_LOCAL();\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c86(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseBLANK_NODE_LABEL() {\n var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c87) {\n s2 = peg$c87;\n peg$currPos += 2;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c88); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parsePN_CHARS_U();\n if (s3 === peg$FAILED) {\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$parsePN_CHARS();\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$parsePN_CHARS();\n }\n if (s4 !== peg$FAILED) {\n s5 = [];\n s6 = peg$currPos;\n s7 = [];\n if (input.charCodeAt(peg$currPos) === 46) {\n s8 = peg$c3;\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s8 !== peg$FAILED) {\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n if (input.charCodeAt(peg$currPos) === 46) {\n s8 = peg$c3;\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n }\n } else {\n s7 = peg$FAILED;\n }\n if (s7 !== peg$FAILED) {\n s8 = [];\n s9 = peg$parsePN_CHARS();\n if (s9 !== peg$FAILED) {\n while (s9 !== peg$FAILED) {\n s8.push(s9);\n s9 = peg$parsePN_CHARS();\n }\n } else {\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s7 = [s7, s8];\n s6 = s7;\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n s6 = peg$currPos;\n s7 = [];\n if (input.charCodeAt(peg$currPos) === 46) {\n s8 = peg$c3;\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s8 !== peg$FAILED) {\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n if (input.charCodeAt(peg$currPos) === 46) {\n s8 = peg$c3;\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n }\n } else {\n s7 = peg$FAILED;\n }\n if (s7 !== peg$FAILED) {\n s8 = [];\n s9 = peg$parsePN_CHARS();\n if (s9 !== peg$FAILED) {\n while (s9 !== peg$FAILED) {\n s8.push(s9);\n s9 = peg$parsePN_CHARS();\n }\n } else {\n s8 = peg$FAILED;\n }\n if (s8 !== peg$FAILED) {\n s7 = [s7, s8];\n s6 = s7;\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n } else {\n peg$currPos = s6;\n s6 = peg$FAILED;\n }\n }\n if (s5 !== peg$FAILED) {\n s2 = [s2, s3, s4, s5];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseLANGTAG() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 64) {\n s1 = peg$c91;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c92); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c93.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c94); }\n }\n if (s3 !== peg$FAILED) {\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c93.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c94); }\n }\n }\n } else {\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 45) {\n s5 = peg$c95;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c96); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c97.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c98); }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c97.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c98); }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c99(s2, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 45) {\n s5 = peg$c95;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c96); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c97.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c98); }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c97.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c98); }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c99(s2, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c100(s2, s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseINTEGER() {\n var s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$currPos;\n if (peg$c101.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c102); }\n }\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n if (s5 !== peg$FAILED) {\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n }\n } else {\n s4 = peg$FAILED;\n }\n if (s4 !== peg$FAILED) {\n s3 = [s3, s4];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = input.substring(s1, peg$currPos);\n } else {\n s1 = s2;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c103(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseDECIMAL() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$currPos;\n if (peg$c101.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c102); }\n }\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n }\n if (s4 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s5 = peg$c3;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n s3 = [s3, s4, s5, s6];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = input.substring(s1, peg$currPos);\n } else {\n s1 = s2;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c104(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseDOUBLE() {\n var s0, s1, s2, s3, s4, s5, s6, s7, s8;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$currPos;\n if (peg$c101.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c102); }\n }\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n if (s3 !== peg$FAILED) {\n s4 = peg$currPos;\n s5 = [];\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 46) {\n s6 = peg$c3;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s6 !== peg$FAILED) {\n s7 = [];\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s8 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s8 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s8 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n }\n if (s7 !== peg$FAILED) {\n s8 = peg$parseEXPONENT();\n if (s8 !== peg$FAILED) {\n s5 = [s5, s6, s7, s8];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n if (s4 === peg$FAILED) {\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 46) {\n s5 = peg$c3;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n s7 = peg$parseEXPONENT();\n if (s7 !== peg$FAILED) {\n s5 = [s5, s6, s7];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n if (s4 === peg$FAILED) {\n s4 = peg$currPos;\n s5 = [];\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s6 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = peg$parseEXPONENT();\n if (s6 !== peg$FAILED) {\n s5 = [s5, s6];\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n }\n if (s4 !== peg$FAILED) {\n s3 = [s3, s4];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n s1 = input.substring(s1, peg$currPos);\n } else {\n s1 = s2;\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c105(s1);\n }\n s0 = s1;\n\n return s0;\n }\n\n function peg$parseEXPONENT() {\n var s0, s1, s2, s3, s4, s5;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n if (peg$c106.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c107); }\n }\n if (s2 !== peg$FAILED) {\n if (peg$c101.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c102); }\n }\n if (s3 === peg$FAILED) {\n s3 = null;\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n if (s5 !== peg$FAILED) {\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s5 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n }\n } else {\n s4 = peg$FAILED;\n }\n if (s4 !== peg$FAILED) {\n s2 = [s2, s3, s4];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseSTRING_LITERAL_QUOTE() {\n var s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s1 = peg$c108;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c109); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c110.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c111); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parseECHAR();\n if (s3 === peg$FAILED) {\n s3 = peg$parseUCHAR();\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c110.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c111); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parseECHAR();\n if (s3 === peg$FAILED) {\n s3 = peg$parseUCHAR();\n }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 34) {\n s3 = peg$c108;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c109); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c12(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseSTRING_LITERAL_SINGLE_QUOTE() {\n var s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s1 = peg$c112;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c113); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c114.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c115); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parseECHAR();\n if (s3 === peg$FAILED) {\n s3 = peg$parseUCHAR();\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c114.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c115); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parseECHAR();\n if (s3 === peg$FAILED) {\n s3 = peg$parseUCHAR();\n }\n }\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 39) {\n s3 = peg$c112;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c113); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c12(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseSTRING_LITERAL_LONG_SINGLE_QUOTE() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 3) === peg$c116) {\n s1 = peg$c116;\n peg$currPos += 3;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c117); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c118.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c119); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parseECHAR();\n if (s3 === peg$FAILED) {\n s3 = peg$parseUCHAR();\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c118.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c119); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parseECHAR();\n if (s3 === peg$FAILED) {\n s3 = peg$parseUCHAR();\n }\n }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c120) {\n s5 = peg$c120;\n peg$currPos += 2;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c121); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c118.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c119); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c118.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c119); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c122(s2, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n if (s4 === peg$FAILED) {\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s5 = peg$c112;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c113); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c118.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c119); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c118.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c119); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c123(s2, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c120) {\n s5 = peg$c120;\n peg$currPos += 2;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c121); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c118.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c119); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c118.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c119); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c122(s2, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n if (s4 === peg$FAILED) {\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 39) {\n s5 = peg$c112;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c113); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c118.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c119); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c118.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c119); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c123(s2, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n }\n if (s3 !== peg$FAILED) {\n if (input.substr(peg$currPos, 3) === peg$c116) {\n s4 = peg$c116;\n peg$currPos += 3;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c117); }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c124(s2, s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseSTRING_LITERAL_LONG_QUOTE() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 3) === peg$c125) {\n s1 = peg$c125;\n peg$currPos += 3;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c126); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n if (peg$c127.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c128); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parseECHAR();\n if (s3 === peg$FAILED) {\n s3 = peg$parseUCHAR();\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n if (peg$c127.test(input.charAt(peg$currPos))) {\n s3 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c128); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parseECHAR();\n if (s3 === peg$FAILED) {\n s3 = peg$parseUCHAR();\n }\n }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c129) {\n s5 = peg$c129;\n peg$currPos += 2;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c130); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c127.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c128); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c127.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c128); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c131(s2, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n if (s4 === peg$FAILED) {\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s5 = peg$c108;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c109); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c127.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c128); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c127.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c128); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c132(s2, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c129) {\n s5 = peg$c129;\n peg$currPos += 2;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c130); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c127.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c128); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c127.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c128); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c131(s2, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n if (s4 === peg$FAILED) {\n s4 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 34) {\n s5 = peg$c108;\n peg$currPos++;\n } else {\n s5 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c109); }\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n if (peg$c127.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c128); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (peg$c127.test(input.charAt(peg$currPos))) {\n s7 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c128); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parseECHAR();\n if (s7 === peg$FAILED) {\n s7 = peg$parseUCHAR();\n }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c132(s2, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n }\n if (s3 !== peg$FAILED) {\n if (input.substr(peg$currPos, 3) === peg$c125) {\n s4 = peg$c125;\n peg$currPos += 3;\n } else {\n s4 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c126); }\n }\n if (s4 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c124(s2, s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parseUCHAR() {\n var s0, s1, s2, s3, s4, s5, s6, s7, s8, s9, s10;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c133) {\n s1 = peg$c133;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c134); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$parseHEX();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseHEX();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseHEX();\n if (s5 !== peg$FAILED) {\n s6 = peg$parseHEX();\n if (s6 !== peg$FAILED) {\n s7 = peg$parseHEX();\n if (s7 !== peg$FAILED) {\n s8 = peg$parseHEX();\n if (s8 !== peg$FAILED) {\n s9 = peg$parseHEX();\n if (s9 !== peg$FAILED) {\n s10 = peg$parseHEX();\n if (s10 !== peg$FAILED) {\n s3 = [s3, s4, s5, s6, s7, s8, s9, s10];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c135(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c136) {\n s1 = peg$c136;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c137); }\n }\n if (s1 !== peg$FAILED) {\n s2 = peg$currPos;\n s3 = peg$parseHEX();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseHEX();\n if (s4 !== peg$FAILED) {\n s5 = peg$parseHEX();\n if (s5 !== peg$FAILED) {\n s6 = peg$parseHEX();\n if (s6 !== peg$FAILED) {\n s3 = [s3, s4, s5, s6];\n s2 = s3;\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n } else {\n peg$currPos = s2;\n s2 = peg$FAILED;\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c138(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n }\n\n return s0;\n }\n\n function peg$parseECHAR() {\n var s0, s1;\n\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c139) {\n s1 = peg$c139;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c140); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c141();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c142) {\n s1 = peg$c142;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c143); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c144();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c145) {\n s1 = peg$c145;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c146); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c147();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c148) {\n s1 = peg$c148;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c149); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c150();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c151) {\n s1 = peg$c151;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c152); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c153();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c154) {\n s1 = peg$c154;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c155); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c156();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c157) {\n s1 = peg$c157;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c158); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c159();\n }\n s0 = s1;\n if (s0 === peg$FAILED) {\n s0 = peg$currPos;\n if (input.substr(peg$currPos, 2) === peg$c160) {\n s1 = peg$c160;\n peg$currPos += 2;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c161); }\n }\n if (s1 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c162();\n }\n s0 = s1;\n }\n }\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parseWS() {\n var s0;\n\n if (peg$c163.test(input.charAt(peg$currPos))) {\n s0 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c164); }\n }\n\n return s0;\n }\n\n function peg$parseANON() {\n var s0, s1, s2, s3;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 91) {\n s1 = peg$c55;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c56); }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parseIGNORE();\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parseIGNORE();\n }\n if (s2 !== peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 93) {\n s3 = peg$c57;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c58); }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c165();\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsePN_CHARS_BASE() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n if (peg$c166.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c167); }\n }\n if (s1 !== peg$FAILED) {\n if (peg$c168.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c169); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c170(s1, s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n if (s0 === peg$FAILED) {\n if (peg$c171.test(input.charAt(peg$currPos))) {\n s0 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c172); }\n }\n }\n\n return s0;\n }\n\n function peg$parsePN_CHARS_U() {\n var s0;\n\n s0 = peg$parsePN_CHARS_BASE();\n if (s0 === peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 95) {\n s0 = peg$c173;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c174); }\n }\n }\n\n return s0;\n }\n\n function peg$parsePN_CHARS() {\n var s0;\n\n s0 = peg$parsePN_CHARS_U();\n if (s0 === peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 45) {\n s0 = peg$c95;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c96); }\n }\n if (s0 === peg$FAILED) {\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s0 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n if (s0 === peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 183) {\n s0 = peg$c175;\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c176); }\n }\n if (s0 === peg$FAILED) {\n if (peg$c177.test(input.charAt(peg$currPos))) {\n s0 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c178); }\n }\n if (s0 === peg$FAILED) {\n if (peg$c179.test(input.charAt(peg$currPos))) {\n s0 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c180); }\n }\n }\n }\n }\n }\n }\n\n return s0;\n }\n\n function peg$parsePN_PREFIX() {\n var s0, s1, s2, s3, s4, s5, s6, s7, s8;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n s2 = peg$parsePN_CHARS_BASE();\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$parsePN_CHARS();\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$parsePN_CHARS();\n }\n if (s3 !== peg$FAILED) {\n s4 = [];\n s5 = peg$currPos;\n s6 = [];\n if (input.charCodeAt(peg$currPos) === 46) {\n s7 = peg$c3;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (input.charCodeAt(peg$currPos) === 46) {\n s7 = peg$c3;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n s7 = [];\n s8 = peg$parsePN_CHARS();\n if (s8 !== peg$FAILED) {\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n s8 = peg$parsePN_CHARS();\n }\n } else {\n s7 = peg$FAILED;\n }\n if (s7 !== peg$FAILED) {\n s6 = [s6, s7];\n s5 = s6;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n while (s5 !== peg$FAILED) {\n s4.push(s5);\n s5 = peg$currPos;\n s6 = [];\n if (input.charCodeAt(peg$currPos) === 46) {\n s7 = peg$c3;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n if (input.charCodeAt(peg$currPos) === 46) {\n s7 = peg$c3;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n s7 = [];\n s8 = peg$parsePN_CHARS();\n if (s8 !== peg$FAILED) {\n while (s8 !== peg$FAILED) {\n s7.push(s8);\n s8 = peg$parsePN_CHARS();\n }\n } else {\n s7 = peg$FAILED;\n }\n if (s7 !== peg$FAILED) {\n s6 = [s6, s7];\n s5 = s6;\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n } else {\n peg$currPos = s5;\n s5 = peg$FAILED;\n }\n }\n if (s4 !== peg$FAILED) {\n s2 = [s2, s3, s4];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parsePN_LOCAL() {\n var s0, s1, s2, s3, s4, s5, s6, s7;\n\n s0 = peg$currPos;\n s1 = peg$parsePN_CHARS_U();\n if (s1 === peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s1 = peg$c82;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c83); }\n }\n if (s1 === peg$FAILED) {\n if (peg$c89.test(input.charAt(peg$currPos))) {\n s1 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c90); }\n }\n if (s1 === peg$FAILED) {\n s1 = peg$parsePLX();\n }\n }\n }\n if (s1 !== peg$FAILED) {\n s2 = [];\n s3 = peg$parsePN_CHARS();\n if (s3 === peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c82;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c83); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parsePLX();\n }\n }\n while (s3 !== peg$FAILED) {\n s2.push(s3);\n s3 = peg$parsePN_CHARS();\n if (s3 === peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s3 = peg$c82;\n peg$currPos++;\n } else {\n s3 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c83); }\n }\n if (s3 === peg$FAILED) {\n s3 = peg$parsePLX();\n }\n }\n }\n if (s2 !== peg$FAILED) {\n s3 = [];\n s4 = peg$currPos;\n s5 = [];\n if (input.charCodeAt(peg$currPos) === 46) {\n s6 = peg$c3;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n if (input.charCodeAt(peg$currPos) === 46) {\n s6 = peg$c3;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n s7 = peg$parsePN_CHARS();\n if (s7 === peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s7 = peg$c82;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c83); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parsePLX();\n }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$parsePN_CHARS();\n if (s7 === peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s7 = peg$c82;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c83); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parsePLX();\n }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c181(s1, s2, s5, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n while (s4 !== peg$FAILED) {\n s3.push(s4);\n s4 = peg$currPos;\n s5 = [];\n if (input.charCodeAt(peg$currPos) === 46) {\n s6 = peg$c3;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n if (s6 !== peg$FAILED) {\n while (s6 !== peg$FAILED) {\n s5.push(s6);\n if (input.charCodeAt(peg$currPos) === 46) {\n s6 = peg$c3;\n peg$currPos++;\n } else {\n s6 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c4); }\n }\n }\n } else {\n s5 = peg$FAILED;\n }\n if (s5 !== peg$FAILED) {\n s6 = [];\n s7 = peg$parsePN_CHARS();\n if (s7 === peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s7 = peg$c82;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c83); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parsePLX();\n }\n }\n if (s7 !== peg$FAILED) {\n while (s7 !== peg$FAILED) {\n s6.push(s7);\n s7 = peg$parsePN_CHARS();\n if (s7 === peg$FAILED) {\n if (input.charCodeAt(peg$currPos) === 58) {\n s7 = peg$c82;\n peg$currPos++;\n } else {\n s7 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c83); }\n }\n if (s7 === peg$FAILED) {\n s7 = peg$parsePLX();\n }\n }\n }\n } else {\n s6 = peg$FAILED;\n }\n if (s6 !== peg$FAILED) {\n peg$savedPos = s4;\n s5 = peg$c181(s1, s2, s5, s6);\n s4 = s5;\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n } else {\n peg$currPos = s4;\n s4 = peg$FAILED;\n }\n }\n if (s3 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c182(s1, s2, s3);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n function peg$parsePLX() {\n var s0;\n\n s0 = peg$parsePERCENT();\n if (s0 === peg$FAILED) {\n s0 = peg$parsePN_LOCAL_ESC();\n }\n\n return s0;\n }\n\n function peg$parsePERCENT() {\n var s0, s1, s2, s3, s4;\n\n s0 = peg$currPos;\n s1 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 37) {\n s2 = peg$c183;\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c184); }\n }\n if (s2 !== peg$FAILED) {\n s3 = peg$parseHEX();\n if (s3 !== peg$FAILED) {\n s4 = peg$parseHEX();\n if (s4 !== peg$FAILED) {\n s2 = [s2, s3, s4];\n s1 = s2;\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n } else {\n peg$currPos = s1;\n s1 = peg$FAILED;\n }\n if (s1 !== peg$FAILED) {\n s0 = input.substring(s0, peg$currPos);\n } else {\n s0 = s1;\n }\n\n return s0;\n }\n\n function peg$parseHEX() {\n var s0;\n\n if (peg$c185.test(input.charAt(peg$currPos))) {\n s0 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s0 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c186); }\n }\n\n return s0;\n }\n\n function peg$parsePN_LOCAL_ESC() {\n var s0, s1, s2;\n\n s0 = peg$currPos;\n if (input.charCodeAt(peg$currPos) === 92) {\n s1 = peg$c187;\n peg$currPos++;\n } else {\n s1 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c188); }\n }\n if (s1 !== peg$FAILED) {\n if (peg$c189.test(input.charAt(peg$currPos))) {\n s2 = input.charAt(peg$currPos);\n peg$currPos++;\n } else {\n s2 = peg$FAILED;\n if (peg$silentFails === 0) { peg$fail(peg$c190); }\n }\n if (s2 !== peg$FAILED) {\n peg$savedPos = s0;\n s1 = peg$c5(s2);\n s0 = s1;\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n } else {\n peg$currPos = s0;\n s0 = peg$FAILED;\n }\n\n return s0;\n }\n\n\n var isIRI = function(a){return a.match(/^[a-z](.*?):(.+?)/g);};\n function createObject(property,value){var a={};a[property]=value;return a;}\n var context = {\n base : [],\n data : {},\n addBase : function(uri){\n if(context.base.length===0){\n context.base.push(uri);\n return;\n }\n const last = context.base[context.base.length-1];\n if(last!==uri) context.base.push(new URL(uri,last).toString());\n },\n addPrefix : function(prefix,uri){\n const list = context.data[prefix];\n if(list===undefined){\n context.data[prefix] = [{uri:uri,count:0}];\n }else if(list[list.length-1].uri!==uri){\n list.push({uri:uri,count:0});\n }\n },\n hasPrefix : function(prefix){\n return this.data[prefix]!==undefined;\n },\n resolve : function(pname,force){\n const prefix = Object.keys(context.data).find(key=>pname.indexOf(key+\":\")===0);\n if(prefix!==undefined) {\n const list = context.data[prefix];\n if(list.length===1 && force!==true && isIRI(list[0].uri)) return pname;\n const uri = list[list.length-1].uri;\n return pname.replace(prefix+\":\",uri);\n }else{\n var base = context.base.length === 0 ? options.baseIRI : context.base[context.base.length-1];\n if(!base || pname.match(/^(http:|https:|urn:|file:)/)) return pname;\n if(pname.indexOf(\"//\")===0 && base) return base.split(\"//\")[0]+pname;\n return new URL(pname,base).toString();\n }\n },\n increment : function(prefix){\n const list = context.data[prefix];\n if(list!==undefined)list[list.length-1].count++;\n },\n decrement : function(prefix){\n const list = context.data[prefix];\n if(list!==undefined)list[list.length-1].count--;\n },\n toJSON : function(){\n const root = {};\n if(context.base.length>0){\n if(root[\"@context\"]===undefined)root[\"@context\"] = {};\n root[\"@context\"][\"@base\"] = context.base[0];\n }\n Object.keys(context.data).forEach(key=>{\n const head = context.data[key][0];\n if(head.uri===\"http://www.w3.org/2001/XMLSchema#\" && head.count < 1) return;\n if(!isIRI(head.uri)) return;\n if(root[\"@context\"]===undefined) root[\"@context\"] = {};\n root[\"@context\"][key] = head.uri;\n });\n return root;\n }\n };\n\n function expandList(container,force){\n if(container[\"@list\"]===undefined) return container;\n if(!force && !container[\"@list\"].find(x=>x[\"@list\"]!==undefined)) return container;\n\n if(container[\"@list\"].length===0)\n return {\"@id\" : \"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil\"};\n\n var root = {};\n var focus = null;\n container[\"@list\"].forEach(b=>{\n if(focus===null) focus = root;\n else {\n focus[\"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest\"] = {};\n focus = focus[\"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest\"];\n }\n focus[\"http://www.w3.org/1999/02/22-rdf-syntax-ns#first\"] = expandList(b,true);\n focus[\"http://www.w3.org/1999/02/22-rdf-syntax-ns#rest\"] = {\n \"@id\" : \"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil\"\n };\n });\n return root;\n }\n\n\n peg$result = peg$startRuleFunction();\n\n if (peg$result !== peg$FAILED && peg$currPos === input.length) {\n return peg$result;\n } else {\n if (peg$result !== peg$FAILED && peg$currPos < input.length) {\n peg$fail(peg$endExpectation());\n }\n\n throw peg$buildStructuredError(\n peg$maxFailExpected,\n peg$maxFailPos < input.length ? input.charAt(peg$maxFailPos) : null,\n peg$maxFailPos < input.length\n ? peg$computeLocation(peg$maxFailPos, peg$maxFailPos + 1)\n : peg$computeLocation(peg$maxFailPos, peg$maxFailPos)\n );\n }\n }\n\n return {\n SyntaxError: peg$SyntaxError,\n parse: peg$parse\n };\n});\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/@frogcat/ttl2jsonld/ttl2jsonld.js?\n}");
63
+
64
+ /***/ },
65
+
12
66
  /***/ "./node_modules/@rubensworks/saxes/saxes.js"
13
67
  /*!**************************************************!*\
14
68
  !*** ./node_modules/@rubensworks/saxes/saxes.js ***!
@@ -20,6 +74,68 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexp
20
74
 
21
75
  /***/ },
22
76
 
77
+ /***/ "./node_modules/@xmldom/xmldom/lib/conventions.js"
78
+ /*!********************************************************!*\
79
+ !*** ./node_modules/@xmldom/xmldom/lib/conventions.js ***!
80
+ \********************************************************/
81
+ (__unused_webpack_module, exports) {
82
+
83
+ "use strict";
84
+ eval("{\n\n/**\n * Ponyfill for `Array.prototype.find` which is only available in ES6 runtimes.\n *\n * Works with anything that has a `length` property and index access properties, including NodeList.\n *\n * @template {unknown} T\n * @param {Array<T> | ({length:number, [number]: T})} list\n * @param {function (item: T, index: number, list:Array<T> | ({length:number, [number]: T})):boolean} predicate\n * @param {Partial<Pick<ArrayConstructor['prototype'], 'find'>>?} ac `Array.prototype` by default,\n * \t\t\t\tallows injecting a custom implementation in tests\n * @returns {T | undefined}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/find\n * @see https://tc39.es/ecma262/multipage/indexed-collections.html#sec-array.prototype.find\n */\nfunction find(list, predicate, ac) {\n\tif (ac === undefined) {\n\t\tac = Array.prototype;\n\t}\n\tif (list && typeof ac.find === 'function') {\n\t\treturn ac.find.call(list, predicate);\n\t}\n\tfor (var i = 0; i < list.length; i++) {\n\t\tif (Object.prototype.hasOwnProperty.call(list, i)) {\n\t\t\tvar item = list[i];\n\t\t\tif (predicate.call(undefined, item, i, list)) {\n\t\t\t\treturn item;\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * \"Shallow freezes\" an object to render it immutable.\n * Uses `Object.freeze` if available,\n * otherwise the immutability is only in the type.\n *\n * Is used to create \"enum like\" objects.\n *\n * @template T\n * @param {T} object the object to freeze\n * @param {Pick<ObjectConstructor, 'freeze'> = Object} oc `Object` by default,\n * \t\t\t\tallows to inject custom object constructor for tests\n * @returns {Readonly<T>}\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/freeze\n */\nfunction freeze(object, oc) {\n\tif (oc === undefined) {\n\t\toc = Object\n\t}\n\treturn oc && typeof oc.freeze === 'function' ? oc.freeze(object) : object\n}\n\n/**\n * Since we can not rely on `Object.assign` we provide a simplified version\n * that is sufficient for our needs.\n *\n * @param {Object} target\n * @param {Object | null | undefined} source\n *\n * @returns {Object} target\n * @throws TypeError if target is not an object\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/assign\n * @see https://tc39.es/ecma262/multipage/fundamental-objects.html#sec-object.assign\n */\nfunction assign(target, source) {\n\tif (target === null || typeof target !== 'object') {\n\t\tthrow new TypeError('target is not an object')\n\t}\n\tfor (var key in source) {\n\t\tif (Object.prototype.hasOwnProperty.call(source, key)) {\n\t\t\ttarget[key] = source[key]\n\t\t}\n\t}\n\treturn target\n}\n\n/**\n * All mime types that are allowed as input to `DOMParser.parseFromString`\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString#Argument02 MDN\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#domparsersupportedtype WHATWG HTML Spec\n * @see DOMParser.prototype.parseFromString\n */\nvar MIME_TYPE = freeze({\n\t/**\n\t * `text/html`, the only mime type that triggers treating an XML document as HTML.\n\t *\n\t * @see DOMParser.SupportedType.isHTML\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec\n\t */\n\tHTML: 'text/html',\n\n\t/**\n\t * Helper method to check a mime type if it indicates an HTML document\n\t *\n\t * @param {string} [value]\n\t * @returns {boolean}\n\t *\n\t * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/HTML Wikipedia\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN\n\t * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring \t */\n\tisHTML: function (value) {\n\t\treturn value === MIME_TYPE.HTML\n\t},\n\n\t/**\n\t * `application/xml`, the standard mime type for XML documents.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_APPLICATION: 'application/xml',\n\n\t/**\n\t * `text/html`, an alias for `application/xml`.\n\t *\n\t * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303\n\t * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration\n\t * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia\n\t */\n\tXML_TEXT: 'text/xml',\n\n\t/**\n\t * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,\n\t * but is parsed as an XML document.\n\t *\n\t * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec\n\t * @see https://en.wikipedia.org/wiki/XHTML Wikipedia\n\t */\n\tXML_XHTML_APPLICATION: 'application/xhtml+xml',\n\n\t/**\n\t * `image/svg+xml`,\n\t *\n\t * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration\n\t * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1\n\t * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia\n\t */\n\tXML_SVG_IMAGE: 'image/svg+xml',\n})\n\n/**\n * Namespaces that are used in this code base.\n *\n * @see http://www.w3.org/TR/REC-xml-names\n */\nvar NAMESPACE = freeze({\n\t/**\n\t * The XHTML namespace.\n\t *\n\t * @see http://www.w3.org/1999/xhtml\n\t */\n\tHTML: 'http://www.w3.org/1999/xhtml',\n\n\t/**\n\t * Checks if `uri` equals `NAMESPACE.HTML`.\n\t *\n\t * @param {string} [uri]\n\t *\n\t * @see NAMESPACE.HTML\n\t */\n\tisHTML: function (uri) {\n\t\treturn uri === NAMESPACE.HTML\n\t},\n\n\t/**\n\t * The SVG namespace.\n\t *\n\t * @see http://www.w3.org/2000/svg\n\t */\n\tSVG: 'http://www.w3.org/2000/svg',\n\n\t/**\n\t * The `xml:` namespace.\n\t *\n\t * @see http://www.w3.org/XML/1998/namespace\n\t */\n\tXML: 'http://www.w3.org/XML/1998/namespace',\n\n\t/**\n\t * The `xmlns:` namespace\n\t *\n\t * @see https://www.w3.org/2000/xmlns/\n\t */\n\tXMLNS: 'http://www.w3.org/2000/xmlns/',\n})\n\nexports.assign = assign;\nexports.find = find;\nexports.freeze = freeze;\nexports.MIME_TYPE = MIME_TYPE;\nexports.NAMESPACE = NAMESPACE;\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/@xmldom/xmldom/lib/conventions.js?\n}");
85
+
86
+ /***/ },
87
+
88
+ /***/ "./node_modules/@xmldom/xmldom/lib/dom-parser.js"
89
+ /*!*******************************************************!*\
90
+ !*** ./node_modules/@xmldom/xmldom/lib/dom-parser.js ***!
91
+ \*******************************************************/
92
+ (__unused_webpack_module, exports, __webpack_require__) {
93
+
94
+ eval("{var conventions = __webpack_require__(/*! ./conventions */ \"./node_modules/@xmldom/xmldom/lib/conventions.js\");\nvar dom = __webpack_require__(/*! ./dom */ \"./node_modules/@xmldom/xmldom/lib/dom.js\")\nvar entities = __webpack_require__(/*! ./entities */ \"./node_modules/@xmldom/xmldom/lib/entities.js\");\nvar sax = __webpack_require__(/*! ./sax */ \"./node_modules/@xmldom/xmldom/lib/sax.js\");\n\nvar DOMImplementation = dom.DOMImplementation;\n\nvar NAMESPACE = conventions.NAMESPACE;\n\nvar ParseError = sax.ParseError;\nvar XMLReader = sax.XMLReader;\n\n/**\n * Normalizes line ending according to https://www.w3.org/TR/xml11/#sec-line-ends:\n *\n * > XML parsed entities are often stored in computer files which,\n * > for editing convenience, are organized into lines.\n * > These lines are typically separated by some combination\n * > of the characters CARRIAGE RETURN (#xD) and LINE FEED (#xA).\n * >\n * > To simplify the tasks of applications, the XML processor must behave\n * > as if it normalized all line breaks in external parsed entities (including the document entity)\n * > on input, before parsing, by translating all of the following to a single #xA character:\n * >\n * > 1. the two-character sequence #xD #xA\n * > 2. the two-character sequence #xD #x85\n * > 3. the single character #x85\n * > 4. the single character #x2028\n * > 5. any #xD character that is not immediately followed by #xA or #x85.\n *\n * @param {string} input\n * @returns {string}\n */\nfunction normalizeLineEndings(input) {\n\treturn input\n\t\t.replace(/\\r[\\n\\u0085]/g, '\\n')\n\t\t.replace(/[\\r\\u0085\\u2028]/g, '\\n')\n}\n\n/**\n * @typedef Locator\n * @property {number} [columnNumber]\n * @property {number} [lineNumber]\n */\n\n/**\n * @typedef DOMParserOptions\n * @property {DOMHandler} [domBuilder]\n * @property {Function} [errorHandler]\n * @property {(string) => string} [normalizeLineEndings] used to replace line endings before parsing\n * \t\t\t\t\t\tdefaults to `normalizeLineEndings`\n * @property {Locator} [locator]\n * @property {Record<string, string>} [xmlns]\n *\n * @see normalizeLineEndings\n */\n\n/**\n * The DOMParser interface provides the ability to parse XML or HTML source code\n * from a string into a DOM `Document`.\n *\n * _xmldom is different from the spec in that it allows an `options` parameter,\n * to override the default behavior._\n *\n * @param {DOMParserOptions} [options]\n * @constructor\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser\n * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-parsing-and-serialization\n */\nfunction DOMParser(options){\n\tthis.options = options ||{locator:{}};\n}\n\nDOMParser.prototype.parseFromString = function(source,mimeType){\n\tvar options = this.options;\n\tvar sax = new XMLReader();\n\tvar domBuilder = options.domBuilder || new DOMHandler();//contentHandler and LexicalHandler\n\tvar errorHandler = options.errorHandler;\n\tvar locator = options.locator;\n\tvar defaultNSMap = options.xmlns||{};\n\tvar isHTML = /\\/x?html?$/.test(mimeType);//mimeType.toLowerCase().indexOf('html') > -1;\n \tvar entityMap = isHTML ? entities.HTML_ENTITIES : entities.XML_ENTITIES;\n\tif(locator){\n\t\tdomBuilder.setDocumentLocator(locator)\n\t}\n\n\tsax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);\n\tsax.domBuilder = options.domBuilder || domBuilder;\n\tif(isHTML){\n\t\tdefaultNSMap[''] = NAMESPACE.HTML;\n\t}\n\tdefaultNSMap.xml = defaultNSMap.xml || NAMESPACE.XML;\n\tvar normalize = options.normalizeLineEndings || normalizeLineEndings;\n\tif (source && typeof source === 'string') {\n\t\tsax.parse(\n\t\t\tnormalize(source),\n\t\t\tdefaultNSMap,\n\t\t\tentityMap\n\t\t)\n\t} else {\n\t\tsax.errorHandler.error('invalid doc source')\n\t}\n\treturn domBuilder.doc;\n}\nfunction buildErrorHandler(errorImpl,domBuilder,locator){\n\tif(!errorImpl){\n\t\tif(domBuilder instanceof DOMHandler){\n\t\t\treturn domBuilder;\n\t\t}\n\t\terrorImpl = domBuilder ;\n\t}\n\tvar errorHandler = {}\n\tvar isCallback = errorImpl instanceof Function;\n\tlocator = locator||{}\n\tfunction build(key){\n\t\tvar fn = errorImpl[key];\n\t\tif(!fn && isCallback){\n\t\t\tfn = errorImpl.length == 2?function(msg){errorImpl(key,msg)}:errorImpl;\n\t\t}\n\t\terrorHandler[key] = fn && function(msg){\n\t\t\tfn('[xmldom '+key+']\\t'+msg+_locator(locator));\n\t\t}||function(){};\n\t}\n\tbuild('warning');\n\tbuild('error');\n\tbuild('fatalError');\n\treturn errorHandler;\n}\n\n//console.log('#\\n\\n\\n\\n\\n\\n\\n####')\n/**\n * +ContentHandler+ErrorHandler\n * +LexicalHandler+EntityResolver2\n * -DeclHandler-DTDHandler\n *\n * DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler\n * DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2\n * @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html\n */\nfunction DOMHandler() {\n this.cdata = false;\n}\nfunction position(locator,node){\n\tnode.lineNumber = locator.lineNumber;\n\tnode.columnNumber = locator.columnNumber;\n}\n/**\n * @see org.xml.sax.ContentHandler#startDocument\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html\n */\nDOMHandler.prototype = {\n\tstartDocument : function() {\n \tthis.doc = new DOMImplementation().createDocument(null, null, null);\n \tif (this.locator) {\n \tthis.doc.documentURI = this.locator.systemId;\n \t}\n\t},\n\tstartElement:function(namespaceURI, localName, qName, attrs) {\n\t\tvar doc = this.doc;\n\t var el = doc.createElementNS(namespaceURI, qName||localName);\n\t var len = attrs.length;\n\t appendElement(this, el);\n\t this.currentElement = el;\n\n\t\tthis.locator && position(this.locator,el)\n\t for (var i = 0 ; i < len; i++) {\n\t var namespaceURI = attrs.getURI(i);\n\t var value = attrs.getValue(i);\n\t var qName = attrs.getQName(i);\n\t\t\tvar attr = doc.createAttributeNS(namespaceURI, qName);\n\t\t\tthis.locator &&position(attrs.getLocator(i),attr);\n\t\t\tattr.value = attr.nodeValue = value;\n\t\t\tel.setAttributeNode(attr)\n\t }\n\t},\n\tendElement:function(namespaceURI, localName, qName) {\n\t\tvar current = this.currentElement\n\t\tvar tagName = current.tagName;\n\t\tthis.currentElement = current.parentNode;\n\t},\n\tstartPrefixMapping:function(prefix, uri) {\n\t},\n\tendPrefixMapping:function(prefix) {\n\t},\n\tprocessingInstruction:function(target, data) {\n\t var ins = this.doc.createProcessingInstruction(target, data);\n\t this.locator && position(this.locator,ins)\n\t appendElement(this, ins);\n\t},\n\tignorableWhitespace:function(ch, start, length) {\n\t},\n\tcharacters:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t\t//console.log(chars)\n\t\tif(chars){\n\t\t\tif (this.cdata) {\n\t\t\t\tvar charNode = this.doc.createCDATASection(chars);\n\t\t\t} else {\n\t\t\t\tvar charNode = this.doc.createTextNode(chars);\n\t\t\t}\n\t\t\tif(this.currentElement){\n\t\t\t\tthis.currentElement.appendChild(charNode);\n\t\t\t}else if(/^\\s*$/.test(chars)){\n\t\t\t\tthis.doc.appendChild(charNode);\n\t\t\t\t//process xml\n\t\t\t}\n\t\t\tthis.locator && position(this.locator,charNode)\n\t\t}\n\t},\n\tskippedEntity:function(name) {\n\t},\n\tendDocument:function() {\n\t\tthis.doc.normalize();\n\t},\n\tsetDocumentLocator:function (locator) {\n\t if(this.locator = locator){// && !('lineNumber' in locator)){\n\t \tlocator.lineNumber = 0;\n\t }\n\t},\n\t//LexicalHandler\n\tcomment:function(chars, start, length) {\n\t\tchars = _toString.apply(this,arguments)\n\t var comm = this.doc.createComment(chars);\n\t this.locator && position(this.locator,comm)\n\t appendElement(this, comm);\n\t},\n\n\tstartCDATA:function() {\n\t //used in characters() methods\n\t this.cdata = true;\n\t},\n\tendCDATA:function() {\n\t this.cdata = false;\n\t},\n\n\tstartDTD:function(name, publicId, systemId) {\n\t\tvar impl = this.doc.implementation;\n\t if (impl && impl.createDocumentType) {\n\t var dt = impl.createDocumentType(name, publicId, systemId);\n\t this.locator && position(this.locator,dt)\n\t appendElement(this, dt);\n\t\t\t\t\tthis.doc.doctype = dt;\n\t }\n\t},\n\t/**\n\t * @see org.xml.sax.ErrorHandler\n\t * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html\n\t */\n\twarning:function(error) {\n\t\tconsole.warn('[xmldom warning]\\t'+error,_locator(this.locator));\n\t},\n\terror:function(error) {\n\t\tconsole.error('[xmldom error]\\t'+error,_locator(this.locator));\n\t},\n\tfatalError:function(error) {\n\t\tthrow new ParseError(error, this.locator);\n\t}\n}\nfunction _locator(l){\n\tif(l){\n\t\treturn '\\n@'+(l.systemId ||'')+'#[line:'+l.lineNumber+',col:'+l.columnNumber+']'\n\t}\n}\nfunction _toString(chars,start,length){\n\tif(typeof chars == 'string'){\n\t\treturn chars.substr(start,length)\n\t}else{//java sax connect width xmldom on rhino(what about: \"? && !(chars instanceof String)\")\n\t\tif(chars.length >= start+length || start){\n\t\t\treturn new java.lang.String(chars,start,length)+'';\n\t\t}\n\t\treturn chars;\n\t}\n}\n\n/*\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/LexicalHandler.html\n * used method of org.xml.sax.ext.LexicalHandler:\n * #comment(chars, start, length)\n * #startCDATA()\n * #endCDATA()\n * #startDTD(name, publicId, systemId)\n *\n *\n * IGNORED method of org.xml.sax.ext.LexicalHandler:\n * #endDTD()\n * #startEntity(name)\n * #endEntity(name)\n *\n *\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/DeclHandler.html\n * IGNORED method of org.xml.sax.ext.DeclHandler\n * \t#attributeDecl(eName, aName, type, mode, value)\n * #elementDecl(name, model)\n * #externalEntityDecl(name, publicId, systemId)\n * #internalEntityDecl(name, value)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/ext/EntityResolver2.html\n * IGNORED method of org.xml.sax.EntityResolver2\n * #resolveEntity(String name,String publicId,String baseURI,String systemId)\n * #resolveEntity(publicId, systemId)\n * #getExternalSubset(name, baseURI)\n * @link http://www.saxproject.org/apidoc/org/xml/sax/DTDHandler.html\n * IGNORED method of org.xml.sax.DTDHandler\n * #notationDecl(name, publicId, systemId) {};\n * #unparsedEntityDecl(name, publicId, systemId, notationName) {};\n */\n\"endDTD,startEntity,endEntity,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,resolveEntity,getExternalSubset,notationDecl,unparsedEntityDecl\".replace(/\\w+/g,function(key){\n\tDOMHandler.prototype[key] = function(){return null}\n})\n\n/* Private static helpers treated below as private instance methods, so don't need to add these to the public API; we might use a Relator to also get rid of non-standard public properties */\nfunction appendElement (hander,node) {\n if (!hander.currentElement) {\n hander.doc.appendChild(node);\n } else {\n hander.currentElement.appendChild(node);\n }\n}//appendChild and setAttributeNS are preformance key\n\nexports.__DOMHandler = DOMHandler;\nexports.normalizeLineEndings = normalizeLineEndings;\nexports.DOMParser = DOMParser;\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/@xmldom/xmldom/lib/dom-parser.js?\n}");
95
+
96
+ /***/ },
97
+
98
+ /***/ "./node_modules/@xmldom/xmldom/lib/dom.js"
99
+ /*!************************************************!*\
100
+ !*** ./node_modules/@xmldom/xmldom/lib/dom.js ***!
101
+ \************************************************/
102
+ (__unused_webpack_module, exports, __webpack_require__) {
103
+
104
+ eval("{var conventions = __webpack_require__(/*! ./conventions */ \"./node_modules/@xmldom/xmldom/lib/conventions.js\");\n\nvar find = conventions.find;\nvar NAMESPACE = conventions.NAMESPACE;\n\n/**\n * A prerequisite for `[].filter`, to drop elements that are empty\n * @param {string} input\n * @returns {boolean}\n */\nfunction notEmptyString (input) {\n\treturn input !== ''\n}\n/**\n * @see https://infra.spec.whatwg.org/#split-on-ascii-whitespace\n * @see https://infra.spec.whatwg.org/#ascii-whitespace\n *\n * @param {string} input\n * @returns {string[]} (can be empty)\n */\nfunction splitOnASCIIWhitespace(input) {\n\t// U+0009 TAB, U+000A LF, U+000C FF, U+000D CR, U+0020 SPACE\n\treturn input ? input.split(/[\\t\\n\\f\\r ]+/).filter(notEmptyString) : []\n}\n\n/**\n * Adds element as a key to current if it is not already present.\n *\n * @param {Record<string, boolean | undefined>} current\n * @param {string} element\n * @returns {Record<string, boolean | undefined>}\n */\nfunction orderedSetReducer (current, element) {\n\tif (!current.hasOwnProperty(element)) {\n\t\tcurrent[element] = true;\n\t}\n\treturn current;\n}\n\n/**\n * @see https://infra.spec.whatwg.org/#ordered-set\n * @param {string} input\n * @returns {string[]}\n */\nfunction toOrderedSet(input) {\n\tif (!input) return [];\n\tvar list = splitOnASCIIWhitespace(input);\n\treturn Object.keys(list.reduce(orderedSetReducer, {}))\n}\n\n/**\n * Uses `list.indexOf` to implement something like `Array.prototype.includes`,\n * which we can not rely on being available.\n *\n * @param {any[]} list\n * @returns {function(any): boolean}\n */\nfunction arrayIncludes (list) {\n\treturn function(element) {\n\t\treturn list && list.indexOf(element) !== -1;\n\t}\n}\n\nfunction copy(src,dest){\n\tfor(var p in src){\n\t\tif (Object.prototype.hasOwnProperty.call(src, p)) {\n\t\t\tdest[p] = src[p];\n\t\t}\n\t}\n}\n\n/**\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*((?:.*\\{\\s*?[\\r\\n][\\s\\S]*?^})|\\S.*?(?=[;\\r\\n]));?\n^\\w+\\.prototype\\.([_\\w]+)\\s*=\\s*(\\S.*?(?=[;\\r\\n]));?\n */\nfunction _extends(Class,Super){\n\tvar pt = Class.prototype;\n\tif(!(pt instanceof Super)){\n\t\tfunction t(){};\n\t\tt.prototype = Super.prototype;\n\t\tt = new t();\n\t\tcopy(pt,t);\n\t\tClass.prototype = pt = t;\n\t}\n\tif(pt.constructor != Class){\n\t\tif(typeof Class != 'function'){\n\t\t\tconsole.error(\"unknown Class:\"+Class)\n\t\t}\n\t\tpt.constructor = Class\n\t}\n}\n\n// Node Types\nvar NodeType = {}\nvar ELEMENT_NODE = NodeType.ELEMENT_NODE = 1;\nvar ATTRIBUTE_NODE = NodeType.ATTRIBUTE_NODE = 2;\nvar TEXT_NODE = NodeType.TEXT_NODE = 3;\nvar CDATA_SECTION_NODE = NodeType.CDATA_SECTION_NODE = 4;\nvar ENTITY_REFERENCE_NODE = NodeType.ENTITY_REFERENCE_NODE = 5;\nvar ENTITY_NODE = NodeType.ENTITY_NODE = 6;\nvar PROCESSING_INSTRUCTION_NODE = NodeType.PROCESSING_INSTRUCTION_NODE = 7;\nvar COMMENT_NODE = NodeType.COMMENT_NODE = 8;\nvar DOCUMENT_NODE = NodeType.DOCUMENT_NODE = 9;\nvar DOCUMENT_TYPE_NODE = NodeType.DOCUMENT_TYPE_NODE = 10;\nvar DOCUMENT_FRAGMENT_NODE = NodeType.DOCUMENT_FRAGMENT_NODE = 11;\nvar NOTATION_NODE = NodeType.NOTATION_NODE = 12;\n\n// ExceptionCode\nvar ExceptionCode = {}\nvar ExceptionMessage = {};\nvar INDEX_SIZE_ERR = ExceptionCode.INDEX_SIZE_ERR = ((ExceptionMessage[1]=\"Index size error\"),1);\nvar DOMSTRING_SIZE_ERR = ExceptionCode.DOMSTRING_SIZE_ERR = ((ExceptionMessage[2]=\"DOMString size error\"),2);\nvar HIERARCHY_REQUEST_ERR = ExceptionCode.HIERARCHY_REQUEST_ERR = ((ExceptionMessage[3]=\"Hierarchy request error\"),3);\nvar WRONG_DOCUMENT_ERR = ExceptionCode.WRONG_DOCUMENT_ERR = ((ExceptionMessage[4]=\"Wrong document\"),4);\nvar INVALID_CHARACTER_ERR = ExceptionCode.INVALID_CHARACTER_ERR = ((ExceptionMessage[5]=\"Invalid character\"),5);\nvar NO_DATA_ALLOWED_ERR = ExceptionCode.NO_DATA_ALLOWED_ERR = ((ExceptionMessage[6]=\"No data allowed\"),6);\nvar NO_MODIFICATION_ALLOWED_ERR = ExceptionCode.NO_MODIFICATION_ALLOWED_ERR = ((ExceptionMessage[7]=\"No modification allowed\"),7);\nvar NOT_FOUND_ERR = ExceptionCode.NOT_FOUND_ERR = ((ExceptionMessage[8]=\"Not found\"),8);\nvar NOT_SUPPORTED_ERR = ExceptionCode.NOT_SUPPORTED_ERR = ((ExceptionMessage[9]=\"Not supported\"),9);\nvar INUSE_ATTRIBUTE_ERR = ExceptionCode.INUSE_ATTRIBUTE_ERR = ((ExceptionMessage[10]=\"Attribute in use\"),10);\n//level2\nvar INVALID_STATE_ERR \t= ExceptionCode.INVALID_STATE_ERR \t= ((ExceptionMessage[11]=\"Invalid state\"),11);\nvar SYNTAX_ERR \t= ExceptionCode.SYNTAX_ERR \t= ((ExceptionMessage[12]=\"Syntax error\"),12);\nvar INVALID_MODIFICATION_ERR \t= ExceptionCode.INVALID_MODIFICATION_ERR \t= ((ExceptionMessage[13]=\"Invalid modification\"),13);\nvar NAMESPACE_ERR \t= ExceptionCode.NAMESPACE_ERR \t= ((ExceptionMessage[14]=\"Invalid namespace\"),14);\nvar INVALID_ACCESS_ERR \t= ExceptionCode.INVALID_ACCESS_ERR \t= ((ExceptionMessage[15]=\"Invalid access\"),15);\n\n/**\n * DOM Level 2\n * Object DOMException\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/ecma-script-binding.html\n * @see http://www.w3.org/TR/REC-DOM-Level-1/ecma-script-language-binding.html\n */\nfunction DOMException(code, message) {\n\tif(message instanceof Error){\n\t\tvar error = message;\n\t}else{\n\t\terror = this;\n\t\tError.call(this, ExceptionMessage[code]);\n\t\tthis.message = ExceptionMessage[code];\n\t\tif(Error.captureStackTrace) Error.captureStackTrace(this, DOMException);\n\t}\n\terror.code = code;\n\tif(message) this.message = this.message + \": \" + message;\n\treturn error;\n};\nDOMException.prototype = Error.prototype;\ncopy(ExceptionCode,DOMException)\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-536297177\n * The NodeList interface provides the abstraction of an ordered collection of nodes, without defining or constraining how this collection is implemented. NodeList objects in the DOM are live.\n * The items in the NodeList are accessible via an integral index, starting from 0.\n */\nfunction NodeList() {\n};\nNodeList.prototype = {\n\t/**\n\t * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.\n\t * @standard level1\n\t */\n\tlength:0,\n\t/**\n\t * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.\n\t * @standard level1\n\t * @param index unsigned long\n\t * Index into the collection.\n\t * @return Node\n\t * \tThe node at the indexth position in the NodeList, or null if that is not a valid index.\n\t */\n\titem: function(index) {\n\t\treturn index >= 0 && index < this.length ? this[index] : null;\n\t},\n\ttoString:function(isHTML,nodeFilter){\n\t\tfor(var buf = [], i = 0;i<this.length;i++){\n\t\t\tserializeToString(this[i],buf,isHTML,nodeFilter);\n\t\t}\n\t\treturn buf.join('');\n\t},\n\t/**\n\t * @private\n\t * @param {function (Node):boolean} predicate\n\t * @returns {Node[]}\n\t */\n\tfilter: function (predicate) {\n\t\treturn Array.prototype.filter.call(this, predicate);\n\t},\n\t/**\n\t * @private\n\t * @param {Node} item\n\t * @returns {number}\n\t */\n\tindexOf: function (item) {\n\t\treturn Array.prototype.indexOf.call(this, item);\n\t},\n};\n\nfunction LiveNodeList(node,refresh){\n\tthis._node = node;\n\tthis._refresh = refresh\n\t_updateLiveList(this);\n}\nfunction _updateLiveList(list){\n\tvar inc = list._node._inc || list._node.ownerDocument._inc;\n\tif (list._inc !== inc) {\n\t\tvar ls = list._refresh(list._node);\n\t\t__set__(list,'length',ls.length);\n\t\tif (!list.$$length || ls.length < list.$$length) {\n\t\t\tfor (var i = ls.length; i in list; i++) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(list, i)) {\n\t\t\t\t\tdelete list[i];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcopy(ls,list);\n\t\tlist._inc = inc;\n\t}\n}\nLiveNodeList.prototype.item = function(i){\n\t_updateLiveList(this);\n\treturn this[i] || null;\n}\n\n_extends(LiveNodeList,NodeList);\n\n/**\n * Objects implementing the NamedNodeMap interface are used\n * to represent collections of nodes that can be accessed by name.\n * Note that NamedNodeMap does not inherit from NodeList;\n * NamedNodeMaps are not maintained in any particular order.\n * Objects contained in an object implementing NamedNodeMap may also be accessed by an ordinal index,\n * but this is simply to allow convenient enumeration of the contents of a NamedNodeMap,\n * and does not imply that the DOM specifies an order to these Nodes.\n * NamedNodeMap objects in the DOM are live.\n * used for attributes or DocumentType entities\n */\nfunction NamedNodeMap() {\n};\n\nfunction _findNodeIndex(list,node){\n\tvar i = list.length;\n\twhile(i--){\n\t\tif(list[i] === node){return i}\n\t}\n}\n\nfunction _addNamedNode(el,list,newAttr,oldAttr){\n\tif(oldAttr){\n\t\tlist[_findNodeIndex(list,oldAttr)] = newAttr;\n\t}else{\n\t\tlist[list.length++] = newAttr;\n\t}\n\tif(el){\n\t\tnewAttr.ownerElement = el;\n\t\tvar doc = el.ownerDocument;\n\t\tif(doc){\n\t\t\toldAttr && _onRemoveAttribute(doc,el,oldAttr);\n\t\t\t_onAddAttribute(doc,el,newAttr);\n\t\t}\n\t}\n}\nfunction _removeNamedNode(el,list,attr){\n\t//console.log('remove attr:'+attr)\n\tvar i = _findNodeIndex(list,attr);\n\tif(i>=0){\n\t\tvar lastIndex = list.length-1\n\t\twhile(i<lastIndex){\n\t\t\tlist[i] = list[++i]\n\t\t}\n\t\tlist.length = lastIndex;\n\t\tif(el){\n\t\t\tvar doc = el.ownerDocument;\n\t\t\tif(doc){\n\t\t\t\t_onRemoveAttribute(doc,el,attr);\n\t\t\t\tattr.ownerElement = null;\n\t\t\t}\n\t\t}\n\t}else{\n\t\tthrow new DOMException(NOT_FOUND_ERR,new Error(el.tagName+'@'+attr))\n\t}\n}\nNamedNodeMap.prototype = {\n\tlength:0,\n\titem:NodeList.prototype.item,\n\tgetNamedItem: function(key) {\n//\t\tif(key.indexOf(':')>0 || key == 'xmlns'){\n//\t\t\treturn null;\n//\t\t}\n\t\t//console.log()\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar attr = this[i];\n\t\t\t//console.log(attr.nodeName,key)\n\t\t\tif(attr.nodeName == key){\n\t\t\t\treturn attr;\n\t\t\t}\n\t\t}\n\t},\n\tsetNamedItem: function(attr) {\n\t\tvar el = attr.ownerElement;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\tvar oldAttr = this.getNamedItem(attr.nodeName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\t/* returns Node */\n\tsetNamedItemNS: function(attr) {// raises: WRONG_DOCUMENT_ERR,NO_MODIFICATION_ALLOWED_ERR,INUSE_ATTRIBUTE_ERR\n\t\tvar el = attr.ownerElement, oldAttr;\n\t\tif(el && el!=this._ownerElement){\n\t\t\tthrow new DOMException(INUSE_ATTRIBUTE_ERR);\n\t\t}\n\t\toldAttr = this.getNamedItemNS(attr.namespaceURI,attr.localName);\n\t\t_addNamedNode(this._ownerElement,this,attr,oldAttr);\n\t\treturn oldAttr;\n\t},\n\n\t/* returns Node */\n\tremoveNamedItem: function(key) {\n\t\tvar attr = this.getNamedItem(key);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\n\n\t},// raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR\n\n\t//for level2\n\tremoveNamedItemNS:function(namespaceURI,localName){\n\t\tvar attr = this.getNamedItemNS(namespaceURI,localName);\n\t\t_removeNamedNode(this._ownerElement,this,attr);\n\t\treturn attr;\n\t},\n\tgetNamedItemNS: function(namespaceURI, localName) {\n\t\tvar i = this.length;\n\t\twhile(i--){\n\t\t\tvar node = this[i];\n\t\t\tif(node.localName == localName && node.namespaceURI == namespaceURI){\n\t\t\t\treturn node;\n\t\t\t}\n\t\t}\n\t\treturn null;\n\t}\n};\n\n/**\n * The DOMImplementation interface represents an object providing methods\n * which are not dependent on any particular document.\n * Such an object is returned by the `Document.implementation` property.\n *\n * __The individual methods describe the differences compared to the specs.__\n *\n * @constructor\n *\n * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation MDN\n * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-102161490 DOM Level 1 Core (Initial)\n * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#ID-102161490 DOM Level 2 Core\n * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#ID-102161490 DOM Level 3 Core\n * @see https://dom.spec.whatwg.org/#domimplementation DOM Living Standard\n */\nfunction DOMImplementation() {\n}\n\nDOMImplementation.prototype = {\n\t/**\n\t * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.\n\t * The different implementations fairly diverged in what kind of features were reported.\n\t * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.\n\t *\n\t * @deprecated It is deprecated and modern browsers return true in all cases.\n\t *\n\t * @param {string} feature\n\t * @param {string} [version]\n\t * @returns {boolean} always true\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN\n\t * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard\n\t */\n\thasFeature: function(feature, version) {\n\t\t\treturn true;\n\t},\n\t/**\n\t * Creates an XML Document object of the specified type with its document element.\n\t *\n\t * __It behaves slightly different from the description in the living standard__:\n\t * - There is no interface/class `XMLDocument`, it returns a `Document` instance.\n\t * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.\n\t * - this implementation is not validating names or qualified names\n\t * (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string|null} namespaceURI\n\t * @param {string} qualifiedName\n\t * @param {DocumentType=null} doctype\n\t * @returns {Document}\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocument: function(namespaceURI, qualifiedName, doctype){\n\t\tvar doc = new Document();\n\t\tdoc.implementation = this;\n\t\tdoc.childNodes = new NodeList();\n\t\tdoc.doctype = doctype || null;\n\t\tif (doctype){\n\t\t\tdoc.appendChild(doctype);\n\t\t}\n\t\tif (qualifiedName){\n\t\t\tvar root = doc.createElementNS(namespaceURI, qualifiedName);\n\t\t\tdoc.appendChild(root);\n\t\t}\n\t\treturn doc;\n\t},\n\t/**\n\t * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.\n\t *\n\t * __This behavior is slightly different from the in the specs__:\n\t * - this implementation is not validating names or qualified names\n\t * (when parsing XML strings, the SAX parser takes care of that)\n\t *\n\t * @param {string} qualifiedName\n\t * @param {string} [publicId]\n\t * @param {string} [systemId]\n\t * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation\n\t * \t\t\t\t or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN\n\t * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core\n\t * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard\n\t *\n\t * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract\n\t * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names\n\t * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names\n\t */\n\tcreateDocumentType: function(qualifiedName, publicId, systemId){\n\t\tvar node = new DocumentType();\n\t\tnode.name = qualifiedName;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.publicId = publicId || '';\n\t\tnode.systemId = systemId || '';\n\n\t\treturn node;\n\t}\n};\n\n\n/**\n * @see http://www.w3.org/TR/2000/REC-DOM-Level-2-Core-20001113/core.html#ID-1950641247\n */\n\nfunction Node() {\n};\n\nNode.prototype = {\n\tfirstChild : null,\n\tlastChild : null,\n\tpreviousSibling : null,\n\tnextSibling : null,\n\tattributes : null,\n\tparentNode : null,\n\tchildNodes : null,\n\townerDocument : null,\n\tnodeValue : null,\n\tnamespaceURI : null,\n\tprefix : null,\n\tlocalName : null,\n\t// Modified in DOM Level 2:\n\tinsertBefore:function(newChild, refChild){//raises\n\t\treturn _insertBefore(this,newChild,refChild);\n\t},\n\treplaceChild:function(newChild, oldChild){//raises\n\t\t_insertBefore(this, newChild,oldChild, assertPreReplacementValidityInDocument);\n\t\tif(oldChild){\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t},\n\tremoveChild:function(oldChild){\n\t\treturn _removeChild(this,oldChild);\n\t},\n\tappendChild:function(newChild){\n\t\treturn this.insertBefore(newChild,null);\n\t},\n\thasChildNodes:function(){\n\t\treturn this.firstChild != null;\n\t},\n\tcloneNode:function(deep){\n\t\treturn cloneNode(this.ownerDocument||this,this,deep);\n\t},\n\t// Modified in DOM Level 2:\n\tnormalize:function(){\n\t\tvar child = this.firstChild;\n\t\twhile(child){\n\t\t\tvar next = child.nextSibling;\n\t\t\tif(next && next.nodeType == TEXT_NODE && child.nodeType == TEXT_NODE){\n\t\t\t\tthis.removeChild(next);\n\t\t\t\tchild.appendData(next.data);\n\t\t\t}else{\n\t\t\t\tchild.normalize();\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t}\n\t},\n \t// Introduced in DOM Level 2:\n\tisSupported:function(feature, version){\n\t\treturn this.ownerDocument.implementation.hasFeature(feature,version);\n\t},\n // Introduced in DOM Level 2:\n hasAttributes:function(){\n \treturn this.attributes.length>0;\n },\n\t/**\n\t * Look up the prefix associated to the given namespace URI, starting from this node.\n\t * **The default namespace declarations are ignored by this method.**\n\t * See Namespace Prefix Lookup for details on the algorithm used by this method.\n\t *\n\t * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._\n\t *\n\t * @param {string | null} namespaceURI\n\t * @returns {string | null}\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix\n\t * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo\n\t * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix\n\t * @see https://github.com/xmldom/xmldom/issues/322\n\t */\n lookupPrefix:function(namespaceURI){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tfor(var n in map){\n\t\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(map, n) && map[n] === namespaceURI) {\n\t\t\t\t\t\t\treturn n;\n\t\t\t\t\t\t}\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n lookupNamespaceURI:function(prefix){\n \tvar el = this;\n \twhile(el){\n \t\tvar map = el._nsMap;\n \t\t//console.dir(map)\n \t\tif(map){\n \t\t\tif(Object.prototype.hasOwnProperty.call(map, prefix)){\n \t\t\t\treturn map[prefix] ;\n \t\t\t}\n \t\t}\n \t\tel = el.nodeType == ATTRIBUTE_NODE?el.ownerDocument : el.parentNode;\n \t}\n \treturn null;\n },\n // Introduced in DOM Level 3:\n isDefaultNamespace:function(namespaceURI){\n \tvar prefix = this.lookupPrefix(namespaceURI);\n \treturn prefix == null;\n }\n};\n\n\nfunction _xmlEncoder(c){\n\treturn c == '<' && '&lt;' ||\n c == '>' && '&gt;' ||\n c == '&' && '&amp;' ||\n c == '\"' && '&quot;' ||\n '&#'+c.charCodeAt()+';'\n}\n\n\ncopy(NodeType,Node);\ncopy(NodeType,Node.prototype);\n\n/**\n * @param callback return true for continue,false for break\n * @return boolean true: break visit;\n */\nfunction _visitNode(node,callback){\n\tif(callback(node)){\n\t\treturn true;\n\t}\n\tif(node = node.firstChild){\n\t\tdo{\n\t\t\tif(_visitNode(node,callback)){return true}\n }while(node=node.nextSibling)\n }\n}\n\n\n\nfunction Document(){\n\tthis.ownerDocument = this;\n}\n\nfunction _onAddAttribute(doc,el,newAttr){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tel._nsMap[newAttr.prefix?newAttr.localName:''] = newAttr.value\n\t}\n}\n\nfunction _onRemoveAttribute(doc,el,newAttr,remove){\n\tdoc && doc._inc++;\n\tvar ns = newAttr.namespaceURI ;\n\tif(ns === NAMESPACE.XMLNS){\n\t\t//update namespace\n\t\tdelete el._nsMap[newAttr.prefix?newAttr.localName:'']\n\t}\n}\n\n/**\n * Updates `el.childNodes`, updating the indexed items and it's `length`.\n * Passing `newChild` means it will be appended.\n * Otherwise it's assumed that an item has been removed,\n * and `el.firstNode` and it's `.nextSibling` are used\n * to walk the current list of child nodes.\n *\n * @param {Document} doc\n * @param {Node} el\n * @param {Node} [newChild]\n * @private\n */\nfunction _onUpdateChild (doc, el, newChild) {\n\tif(doc && doc._inc){\n\t\tdoc._inc++;\n\t\t//update childNodes\n\t\tvar cs = el.childNodes;\n\t\tif (newChild) {\n\t\t\tcs[cs.length++] = newChild;\n\t\t} else {\n\t\t\tvar child = el.firstChild;\n\t\t\tvar i = 0;\n\t\t\twhile (child) {\n\t\t\t\tcs[i++] = child;\n\t\t\t\tchild = child.nextSibling;\n\t\t\t}\n\t\t\tcs.length = i;\n\t\t\tdelete cs[cs.length];\n\t\t}\n\t}\n}\n\n/**\n * Removes the connections between `parentNode` and `child`\n * and any existing `child.previousSibling` or `child.nextSibling`.\n *\n * @see https://github.com/xmldom/xmldom/issues/135\n * @see https://github.com/xmldom/xmldom/issues/145\n *\n * @param {Node} parentNode\n * @param {Node} child\n * @returns {Node} the child that was removed.\n * @private\n */\nfunction _removeChild (parentNode, child) {\n\tvar previous = child.previousSibling;\n\tvar next = child.nextSibling;\n\tif (previous) {\n\t\tprevious.nextSibling = next;\n\t} else {\n\t\tparentNode.firstChild = next;\n\t}\n\tif (next) {\n\t\tnext.previousSibling = previous;\n\t} else {\n\t\tparentNode.lastChild = previous;\n\t}\n\tchild.parentNode = null;\n\tchild.previousSibling = null;\n\tchild.nextSibling = null;\n\t_onUpdateChild(parentNode.ownerDocument, parentNode);\n\treturn child;\n}\n\n/**\n * Returns `true` if `node` can be a parent for insertion.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasValidParentNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(node.nodeType === Node.DOCUMENT_NODE || node.nodeType === Node.DOCUMENT_FRAGMENT_NODE || node.nodeType === Node.ELEMENT_NODE)\n\t);\n}\n\n/**\n * Returns `true` if `node` can be inserted according to it's `nodeType`.\n * @param {Node} node\n * @returns {boolean}\n */\nfunction hasInsertableNodeType(node) {\n\treturn (\n\t\tnode &&\n\t\t(isElementNode(node) ||\n\t\t\tisTextNode(node) ||\n\t\t\tisDocTypeNode(node) ||\n\t\t\tnode.nodeType === Node.DOCUMENT_FRAGMENT_NODE ||\n\t\t\tnode.nodeType === Node.COMMENT_NODE ||\n\t\t\tnode.nodeType === Node.PROCESSING_INSTRUCTION_NODE)\n\t);\n}\n\n/**\n * Returns true if `node` is a DOCTYPE node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isDocTypeNode(node) {\n\treturn node && node.nodeType === Node.DOCUMENT_TYPE_NODE;\n}\n\n/**\n * Returns true if the node is an element\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isElementNode(node) {\n\treturn node && node.nodeType === Node.ELEMENT_NODE;\n}\n/**\n * Returns true if `node` is a text node\n * @param {Node} node\n * @returns {boolean}\n */\nfunction isTextNode(node) {\n\treturn node && node.nodeType === Node.TEXT_NODE;\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Document} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementInsertionPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\tif (find(parentChildNodes, isElementNode) || isDocTypeNode(child)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * Check if en element node can be inserted before `child`, or at the end if child is falsy,\n * according to the presence and position of a doctype node on the same level.\n *\n * @param {Node} doc The document node\n * @param {Node} child the node that would become the nextSibling if the element would be inserted\n * @returns {boolean} `true` if an element can be inserted before child\n * @private\n * https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction isElementReplacementPossible(doc, child) {\n\tvar parentChildNodes = doc.childNodes || [];\n\n\tfunction hasElementChildThatIsNotChild(node) {\n\t\treturn isElementNode(node) && node !== child;\n\t}\n\n\tif (find(parentChildNodes, hasElementChildThatIsNotChild)) {\n\t\treturn false;\n\t}\n\tvar docTypeNode = find(parentChildNodes, isDocTypeNode);\n\treturn !(child && docTypeNode && parentChildNodes.indexOf(docTypeNode) > parentChildNodes.indexOf(child));\n}\n\n/**\n * @private\n * Steps 1-5 of the checks before inserting and before replacing a child are the same.\n *\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidity1to5(parent, node, child) {\n\t// 1. If `parent` is not a Document, DocumentFragment, or Element node, then throw a \"HierarchyRequestError\" DOMException.\n\tif (!hasValidParentNodeType(parent)) {\n\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Unexpected parent node type ' + parent.nodeType);\n\t}\n\t// 2. If `node` is a host-including inclusive ancestor of `parent`, then throw a \"HierarchyRequestError\" DOMException.\n\t// not implemented!\n\t// 3. If `child` is non-null and its parent is not `parent`, then throw a \"NotFoundError\" DOMException.\n\tif (child && child.parentNode !== parent) {\n\t\tthrow new DOMException(NOT_FOUND_ERR, 'child not in parent');\n\t}\n\tif (\n\t\t// 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a \"HierarchyRequestError\" DOMException.\n\t\t!hasInsertableNodeType(node) ||\n\t\t// 5. If either `node` is a Text node and `parent` is a document,\n\t\t// the sax parser currently adds top level text nodes, this will be fixed in 0.9.0\n\t\t// || (node.nodeType === Node.TEXT_NODE && parent.nodeType === Node.DOCUMENT_NODE)\n\t\t// or `node` is a doctype and `parent` is not a document, then throw a \"HierarchyRequestError\" DOMException.\n\t\t(isDocTypeNode(node) && parent.nodeType !== Node.DOCUMENT_NODE)\n\t) {\n\t\tthrow new DOMException(\n\t\t\tHIERARCHY_REQUEST_ERR,\n\t\t\t'Unexpected node type ' + node.nodeType + ' for parent node type ' + parent.nodeType\n\t\t);\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreInsertionValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If node has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child,\n\t\t// `child` is a doctype, or `child` is non-null and a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child, `child` is a doctype,\n\t\t// or `child` is non-null and a doctype is following `child`.\n\t\tif (!isElementInsertionPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\t// `parent` has a doctype child,\n\t\tif (find(parentChildNodes, isDocTypeNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// `child` is non-null and an element is preceding `child`,\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t\t// or `child` is null and `parent` has an element child.\n\t\tif (!child && parentElementChild) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can not be appended since element is present');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * Step 6 of the checks before inserting and before replacing a child are different.\n *\n * @param {Document} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node | undefined} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n * @see https://dom.spec.whatwg.org/#concept-node-replace\n */\nfunction assertPreReplacementValidityInDocument(parent, node, child) {\n\tvar parentChildNodes = parent.childNodes || [];\n\tvar nodeChildNodes = node.childNodes || [];\n\n\t// DocumentFragment\n\tif (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE) {\n\t\tvar nodeChildElements = nodeChildNodes.filter(isElementNode);\n\t\t// If `node` has more than one element child or has a Text node child.\n\t\tif (nodeChildElements.length > 1 || find(nodeChildNodes, isTextNode)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'More than one element or text in fragment');\n\t\t}\n\t\t// Otherwise, if `node` has one element child and either `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (nodeChildElements.length === 1 && !isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Element in fragment can not be inserted before doctype');\n\t\t}\n\t}\n\t// Element\n\tif (isElementNode(node)) {\n\t\t// `parent` has an element child that is not `child` or a doctype is following `child`.\n\t\tif (!isElementReplacementPossible(parent, child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one element can be added and only after doctype');\n\t\t}\n\t}\n\t// DocumentType\n\tif (isDocTypeNode(node)) {\n\t\tfunction hasDoctypeChildThatIsNotChild(node) {\n\t\t\treturn isDocTypeNode(node) && node !== child;\n\t\t}\n\n\t\t// `parent` has a doctype child that is not `child`,\n\t\tif (find(parentChildNodes, hasDoctypeChildThatIsNotChild)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Only one doctype is allowed');\n\t\t}\n\t\tvar parentElementChild = find(parentChildNodes, isElementNode);\n\t\t// or an element is preceding `child`.\n\t\tif (child && parentChildNodes.indexOf(parentElementChild) < parentChildNodes.indexOf(child)) {\n\t\t\tthrow new DOMException(HIERARCHY_REQUEST_ERR, 'Doctype can only be inserted before an element');\n\t\t}\n\t}\n}\n\n/**\n * @private\n * @param {Node} parent the parent node to insert `node` into\n * @param {Node} node the node to insert\n * @param {Node=} child the node that should become the `nextSibling` of `node`\n * @returns {Node}\n * @throws DOMException for several node combinations that would create a DOM that is not well-formed.\n * @throws DOMException if `child` is provided but is not a child of `parent`.\n * @see https://dom.spec.whatwg.org/#concept-node-ensure-pre-insertion-validity\n */\nfunction _insertBefore(parent, node, child, _inDocumentAssertion) {\n\t// To ensure pre-insertion validity of a node into a parent before a child, run these steps:\n\tassertPreInsertionValidity1to5(parent, node, child);\n\n\t// If parent is a document, and any of the statements below, switched on the interface node implements,\n\t// are true, then throw a \"HierarchyRequestError\" DOMException.\n\tif (parent.nodeType === Node.DOCUMENT_NODE) {\n\t\t(_inDocumentAssertion || assertPreInsertionValidityInDocument)(parent, node, child);\n\t}\n\n\tvar cp = node.parentNode;\n\tif(cp){\n\t\tcp.removeChild(node);//remove and update\n\t}\n\tif(node.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\tvar newFirst = node.firstChild;\n\t\tif (newFirst == null) {\n\t\t\treturn node;\n\t\t}\n\t\tvar newLast = node.lastChild;\n\t}else{\n\t\tnewFirst = newLast = node;\n\t}\n\tvar pre = child ? child.previousSibling : parent.lastChild;\n\n\tnewFirst.previousSibling = pre;\n\tnewLast.nextSibling = child;\n\n\n\tif(pre){\n\t\tpre.nextSibling = newFirst;\n\t}else{\n\t\tparent.firstChild = newFirst;\n\t}\n\tif(child == null){\n\t\tparent.lastChild = newLast;\n\t}else{\n\t\tchild.previousSibling = newLast;\n\t}\n\tdo{\n\t\tnewFirst.parentNode = parent;\n\t\t// Update ownerDocument for each node being inserted\n\t\tvar targetDoc = parent.ownerDocument || parent;\n\t\t_updateOwnerDocument(newFirst, targetDoc);\n\t}while(newFirst !== newLast && (newFirst= newFirst.nextSibling))\n\t_onUpdateChild(parent.ownerDocument||parent, parent);\n\t//console.log(parent.lastChild.nextSibling == null)\n\tif (node.nodeType == DOCUMENT_FRAGMENT_NODE) {\n\t\tnode.firstChild = node.lastChild = null;\n\t}\n\treturn node;\n}\n\n/**\n * Recursively updates the ownerDocument property for a node and all its descendants\n * @param {Node} node\n * @param {Document} newOwnerDocument\n * @private\n */\nfunction _updateOwnerDocument(node, newOwnerDocument) {\n\tif (node.ownerDocument === newOwnerDocument) {\n\t\treturn;\n\t}\n\t\n\tnode.ownerDocument = newOwnerDocument;\n\t\n\t// Update attributes if this is an element\n\tif (node.nodeType === ELEMENT_NODE && node.attributes) {\n\t\tfor (var i = 0; i < node.attributes.length; i++) {\n\t\t\tvar attr = node.attributes.item(i);\n\t\t\tif (attr) {\n\t\t\t\tattr.ownerDocument = newOwnerDocument;\n\t\t\t}\n\t\t}\n\t}\n\t\n\t// Recursively update child nodes\n\tvar child = node.firstChild;\n\twhile (child) {\n\t\t_updateOwnerDocument(child, newOwnerDocument);\n\t\tchild = child.nextSibling;\n\t}\n}\n\n/**\n * Appends `newChild` to `parentNode`.\n * If `newChild` is already connected to a `parentNode` it is first removed from it.\n *\n * @see https://github.com/xmldom/xmldom/issues/135\n * @see https://github.com/xmldom/xmldom/issues/145\n * @param {Node} parentNode\n * @param {Node} newChild\n * @returns {Node}\n * @private\n */\nfunction _appendSingleChild (parentNode, newChild) {\n\tif (newChild.parentNode) {\n\t\tnewChild.parentNode.removeChild(newChild);\n\t}\n\tnewChild.parentNode = parentNode;\n\tnewChild.previousSibling = parentNode.lastChild;\n\tnewChild.nextSibling = null;\n\tif (newChild.previousSibling) {\n\t\tnewChild.previousSibling.nextSibling = newChild;\n\t} else {\n\t\tparentNode.firstChild = newChild;\n\t}\n\tparentNode.lastChild = newChild;\n\t_onUpdateChild(parentNode.ownerDocument, parentNode, newChild);\n\t\n\t// Update ownerDocument for the new child and all its descendants\n\tvar targetDoc = parentNode.ownerDocument || parentNode;\n\t_updateOwnerDocument(newChild, targetDoc);\n\t\n\treturn newChild;\n}\n\nDocument.prototype = {\n\t//implementation : null,\n\tnodeName : '#document',\n\tnodeType : DOCUMENT_NODE,\n\t/**\n\t * The DocumentType node of the document.\n\t *\n\t * @readonly\n\t * @type DocumentType\n\t */\n\tdoctype : null,\n\tdocumentElement : null,\n\t_inc : 1,\n\n\tinsertBefore : function(newChild, refChild){//raises\n\t\tif(newChild.nodeType == DOCUMENT_FRAGMENT_NODE){\n\t\t\tvar child = newChild.firstChild;\n\t\t\twhile(child){\n\t\t\t\tvar next = child.nextSibling;\n\t\t\t\tthis.insertBefore(child,refChild);\n\t\t\t\tchild = next;\n\t\t\t}\n\t\t\treturn newChild;\n\t\t}\n\t\t_insertBefore(this, newChild, refChild);\n\t\t_updateOwnerDocument(newChild, this);\n\t\tif (this.documentElement === null && newChild.nodeType === ELEMENT_NODE) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\n\t\treturn newChild;\n\t},\n\tremoveChild : function(oldChild){\n\t\tif(this.documentElement == oldChild){\n\t\t\tthis.documentElement = null;\n\t\t}\n\t\treturn _removeChild(this,oldChild);\n\t},\n\treplaceChild: function (newChild, oldChild) {\n\t\t//raises\n\t\t_insertBefore(this, newChild, oldChild, assertPreReplacementValidityInDocument);\n\t\t_updateOwnerDocument(newChild, this);\n\t\tif (oldChild) {\n\t\t\tthis.removeChild(oldChild);\n\t\t}\n\t\tif (isElementNode(newChild)) {\n\t\t\tthis.documentElement = newChild;\n\t\t}\n\t},\n\t// Introduced in DOM Level 2:\n\timportNode : function(importedNode,deep){\n\t\treturn importNode(this,importedNode,deep);\n\t},\n\t// Introduced in DOM Level 2:\n\tgetElementById :\tfunction(id){\n\t\tvar rtv = null;\n\t\t_visitNode(this.documentElement,function(node){\n\t\t\tif(node.nodeType == ELEMENT_NODE){\n\t\t\t\tif(node.getAttribute('id') == id){\n\t\t\t\t\trtv = node;\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\t\treturn rtv;\n\t},\n\n\t/**\n\t * The `getElementsByClassName` method of `Document` interface returns an array-like object\n\t * of all child elements which have **all** of the given class name(s).\n\t *\n\t * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.\n\t *\n\t *\n\t * Warning: This is a live LiveNodeList.\n\t * Changes in the DOM will reflect in the array as the changes occur.\n\t * If an element selected by this array no longer qualifies for the selector,\n\t * it will automatically be removed. Be aware of this for iteration purposes.\n\t *\n\t * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace\n\t *\n\t * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName\n\t * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname\n\t */\n\tgetElementsByClassName: function(classNames) {\n\t\tvar classNamesSet = toOrderedSet(classNames)\n\t\treturn new LiveNodeList(this, function(base) {\n\t\t\tvar ls = [];\n\t\t\tif (classNamesSet.length > 0) {\n\t\t\t\t_visitNode(base.documentElement, function(node) {\n\t\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE) {\n\t\t\t\t\t\tvar nodeClassNames = node.getAttribute('class')\n\t\t\t\t\t\t// can be null if the attribute does not exist\n\t\t\t\t\t\tif (nodeClassNames) {\n\t\t\t\t\t\t\t// before splitting and iterating just compare them for the most common case\n\t\t\t\t\t\t\tvar matches = classNames === nodeClassNames;\n\t\t\t\t\t\t\tif (!matches) {\n\t\t\t\t\t\t\t\tvar nodeClassNamesSet = toOrderedSet(nodeClassNames)\n\t\t\t\t\t\t\t\tmatches = classNamesSet.every(arrayIncludes(nodeClassNamesSet))\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif(matches) {\n\t\t\t\t\t\t\t\tls.push(node);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t}\n\t\t\treturn ls;\n\t\t});\n\t},\n\n\t//document factory method:\n\tcreateElement :\tfunction(tagName){\n\t\tvar node = new Element();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = tagName;\n\t\tnode.tagName = tagName;\n\t\tnode.localName = tagName;\n\t\tnode.childNodes = new NodeList();\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\tcreateDocumentFragment :\tfunction(){\n\t\tvar node = new DocumentFragment();\n\t\tnode.ownerDocument = this;\n\t\tnode.childNodes = new NodeList();\n\t\treturn node;\n\t},\n\tcreateTextNode :\tfunction(data){\n\t\tvar node = new Text();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateComment :\tfunction(data){\n\t\tvar node = new Comment();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateCDATASection :\tfunction(data){\n\t\tvar node = new CDATASection();\n\t\tnode.ownerDocument = this;\n\t\tnode.appendData(data)\n\t\treturn node;\n\t},\n\tcreateProcessingInstruction :\tfunction(target,data){\n\t\tvar node = new ProcessingInstruction();\n\t\tnode.ownerDocument = this;\n\t\tnode.tagName = node.nodeName = node.target = target;\n\t\tnode.nodeValue = node.data = data;\n\t\treturn node;\n\t},\n\tcreateAttribute :\tfunction(name){\n\t\tvar node = new Attr();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.name = name;\n\t\tnode.nodeName\t= name;\n\t\tnode.localName = name;\n\t\tnode.specified = true;\n\t\treturn node;\n\t},\n\tcreateEntityReference :\tfunction(name){\n\t\tvar node = new EntityReference();\n\t\tnode.ownerDocument\t= this;\n\t\tnode.nodeName\t= name;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateElementNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Element();\n\t\tvar pl = qualifiedName.split(':');\n\t\tvar attrs\t= node.attributes = new NamedNodeMap();\n\t\tnode.childNodes = new NodeList();\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.tagName = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\tattrs._ownerElement = node;\n\t\treturn node;\n\t},\n\t// Introduced in DOM Level 2:\n\tcreateAttributeNS :\tfunction(namespaceURI,qualifiedName){\n\t\tvar node = new Attr();\n\t\tvar pl = qualifiedName.split(':');\n\t\tnode.ownerDocument = this;\n\t\tnode.nodeName = qualifiedName;\n\t\tnode.name = qualifiedName;\n\t\tnode.namespaceURI = namespaceURI;\n\t\tnode.specified = true;\n\t\tif(pl.length == 2){\n\t\t\tnode.prefix = pl[0];\n\t\t\tnode.localName = pl[1];\n\t\t}else{\n\t\t\t//el.prefix = null;\n\t\t\tnode.localName = qualifiedName;\n\t\t}\n\t\treturn node;\n\t}\n};\n_extends(Document,Node);\n\n\nfunction Element() {\n\tthis._nsMap = {};\n};\nElement.prototype = {\n\tnodeType : ELEMENT_NODE,\n\thasAttribute : function(name){\n\t\treturn this.getAttributeNode(name)!=null;\n\t},\n\tgetAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name);\n\t\treturn attr && attr.value || '';\n\t},\n\tgetAttributeNode : function(name){\n\t\treturn this.attributes.getNamedItem(name);\n\t},\n\tsetAttribute : function(name, value){\n\t\tvar attr = this.ownerDocument.createAttribute(name);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tremoveAttribute : function(name){\n\t\tvar attr = this.getAttributeNode(name)\n\t\tattr && this.removeAttributeNode(attr);\n\t},\n\n\t//four real opeartion method\n\tappendChild:function(newChild){\n\t\tif(newChild.nodeType === DOCUMENT_FRAGMENT_NODE){\n\t\t\treturn this.insertBefore(newChild,null);\n\t\t}else{\n\t\t\treturn _appendSingleChild(this,newChild);\n\t\t}\n\t},\n\tsetAttributeNode : function(newAttr){\n\t\treturn this.attributes.setNamedItem(newAttr);\n\t},\n\tsetAttributeNodeNS : function(newAttr){\n\t\treturn this.attributes.setNamedItemNS(newAttr);\n\t},\n\tremoveAttributeNode : function(oldAttr){\n\t\t//console.log(this == oldAttr.ownerElement)\n\t\treturn this.attributes.removeNamedItem(oldAttr.nodeName);\n\t},\n\t//get real attribute name,and remove it by removeAttributeNode\n\tremoveAttributeNS : function(namespaceURI, localName){\n\t\tvar old = this.getAttributeNodeNS(namespaceURI, localName);\n\t\told && this.removeAttributeNode(old);\n\t},\n\n\thasAttributeNS : function(namespaceURI, localName){\n\t\treturn this.getAttributeNodeNS(namespaceURI, localName)!=null;\n\t},\n\tgetAttributeNS : function(namespaceURI, localName){\n\t\tvar attr = this.getAttributeNodeNS(namespaceURI, localName);\n\t\treturn attr && attr.value || '';\n\t},\n\tsetAttributeNS : function(namespaceURI, qualifiedName, value){\n\t\tvar attr = this.ownerDocument.createAttributeNS(namespaceURI, qualifiedName);\n\t\tattr.value = attr.nodeValue = \"\" + value;\n\t\tthis.setAttributeNode(attr)\n\t},\n\tgetAttributeNodeNS : function(namespaceURI, localName){\n\t\treturn this.attributes.getNamedItemNS(namespaceURI, localName);\n\t},\n\n\tgetElementsByTagName : function(tagName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType == ELEMENT_NODE && (tagName === '*' || node.tagName == tagName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\t\t});\n\t},\n\tgetElementsByTagNameNS : function(namespaceURI, localName){\n\t\treturn new LiveNodeList(this,function(base){\n\t\t\tvar ls = [];\n\t\t\t_visitNode(base,function(node){\n\t\t\t\tif(node !== base && node.nodeType === ELEMENT_NODE && (namespaceURI === '*' || node.namespaceURI === namespaceURI) && (localName === '*' || node.localName == localName)){\n\t\t\t\t\tls.push(node);\n\t\t\t\t}\n\t\t\t});\n\t\t\treturn ls;\n\n\t\t});\n\t}\n};\nDocument.prototype.getElementsByTagName = Element.prototype.getElementsByTagName;\nDocument.prototype.getElementsByTagNameNS = Element.prototype.getElementsByTagNameNS;\n\n\n_extends(Element,Node);\nfunction Attr() {\n};\nAttr.prototype.nodeType = ATTRIBUTE_NODE;\n_extends(Attr,Node);\n\n\nfunction CharacterData() {\n};\nCharacterData.prototype = {\n\tdata : '',\n\tsubstringData : function(offset, count) {\n\t\treturn this.data.substring(offset, offset+count);\n\t},\n\tappendData: function(text) {\n\t\ttext = this.data+text;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t},\n\tinsertData: function(offset,text) {\n\t\tthis.replaceData(offset,0,text);\n\n\t},\n\tappendChild:function(newChild){\n\t\tthrow new Error(ExceptionMessage[HIERARCHY_REQUEST_ERR])\n\t},\n\tdeleteData: function(offset, count) {\n\t\tthis.replaceData(offset,count,\"\");\n\t},\n\treplaceData: function(offset, count, text) {\n\t\tvar start = this.data.substring(0,offset);\n\t\tvar end = this.data.substring(offset+count);\n\t\ttext = start + text + end;\n\t\tthis.nodeValue = this.data = text;\n\t\tthis.length = text.length;\n\t}\n}\n_extends(CharacterData,Node);\nfunction Text() {\n};\nText.prototype = {\n\tnodeName : \"#text\",\n\tnodeType : TEXT_NODE,\n\tsplitText : function(offset) {\n\t\tvar text = this.data;\n\t\tvar newText = text.substring(offset);\n\t\ttext = text.substring(0, offset);\n\t\tthis.data = this.nodeValue = text;\n\t\tthis.length = text.length;\n\t\tvar newNode = this.ownerDocument.createTextNode(newText);\n\t\tif(this.parentNode){\n\t\t\tthis.parentNode.insertBefore(newNode, this.nextSibling);\n\t\t}\n\t\treturn newNode;\n\t}\n}\n_extends(Text,CharacterData);\nfunction Comment() {\n};\nComment.prototype = {\n\tnodeName : \"#comment\",\n\tnodeType : COMMENT_NODE\n}\n_extends(Comment,CharacterData);\n\nfunction CDATASection() {\n};\nCDATASection.prototype = {\n\tnodeName : \"#cdata-section\",\n\tnodeType : CDATA_SECTION_NODE\n}\n_extends(CDATASection,CharacterData);\n\n\nfunction DocumentType() {\n};\nDocumentType.prototype.nodeType = DOCUMENT_TYPE_NODE;\n_extends(DocumentType,Node);\n\nfunction Notation() {\n};\nNotation.prototype.nodeType = NOTATION_NODE;\n_extends(Notation,Node);\n\nfunction Entity() {\n};\nEntity.prototype.nodeType = ENTITY_NODE;\n_extends(Entity,Node);\n\nfunction EntityReference() {\n};\nEntityReference.prototype.nodeType = ENTITY_REFERENCE_NODE;\n_extends(EntityReference,Node);\n\nfunction DocumentFragment() {\n};\nDocumentFragment.prototype.nodeName =\t\"#document-fragment\";\nDocumentFragment.prototype.nodeType =\tDOCUMENT_FRAGMENT_NODE;\n_extends(DocumentFragment,Node);\n\n\nfunction ProcessingInstruction() {\n}\nProcessingInstruction.prototype.nodeType = PROCESSING_INSTRUCTION_NODE;\n_extends(ProcessingInstruction,Node);\nfunction XMLSerializer(){}\nXMLSerializer.prototype.serializeToString = function(node,isHtml,nodeFilter){\n\treturn nodeSerializeToString.call(node,isHtml,nodeFilter);\n}\nNode.prototype.toString = nodeSerializeToString;\nfunction nodeSerializeToString(isHtml,nodeFilter){\n\tvar buf = [];\n\tvar refNode = this.nodeType == 9 && this.documentElement || this;\n\tvar prefix = refNode.prefix;\n\tvar uri = refNode.namespaceURI;\n\n\tif(uri && prefix == null){\n\t\t//console.log(prefix)\n\t\tvar prefix = refNode.lookupPrefix(uri);\n\t\tif(prefix == null){\n\t\t\t//isHTML = true;\n\t\t\tvar visibleNamespaces=[\n\t\t\t{namespace:uri,prefix:null}\n\t\t\t//{namespace:uri,prefix:''}\n\t\t\t]\n\t\t}\n\t}\n\tserializeToString(this,buf,isHtml,nodeFilter,visibleNamespaces);\n\t//console.log('###',this.nodeType,uri,prefix,buf.join(''))\n\treturn buf.join('');\n}\n\nfunction needNamespaceDefine(node, isHTML, visibleNamespaces) {\n\tvar prefix = node.prefix || '';\n\tvar uri = node.namespaceURI;\n\t// According to [Namespaces in XML 1.0](https://www.w3.org/TR/REC-xml-names/#ns-using) ,\n\t// and more specifically https://www.w3.org/TR/REC-xml-names/#nsc-NoPrefixUndecl :\n\t// > In a namespace declaration for a prefix [...], the attribute value MUST NOT be empty.\n\t// in a similar manner [Namespaces in XML 1.1](https://www.w3.org/TR/xml-names11/#ns-using)\n\t// and more specifically https://www.w3.org/TR/xml-names11/#nsc-NSDeclared :\n\t// > [...] Furthermore, the attribute value [...] must not be an empty string.\n\t// so serializing empty namespace value like xmlns:ds=\"\" would produce an invalid XML document.\n\tif (!uri) {\n\t\treturn false;\n\t}\n\tif (prefix === \"xml\" && uri === NAMESPACE.XML || uri === NAMESPACE.XMLNS) {\n\t\treturn false;\n\t}\n\n\tvar i = visibleNamespaces.length\n\twhile (i--) {\n\t\tvar ns = visibleNamespaces[i];\n\t\t// get namespace prefix\n\t\tif (ns.prefix === prefix) {\n\t\t\treturn ns.namespace !== uri;\n\t\t}\n\t}\n\treturn true;\n}\n/**\n * Well-formed constraint: No < in Attribute Values\n * > The replacement text of any entity referred to directly or indirectly\n * > in an attribute value must not contain a <.\n * @see https://www.w3.org/TR/xml11/#CleanAttrVals\n * @see https://www.w3.org/TR/xml11/#NT-AttValue\n *\n * Literal whitespace other than space that appear in attribute values\n * are serialized as their entity references, so they will be preserved.\n * (In contrast to whitespace literals in the input which are normalized to spaces)\n * @see https://www.w3.org/TR/xml11/#AVNormalize\n * @see https://w3c.github.io/DOM-Parsing/#serializing-an-element-s-attributes\n */\nfunction addSerializedAttribute(buf, qualifiedName, value) {\n\tbuf.push(' ', qualifiedName, '=\"', value.replace(/[<>&\"\\t\\n\\r]/g, _xmlEncoder), '\"')\n}\n\nfunction serializeToString(node,buf,isHTML,nodeFilter,visibleNamespaces){\n\tif (!visibleNamespaces) {\n\t\tvisibleNamespaces = [];\n\t}\n\n\tif(nodeFilter){\n\t\tnode = nodeFilter(node);\n\t\tif(node){\n\t\t\tif(typeof node == 'string'){\n\t\t\t\tbuf.push(node);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else{\n\t\t\treturn;\n\t\t}\n\t\t//buf.sort.apply(attrs, attributeSorter);\n\t}\n\n\tswitch(node.nodeType){\n\tcase ELEMENT_NODE:\n\t\tvar attrs = node.attributes;\n\t\tvar len = attrs.length;\n\t\tvar child = node.firstChild;\n\t\tvar nodeName = node.tagName;\n\n\t\tisHTML = NAMESPACE.isHTML(node.namespaceURI) || isHTML\n\n\t\tvar prefixedNodeName = nodeName\n\t\tif (!isHTML && !node.prefix && node.namespaceURI) {\n\t\t\tvar defaultNS\n\t\t\t// lookup current default ns from `xmlns` attribute\n\t\t\tfor (var ai = 0; ai < attrs.length; ai++) {\n\t\t\t\tif (attrs.item(ai).name === 'xmlns') {\n\t\t\t\t\tdefaultNS = attrs.item(ai).value\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!defaultNS) {\n\t\t\t\t// lookup current default ns in visibleNamespaces\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.prefix === '' && namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tdefaultNS = namespace.namespace\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (defaultNS !== node.namespaceURI) {\n\t\t\t\tfor (var nsi = visibleNamespaces.length - 1; nsi >= 0; nsi--) {\n\t\t\t\t\tvar namespace = visibleNamespaces[nsi]\n\t\t\t\t\tif (namespace.namespace === node.namespaceURI) {\n\t\t\t\t\t\tif (namespace.prefix) {\n\t\t\t\t\t\t\tprefixedNodeName = namespace.prefix + ':' + nodeName\n\t\t\t\t\t\t}\n\t\t\t\t\t\tbreak\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tbuf.push('<', prefixedNodeName);\n\n\t\tfor(var i=0;i<len;i++){\n\t\t\t// add namespaces for attributes\n\t\t\tvar attr = attrs.item(i);\n\t\t\tif (attr.prefix == 'xmlns') {\n\t\t\t\tvisibleNamespaces.push({ prefix: attr.localName, namespace: attr.value });\n\t\t\t}else if(attr.nodeName == 'xmlns'){\n\t\t\t\tvisibleNamespaces.push({ prefix: '', namespace: attr.value });\n\t\t\t}\n\t\t}\n\n\t\tfor(var i=0;i<len;i++){\n\t\t\tvar attr = attrs.item(i);\n\t\t\tif (needNamespaceDefine(attr,isHTML, visibleNamespaces)) {\n\t\t\t\tvar prefix = attr.prefix||'';\n\t\t\t\tvar uri = attr.namespaceURI;\n\t\t\t\taddSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : \"xmlns\", uri);\n\t\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace:uri });\n\t\t\t}\n\t\t\tserializeToString(attr,buf,isHTML,nodeFilter,visibleNamespaces);\n\t\t}\n\n\t\t// add namespace for current node\n\t\tif (nodeName === prefixedNodeName && needNamespaceDefine(node, isHTML, visibleNamespaces)) {\n\t\t\tvar prefix = node.prefix||'';\n\t\t\tvar uri = node.namespaceURI;\n\t\t\taddSerializedAttribute(buf, prefix ? 'xmlns:' + prefix : \"xmlns\", uri);\n\t\t\tvisibleNamespaces.push({ prefix: prefix, namespace:uri });\n\t\t}\n\n\t\tif(child || isHTML && !/^(?:meta|link|img|br|hr|input)$/i.test(nodeName)){\n\t\t\tbuf.push('>');\n\t\t\t//if is cdata child node\n\t\t\tif(isHTML && /^script$/i.test(nodeName)){\n\t\t\t\twhile(child){\n\t\t\t\t\tif(child.data){\n\t\t\t\t\t\tbuf.push(child.data);\n\t\t\t\t\t}else{\n\t\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\t}\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}else\n\t\t\t{\n\t\t\t\twhile(child){\n\t\t\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\t\t\tchild = child.nextSibling;\n\t\t\t\t}\n\t\t\t}\n\t\t\tbuf.push('</',prefixedNodeName,'>');\n\t\t}else{\n\t\t\tbuf.push('/>');\n\t\t}\n\t\t// remove added visible namespaces\n\t\t//visibleNamespaces.length = startVisibleNamespaces;\n\t\treturn;\n\tcase DOCUMENT_NODE:\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tserializeToString(child, buf, isHTML, nodeFilter, visibleNamespaces.slice());\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t\treturn;\n\tcase ATTRIBUTE_NODE:\n\t\treturn addSerializedAttribute(buf, node.name, node.value);\n\tcase TEXT_NODE:\n\t\t/**\n\t\t * The ampersand character (&) and the left angle bracket (<) must not appear in their literal form,\n\t\t * except when used as markup delimiters, or within a comment, a processing instruction, or a CDATA section.\n\t\t * If they are needed elsewhere, they must be escaped using either numeric character references or the strings\n\t\t * `&amp;` and `&lt;` respectively.\n\t\t * The right angle bracket (>) may be represented using the string \" &gt; \", and must, for compatibility,\n\t\t * be escaped using either `&gt;` or a character reference when it appears in the string `]]>` in content,\n\t\t * when that string is not marking the end of a CDATA section.\n\t\t *\n\t\t * In the content of elements, character data is any string of characters\n\t\t * which does not contain the start-delimiter of any markup\n\t\t * and does not include the CDATA-section-close delimiter, `]]>`.\n\t\t *\n\t\t * @see https://www.w3.org/TR/xml/#NT-CharData\n\t\t * @see https://w3c.github.io/DOM-Parsing/#xml-serializing-a-text-node\n\t\t */\n\t\treturn buf.push(node.data\n\t\t\t.replace(/[<&>]/g,_xmlEncoder)\n\t\t);\n\tcase CDATA_SECTION_NODE:\n\t\treturn buf.push( '<![CDATA[',node.data,']]>');\n\tcase COMMENT_NODE:\n\t\treturn buf.push( \"<!--\",node.data,\"-->\");\n\tcase DOCUMENT_TYPE_NODE:\n\t\tvar pubid = node.publicId;\n\t\tvar sysid = node.systemId;\n\t\tbuf.push('<!DOCTYPE ',node.name);\n\t\tif(pubid){\n\t\t\tbuf.push(' PUBLIC ', pubid);\n\t\t\tif (sysid && sysid!='.') {\n\t\t\t\tbuf.push(' ', sysid);\n\t\t\t}\n\t\t\tbuf.push('>');\n\t\t}else if(sysid && sysid!='.'){\n\t\t\tbuf.push(' SYSTEM ', sysid, '>');\n\t\t}else{\n\t\t\tvar sub = node.internalSubset;\n\t\t\tif(sub){\n\t\t\t\tbuf.push(\" [\",sub,\"]\");\n\t\t\t}\n\t\t\tbuf.push(\">\");\n\t\t}\n\t\treturn;\n\tcase PROCESSING_INSTRUCTION_NODE:\n\t\treturn buf.push( \"<?\",node.target,\" \",node.data,\"?>\");\n\tcase ENTITY_REFERENCE_NODE:\n\t\treturn buf.push( '&',node.nodeName,';');\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\tdefault:\n\t\tbuf.push('??',node.nodeName);\n\t}\n}\nfunction importNode(doc,node,deep){\n\tvar node2;\n\tswitch (node.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tnode2 = node.cloneNode(false);\n\t\tnode2.ownerDocument = doc;\n\t\t//var attrs = node2.attributes;\n\t\t//var len = attrs.length;\n\t\t//for(var i=0;i<len;i++){\n\t\t\t//node2.setAttributeNodeNS(importNode(doc,attrs.item(i),deep));\n\t\t//}\n\tcase DOCUMENT_FRAGMENT_NODE:\n\t\tbreak;\n\tcase ATTRIBUTE_NODE:\n\t\tdeep = true;\n\t\tbreak;\n\t//case ENTITY_REFERENCE_NODE:\n\t//case PROCESSING_INSTRUCTION_NODE:\n\t////case TEXT_NODE:\n\t//case CDATA_SECTION_NODE:\n\t//case COMMENT_NODE:\n\t//\tdeep = false;\n\t//\tbreak;\n\t//case DOCUMENT_NODE:\n\t//case DOCUMENT_TYPE_NODE:\n\t//cannot be imported.\n\t//case ENTITY_NODE:\n\t//case NOTATION_NODE:\n\t//can not hit in level3\n\t//default:throw e;\n\t}\n\tif(!node2){\n\t\tnode2 = node.cloneNode(false);//false\n\t}\n\tnode2.ownerDocument = doc;\n\tnode2.parentNode = null;\n\tif(deep){\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tnode2.appendChild(importNode(doc,child,deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n//\n//var _relationMap = {firstChild:1,lastChild:1,previousSibling:1,nextSibling:1,\n//\t\t\t\t\tattributes:1,childNodes:1,parentNode:1,documentElement:1,doctype,};\nfunction cloneNode(doc,node,deep){\n\tvar node2 = new node.constructor();\n\tfor (var n in node) {\n\t\tif (Object.prototype.hasOwnProperty.call(node, n)) {\n\t\t\tvar v = node[n];\n\t\t\tif (typeof v != \"object\") {\n\t\t\t\tif (v != node2[n]) {\n\t\t\t\t\tnode2[n] = v;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tif(node.childNodes){\n\t\tnode2.childNodes = new NodeList();\n\t}\n\tnode2.ownerDocument = doc;\n\tswitch (node2.nodeType) {\n\tcase ELEMENT_NODE:\n\t\tvar attrs\t= node.attributes;\n\t\tvar attrs2\t= node2.attributes = new NamedNodeMap();\n\t\tvar len = attrs.length\n\t\tattrs2._ownerElement = node2;\n\t\tfor(var i=0;i<len;i++){\n\t\t\tnode2.setAttributeNode(cloneNode(doc,attrs.item(i),true));\n\t\t}\n\t\tbreak;;\n\tcase ATTRIBUTE_NODE:\n\t\tdeep = true;\n\t}\n\tif(deep){\n\t\tvar child = node.firstChild;\n\t\twhile(child){\n\t\t\tnode2.appendChild(cloneNode(doc,child,deep));\n\t\t\tchild = child.nextSibling;\n\t\t}\n\t}\n\treturn node2;\n}\n\nfunction __set__(object,key,value){\n\tobject[key] = value\n}\n//do dynamic\ntry{\n\tif(Object.defineProperty){\n\t\tObject.defineProperty(LiveNodeList.prototype,'length',{\n\t\t\tget:function(){\n\t\t\t\t_updateLiveList(this);\n\t\t\t\treturn this.$$length;\n\t\t\t}\n\t\t});\n\n\t\tObject.defineProperty(Node.prototype,'textContent',{\n\t\t\tget:function(){\n\t\t\t\treturn getTextContent(this);\n\t\t\t},\n\n\t\t\tset:function(data){\n\t\t\t\tswitch(this.nodeType){\n\t\t\t\tcase ELEMENT_NODE:\n\t\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\t\twhile(this.firstChild){\n\t\t\t\t\t\tthis.removeChild(this.firstChild);\n\t\t\t\t\t}\n\t\t\t\t\tif(data || String(data)){\n\t\t\t\t\t\tthis.appendChild(this.ownerDocument.createTextNode(data));\n\t\t\t\t\t}\n\t\t\t\t\tbreak;\n\n\t\t\t\tdefault:\n\t\t\t\t\tthis.data = data;\n\t\t\t\t\tthis.value = data;\n\t\t\t\t\tthis.nodeValue = data;\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\tfunction getTextContent(node){\n\t\t\tswitch(node.nodeType){\n\t\t\tcase ELEMENT_NODE:\n\t\t\tcase DOCUMENT_FRAGMENT_NODE:\n\t\t\t\tvar buf = [];\n\t\t\t\tnode = node.firstChild;\n\t\t\t\twhile(node){\n\t\t\t\t\tif(node.nodeType!==7 && node.nodeType !==8){\n\t\t\t\t\t\tbuf.push(getTextContent(node));\n\t\t\t\t\t}\n\t\t\t\t\tnode = node.nextSibling;\n\t\t\t\t}\n\t\t\t\treturn buf.join('');\n\t\t\tdefault:\n\t\t\t\treturn node.nodeValue;\n\t\t\t}\n\t\t}\n\n\t\t__set__ = function(object,key,value){\n\t\t\t//console.log(value)\n\t\t\tobject['$$'+key] = value\n\t\t}\n\t}\n}catch(e){//ie8\n}\n\n//if(typeof require == 'function'){\n\texports.DocumentType = DocumentType;\n\texports.DOMException = DOMException;\n\texports.DOMImplementation = DOMImplementation;\n\texports.Element = Element;\n\texports.Node = Node;\n\texports.NodeList = NodeList;\n\texports.XMLSerializer = XMLSerializer;\n//}\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/@xmldom/xmldom/lib/dom.js?\n}");
105
+
106
+ /***/ },
107
+
108
+ /***/ "./node_modules/@xmldom/xmldom/lib/entities.js"
109
+ /*!*****************************************************!*\
110
+ !*** ./node_modules/@xmldom/xmldom/lib/entities.js ***!
111
+ \*****************************************************/
112
+ (__unused_webpack_module, exports, __webpack_require__) {
113
+
114
+ "use strict";
115
+ eval("{\n\nvar freeze = (__webpack_require__(/*! ./conventions */ \"./node_modules/@xmldom/xmldom/lib/conventions.js\").freeze);\n\n/**\n * The entities that are predefined in every XML document.\n *\n * @see https://www.w3.org/TR/2006/REC-xml11-20060816/#sec-predefined-ent W3C XML 1.1\n * @see https://www.w3.org/TR/2008/REC-xml-20081126/#sec-predefined-ent W3C XML 1.0\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Predefined_entities_in_XML Wikipedia\n */\nexports.XML_ENTITIES = freeze({\n\tamp: '&',\n\tapos: \"'\",\n\tgt: '>',\n\tlt: '<',\n\tquot: '\"',\n});\n\n/**\n * A map of all entities that are detected in an HTML document.\n * They contain all entries from `XML_ENTITIES`.\n *\n * @see XML_ENTITIES\n * @see DOMParser.parseFromString\n * @see DOMImplementation.prototype.createHTMLDocument\n * @see https://html.spec.whatwg.org/#named-character-references WHATWG HTML(5) Spec\n * @see https://html.spec.whatwg.org/entities.json JSON\n * @see https://www.w3.org/TR/xml-entity-names/ W3C XML Entity Names\n * @see https://www.w3.org/TR/html4/sgml/entities.html W3C HTML4/SGML\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Character_entity_references_in_HTML Wikipedia (HTML)\n * @see https://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references#Entities_representing_special_characters_in_XHTML Wikpedia (XHTML)\n */\nexports.HTML_ENTITIES = freeze({\n\tAacute: '\\u00C1',\n\taacute: '\\u00E1',\n\tAbreve: '\\u0102',\n\tabreve: '\\u0103',\n\tac: '\\u223E',\n\tacd: '\\u223F',\n\tacE: '\\u223E\\u0333',\n\tAcirc: '\\u00C2',\n\tacirc: '\\u00E2',\n\tacute: '\\u00B4',\n\tAcy: '\\u0410',\n\tacy: '\\u0430',\n\tAElig: '\\u00C6',\n\taelig: '\\u00E6',\n\taf: '\\u2061',\n\tAfr: '\\uD835\\uDD04',\n\tafr: '\\uD835\\uDD1E',\n\tAgrave: '\\u00C0',\n\tagrave: '\\u00E0',\n\talefsym: '\\u2135',\n\taleph: '\\u2135',\n\tAlpha: '\\u0391',\n\talpha: '\\u03B1',\n\tAmacr: '\\u0100',\n\tamacr: '\\u0101',\n\tamalg: '\\u2A3F',\n\tAMP: '\\u0026',\n\tamp: '\\u0026',\n\tAnd: '\\u2A53',\n\tand: '\\u2227',\n\tandand: '\\u2A55',\n\tandd: '\\u2A5C',\n\tandslope: '\\u2A58',\n\tandv: '\\u2A5A',\n\tang: '\\u2220',\n\tange: '\\u29A4',\n\tangle: '\\u2220',\n\tangmsd: '\\u2221',\n\tangmsdaa: '\\u29A8',\n\tangmsdab: '\\u29A9',\n\tangmsdac: '\\u29AA',\n\tangmsdad: '\\u29AB',\n\tangmsdae: '\\u29AC',\n\tangmsdaf: '\\u29AD',\n\tangmsdag: '\\u29AE',\n\tangmsdah: '\\u29AF',\n\tangrt: '\\u221F',\n\tangrtvb: '\\u22BE',\n\tangrtvbd: '\\u299D',\n\tangsph: '\\u2222',\n\tangst: '\\u00C5',\n\tangzarr: '\\u237C',\n\tAogon: '\\u0104',\n\taogon: '\\u0105',\n\tAopf: '\\uD835\\uDD38',\n\taopf: '\\uD835\\uDD52',\n\tap: '\\u2248',\n\tapacir: '\\u2A6F',\n\tapE: '\\u2A70',\n\tape: '\\u224A',\n\tapid: '\\u224B',\n\tapos: '\\u0027',\n\tApplyFunction: '\\u2061',\n\tapprox: '\\u2248',\n\tapproxeq: '\\u224A',\n\tAring: '\\u00C5',\n\taring: '\\u00E5',\n\tAscr: '\\uD835\\uDC9C',\n\tascr: '\\uD835\\uDCB6',\n\tAssign: '\\u2254',\n\tast: '\\u002A',\n\tasymp: '\\u2248',\n\tasympeq: '\\u224D',\n\tAtilde: '\\u00C3',\n\tatilde: '\\u00E3',\n\tAuml: '\\u00C4',\n\tauml: '\\u00E4',\n\tawconint: '\\u2233',\n\tawint: '\\u2A11',\n\tbackcong: '\\u224C',\n\tbackepsilon: '\\u03F6',\n\tbackprime: '\\u2035',\n\tbacksim: '\\u223D',\n\tbacksimeq: '\\u22CD',\n\tBackslash: '\\u2216',\n\tBarv: '\\u2AE7',\n\tbarvee: '\\u22BD',\n\tBarwed: '\\u2306',\n\tbarwed: '\\u2305',\n\tbarwedge: '\\u2305',\n\tbbrk: '\\u23B5',\n\tbbrktbrk: '\\u23B6',\n\tbcong: '\\u224C',\n\tBcy: '\\u0411',\n\tbcy: '\\u0431',\n\tbdquo: '\\u201E',\n\tbecaus: '\\u2235',\n\tBecause: '\\u2235',\n\tbecause: '\\u2235',\n\tbemptyv: '\\u29B0',\n\tbepsi: '\\u03F6',\n\tbernou: '\\u212C',\n\tBernoullis: '\\u212C',\n\tBeta: '\\u0392',\n\tbeta: '\\u03B2',\n\tbeth: '\\u2136',\n\tbetween: '\\u226C',\n\tBfr: '\\uD835\\uDD05',\n\tbfr: '\\uD835\\uDD1F',\n\tbigcap: '\\u22C2',\n\tbigcirc: '\\u25EF',\n\tbigcup: '\\u22C3',\n\tbigodot: '\\u2A00',\n\tbigoplus: '\\u2A01',\n\tbigotimes: '\\u2A02',\n\tbigsqcup: '\\u2A06',\n\tbigstar: '\\u2605',\n\tbigtriangledown: '\\u25BD',\n\tbigtriangleup: '\\u25B3',\n\tbiguplus: '\\u2A04',\n\tbigvee: '\\u22C1',\n\tbigwedge: '\\u22C0',\n\tbkarow: '\\u290D',\n\tblacklozenge: '\\u29EB',\n\tblacksquare: '\\u25AA',\n\tblacktriangle: '\\u25B4',\n\tblacktriangledown: '\\u25BE',\n\tblacktriangleleft: '\\u25C2',\n\tblacktriangleright: '\\u25B8',\n\tblank: '\\u2423',\n\tblk12: '\\u2592',\n\tblk14: '\\u2591',\n\tblk34: '\\u2593',\n\tblock: '\\u2588',\n\tbne: '\\u003D\\u20E5',\n\tbnequiv: '\\u2261\\u20E5',\n\tbNot: '\\u2AED',\n\tbnot: '\\u2310',\n\tBopf: '\\uD835\\uDD39',\n\tbopf: '\\uD835\\uDD53',\n\tbot: '\\u22A5',\n\tbottom: '\\u22A5',\n\tbowtie: '\\u22C8',\n\tboxbox: '\\u29C9',\n\tboxDL: '\\u2557',\n\tboxDl: '\\u2556',\n\tboxdL: '\\u2555',\n\tboxdl: '\\u2510',\n\tboxDR: '\\u2554',\n\tboxDr: '\\u2553',\n\tboxdR: '\\u2552',\n\tboxdr: '\\u250C',\n\tboxH: '\\u2550',\n\tboxh: '\\u2500',\n\tboxHD: '\\u2566',\n\tboxHd: '\\u2564',\n\tboxhD: '\\u2565',\n\tboxhd: '\\u252C',\n\tboxHU: '\\u2569',\n\tboxHu: '\\u2567',\n\tboxhU: '\\u2568',\n\tboxhu: '\\u2534',\n\tboxminus: '\\u229F',\n\tboxplus: '\\u229E',\n\tboxtimes: '\\u22A0',\n\tboxUL: '\\u255D',\n\tboxUl: '\\u255C',\n\tboxuL: '\\u255B',\n\tboxul: '\\u2518',\n\tboxUR: '\\u255A',\n\tboxUr: '\\u2559',\n\tboxuR: '\\u2558',\n\tboxur: '\\u2514',\n\tboxV: '\\u2551',\n\tboxv: '\\u2502',\n\tboxVH: '\\u256C',\n\tboxVh: '\\u256B',\n\tboxvH: '\\u256A',\n\tboxvh: '\\u253C',\n\tboxVL: '\\u2563',\n\tboxVl: '\\u2562',\n\tboxvL: '\\u2561',\n\tboxvl: '\\u2524',\n\tboxVR: '\\u2560',\n\tboxVr: '\\u255F',\n\tboxvR: '\\u255E',\n\tboxvr: '\\u251C',\n\tbprime: '\\u2035',\n\tBreve: '\\u02D8',\n\tbreve: '\\u02D8',\n\tbrvbar: '\\u00A6',\n\tBscr: '\\u212C',\n\tbscr: '\\uD835\\uDCB7',\n\tbsemi: '\\u204F',\n\tbsim: '\\u223D',\n\tbsime: '\\u22CD',\n\tbsol: '\\u005C',\n\tbsolb: '\\u29C5',\n\tbsolhsub: '\\u27C8',\n\tbull: '\\u2022',\n\tbullet: '\\u2022',\n\tbump: '\\u224E',\n\tbumpE: '\\u2AAE',\n\tbumpe: '\\u224F',\n\tBumpeq: '\\u224E',\n\tbumpeq: '\\u224F',\n\tCacute: '\\u0106',\n\tcacute: '\\u0107',\n\tCap: '\\u22D2',\n\tcap: '\\u2229',\n\tcapand: '\\u2A44',\n\tcapbrcup: '\\u2A49',\n\tcapcap: '\\u2A4B',\n\tcapcup: '\\u2A47',\n\tcapdot: '\\u2A40',\n\tCapitalDifferentialD: '\\u2145',\n\tcaps: '\\u2229\\uFE00',\n\tcaret: '\\u2041',\n\tcaron: '\\u02C7',\n\tCayleys: '\\u212D',\n\tccaps: '\\u2A4D',\n\tCcaron: '\\u010C',\n\tccaron: '\\u010D',\n\tCcedil: '\\u00C7',\n\tccedil: '\\u00E7',\n\tCcirc: '\\u0108',\n\tccirc: '\\u0109',\n\tCconint: '\\u2230',\n\tccups: '\\u2A4C',\n\tccupssm: '\\u2A50',\n\tCdot: '\\u010A',\n\tcdot: '\\u010B',\n\tcedil: '\\u00B8',\n\tCedilla: '\\u00B8',\n\tcemptyv: '\\u29B2',\n\tcent: '\\u00A2',\n\tCenterDot: '\\u00B7',\n\tcenterdot: '\\u00B7',\n\tCfr: '\\u212D',\n\tcfr: '\\uD835\\uDD20',\n\tCHcy: '\\u0427',\n\tchcy: '\\u0447',\n\tcheck: '\\u2713',\n\tcheckmark: '\\u2713',\n\tChi: '\\u03A7',\n\tchi: '\\u03C7',\n\tcir: '\\u25CB',\n\tcirc: '\\u02C6',\n\tcirceq: '\\u2257',\n\tcirclearrowleft: '\\u21BA',\n\tcirclearrowright: '\\u21BB',\n\tcircledast: '\\u229B',\n\tcircledcirc: '\\u229A',\n\tcircleddash: '\\u229D',\n\tCircleDot: '\\u2299',\n\tcircledR: '\\u00AE',\n\tcircledS: '\\u24C8',\n\tCircleMinus: '\\u2296',\n\tCirclePlus: '\\u2295',\n\tCircleTimes: '\\u2297',\n\tcirE: '\\u29C3',\n\tcire: '\\u2257',\n\tcirfnint: '\\u2A10',\n\tcirmid: '\\u2AEF',\n\tcirscir: '\\u29C2',\n\tClockwiseContourIntegral: '\\u2232',\n\tCloseCurlyDoubleQuote: '\\u201D',\n\tCloseCurlyQuote: '\\u2019',\n\tclubs: '\\u2663',\n\tclubsuit: '\\u2663',\n\tColon: '\\u2237',\n\tcolon: '\\u003A',\n\tColone: '\\u2A74',\n\tcolone: '\\u2254',\n\tcoloneq: '\\u2254',\n\tcomma: '\\u002C',\n\tcommat: '\\u0040',\n\tcomp: '\\u2201',\n\tcompfn: '\\u2218',\n\tcomplement: '\\u2201',\n\tcomplexes: '\\u2102',\n\tcong: '\\u2245',\n\tcongdot: '\\u2A6D',\n\tCongruent: '\\u2261',\n\tConint: '\\u222F',\n\tconint: '\\u222E',\n\tContourIntegral: '\\u222E',\n\tCopf: '\\u2102',\n\tcopf: '\\uD835\\uDD54',\n\tcoprod: '\\u2210',\n\tCoproduct: '\\u2210',\n\tCOPY: '\\u00A9',\n\tcopy: '\\u00A9',\n\tcopysr: '\\u2117',\n\tCounterClockwiseContourIntegral: '\\u2233',\n\tcrarr: '\\u21B5',\n\tCross: '\\u2A2F',\n\tcross: '\\u2717',\n\tCscr: '\\uD835\\uDC9E',\n\tcscr: '\\uD835\\uDCB8',\n\tcsub: '\\u2ACF',\n\tcsube: '\\u2AD1',\n\tcsup: '\\u2AD0',\n\tcsupe: '\\u2AD2',\n\tctdot: '\\u22EF',\n\tcudarrl: '\\u2938',\n\tcudarrr: '\\u2935',\n\tcuepr: '\\u22DE',\n\tcuesc: '\\u22DF',\n\tcularr: '\\u21B6',\n\tcularrp: '\\u293D',\n\tCup: '\\u22D3',\n\tcup: '\\u222A',\n\tcupbrcap: '\\u2A48',\n\tCupCap: '\\u224D',\n\tcupcap: '\\u2A46',\n\tcupcup: '\\u2A4A',\n\tcupdot: '\\u228D',\n\tcupor: '\\u2A45',\n\tcups: '\\u222A\\uFE00',\n\tcurarr: '\\u21B7',\n\tcurarrm: '\\u293C',\n\tcurlyeqprec: '\\u22DE',\n\tcurlyeqsucc: '\\u22DF',\n\tcurlyvee: '\\u22CE',\n\tcurlywedge: '\\u22CF',\n\tcurren: '\\u00A4',\n\tcurvearrowleft: '\\u21B6',\n\tcurvearrowright: '\\u21B7',\n\tcuvee: '\\u22CE',\n\tcuwed: '\\u22CF',\n\tcwconint: '\\u2232',\n\tcwint: '\\u2231',\n\tcylcty: '\\u232D',\n\tDagger: '\\u2021',\n\tdagger: '\\u2020',\n\tdaleth: '\\u2138',\n\tDarr: '\\u21A1',\n\tdArr: '\\u21D3',\n\tdarr: '\\u2193',\n\tdash: '\\u2010',\n\tDashv: '\\u2AE4',\n\tdashv: '\\u22A3',\n\tdbkarow: '\\u290F',\n\tdblac: '\\u02DD',\n\tDcaron: '\\u010E',\n\tdcaron: '\\u010F',\n\tDcy: '\\u0414',\n\tdcy: '\\u0434',\n\tDD: '\\u2145',\n\tdd: '\\u2146',\n\tddagger: '\\u2021',\n\tddarr: '\\u21CA',\n\tDDotrahd: '\\u2911',\n\tddotseq: '\\u2A77',\n\tdeg: '\\u00B0',\n\tDel: '\\u2207',\n\tDelta: '\\u0394',\n\tdelta: '\\u03B4',\n\tdemptyv: '\\u29B1',\n\tdfisht: '\\u297F',\n\tDfr: '\\uD835\\uDD07',\n\tdfr: '\\uD835\\uDD21',\n\tdHar: '\\u2965',\n\tdharl: '\\u21C3',\n\tdharr: '\\u21C2',\n\tDiacriticalAcute: '\\u00B4',\n\tDiacriticalDot: '\\u02D9',\n\tDiacriticalDoubleAcute: '\\u02DD',\n\tDiacriticalGrave: '\\u0060',\n\tDiacriticalTilde: '\\u02DC',\n\tdiam: '\\u22C4',\n\tDiamond: '\\u22C4',\n\tdiamond: '\\u22C4',\n\tdiamondsuit: '\\u2666',\n\tdiams: '\\u2666',\n\tdie: '\\u00A8',\n\tDifferentialD: '\\u2146',\n\tdigamma: '\\u03DD',\n\tdisin: '\\u22F2',\n\tdiv: '\\u00F7',\n\tdivide: '\\u00F7',\n\tdivideontimes: '\\u22C7',\n\tdivonx: '\\u22C7',\n\tDJcy: '\\u0402',\n\tdjcy: '\\u0452',\n\tdlcorn: '\\u231E',\n\tdlcrop: '\\u230D',\n\tdollar: '\\u0024',\n\tDopf: '\\uD835\\uDD3B',\n\tdopf: '\\uD835\\uDD55',\n\tDot: '\\u00A8',\n\tdot: '\\u02D9',\n\tDotDot: '\\u20DC',\n\tdoteq: '\\u2250',\n\tdoteqdot: '\\u2251',\n\tDotEqual: '\\u2250',\n\tdotminus: '\\u2238',\n\tdotplus: '\\u2214',\n\tdotsquare: '\\u22A1',\n\tdoublebarwedge: '\\u2306',\n\tDoubleContourIntegral: '\\u222F',\n\tDoubleDot: '\\u00A8',\n\tDoubleDownArrow: '\\u21D3',\n\tDoubleLeftArrow: '\\u21D0',\n\tDoubleLeftRightArrow: '\\u21D4',\n\tDoubleLeftTee: '\\u2AE4',\n\tDoubleLongLeftArrow: '\\u27F8',\n\tDoubleLongLeftRightArrow: '\\u27FA',\n\tDoubleLongRightArrow: '\\u27F9',\n\tDoubleRightArrow: '\\u21D2',\n\tDoubleRightTee: '\\u22A8',\n\tDoubleUpArrow: '\\u21D1',\n\tDoubleUpDownArrow: '\\u21D5',\n\tDoubleVerticalBar: '\\u2225',\n\tDownArrow: '\\u2193',\n\tDownarrow: '\\u21D3',\n\tdownarrow: '\\u2193',\n\tDownArrowBar: '\\u2913',\n\tDownArrowUpArrow: '\\u21F5',\n\tDownBreve: '\\u0311',\n\tdowndownarrows: '\\u21CA',\n\tdownharpoonleft: '\\u21C3',\n\tdownharpoonright: '\\u21C2',\n\tDownLeftRightVector: '\\u2950',\n\tDownLeftTeeVector: '\\u295E',\n\tDownLeftVector: '\\u21BD',\n\tDownLeftVectorBar: '\\u2956',\n\tDownRightTeeVector: '\\u295F',\n\tDownRightVector: '\\u21C1',\n\tDownRightVectorBar: '\\u2957',\n\tDownTee: '\\u22A4',\n\tDownTeeArrow: '\\u21A7',\n\tdrbkarow: '\\u2910',\n\tdrcorn: '\\u231F',\n\tdrcrop: '\\u230C',\n\tDscr: '\\uD835\\uDC9F',\n\tdscr: '\\uD835\\uDCB9',\n\tDScy: '\\u0405',\n\tdscy: '\\u0455',\n\tdsol: '\\u29F6',\n\tDstrok: '\\u0110',\n\tdstrok: '\\u0111',\n\tdtdot: '\\u22F1',\n\tdtri: '\\u25BF',\n\tdtrif: '\\u25BE',\n\tduarr: '\\u21F5',\n\tduhar: '\\u296F',\n\tdwangle: '\\u29A6',\n\tDZcy: '\\u040F',\n\tdzcy: '\\u045F',\n\tdzigrarr: '\\u27FF',\n\tEacute: '\\u00C9',\n\teacute: '\\u00E9',\n\teaster: '\\u2A6E',\n\tEcaron: '\\u011A',\n\tecaron: '\\u011B',\n\tecir: '\\u2256',\n\tEcirc: '\\u00CA',\n\tecirc: '\\u00EA',\n\tecolon: '\\u2255',\n\tEcy: '\\u042D',\n\tecy: '\\u044D',\n\teDDot: '\\u2A77',\n\tEdot: '\\u0116',\n\teDot: '\\u2251',\n\tedot: '\\u0117',\n\tee: '\\u2147',\n\tefDot: '\\u2252',\n\tEfr: '\\uD835\\uDD08',\n\tefr: '\\uD835\\uDD22',\n\teg: '\\u2A9A',\n\tEgrave: '\\u00C8',\n\tegrave: '\\u00E8',\n\tegs: '\\u2A96',\n\tegsdot: '\\u2A98',\n\tel: '\\u2A99',\n\tElement: '\\u2208',\n\telinters: '\\u23E7',\n\tell: '\\u2113',\n\tels: '\\u2A95',\n\telsdot: '\\u2A97',\n\tEmacr: '\\u0112',\n\temacr: '\\u0113',\n\tempty: '\\u2205',\n\temptyset: '\\u2205',\n\tEmptySmallSquare: '\\u25FB',\n\temptyv: '\\u2205',\n\tEmptyVerySmallSquare: '\\u25AB',\n\temsp: '\\u2003',\n\temsp13: '\\u2004',\n\temsp14: '\\u2005',\n\tENG: '\\u014A',\n\teng: '\\u014B',\n\tensp: '\\u2002',\n\tEogon: '\\u0118',\n\teogon: '\\u0119',\n\tEopf: '\\uD835\\uDD3C',\n\teopf: '\\uD835\\uDD56',\n\tepar: '\\u22D5',\n\teparsl: '\\u29E3',\n\teplus: '\\u2A71',\n\tepsi: '\\u03B5',\n\tEpsilon: '\\u0395',\n\tepsilon: '\\u03B5',\n\tepsiv: '\\u03F5',\n\teqcirc: '\\u2256',\n\teqcolon: '\\u2255',\n\teqsim: '\\u2242',\n\teqslantgtr: '\\u2A96',\n\teqslantless: '\\u2A95',\n\tEqual: '\\u2A75',\n\tequals: '\\u003D',\n\tEqualTilde: '\\u2242',\n\tequest: '\\u225F',\n\tEquilibrium: '\\u21CC',\n\tequiv: '\\u2261',\n\tequivDD: '\\u2A78',\n\teqvparsl: '\\u29E5',\n\terarr: '\\u2971',\n\terDot: '\\u2253',\n\tEscr: '\\u2130',\n\tescr: '\\u212F',\n\tesdot: '\\u2250',\n\tEsim: '\\u2A73',\n\tesim: '\\u2242',\n\tEta: '\\u0397',\n\teta: '\\u03B7',\n\tETH: '\\u00D0',\n\teth: '\\u00F0',\n\tEuml: '\\u00CB',\n\teuml: '\\u00EB',\n\teuro: '\\u20AC',\n\texcl: '\\u0021',\n\texist: '\\u2203',\n\tExists: '\\u2203',\n\texpectation: '\\u2130',\n\tExponentialE: '\\u2147',\n\texponentiale: '\\u2147',\n\tfallingdotseq: '\\u2252',\n\tFcy: '\\u0424',\n\tfcy: '\\u0444',\n\tfemale: '\\u2640',\n\tffilig: '\\uFB03',\n\tfflig: '\\uFB00',\n\tffllig: '\\uFB04',\n\tFfr: '\\uD835\\uDD09',\n\tffr: '\\uD835\\uDD23',\n\tfilig: '\\uFB01',\n\tFilledSmallSquare: '\\u25FC',\n\tFilledVerySmallSquare: '\\u25AA',\n\tfjlig: '\\u0066\\u006A',\n\tflat: '\\u266D',\n\tfllig: '\\uFB02',\n\tfltns: '\\u25B1',\n\tfnof: '\\u0192',\n\tFopf: '\\uD835\\uDD3D',\n\tfopf: '\\uD835\\uDD57',\n\tForAll: '\\u2200',\n\tforall: '\\u2200',\n\tfork: '\\u22D4',\n\tforkv: '\\u2AD9',\n\tFouriertrf: '\\u2131',\n\tfpartint: '\\u2A0D',\n\tfrac12: '\\u00BD',\n\tfrac13: '\\u2153',\n\tfrac14: '\\u00BC',\n\tfrac15: '\\u2155',\n\tfrac16: '\\u2159',\n\tfrac18: '\\u215B',\n\tfrac23: '\\u2154',\n\tfrac25: '\\u2156',\n\tfrac34: '\\u00BE',\n\tfrac35: '\\u2157',\n\tfrac38: '\\u215C',\n\tfrac45: '\\u2158',\n\tfrac56: '\\u215A',\n\tfrac58: '\\u215D',\n\tfrac78: '\\u215E',\n\tfrasl: '\\u2044',\n\tfrown: '\\u2322',\n\tFscr: '\\u2131',\n\tfscr: '\\uD835\\uDCBB',\n\tgacute: '\\u01F5',\n\tGamma: '\\u0393',\n\tgamma: '\\u03B3',\n\tGammad: '\\u03DC',\n\tgammad: '\\u03DD',\n\tgap: '\\u2A86',\n\tGbreve: '\\u011E',\n\tgbreve: '\\u011F',\n\tGcedil: '\\u0122',\n\tGcirc: '\\u011C',\n\tgcirc: '\\u011D',\n\tGcy: '\\u0413',\n\tgcy: '\\u0433',\n\tGdot: '\\u0120',\n\tgdot: '\\u0121',\n\tgE: '\\u2267',\n\tge: '\\u2265',\n\tgEl: '\\u2A8C',\n\tgel: '\\u22DB',\n\tgeq: '\\u2265',\n\tgeqq: '\\u2267',\n\tgeqslant: '\\u2A7E',\n\tges: '\\u2A7E',\n\tgescc: '\\u2AA9',\n\tgesdot: '\\u2A80',\n\tgesdoto: '\\u2A82',\n\tgesdotol: '\\u2A84',\n\tgesl: '\\u22DB\\uFE00',\n\tgesles: '\\u2A94',\n\tGfr: '\\uD835\\uDD0A',\n\tgfr: '\\uD835\\uDD24',\n\tGg: '\\u22D9',\n\tgg: '\\u226B',\n\tggg: '\\u22D9',\n\tgimel: '\\u2137',\n\tGJcy: '\\u0403',\n\tgjcy: '\\u0453',\n\tgl: '\\u2277',\n\tgla: '\\u2AA5',\n\tglE: '\\u2A92',\n\tglj: '\\u2AA4',\n\tgnap: '\\u2A8A',\n\tgnapprox: '\\u2A8A',\n\tgnE: '\\u2269',\n\tgne: '\\u2A88',\n\tgneq: '\\u2A88',\n\tgneqq: '\\u2269',\n\tgnsim: '\\u22E7',\n\tGopf: '\\uD835\\uDD3E',\n\tgopf: '\\uD835\\uDD58',\n\tgrave: '\\u0060',\n\tGreaterEqual: '\\u2265',\n\tGreaterEqualLess: '\\u22DB',\n\tGreaterFullEqual: '\\u2267',\n\tGreaterGreater: '\\u2AA2',\n\tGreaterLess: '\\u2277',\n\tGreaterSlantEqual: '\\u2A7E',\n\tGreaterTilde: '\\u2273',\n\tGscr: '\\uD835\\uDCA2',\n\tgscr: '\\u210A',\n\tgsim: '\\u2273',\n\tgsime: '\\u2A8E',\n\tgsiml: '\\u2A90',\n\tGt: '\\u226B',\n\tGT: '\\u003E',\n\tgt: '\\u003E',\n\tgtcc: '\\u2AA7',\n\tgtcir: '\\u2A7A',\n\tgtdot: '\\u22D7',\n\tgtlPar: '\\u2995',\n\tgtquest: '\\u2A7C',\n\tgtrapprox: '\\u2A86',\n\tgtrarr: '\\u2978',\n\tgtrdot: '\\u22D7',\n\tgtreqless: '\\u22DB',\n\tgtreqqless: '\\u2A8C',\n\tgtrless: '\\u2277',\n\tgtrsim: '\\u2273',\n\tgvertneqq: '\\u2269\\uFE00',\n\tgvnE: '\\u2269\\uFE00',\n\tHacek: '\\u02C7',\n\thairsp: '\\u200A',\n\thalf: '\\u00BD',\n\thamilt: '\\u210B',\n\tHARDcy: '\\u042A',\n\thardcy: '\\u044A',\n\thArr: '\\u21D4',\n\tharr: '\\u2194',\n\tharrcir: '\\u2948',\n\tharrw: '\\u21AD',\n\tHat: '\\u005E',\n\thbar: '\\u210F',\n\tHcirc: '\\u0124',\n\thcirc: '\\u0125',\n\thearts: '\\u2665',\n\theartsuit: '\\u2665',\n\thellip: '\\u2026',\n\thercon: '\\u22B9',\n\tHfr: '\\u210C',\n\thfr: '\\uD835\\uDD25',\n\tHilbertSpace: '\\u210B',\n\thksearow: '\\u2925',\n\thkswarow: '\\u2926',\n\thoarr: '\\u21FF',\n\thomtht: '\\u223B',\n\thookleftarrow: '\\u21A9',\n\thookrightarrow: '\\u21AA',\n\tHopf: '\\u210D',\n\thopf: '\\uD835\\uDD59',\n\thorbar: '\\u2015',\n\tHorizontalLine: '\\u2500',\n\tHscr: '\\u210B',\n\thscr: '\\uD835\\uDCBD',\n\thslash: '\\u210F',\n\tHstrok: '\\u0126',\n\thstrok: '\\u0127',\n\tHumpDownHump: '\\u224E',\n\tHumpEqual: '\\u224F',\n\thybull: '\\u2043',\n\thyphen: '\\u2010',\n\tIacute: '\\u00CD',\n\tiacute: '\\u00ED',\n\tic: '\\u2063',\n\tIcirc: '\\u00CE',\n\ticirc: '\\u00EE',\n\tIcy: '\\u0418',\n\ticy: '\\u0438',\n\tIdot: '\\u0130',\n\tIEcy: '\\u0415',\n\tiecy: '\\u0435',\n\tiexcl: '\\u00A1',\n\tiff: '\\u21D4',\n\tIfr: '\\u2111',\n\tifr: '\\uD835\\uDD26',\n\tIgrave: '\\u00CC',\n\tigrave: '\\u00EC',\n\tii: '\\u2148',\n\tiiiint: '\\u2A0C',\n\tiiint: '\\u222D',\n\tiinfin: '\\u29DC',\n\tiiota: '\\u2129',\n\tIJlig: '\\u0132',\n\tijlig: '\\u0133',\n\tIm: '\\u2111',\n\tImacr: '\\u012A',\n\timacr: '\\u012B',\n\timage: '\\u2111',\n\tImaginaryI: '\\u2148',\n\timagline: '\\u2110',\n\timagpart: '\\u2111',\n\timath: '\\u0131',\n\timof: '\\u22B7',\n\timped: '\\u01B5',\n\tImplies: '\\u21D2',\n\tin: '\\u2208',\n\tincare: '\\u2105',\n\tinfin: '\\u221E',\n\tinfintie: '\\u29DD',\n\tinodot: '\\u0131',\n\tInt: '\\u222C',\n\tint: '\\u222B',\n\tintcal: '\\u22BA',\n\tintegers: '\\u2124',\n\tIntegral: '\\u222B',\n\tintercal: '\\u22BA',\n\tIntersection: '\\u22C2',\n\tintlarhk: '\\u2A17',\n\tintprod: '\\u2A3C',\n\tInvisibleComma: '\\u2063',\n\tInvisibleTimes: '\\u2062',\n\tIOcy: '\\u0401',\n\tiocy: '\\u0451',\n\tIogon: '\\u012E',\n\tiogon: '\\u012F',\n\tIopf: '\\uD835\\uDD40',\n\tiopf: '\\uD835\\uDD5A',\n\tIota: '\\u0399',\n\tiota: '\\u03B9',\n\tiprod: '\\u2A3C',\n\tiquest: '\\u00BF',\n\tIscr: '\\u2110',\n\tiscr: '\\uD835\\uDCBE',\n\tisin: '\\u2208',\n\tisindot: '\\u22F5',\n\tisinE: '\\u22F9',\n\tisins: '\\u22F4',\n\tisinsv: '\\u22F3',\n\tisinv: '\\u2208',\n\tit: '\\u2062',\n\tItilde: '\\u0128',\n\titilde: '\\u0129',\n\tIukcy: '\\u0406',\n\tiukcy: '\\u0456',\n\tIuml: '\\u00CF',\n\tiuml: '\\u00EF',\n\tJcirc: '\\u0134',\n\tjcirc: '\\u0135',\n\tJcy: '\\u0419',\n\tjcy: '\\u0439',\n\tJfr: '\\uD835\\uDD0D',\n\tjfr: '\\uD835\\uDD27',\n\tjmath: '\\u0237',\n\tJopf: '\\uD835\\uDD41',\n\tjopf: '\\uD835\\uDD5B',\n\tJscr: '\\uD835\\uDCA5',\n\tjscr: '\\uD835\\uDCBF',\n\tJsercy: '\\u0408',\n\tjsercy: '\\u0458',\n\tJukcy: '\\u0404',\n\tjukcy: '\\u0454',\n\tKappa: '\\u039A',\n\tkappa: '\\u03BA',\n\tkappav: '\\u03F0',\n\tKcedil: '\\u0136',\n\tkcedil: '\\u0137',\n\tKcy: '\\u041A',\n\tkcy: '\\u043A',\n\tKfr: '\\uD835\\uDD0E',\n\tkfr: '\\uD835\\uDD28',\n\tkgreen: '\\u0138',\n\tKHcy: '\\u0425',\n\tkhcy: '\\u0445',\n\tKJcy: '\\u040C',\n\tkjcy: '\\u045C',\n\tKopf: '\\uD835\\uDD42',\n\tkopf: '\\uD835\\uDD5C',\n\tKscr: '\\uD835\\uDCA6',\n\tkscr: '\\uD835\\uDCC0',\n\tlAarr: '\\u21DA',\n\tLacute: '\\u0139',\n\tlacute: '\\u013A',\n\tlaemptyv: '\\u29B4',\n\tlagran: '\\u2112',\n\tLambda: '\\u039B',\n\tlambda: '\\u03BB',\n\tLang: '\\u27EA',\n\tlang: '\\u27E8',\n\tlangd: '\\u2991',\n\tlangle: '\\u27E8',\n\tlap: '\\u2A85',\n\tLaplacetrf: '\\u2112',\n\tlaquo: '\\u00AB',\n\tLarr: '\\u219E',\n\tlArr: '\\u21D0',\n\tlarr: '\\u2190',\n\tlarrb: '\\u21E4',\n\tlarrbfs: '\\u291F',\n\tlarrfs: '\\u291D',\n\tlarrhk: '\\u21A9',\n\tlarrlp: '\\u21AB',\n\tlarrpl: '\\u2939',\n\tlarrsim: '\\u2973',\n\tlarrtl: '\\u21A2',\n\tlat: '\\u2AAB',\n\tlAtail: '\\u291B',\n\tlatail: '\\u2919',\n\tlate: '\\u2AAD',\n\tlates: '\\u2AAD\\uFE00',\n\tlBarr: '\\u290E',\n\tlbarr: '\\u290C',\n\tlbbrk: '\\u2772',\n\tlbrace: '\\u007B',\n\tlbrack: '\\u005B',\n\tlbrke: '\\u298B',\n\tlbrksld: '\\u298F',\n\tlbrkslu: '\\u298D',\n\tLcaron: '\\u013D',\n\tlcaron: '\\u013E',\n\tLcedil: '\\u013B',\n\tlcedil: '\\u013C',\n\tlceil: '\\u2308',\n\tlcub: '\\u007B',\n\tLcy: '\\u041B',\n\tlcy: '\\u043B',\n\tldca: '\\u2936',\n\tldquo: '\\u201C',\n\tldquor: '\\u201E',\n\tldrdhar: '\\u2967',\n\tldrushar: '\\u294B',\n\tldsh: '\\u21B2',\n\tlE: '\\u2266',\n\tle: '\\u2264',\n\tLeftAngleBracket: '\\u27E8',\n\tLeftArrow: '\\u2190',\n\tLeftarrow: '\\u21D0',\n\tleftarrow: '\\u2190',\n\tLeftArrowBar: '\\u21E4',\n\tLeftArrowRightArrow: '\\u21C6',\n\tleftarrowtail: '\\u21A2',\n\tLeftCeiling: '\\u2308',\n\tLeftDoubleBracket: '\\u27E6',\n\tLeftDownTeeVector: '\\u2961',\n\tLeftDownVector: '\\u21C3',\n\tLeftDownVectorBar: '\\u2959',\n\tLeftFloor: '\\u230A',\n\tleftharpoondown: '\\u21BD',\n\tleftharpoonup: '\\u21BC',\n\tleftleftarrows: '\\u21C7',\n\tLeftRightArrow: '\\u2194',\n\tLeftrightarrow: '\\u21D4',\n\tleftrightarrow: '\\u2194',\n\tleftrightarrows: '\\u21C6',\n\tleftrightharpoons: '\\u21CB',\n\tleftrightsquigarrow: '\\u21AD',\n\tLeftRightVector: '\\u294E',\n\tLeftTee: '\\u22A3',\n\tLeftTeeArrow: '\\u21A4',\n\tLeftTeeVector: '\\u295A',\n\tleftthreetimes: '\\u22CB',\n\tLeftTriangle: '\\u22B2',\n\tLeftTriangleBar: '\\u29CF',\n\tLeftTriangleEqual: '\\u22B4',\n\tLeftUpDownVector: '\\u2951',\n\tLeftUpTeeVector: '\\u2960',\n\tLeftUpVector: '\\u21BF',\n\tLeftUpVectorBar: '\\u2958',\n\tLeftVector: '\\u21BC',\n\tLeftVectorBar: '\\u2952',\n\tlEg: '\\u2A8B',\n\tleg: '\\u22DA',\n\tleq: '\\u2264',\n\tleqq: '\\u2266',\n\tleqslant: '\\u2A7D',\n\tles: '\\u2A7D',\n\tlescc: '\\u2AA8',\n\tlesdot: '\\u2A7F',\n\tlesdoto: '\\u2A81',\n\tlesdotor: '\\u2A83',\n\tlesg: '\\u22DA\\uFE00',\n\tlesges: '\\u2A93',\n\tlessapprox: '\\u2A85',\n\tlessdot: '\\u22D6',\n\tlesseqgtr: '\\u22DA',\n\tlesseqqgtr: '\\u2A8B',\n\tLessEqualGreater: '\\u22DA',\n\tLessFullEqual: '\\u2266',\n\tLessGreater: '\\u2276',\n\tlessgtr: '\\u2276',\n\tLessLess: '\\u2AA1',\n\tlesssim: '\\u2272',\n\tLessSlantEqual: '\\u2A7D',\n\tLessTilde: '\\u2272',\n\tlfisht: '\\u297C',\n\tlfloor: '\\u230A',\n\tLfr: '\\uD835\\uDD0F',\n\tlfr: '\\uD835\\uDD29',\n\tlg: '\\u2276',\n\tlgE: '\\u2A91',\n\tlHar: '\\u2962',\n\tlhard: '\\u21BD',\n\tlharu: '\\u21BC',\n\tlharul: '\\u296A',\n\tlhblk: '\\u2584',\n\tLJcy: '\\u0409',\n\tljcy: '\\u0459',\n\tLl: '\\u22D8',\n\tll: '\\u226A',\n\tllarr: '\\u21C7',\n\tllcorner: '\\u231E',\n\tLleftarrow: '\\u21DA',\n\tllhard: '\\u296B',\n\tlltri: '\\u25FA',\n\tLmidot: '\\u013F',\n\tlmidot: '\\u0140',\n\tlmoust: '\\u23B0',\n\tlmoustache: '\\u23B0',\n\tlnap: '\\u2A89',\n\tlnapprox: '\\u2A89',\n\tlnE: '\\u2268',\n\tlne: '\\u2A87',\n\tlneq: '\\u2A87',\n\tlneqq: '\\u2268',\n\tlnsim: '\\u22E6',\n\tloang: '\\u27EC',\n\tloarr: '\\u21FD',\n\tlobrk: '\\u27E6',\n\tLongLeftArrow: '\\u27F5',\n\tLongleftarrow: '\\u27F8',\n\tlongleftarrow: '\\u27F5',\n\tLongLeftRightArrow: '\\u27F7',\n\tLongleftrightarrow: '\\u27FA',\n\tlongleftrightarrow: '\\u27F7',\n\tlongmapsto: '\\u27FC',\n\tLongRightArrow: '\\u27F6',\n\tLongrightarrow: '\\u27F9',\n\tlongrightarrow: '\\u27F6',\n\tlooparrowleft: '\\u21AB',\n\tlooparrowright: '\\u21AC',\n\tlopar: '\\u2985',\n\tLopf: '\\uD835\\uDD43',\n\tlopf: '\\uD835\\uDD5D',\n\tloplus: '\\u2A2D',\n\tlotimes: '\\u2A34',\n\tlowast: '\\u2217',\n\tlowbar: '\\u005F',\n\tLowerLeftArrow: '\\u2199',\n\tLowerRightArrow: '\\u2198',\n\tloz: '\\u25CA',\n\tlozenge: '\\u25CA',\n\tlozf: '\\u29EB',\n\tlpar: '\\u0028',\n\tlparlt: '\\u2993',\n\tlrarr: '\\u21C6',\n\tlrcorner: '\\u231F',\n\tlrhar: '\\u21CB',\n\tlrhard: '\\u296D',\n\tlrm: '\\u200E',\n\tlrtri: '\\u22BF',\n\tlsaquo: '\\u2039',\n\tLscr: '\\u2112',\n\tlscr: '\\uD835\\uDCC1',\n\tLsh: '\\u21B0',\n\tlsh: '\\u21B0',\n\tlsim: '\\u2272',\n\tlsime: '\\u2A8D',\n\tlsimg: '\\u2A8F',\n\tlsqb: '\\u005B',\n\tlsquo: '\\u2018',\n\tlsquor: '\\u201A',\n\tLstrok: '\\u0141',\n\tlstrok: '\\u0142',\n\tLt: '\\u226A',\n\tLT: '\\u003C',\n\tlt: '\\u003C',\n\tltcc: '\\u2AA6',\n\tltcir: '\\u2A79',\n\tltdot: '\\u22D6',\n\tlthree: '\\u22CB',\n\tltimes: '\\u22C9',\n\tltlarr: '\\u2976',\n\tltquest: '\\u2A7B',\n\tltri: '\\u25C3',\n\tltrie: '\\u22B4',\n\tltrif: '\\u25C2',\n\tltrPar: '\\u2996',\n\tlurdshar: '\\u294A',\n\tluruhar: '\\u2966',\n\tlvertneqq: '\\u2268\\uFE00',\n\tlvnE: '\\u2268\\uFE00',\n\tmacr: '\\u00AF',\n\tmale: '\\u2642',\n\tmalt: '\\u2720',\n\tmaltese: '\\u2720',\n\tMap: '\\u2905',\n\tmap: '\\u21A6',\n\tmapsto: '\\u21A6',\n\tmapstodown: '\\u21A7',\n\tmapstoleft: '\\u21A4',\n\tmapstoup: '\\u21A5',\n\tmarker: '\\u25AE',\n\tmcomma: '\\u2A29',\n\tMcy: '\\u041C',\n\tmcy: '\\u043C',\n\tmdash: '\\u2014',\n\tmDDot: '\\u223A',\n\tmeasuredangle: '\\u2221',\n\tMediumSpace: '\\u205F',\n\tMellintrf: '\\u2133',\n\tMfr: '\\uD835\\uDD10',\n\tmfr: '\\uD835\\uDD2A',\n\tmho: '\\u2127',\n\tmicro: '\\u00B5',\n\tmid: '\\u2223',\n\tmidast: '\\u002A',\n\tmidcir: '\\u2AF0',\n\tmiddot: '\\u00B7',\n\tminus: '\\u2212',\n\tminusb: '\\u229F',\n\tminusd: '\\u2238',\n\tminusdu: '\\u2A2A',\n\tMinusPlus: '\\u2213',\n\tmlcp: '\\u2ADB',\n\tmldr: '\\u2026',\n\tmnplus: '\\u2213',\n\tmodels: '\\u22A7',\n\tMopf: '\\uD835\\uDD44',\n\tmopf: '\\uD835\\uDD5E',\n\tmp: '\\u2213',\n\tMscr: '\\u2133',\n\tmscr: '\\uD835\\uDCC2',\n\tmstpos: '\\u223E',\n\tMu: '\\u039C',\n\tmu: '\\u03BC',\n\tmultimap: '\\u22B8',\n\tmumap: '\\u22B8',\n\tnabla: '\\u2207',\n\tNacute: '\\u0143',\n\tnacute: '\\u0144',\n\tnang: '\\u2220\\u20D2',\n\tnap: '\\u2249',\n\tnapE: '\\u2A70\\u0338',\n\tnapid: '\\u224B\\u0338',\n\tnapos: '\\u0149',\n\tnapprox: '\\u2249',\n\tnatur: '\\u266E',\n\tnatural: '\\u266E',\n\tnaturals: '\\u2115',\n\tnbsp: '\\u00A0',\n\tnbump: '\\u224E\\u0338',\n\tnbumpe: '\\u224F\\u0338',\n\tncap: '\\u2A43',\n\tNcaron: '\\u0147',\n\tncaron: '\\u0148',\n\tNcedil: '\\u0145',\n\tncedil: '\\u0146',\n\tncong: '\\u2247',\n\tncongdot: '\\u2A6D\\u0338',\n\tncup: '\\u2A42',\n\tNcy: '\\u041D',\n\tncy: '\\u043D',\n\tndash: '\\u2013',\n\tne: '\\u2260',\n\tnearhk: '\\u2924',\n\tneArr: '\\u21D7',\n\tnearr: '\\u2197',\n\tnearrow: '\\u2197',\n\tnedot: '\\u2250\\u0338',\n\tNegativeMediumSpace: '\\u200B',\n\tNegativeThickSpace: '\\u200B',\n\tNegativeThinSpace: '\\u200B',\n\tNegativeVeryThinSpace: '\\u200B',\n\tnequiv: '\\u2262',\n\tnesear: '\\u2928',\n\tnesim: '\\u2242\\u0338',\n\tNestedGreaterGreater: '\\u226B',\n\tNestedLessLess: '\\u226A',\n\tNewLine: '\\u000A',\n\tnexist: '\\u2204',\n\tnexists: '\\u2204',\n\tNfr: '\\uD835\\uDD11',\n\tnfr: '\\uD835\\uDD2B',\n\tngE: '\\u2267\\u0338',\n\tnge: '\\u2271',\n\tngeq: '\\u2271',\n\tngeqq: '\\u2267\\u0338',\n\tngeqslant: '\\u2A7E\\u0338',\n\tnges: '\\u2A7E\\u0338',\n\tnGg: '\\u22D9\\u0338',\n\tngsim: '\\u2275',\n\tnGt: '\\u226B\\u20D2',\n\tngt: '\\u226F',\n\tngtr: '\\u226F',\n\tnGtv: '\\u226B\\u0338',\n\tnhArr: '\\u21CE',\n\tnharr: '\\u21AE',\n\tnhpar: '\\u2AF2',\n\tni: '\\u220B',\n\tnis: '\\u22FC',\n\tnisd: '\\u22FA',\n\tniv: '\\u220B',\n\tNJcy: '\\u040A',\n\tnjcy: '\\u045A',\n\tnlArr: '\\u21CD',\n\tnlarr: '\\u219A',\n\tnldr: '\\u2025',\n\tnlE: '\\u2266\\u0338',\n\tnle: '\\u2270',\n\tnLeftarrow: '\\u21CD',\n\tnleftarrow: '\\u219A',\n\tnLeftrightarrow: '\\u21CE',\n\tnleftrightarrow: '\\u21AE',\n\tnleq: '\\u2270',\n\tnleqq: '\\u2266\\u0338',\n\tnleqslant: '\\u2A7D\\u0338',\n\tnles: '\\u2A7D\\u0338',\n\tnless: '\\u226E',\n\tnLl: '\\u22D8\\u0338',\n\tnlsim: '\\u2274',\n\tnLt: '\\u226A\\u20D2',\n\tnlt: '\\u226E',\n\tnltri: '\\u22EA',\n\tnltrie: '\\u22EC',\n\tnLtv: '\\u226A\\u0338',\n\tnmid: '\\u2224',\n\tNoBreak: '\\u2060',\n\tNonBreakingSpace: '\\u00A0',\n\tNopf: '\\u2115',\n\tnopf: '\\uD835\\uDD5F',\n\tNot: '\\u2AEC',\n\tnot: '\\u00AC',\n\tNotCongruent: '\\u2262',\n\tNotCupCap: '\\u226D',\n\tNotDoubleVerticalBar: '\\u2226',\n\tNotElement: '\\u2209',\n\tNotEqual: '\\u2260',\n\tNotEqualTilde: '\\u2242\\u0338',\n\tNotExists: '\\u2204',\n\tNotGreater: '\\u226F',\n\tNotGreaterEqual: '\\u2271',\n\tNotGreaterFullEqual: '\\u2267\\u0338',\n\tNotGreaterGreater: '\\u226B\\u0338',\n\tNotGreaterLess: '\\u2279',\n\tNotGreaterSlantEqual: '\\u2A7E\\u0338',\n\tNotGreaterTilde: '\\u2275',\n\tNotHumpDownHump: '\\u224E\\u0338',\n\tNotHumpEqual: '\\u224F\\u0338',\n\tnotin: '\\u2209',\n\tnotindot: '\\u22F5\\u0338',\n\tnotinE: '\\u22F9\\u0338',\n\tnotinva: '\\u2209',\n\tnotinvb: '\\u22F7',\n\tnotinvc: '\\u22F6',\n\tNotLeftTriangle: '\\u22EA',\n\tNotLeftTriangleBar: '\\u29CF\\u0338',\n\tNotLeftTriangleEqual: '\\u22EC',\n\tNotLess: '\\u226E',\n\tNotLessEqual: '\\u2270',\n\tNotLessGreater: '\\u2278',\n\tNotLessLess: '\\u226A\\u0338',\n\tNotLessSlantEqual: '\\u2A7D\\u0338',\n\tNotLessTilde: '\\u2274',\n\tNotNestedGreaterGreater: '\\u2AA2\\u0338',\n\tNotNestedLessLess: '\\u2AA1\\u0338',\n\tnotni: '\\u220C',\n\tnotniva: '\\u220C',\n\tnotnivb: '\\u22FE',\n\tnotnivc: '\\u22FD',\n\tNotPrecedes: '\\u2280',\n\tNotPrecedesEqual: '\\u2AAF\\u0338',\n\tNotPrecedesSlantEqual: '\\u22E0',\n\tNotReverseElement: '\\u220C',\n\tNotRightTriangle: '\\u22EB',\n\tNotRightTriangleBar: '\\u29D0\\u0338',\n\tNotRightTriangleEqual: '\\u22ED',\n\tNotSquareSubset: '\\u228F\\u0338',\n\tNotSquareSubsetEqual: '\\u22E2',\n\tNotSquareSuperset: '\\u2290\\u0338',\n\tNotSquareSupersetEqual: '\\u22E3',\n\tNotSubset: '\\u2282\\u20D2',\n\tNotSubsetEqual: '\\u2288',\n\tNotSucceeds: '\\u2281',\n\tNotSucceedsEqual: '\\u2AB0\\u0338',\n\tNotSucceedsSlantEqual: '\\u22E1',\n\tNotSucceedsTilde: '\\u227F\\u0338',\n\tNotSuperset: '\\u2283\\u20D2',\n\tNotSupersetEqual: '\\u2289',\n\tNotTilde: '\\u2241',\n\tNotTildeEqual: '\\u2244',\n\tNotTildeFullEqual: '\\u2247',\n\tNotTildeTilde: '\\u2249',\n\tNotVerticalBar: '\\u2224',\n\tnpar: '\\u2226',\n\tnparallel: '\\u2226',\n\tnparsl: '\\u2AFD\\u20E5',\n\tnpart: '\\u2202\\u0338',\n\tnpolint: '\\u2A14',\n\tnpr: '\\u2280',\n\tnprcue: '\\u22E0',\n\tnpre: '\\u2AAF\\u0338',\n\tnprec: '\\u2280',\n\tnpreceq: '\\u2AAF\\u0338',\n\tnrArr: '\\u21CF',\n\tnrarr: '\\u219B',\n\tnrarrc: '\\u2933\\u0338',\n\tnrarrw: '\\u219D\\u0338',\n\tnRightarrow: '\\u21CF',\n\tnrightarrow: '\\u219B',\n\tnrtri: '\\u22EB',\n\tnrtrie: '\\u22ED',\n\tnsc: '\\u2281',\n\tnsccue: '\\u22E1',\n\tnsce: '\\u2AB0\\u0338',\n\tNscr: '\\uD835\\uDCA9',\n\tnscr: '\\uD835\\uDCC3',\n\tnshortmid: '\\u2224',\n\tnshortparallel: '\\u2226',\n\tnsim: '\\u2241',\n\tnsime: '\\u2244',\n\tnsimeq: '\\u2244',\n\tnsmid: '\\u2224',\n\tnspar: '\\u2226',\n\tnsqsube: '\\u22E2',\n\tnsqsupe: '\\u22E3',\n\tnsub: '\\u2284',\n\tnsubE: '\\u2AC5\\u0338',\n\tnsube: '\\u2288',\n\tnsubset: '\\u2282\\u20D2',\n\tnsubseteq: '\\u2288',\n\tnsubseteqq: '\\u2AC5\\u0338',\n\tnsucc: '\\u2281',\n\tnsucceq: '\\u2AB0\\u0338',\n\tnsup: '\\u2285',\n\tnsupE: '\\u2AC6\\u0338',\n\tnsupe: '\\u2289',\n\tnsupset: '\\u2283\\u20D2',\n\tnsupseteq: '\\u2289',\n\tnsupseteqq: '\\u2AC6\\u0338',\n\tntgl: '\\u2279',\n\tNtilde: '\\u00D1',\n\tntilde: '\\u00F1',\n\tntlg: '\\u2278',\n\tntriangleleft: '\\u22EA',\n\tntrianglelefteq: '\\u22EC',\n\tntriangleright: '\\u22EB',\n\tntrianglerighteq: '\\u22ED',\n\tNu: '\\u039D',\n\tnu: '\\u03BD',\n\tnum: '\\u0023',\n\tnumero: '\\u2116',\n\tnumsp: '\\u2007',\n\tnvap: '\\u224D\\u20D2',\n\tnVDash: '\\u22AF',\n\tnVdash: '\\u22AE',\n\tnvDash: '\\u22AD',\n\tnvdash: '\\u22AC',\n\tnvge: '\\u2265\\u20D2',\n\tnvgt: '\\u003E\\u20D2',\n\tnvHarr: '\\u2904',\n\tnvinfin: '\\u29DE',\n\tnvlArr: '\\u2902',\n\tnvle: '\\u2264\\u20D2',\n\tnvlt: '\\u003C\\u20D2',\n\tnvltrie: '\\u22B4\\u20D2',\n\tnvrArr: '\\u2903',\n\tnvrtrie: '\\u22B5\\u20D2',\n\tnvsim: '\\u223C\\u20D2',\n\tnwarhk: '\\u2923',\n\tnwArr: '\\u21D6',\n\tnwarr: '\\u2196',\n\tnwarrow: '\\u2196',\n\tnwnear: '\\u2927',\n\tOacute: '\\u00D3',\n\toacute: '\\u00F3',\n\toast: '\\u229B',\n\tocir: '\\u229A',\n\tOcirc: '\\u00D4',\n\tocirc: '\\u00F4',\n\tOcy: '\\u041E',\n\tocy: '\\u043E',\n\todash: '\\u229D',\n\tOdblac: '\\u0150',\n\todblac: '\\u0151',\n\todiv: '\\u2A38',\n\todot: '\\u2299',\n\todsold: '\\u29BC',\n\tOElig: '\\u0152',\n\toelig: '\\u0153',\n\tofcir: '\\u29BF',\n\tOfr: '\\uD835\\uDD12',\n\tofr: '\\uD835\\uDD2C',\n\togon: '\\u02DB',\n\tOgrave: '\\u00D2',\n\tograve: '\\u00F2',\n\togt: '\\u29C1',\n\tohbar: '\\u29B5',\n\tohm: '\\u03A9',\n\toint: '\\u222E',\n\tolarr: '\\u21BA',\n\tolcir: '\\u29BE',\n\tolcross: '\\u29BB',\n\toline: '\\u203E',\n\tolt: '\\u29C0',\n\tOmacr: '\\u014C',\n\tomacr: '\\u014D',\n\tOmega: '\\u03A9',\n\tomega: '\\u03C9',\n\tOmicron: '\\u039F',\n\tomicron: '\\u03BF',\n\tomid: '\\u29B6',\n\tominus: '\\u2296',\n\tOopf: '\\uD835\\uDD46',\n\toopf: '\\uD835\\uDD60',\n\topar: '\\u29B7',\n\tOpenCurlyDoubleQuote: '\\u201C',\n\tOpenCurlyQuote: '\\u2018',\n\toperp: '\\u29B9',\n\toplus: '\\u2295',\n\tOr: '\\u2A54',\n\tor: '\\u2228',\n\torarr: '\\u21BB',\n\tord: '\\u2A5D',\n\torder: '\\u2134',\n\torderof: '\\u2134',\n\tordf: '\\u00AA',\n\tordm: '\\u00BA',\n\torigof: '\\u22B6',\n\toror: '\\u2A56',\n\torslope: '\\u2A57',\n\torv: '\\u2A5B',\n\toS: '\\u24C8',\n\tOscr: '\\uD835\\uDCAA',\n\toscr: '\\u2134',\n\tOslash: '\\u00D8',\n\toslash: '\\u00F8',\n\tosol: '\\u2298',\n\tOtilde: '\\u00D5',\n\totilde: '\\u00F5',\n\tOtimes: '\\u2A37',\n\totimes: '\\u2297',\n\totimesas: '\\u2A36',\n\tOuml: '\\u00D6',\n\touml: '\\u00F6',\n\tovbar: '\\u233D',\n\tOverBar: '\\u203E',\n\tOverBrace: '\\u23DE',\n\tOverBracket: '\\u23B4',\n\tOverParenthesis: '\\u23DC',\n\tpar: '\\u2225',\n\tpara: '\\u00B6',\n\tparallel: '\\u2225',\n\tparsim: '\\u2AF3',\n\tparsl: '\\u2AFD',\n\tpart: '\\u2202',\n\tPartialD: '\\u2202',\n\tPcy: '\\u041F',\n\tpcy: '\\u043F',\n\tpercnt: '\\u0025',\n\tperiod: '\\u002E',\n\tpermil: '\\u2030',\n\tperp: '\\u22A5',\n\tpertenk: '\\u2031',\n\tPfr: '\\uD835\\uDD13',\n\tpfr: '\\uD835\\uDD2D',\n\tPhi: '\\u03A6',\n\tphi: '\\u03C6',\n\tphiv: '\\u03D5',\n\tphmmat: '\\u2133',\n\tphone: '\\u260E',\n\tPi: '\\u03A0',\n\tpi: '\\u03C0',\n\tpitchfork: '\\u22D4',\n\tpiv: '\\u03D6',\n\tplanck: '\\u210F',\n\tplanckh: '\\u210E',\n\tplankv: '\\u210F',\n\tplus: '\\u002B',\n\tplusacir: '\\u2A23',\n\tplusb: '\\u229E',\n\tpluscir: '\\u2A22',\n\tplusdo: '\\u2214',\n\tplusdu: '\\u2A25',\n\tpluse: '\\u2A72',\n\tPlusMinus: '\\u00B1',\n\tplusmn: '\\u00B1',\n\tplussim: '\\u2A26',\n\tplustwo: '\\u2A27',\n\tpm: '\\u00B1',\n\tPoincareplane: '\\u210C',\n\tpointint: '\\u2A15',\n\tPopf: '\\u2119',\n\tpopf: '\\uD835\\uDD61',\n\tpound: '\\u00A3',\n\tPr: '\\u2ABB',\n\tpr: '\\u227A',\n\tprap: '\\u2AB7',\n\tprcue: '\\u227C',\n\tprE: '\\u2AB3',\n\tpre: '\\u2AAF',\n\tprec: '\\u227A',\n\tprecapprox: '\\u2AB7',\n\tpreccurlyeq: '\\u227C',\n\tPrecedes: '\\u227A',\n\tPrecedesEqual: '\\u2AAF',\n\tPrecedesSlantEqual: '\\u227C',\n\tPrecedesTilde: '\\u227E',\n\tpreceq: '\\u2AAF',\n\tprecnapprox: '\\u2AB9',\n\tprecneqq: '\\u2AB5',\n\tprecnsim: '\\u22E8',\n\tprecsim: '\\u227E',\n\tPrime: '\\u2033',\n\tprime: '\\u2032',\n\tprimes: '\\u2119',\n\tprnap: '\\u2AB9',\n\tprnE: '\\u2AB5',\n\tprnsim: '\\u22E8',\n\tprod: '\\u220F',\n\tProduct: '\\u220F',\n\tprofalar: '\\u232E',\n\tprofline: '\\u2312',\n\tprofsurf: '\\u2313',\n\tprop: '\\u221D',\n\tProportion: '\\u2237',\n\tProportional: '\\u221D',\n\tpropto: '\\u221D',\n\tprsim: '\\u227E',\n\tprurel: '\\u22B0',\n\tPscr: '\\uD835\\uDCAB',\n\tpscr: '\\uD835\\uDCC5',\n\tPsi: '\\u03A8',\n\tpsi: '\\u03C8',\n\tpuncsp: '\\u2008',\n\tQfr: '\\uD835\\uDD14',\n\tqfr: '\\uD835\\uDD2E',\n\tqint: '\\u2A0C',\n\tQopf: '\\u211A',\n\tqopf: '\\uD835\\uDD62',\n\tqprime: '\\u2057',\n\tQscr: '\\uD835\\uDCAC',\n\tqscr: '\\uD835\\uDCC6',\n\tquaternions: '\\u210D',\n\tquatint: '\\u2A16',\n\tquest: '\\u003F',\n\tquesteq: '\\u225F',\n\tQUOT: '\\u0022',\n\tquot: '\\u0022',\n\trAarr: '\\u21DB',\n\trace: '\\u223D\\u0331',\n\tRacute: '\\u0154',\n\tracute: '\\u0155',\n\tradic: '\\u221A',\n\traemptyv: '\\u29B3',\n\tRang: '\\u27EB',\n\trang: '\\u27E9',\n\trangd: '\\u2992',\n\trange: '\\u29A5',\n\trangle: '\\u27E9',\n\traquo: '\\u00BB',\n\tRarr: '\\u21A0',\n\trArr: '\\u21D2',\n\trarr: '\\u2192',\n\trarrap: '\\u2975',\n\trarrb: '\\u21E5',\n\trarrbfs: '\\u2920',\n\trarrc: '\\u2933',\n\trarrfs: '\\u291E',\n\trarrhk: '\\u21AA',\n\trarrlp: '\\u21AC',\n\trarrpl: '\\u2945',\n\trarrsim: '\\u2974',\n\tRarrtl: '\\u2916',\n\trarrtl: '\\u21A3',\n\trarrw: '\\u219D',\n\trAtail: '\\u291C',\n\tratail: '\\u291A',\n\tratio: '\\u2236',\n\trationals: '\\u211A',\n\tRBarr: '\\u2910',\n\trBarr: '\\u290F',\n\trbarr: '\\u290D',\n\trbbrk: '\\u2773',\n\trbrace: '\\u007D',\n\trbrack: '\\u005D',\n\trbrke: '\\u298C',\n\trbrksld: '\\u298E',\n\trbrkslu: '\\u2990',\n\tRcaron: '\\u0158',\n\trcaron: '\\u0159',\n\tRcedil: '\\u0156',\n\trcedil: '\\u0157',\n\trceil: '\\u2309',\n\trcub: '\\u007D',\n\tRcy: '\\u0420',\n\trcy: '\\u0440',\n\trdca: '\\u2937',\n\trdldhar: '\\u2969',\n\trdquo: '\\u201D',\n\trdquor: '\\u201D',\n\trdsh: '\\u21B3',\n\tRe: '\\u211C',\n\treal: '\\u211C',\n\trealine: '\\u211B',\n\trealpart: '\\u211C',\n\treals: '\\u211D',\n\trect: '\\u25AD',\n\tREG: '\\u00AE',\n\treg: '\\u00AE',\n\tReverseElement: '\\u220B',\n\tReverseEquilibrium: '\\u21CB',\n\tReverseUpEquilibrium: '\\u296F',\n\trfisht: '\\u297D',\n\trfloor: '\\u230B',\n\tRfr: '\\u211C',\n\trfr: '\\uD835\\uDD2F',\n\trHar: '\\u2964',\n\trhard: '\\u21C1',\n\trharu: '\\u21C0',\n\trharul: '\\u296C',\n\tRho: '\\u03A1',\n\trho: '\\u03C1',\n\trhov: '\\u03F1',\n\tRightAngleBracket: '\\u27E9',\n\tRightArrow: '\\u2192',\n\tRightarrow: '\\u21D2',\n\trightarrow: '\\u2192',\n\tRightArrowBar: '\\u21E5',\n\tRightArrowLeftArrow: '\\u21C4',\n\trightarrowtail: '\\u21A3',\n\tRightCeiling: '\\u2309',\n\tRightDoubleBracket: '\\u27E7',\n\tRightDownTeeVector: '\\u295D',\n\tRightDownVector: '\\u21C2',\n\tRightDownVectorBar: '\\u2955',\n\tRightFloor: '\\u230B',\n\trightharpoondown: '\\u21C1',\n\trightharpoonup: '\\u21C0',\n\trightleftarrows: '\\u21C4',\n\trightleftharpoons: '\\u21CC',\n\trightrightarrows: '\\u21C9',\n\trightsquigarrow: '\\u219D',\n\tRightTee: '\\u22A2',\n\tRightTeeArrow: '\\u21A6',\n\tRightTeeVector: '\\u295B',\n\trightthreetimes: '\\u22CC',\n\tRightTriangle: '\\u22B3',\n\tRightTriangleBar: '\\u29D0',\n\tRightTriangleEqual: '\\u22B5',\n\tRightUpDownVector: '\\u294F',\n\tRightUpTeeVector: '\\u295C',\n\tRightUpVector: '\\u21BE',\n\tRightUpVectorBar: '\\u2954',\n\tRightVector: '\\u21C0',\n\tRightVectorBar: '\\u2953',\n\tring: '\\u02DA',\n\trisingdotseq: '\\u2253',\n\trlarr: '\\u21C4',\n\trlhar: '\\u21CC',\n\trlm: '\\u200F',\n\trmoust: '\\u23B1',\n\trmoustache: '\\u23B1',\n\trnmid: '\\u2AEE',\n\troang: '\\u27ED',\n\troarr: '\\u21FE',\n\trobrk: '\\u27E7',\n\tropar: '\\u2986',\n\tRopf: '\\u211D',\n\tropf: '\\uD835\\uDD63',\n\troplus: '\\u2A2E',\n\trotimes: '\\u2A35',\n\tRoundImplies: '\\u2970',\n\trpar: '\\u0029',\n\trpargt: '\\u2994',\n\trppolint: '\\u2A12',\n\trrarr: '\\u21C9',\n\tRrightarrow: '\\u21DB',\n\trsaquo: '\\u203A',\n\tRscr: '\\u211B',\n\trscr: '\\uD835\\uDCC7',\n\tRsh: '\\u21B1',\n\trsh: '\\u21B1',\n\trsqb: '\\u005D',\n\trsquo: '\\u2019',\n\trsquor: '\\u2019',\n\trthree: '\\u22CC',\n\trtimes: '\\u22CA',\n\trtri: '\\u25B9',\n\trtrie: '\\u22B5',\n\trtrif: '\\u25B8',\n\trtriltri: '\\u29CE',\n\tRuleDelayed: '\\u29F4',\n\truluhar: '\\u2968',\n\trx: '\\u211E',\n\tSacute: '\\u015A',\n\tsacute: '\\u015B',\n\tsbquo: '\\u201A',\n\tSc: '\\u2ABC',\n\tsc: '\\u227B',\n\tscap: '\\u2AB8',\n\tScaron: '\\u0160',\n\tscaron: '\\u0161',\n\tsccue: '\\u227D',\n\tscE: '\\u2AB4',\n\tsce: '\\u2AB0',\n\tScedil: '\\u015E',\n\tscedil: '\\u015F',\n\tScirc: '\\u015C',\n\tscirc: '\\u015D',\n\tscnap: '\\u2ABA',\n\tscnE: '\\u2AB6',\n\tscnsim: '\\u22E9',\n\tscpolint: '\\u2A13',\n\tscsim: '\\u227F',\n\tScy: '\\u0421',\n\tscy: '\\u0441',\n\tsdot: '\\u22C5',\n\tsdotb: '\\u22A1',\n\tsdote: '\\u2A66',\n\tsearhk: '\\u2925',\n\tseArr: '\\u21D8',\n\tsearr: '\\u2198',\n\tsearrow: '\\u2198',\n\tsect: '\\u00A7',\n\tsemi: '\\u003B',\n\tseswar: '\\u2929',\n\tsetminus: '\\u2216',\n\tsetmn: '\\u2216',\n\tsext: '\\u2736',\n\tSfr: '\\uD835\\uDD16',\n\tsfr: '\\uD835\\uDD30',\n\tsfrown: '\\u2322',\n\tsharp: '\\u266F',\n\tSHCHcy: '\\u0429',\n\tshchcy: '\\u0449',\n\tSHcy: '\\u0428',\n\tshcy: '\\u0448',\n\tShortDownArrow: '\\u2193',\n\tShortLeftArrow: '\\u2190',\n\tshortmid: '\\u2223',\n\tshortparallel: '\\u2225',\n\tShortRightArrow: '\\u2192',\n\tShortUpArrow: '\\u2191',\n\tshy: '\\u00AD',\n\tSigma: '\\u03A3',\n\tsigma: '\\u03C3',\n\tsigmaf: '\\u03C2',\n\tsigmav: '\\u03C2',\n\tsim: '\\u223C',\n\tsimdot: '\\u2A6A',\n\tsime: '\\u2243',\n\tsimeq: '\\u2243',\n\tsimg: '\\u2A9E',\n\tsimgE: '\\u2AA0',\n\tsiml: '\\u2A9D',\n\tsimlE: '\\u2A9F',\n\tsimne: '\\u2246',\n\tsimplus: '\\u2A24',\n\tsimrarr: '\\u2972',\n\tslarr: '\\u2190',\n\tSmallCircle: '\\u2218',\n\tsmallsetminus: '\\u2216',\n\tsmashp: '\\u2A33',\n\tsmeparsl: '\\u29E4',\n\tsmid: '\\u2223',\n\tsmile: '\\u2323',\n\tsmt: '\\u2AAA',\n\tsmte: '\\u2AAC',\n\tsmtes: '\\u2AAC\\uFE00',\n\tSOFTcy: '\\u042C',\n\tsoftcy: '\\u044C',\n\tsol: '\\u002F',\n\tsolb: '\\u29C4',\n\tsolbar: '\\u233F',\n\tSopf: '\\uD835\\uDD4A',\n\tsopf: '\\uD835\\uDD64',\n\tspades: '\\u2660',\n\tspadesuit: '\\u2660',\n\tspar: '\\u2225',\n\tsqcap: '\\u2293',\n\tsqcaps: '\\u2293\\uFE00',\n\tsqcup: '\\u2294',\n\tsqcups: '\\u2294\\uFE00',\n\tSqrt: '\\u221A',\n\tsqsub: '\\u228F',\n\tsqsube: '\\u2291',\n\tsqsubset: '\\u228F',\n\tsqsubseteq: '\\u2291',\n\tsqsup: '\\u2290',\n\tsqsupe: '\\u2292',\n\tsqsupset: '\\u2290',\n\tsqsupseteq: '\\u2292',\n\tsqu: '\\u25A1',\n\tSquare: '\\u25A1',\n\tsquare: '\\u25A1',\n\tSquareIntersection: '\\u2293',\n\tSquareSubset: '\\u228F',\n\tSquareSubsetEqual: '\\u2291',\n\tSquareSuperset: '\\u2290',\n\tSquareSupersetEqual: '\\u2292',\n\tSquareUnion: '\\u2294',\n\tsquarf: '\\u25AA',\n\tsquf: '\\u25AA',\n\tsrarr: '\\u2192',\n\tSscr: '\\uD835\\uDCAE',\n\tsscr: '\\uD835\\uDCC8',\n\tssetmn: '\\u2216',\n\tssmile: '\\u2323',\n\tsstarf: '\\u22C6',\n\tStar: '\\u22C6',\n\tstar: '\\u2606',\n\tstarf: '\\u2605',\n\tstraightepsilon: '\\u03F5',\n\tstraightphi: '\\u03D5',\n\tstrns: '\\u00AF',\n\tSub: '\\u22D0',\n\tsub: '\\u2282',\n\tsubdot: '\\u2ABD',\n\tsubE: '\\u2AC5',\n\tsube: '\\u2286',\n\tsubedot: '\\u2AC3',\n\tsubmult: '\\u2AC1',\n\tsubnE: '\\u2ACB',\n\tsubne: '\\u228A',\n\tsubplus: '\\u2ABF',\n\tsubrarr: '\\u2979',\n\tSubset: '\\u22D0',\n\tsubset: '\\u2282',\n\tsubseteq: '\\u2286',\n\tsubseteqq: '\\u2AC5',\n\tSubsetEqual: '\\u2286',\n\tsubsetneq: '\\u228A',\n\tsubsetneqq: '\\u2ACB',\n\tsubsim: '\\u2AC7',\n\tsubsub: '\\u2AD5',\n\tsubsup: '\\u2AD3',\n\tsucc: '\\u227B',\n\tsuccapprox: '\\u2AB8',\n\tsucccurlyeq: '\\u227D',\n\tSucceeds: '\\u227B',\n\tSucceedsEqual: '\\u2AB0',\n\tSucceedsSlantEqual: '\\u227D',\n\tSucceedsTilde: '\\u227F',\n\tsucceq: '\\u2AB0',\n\tsuccnapprox: '\\u2ABA',\n\tsuccneqq: '\\u2AB6',\n\tsuccnsim: '\\u22E9',\n\tsuccsim: '\\u227F',\n\tSuchThat: '\\u220B',\n\tSum: '\\u2211',\n\tsum: '\\u2211',\n\tsung: '\\u266A',\n\tSup: '\\u22D1',\n\tsup: '\\u2283',\n\tsup1: '\\u00B9',\n\tsup2: '\\u00B2',\n\tsup3: '\\u00B3',\n\tsupdot: '\\u2ABE',\n\tsupdsub: '\\u2AD8',\n\tsupE: '\\u2AC6',\n\tsupe: '\\u2287',\n\tsupedot: '\\u2AC4',\n\tSuperset: '\\u2283',\n\tSupersetEqual: '\\u2287',\n\tsuphsol: '\\u27C9',\n\tsuphsub: '\\u2AD7',\n\tsuplarr: '\\u297B',\n\tsupmult: '\\u2AC2',\n\tsupnE: '\\u2ACC',\n\tsupne: '\\u228B',\n\tsupplus: '\\u2AC0',\n\tSupset: '\\u22D1',\n\tsupset: '\\u2283',\n\tsupseteq: '\\u2287',\n\tsupseteqq: '\\u2AC6',\n\tsupsetneq: '\\u228B',\n\tsupsetneqq: '\\u2ACC',\n\tsupsim: '\\u2AC8',\n\tsupsub: '\\u2AD4',\n\tsupsup: '\\u2AD6',\n\tswarhk: '\\u2926',\n\tswArr: '\\u21D9',\n\tswarr: '\\u2199',\n\tswarrow: '\\u2199',\n\tswnwar: '\\u292A',\n\tszlig: '\\u00DF',\n\tTab: '\\u0009',\n\ttarget: '\\u2316',\n\tTau: '\\u03A4',\n\ttau: '\\u03C4',\n\ttbrk: '\\u23B4',\n\tTcaron: '\\u0164',\n\ttcaron: '\\u0165',\n\tTcedil: '\\u0162',\n\ttcedil: '\\u0163',\n\tTcy: '\\u0422',\n\ttcy: '\\u0442',\n\ttdot: '\\u20DB',\n\ttelrec: '\\u2315',\n\tTfr: '\\uD835\\uDD17',\n\ttfr: '\\uD835\\uDD31',\n\tthere4: '\\u2234',\n\tTherefore: '\\u2234',\n\ttherefore: '\\u2234',\n\tTheta: '\\u0398',\n\ttheta: '\\u03B8',\n\tthetasym: '\\u03D1',\n\tthetav: '\\u03D1',\n\tthickapprox: '\\u2248',\n\tthicksim: '\\u223C',\n\tThickSpace: '\\u205F\\u200A',\n\tthinsp: '\\u2009',\n\tThinSpace: '\\u2009',\n\tthkap: '\\u2248',\n\tthksim: '\\u223C',\n\tTHORN: '\\u00DE',\n\tthorn: '\\u00FE',\n\tTilde: '\\u223C',\n\ttilde: '\\u02DC',\n\tTildeEqual: '\\u2243',\n\tTildeFullEqual: '\\u2245',\n\tTildeTilde: '\\u2248',\n\ttimes: '\\u00D7',\n\ttimesb: '\\u22A0',\n\ttimesbar: '\\u2A31',\n\ttimesd: '\\u2A30',\n\ttint: '\\u222D',\n\ttoea: '\\u2928',\n\ttop: '\\u22A4',\n\ttopbot: '\\u2336',\n\ttopcir: '\\u2AF1',\n\tTopf: '\\uD835\\uDD4B',\n\ttopf: '\\uD835\\uDD65',\n\ttopfork: '\\u2ADA',\n\ttosa: '\\u2929',\n\ttprime: '\\u2034',\n\tTRADE: '\\u2122',\n\ttrade: '\\u2122',\n\ttriangle: '\\u25B5',\n\ttriangledown: '\\u25BF',\n\ttriangleleft: '\\u25C3',\n\ttrianglelefteq: '\\u22B4',\n\ttriangleq: '\\u225C',\n\ttriangleright: '\\u25B9',\n\ttrianglerighteq: '\\u22B5',\n\ttridot: '\\u25EC',\n\ttrie: '\\u225C',\n\ttriminus: '\\u2A3A',\n\tTripleDot: '\\u20DB',\n\ttriplus: '\\u2A39',\n\ttrisb: '\\u29CD',\n\ttritime: '\\u2A3B',\n\ttrpezium: '\\u23E2',\n\tTscr: '\\uD835\\uDCAF',\n\ttscr: '\\uD835\\uDCC9',\n\tTScy: '\\u0426',\n\ttscy: '\\u0446',\n\tTSHcy: '\\u040B',\n\ttshcy: '\\u045B',\n\tTstrok: '\\u0166',\n\ttstrok: '\\u0167',\n\ttwixt: '\\u226C',\n\ttwoheadleftarrow: '\\u219E',\n\ttwoheadrightarrow: '\\u21A0',\n\tUacute: '\\u00DA',\n\tuacute: '\\u00FA',\n\tUarr: '\\u219F',\n\tuArr: '\\u21D1',\n\tuarr: '\\u2191',\n\tUarrocir: '\\u2949',\n\tUbrcy: '\\u040E',\n\tubrcy: '\\u045E',\n\tUbreve: '\\u016C',\n\tubreve: '\\u016D',\n\tUcirc: '\\u00DB',\n\tucirc: '\\u00FB',\n\tUcy: '\\u0423',\n\tucy: '\\u0443',\n\tudarr: '\\u21C5',\n\tUdblac: '\\u0170',\n\tudblac: '\\u0171',\n\tudhar: '\\u296E',\n\tufisht: '\\u297E',\n\tUfr: '\\uD835\\uDD18',\n\tufr: '\\uD835\\uDD32',\n\tUgrave: '\\u00D9',\n\tugrave: '\\u00F9',\n\tuHar: '\\u2963',\n\tuharl: '\\u21BF',\n\tuharr: '\\u21BE',\n\tuhblk: '\\u2580',\n\tulcorn: '\\u231C',\n\tulcorner: '\\u231C',\n\tulcrop: '\\u230F',\n\tultri: '\\u25F8',\n\tUmacr: '\\u016A',\n\tumacr: '\\u016B',\n\tuml: '\\u00A8',\n\tUnderBar: '\\u005F',\n\tUnderBrace: '\\u23DF',\n\tUnderBracket: '\\u23B5',\n\tUnderParenthesis: '\\u23DD',\n\tUnion: '\\u22C3',\n\tUnionPlus: '\\u228E',\n\tUogon: '\\u0172',\n\tuogon: '\\u0173',\n\tUopf: '\\uD835\\uDD4C',\n\tuopf: '\\uD835\\uDD66',\n\tUpArrow: '\\u2191',\n\tUparrow: '\\u21D1',\n\tuparrow: '\\u2191',\n\tUpArrowBar: '\\u2912',\n\tUpArrowDownArrow: '\\u21C5',\n\tUpDownArrow: '\\u2195',\n\tUpdownarrow: '\\u21D5',\n\tupdownarrow: '\\u2195',\n\tUpEquilibrium: '\\u296E',\n\tupharpoonleft: '\\u21BF',\n\tupharpoonright: '\\u21BE',\n\tuplus: '\\u228E',\n\tUpperLeftArrow: '\\u2196',\n\tUpperRightArrow: '\\u2197',\n\tUpsi: '\\u03D2',\n\tupsi: '\\u03C5',\n\tupsih: '\\u03D2',\n\tUpsilon: '\\u03A5',\n\tupsilon: '\\u03C5',\n\tUpTee: '\\u22A5',\n\tUpTeeArrow: '\\u21A5',\n\tupuparrows: '\\u21C8',\n\turcorn: '\\u231D',\n\turcorner: '\\u231D',\n\turcrop: '\\u230E',\n\tUring: '\\u016E',\n\turing: '\\u016F',\n\turtri: '\\u25F9',\n\tUscr: '\\uD835\\uDCB0',\n\tuscr: '\\uD835\\uDCCA',\n\tutdot: '\\u22F0',\n\tUtilde: '\\u0168',\n\tutilde: '\\u0169',\n\tutri: '\\u25B5',\n\tutrif: '\\u25B4',\n\tuuarr: '\\u21C8',\n\tUuml: '\\u00DC',\n\tuuml: '\\u00FC',\n\tuwangle: '\\u29A7',\n\tvangrt: '\\u299C',\n\tvarepsilon: '\\u03F5',\n\tvarkappa: '\\u03F0',\n\tvarnothing: '\\u2205',\n\tvarphi: '\\u03D5',\n\tvarpi: '\\u03D6',\n\tvarpropto: '\\u221D',\n\tvArr: '\\u21D5',\n\tvarr: '\\u2195',\n\tvarrho: '\\u03F1',\n\tvarsigma: '\\u03C2',\n\tvarsubsetneq: '\\u228A\\uFE00',\n\tvarsubsetneqq: '\\u2ACB\\uFE00',\n\tvarsupsetneq: '\\u228B\\uFE00',\n\tvarsupsetneqq: '\\u2ACC\\uFE00',\n\tvartheta: '\\u03D1',\n\tvartriangleleft: '\\u22B2',\n\tvartriangleright: '\\u22B3',\n\tVbar: '\\u2AEB',\n\tvBar: '\\u2AE8',\n\tvBarv: '\\u2AE9',\n\tVcy: '\\u0412',\n\tvcy: '\\u0432',\n\tVDash: '\\u22AB',\n\tVdash: '\\u22A9',\n\tvDash: '\\u22A8',\n\tvdash: '\\u22A2',\n\tVdashl: '\\u2AE6',\n\tVee: '\\u22C1',\n\tvee: '\\u2228',\n\tveebar: '\\u22BB',\n\tveeeq: '\\u225A',\n\tvellip: '\\u22EE',\n\tVerbar: '\\u2016',\n\tverbar: '\\u007C',\n\tVert: '\\u2016',\n\tvert: '\\u007C',\n\tVerticalBar: '\\u2223',\n\tVerticalLine: '\\u007C',\n\tVerticalSeparator: '\\u2758',\n\tVerticalTilde: '\\u2240',\n\tVeryThinSpace: '\\u200A',\n\tVfr: '\\uD835\\uDD19',\n\tvfr: '\\uD835\\uDD33',\n\tvltri: '\\u22B2',\n\tvnsub: '\\u2282\\u20D2',\n\tvnsup: '\\u2283\\u20D2',\n\tVopf: '\\uD835\\uDD4D',\n\tvopf: '\\uD835\\uDD67',\n\tvprop: '\\u221D',\n\tvrtri: '\\u22B3',\n\tVscr: '\\uD835\\uDCB1',\n\tvscr: '\\uD835\\uDCCB',\n\tvsubnE: '\\u2ACB\\uFE00',\n\tvsubne: '\\u228A\\uFE00',\n\tvsupnE: '\\u2ACC\\uFE00',\n\tvsupne: '\\u228B\\uFE00',\n\tVvdash: '\\u22AA',\n\tvzigzag: '\\u299A',\n\tWcirc: '\\u0174',\n\twcirc: '\\u0175',\n\twedbar: '\\u2A5F',\n\tWedge: '\\u22C0',\n\twedge: '\\u2227',\n\twedgeq: '\\u2259',\n\tweierp: '\\u2118',\n\tWfr: '\\uD835\\uDD1A',\n\twfr: '\\uD835\\uDD34',\n\tWopf: '\\uD835\\uDD4E',\n\twopf: '\\uD835\\uDD68',\n\twp: '\\u2118',\n\twr: '\\u2240',\n\twreath: '\\u2240',\n\tWscr: '\\uD835\\uDCB2',\n\twscr: '\\uD835\\uDCCC',\n\txcap: '\\u22C2',\n\txcirc: '\\u25EF',\n\txcup: '\\u22C3',\n\txdtri: '\\u25BD',\n\tXfr: '\\uD835\\uDD1B',\n\txfr: '\\uD835\\uDD35',\n\txhArr: '\\u27FA',\n\txharr: '\\u27F7',\n\tXi: '\\u039E',\n\txi: '\\u03BE',\n\txlArr: '\\u27F8',\n\txlarr: '\\u27F5',\n\txmap: '\\u27FC',\n\txnis: '\\u22FB',\n\txodot: '\\u2A00',\n\tXopf: '\\uD835\\uDD4F',\n\txopf: '\\uD835\\uDD69',\n\txoplus: '\\u2A01',\n\txotime: '\\u2A02',\n\txrArr: '\\u27F9',\n\txrarr: '\\u27F6',\n\tXscr: '\\uD835\\uDCB3',\n\txscr: '\\uD835\\uDCCD',\n\txsqcup: '\\u2A06',\n\txuplus: '\\u2A04',\n\txutri: '\\u25B3',\n\txvee: '\\u22C1',\n\txwedge: '\\u22C0',\n\tYacute: '\\u00DD',\n\tyacute: '\\u00FD',\n\tYAcy: '\\u042F',\n\tyacy: '\\u044F',\n\tYcirc: '\\u0176',\n\tycirc: '\\u0177',\n\tYcy: '\\u042B',\n\tycy: '\\u044B',\n\tyen: '\\u00A5',\n\tYfr: '\\uD835\\uDD1C',\n\tyfr: '\\uD835\\uDD36',\n\tYIcy: '\\u0407',\n\tyicy: '\\u0457',\n\tYopf: '\\uD835\\uDD50',\n\tyopf: '\\uD835\\uDD6A',\n\tYscr: '\\uD835\\uDCB4',\n\tyscr: '\\uD835\\uDCCE',\n\tYUcy: '\\u042E',\n\tyucy: '\\u044E',\n\tYuml: '\\u0178',\n\tyuml: '\\u00FF',\n\tZacute: '\\u0179',\n\tzacute: '\\u017A',\n\tZcaron: '\\u017D',\n\tzcaron: '\\u017E',\n\tZcy: '\\u0417',\n\tzcy: '\\u0437',\n\tZdot: '\\u017B',\n\tzdot: '\\u017C',\n\tzeetrf: '\\u2128',\n\tZeroWidthSpace: '\\u200B',\n\tZeta: '\\u0396',\n\tzeta: '\\u03B6',\n\tZfr: '\\u2128',\n\tzfr: '\\uD835\\uDD37',\n\tZHcy: '\\u0416',\n\tzhcy: '\\u0436',\n\tzigrarr: '\\u21DD',\n\tZopf: '\\u2124',\n\tzopf: '\\uD835\\uDD6B',\n\tZscr: '\\uD835\\uDCB5',\n\tzscr: '\\uD835\\uDCCF',\n\tzwj: '\\u200D',\n\tzwnj: '\\u200C',\n});\n\n/**\n * @deprecated use `HTML_ENTITIES` instead\n * @see HTML_ENTITIES\n */\nexports.entityMap = exports.HTML_ENTITIES;\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/@xmldom/xmldom/lib/entities.js?\n}");
116
+
117
+ /***/ },
118
+
119
+ /***/ "./node_modules/@xmldom/xmldom/lib/index.js"
120
+ /*!**************************************************!*\
121
+ !*** ./node_modules/@xmldom/xmldom/lib/index.js ***!
122
+ \**************************************************/
123
+ (__unused_webpack_module, exports, __webpack_require__) {
124
+
125
+ eval("{var dom = __webpack_require__(/*! ./dom */ \"./node_modules/@xmldom/xmldom/lib/dom.js\")\nexports.DOMImplementation = dom.DOMImplementation\nexports.XMLSerializer = dom.XMLSerializer\nexports.DOMParser = __webpack_require__(/*! ./dom-parser */ \"./node_modules/@xmldom/xmldom/lib/dom-parser.js\").DOMParser\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/@xmldom/xmldom/lib/index.js?\n}");
126
+
127
+ /***/ },
128
+
129
+ /***/ "./node_modules/@xmldom/xmldom/lib/sax.js"
130
+ /*!************************************************!*\
131
+ !*** ./node_modules/@xmldom/xmldom/lib/sax.js ***!
132
+ \************************************************/
133
+ (__unused_webpack_module, exports, __webpack_require__) {
134
+
135
+ eval("{var NAMESPACE = (__webpack_require__(/*! ./conventions */ \"./node_modules/@xmldom/xmldom/lib/conventions.js\").NAMESPACE);\n\n//[4] \tNameStartChar\t ::= \t\":\" | [A-Z] | \"_\" | [a-z] | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x2FF] | [#x370-#x37D] | [#x37F-#x1FFF] | [#x200C-#x200D] | [#x2070-#x218F] | [#x2C00-#x2FEF] | [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n//[4a] \tNameChar\t ::= \tNameStartChar | \"-\" | \".\" | [0-9] | #xB7 | [#x0300-#x036F] | [#x203F-#x2040]\n//[5] \tName\t ::= \tNameStartChar (NameChar)*\nvar nameStartChar = /[A-Z_a-z\\xC0-\\xD6\\xD8-\\xF6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD]///\\u10000-\\uEFFFF\nvar nameChar = new RegExp(\"[\\\\-\\\\.0-9\"+nameStartChar.source.slice(1,-1)+\"\\\\u00B7\\\\u0300-\\\\u036F\\\\u203F-\\\\u2040]\");\nvar tagNamePattern = new RegExp('^'+nameStartChar.source+nameChar.source+'*(?:\\:'+nameStartChar.source+nameChar.source+'*)?$');\n//var tagNamePattern = /^[a-zA-Z_][\\w\\-\\.]*(?:\\:[a-zA-Z_][\\w\\-\\.]*)?$/\n//var handlers = 'resolveEntity,getExternalSubset,characters,endDocument,endElement,endPrefixMapping,ignorableWhitespace,processingInstruction,setDocumentLocator,skippedEntity,startDocument,startElement,startPrefixMapping,notationDecl,unparsedEntityDecl,error,fatalError,warning,attributeDecl,elementDecl,externalEntityDecl,internalEntityDecl,comment,endCDATA,endDTD,endEntity,startCDATA,startDTD,startEntity'.split(',')\n\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\nvar S_TAG = 0;//tag name offerring\nvar S_ATTR = 1;//attr name offerring\nvar S_ATTR_SPACE=2;//attr name end and space offer\nvar S_EQ = 3;//=space?\nvar S_ATTR_NOQUOT_VALUE = 4;//attr value(no quot value only)\nvar S_ATTR_END = 5;//attr value end and no space(quot end)\nvar S_TAG_SPACE = 6;//(attr value end || tag end ) && (space offer)\nvar S_TAG_CLOSE = 7;//closed el<el />\n\n/**\n * Creates an error that will not be caught by XMLReader aka the SAX parser.\n *\n * @param {string} message\n * @param {any?} locator Optional, can provide details about the location in the source\n * @constructor\n */\nfunction ParseError(message, locator) {\n\tthis.message = message\n\tthis.locator = locator\n\tif(Error.captureStackTrace) Error.captureStackTrace(this, ParseError);\n}\nParseError.prototype = new Error();\nParseError.prototype.name = ParseError.name\n\nfunction XMLReader(){\n\n}\n\nXMLReader.prototype = {\n\tparse:function(source,defaultNSMap,entityMap){\n\t\tvar domBuilder = this.domBuilder;\n\t\tdomBuilder.startDocument();\n\t\t_copy(defaultNSMap ,defaultNSMap = {})\n\t\tparse(source,defaultNSMap,entityMap,\n\t\t\t\tdomBuilder,this.errorHandler);\n\t\tdomBuilder.endDocument();\n\t}\n}\nfunction parse(source,defaultNSMapCopy,entityMap,domBuilder,errorHandler){\n\tfunction fixedFromCharCode(code) {\n\t\t// String.prototype.fromCharCode does not supports\n\t\t// > 2 bytes unicode chars directly\n\t\tif (code > 0xffff) {\n\t\t\tcode -= 0x10000;\n\t\t\tvar surrogate1 = 0xd800 + (code >> 10)\n\t\t\t\t, surrogate2 = 0xdc00 + (code & 0x3ff);\n\n\t\t\treturn String.fromCharCode(surrogate1, surrogate2);\n\t\t} else {\n\t\t\treturn String.fromCharCode(code);\n\t\t}\n\t}\n\tfunction entityReplacer(a){\n\t\tvar k = a.slice(1,-1);\n\t\tif (Object.hasOwnProperty.call(entityMap, k)) {\n\t\t\treturn entityMap[k];\n\t\t}else if(k.charAt(0) === '#'){\n\t\t\treturn fixedFromCharCode(parseInt(k.substr(1).replace('x','0x')))\n\t\t}else{\n\t\t\terrorHandler.error('entity not found:'+a);\n\t\t\treturn a;\n\t\t}\n\t}\n\tfunction appendText(end){//has some bugs\n\t\tif(end>start){\n\t\t\tvar xt = source.substring(start,end).replace(/&#?\\w+;/g,entityReplacer);\n\t\t\tlocator&&position(start);\n\t\t\tdomBuilder.characters(xt,0,end-start);\n\t\t\tstart = end\n\t\t}\n\t}\n\tfunction position(p,m){\n\t\twhile(p>=lineEnd && (m = linePattern.exec(source))){\n\t\t\tlineStart = m.index;\n\t\t\tlineEnd = lineStart + m[0].length;\n\t\t\tlocator.lineNumber++;\n\t\t\t//console.log('line++:',locator,startPos,endPos)\n\t\t}\n\t\tlocator.columnNumber = p-lineStart+1;\n\t}\n\tvar lineStart = 0;\n\tvar lineEnd = 0;\n\tvar linePattern = /.*(?:\\r\\n?|\\n)|.*$/g\n\tvar locator = domBuilder.locator;\n\n\tvar parseStack = [{currentNSMap:defaultNSMapCopy}]\n\tvar closeMap = {};\n\tvar start = 0;\n\twhile(true){\n\t\ttry{\n\t\t\tvar tagStart = source.indexOf('<',start);\n\t\t\tif(tagStart<0){\n\t\t\t\tif(!source.substr(start).match(/^\\s*$/)){\n\t\t\t\t\tvar doc = domBuilder.doc;\n\t \t\t\tvar text = doc.createTextNode(source.substr(start));\n\t \t\t\tdoc.appendChild(text);\n\t \t\t\tdomBuilder.currentElement = text;\n\t\t\t\t}\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif(tagStart>start){\n\t\t\t\tappendText(tagStart);\n\t\t\t}\n\t\t\tswitch(source.charAt(tagStart+1)){\n\t\t\tcase '/':\n\t\t\t\tvar end = source.indexOf('>',tagStart+3);\n\t\t\t\tvar tagName = source.substring(tagStart + 2, end).replace(/[ \\t\\n\\r]+$/g, '');\n\t\t\t\tvar config = parseStack.pop();\n\t\t\t\tif(end<0){\n\n\t \t\ttagName = source.substring(tagStart+2).replace(/[\\s<].*/,'');\n\t \t\terrorHandler.error(\"end tag name: \"+tagName+' is not complete:'+config.tagName);\n\t \t\tend = tagStart+1+tagName.length;\n\t \t}else if(tagName.match(/\\s</)){\n\t \t\ttagName = tagName.replace(/[\\s<].*/,'');\n\t \t\terrorHandler.error(\"end tag name: \"+tagName+' maybe not complete');\n\t \t\tend = tagStart+1+tagName.length;\n\t\t\t\t}\n\t\t\t\tvar localNSMap = config.localNSMap;\n\t\t\t\tvar endMatch = config.tagName == tagName;\n\t\t\t\tvar endIgnoreCaseMach = endMatch || config.tagName&&config.tagName.toLowerCase() == tagName.toLowerCase()\n\t\t if(endIgnoreCaseMach){\n\t\t \tdomBuilder.endElement(config.uri,config.localName,tagName);\n\t\t\t\t\tif(localNSMap){\n\t\t\t\t\t\tfor (var prefix in localNSMap) {\n\t\t\t\t\t\t\tif (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {\n\t\t\t\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif(!endMatch){\n\t\t \terrorHandler.fatalError(\"end tag name: \"+tagName+' is not match the current start tagName:'+config.tagName ); // No known test case\n\t\t\t\t\t}\n\t\t }else{\n\t\t \tparseStack.push(config)\n\t\t }\n\n\t\t\t\tend++;\n\t\t\t\tbreak;\n\t\t\t\t// end elment\n\t\t\tcase '?':// <?...?>\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseInstruction(source,tagStart,domBuilder);\n\t\t\t\tbreak;\n\t\t\tcase '!':// <!doctype,<![CDATA,<!--\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tend = parseDCC(source,tagStart,domBuilder,errorHandler);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tlocator&&position(tagStart);\n\t\t\t\tvar el = new ElementAttributes();\n\t\t\t\tvar currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\t\t\t\t//elStartEnd\n\t\t\t\tvar end = parseElementStartPart(source,tagStart,el,currentNSMap,entityReplacer,errorHandler);\n\t\t\t\tvar len = el.length;\n\n\n\t\t\t\tif(!el.closed && fixSelfClosed(source,end,el.tagName,closeMap)){\n\t\t\t\t\tel.closed = true;\n\t\t\t\t\tif(!entityMap.nbsp){\n\t\t\t\t\t\terrorHandler.warning('unclosed xml attribute');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif(locator && len){\n\t\t\t\t\tvar locator2 = copyLocator(locator,{});\n\t\t\t\t\t//try{//attribute position fixed\n\t\t\t\t\tfor(var i = 0;i<len;i++){\n\t\t\t\t\t\tvar a = el[i];\n\t\t\t\t\t\tposition(a.offset);\n\t\t\t\t\t\ta.locator = copyLocator(locator,{});\n\t\t\t\t\t}\n\t\t\t\t\tdomBuilder.locator = locator2\n\t\t\t\t\tif(appendElement(el,domBuilder,currentNSMap)){\n\t\t\t\t\t\tparseStack.push(el)\n\t\t\t\t\t}\n\t\t\t\t\tdomBuilder.locator = locator;\n\t\t\t\t}else{\n\t\t\t\t\tif(appendElement(el,domBuilder,currentNSMap)){\n\t\t\t\t\t\tparseStack.push(el)\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (NAMESPACE.isHTML(el.uri) && !el.closed) {\n\t\t\t\t\tend = parseHtmlSpecialContent(source,end,el.tagName,entityReplacer,domBuilder)\n\t\t\t\t} else {\n\t\t\t\t\tend++;\n\t\t\t\t}\n\t\t\t}\n\t\t}catch(e){\n\t\t\tif (e instanceof ParseError) {\n\t\t\t\tthrow e;\n\t\t\t}\n\t\t\terrorHandler.error('element parse error: '+e)\n\t\t\tend = -1;\n\t\t}\n\t\tif(end>start){\n\t\t\tstart = end;\n\t\t}else{\n\t\t\t//TODO: 这里有可能sax回退,有位置错误风险\n\t\t\tappendText(Math.max(tagStart,start)+1);\n\t\t}\n\t}\n}\nfunction copyLocator(f,t){\n\tt.lineNumber = f.lineNumber;\n\tt.columnNumber = f.columnNumber;\n\treturn t;\n}\n\n/**\n * @see #appendElement(source,elStartEnd,el,selfClosed,entityReplacer,domBuilder,parseStack);\n * @return end of the elementStartPart(end of elementEndPart for selfClosed el)\n */\nfunction parseElementStartPart(source,start,el,currentNSMap,entityReplacer,errorHandler){\n\n\t/**\n\t * @param {string} qname\n\t * @param {string} value\n\t * @param {number} startIndex\n\t */\n\tfunction addAttribute(qname, value, startIndex) {\n\t\tif (el.attributeNames.hasOwnProperty(qname)) {\n\t\t\terrorHandler.fatalError('Attribute ' + qname + ' redefined')\n\t\t}\n\t\tel.addValue(\n\t\t\tqname,\n\t\t\t// @see https://www.w3.org/TR/xml/#AVNormalize\n\t\t\t// since the xmldom sax parser does not \"interpret\" DTD the following is not implemented:\n\t\t\t// - recursive replacement of (DTD) entity references\n\t\t\t// - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA\n\t\t\tvalue.replace(/[\\t\\n\\r]/g, ' ').replace(/&#?\\w+;/g, entityReplacer),\n\t\t\tstartIndex\n\t\t)\n\t}\n\tvar attrName;\n\tvar value;\n\tvar p = ++start;\n\tvar s = S_TAG;//status\n\twhile(true){\n\t\tvar c = source.charAt(p);\n\t\tswitch(c){\n\t\tcase '=':\n\t\t\tif(s === S_ATTR){//attrName\n\t\t\t\tattrName = source.slice(start,p);\n\t\t\t\ts = S_EQ;\n\t\t\t}else if(s === S_ATTR_SPACE){\n\t\t\t\ts = S_EQ;\n\t\t\t}else{\n\t\t\t\t//fatalError: equal must after attrName or space after attrName\n\t\t\t\tthrow new Error('attribute equal must after attrName'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '\\'':\n\t\tcase '\"':\n\t\t\tif(s === S_EQ || s === S_ATTR //|| s == S_ATTR_SPACE\n\t\t\t\t){//equal\n\t\t\t\tif(s === S_ATTR){\n\t\t\t\t\terrorHandler.warning('attribute value must after \"=\"')\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t}\n\t\t\t\tstart = p+1;\n\t\t\t\tp = source.indexOf(c,start)\n\t\t\t\tif(p>0){\n\t\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\t\taddAttribute(attrName, value, start-1);\n\t\t\t\t\ts = S_ATTR_END;\n\t\t\t\t}else{\n\t\t\t\t\t//fatalError: no end quot match\n\t\t\t\t\tthrow new Error('attribute value no end \\''+c+'\\' match');\n\t\t\t\t}\n\t\t\t}else if(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\tvalue = source.slice(start, p);\n\t\t\t\taddAttribute(attrName, value, start);\n\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed start quot('+c+')!!');\n\t\t\t\tstart = p+1;\n\t\t\t\ts = S_ATTR_END\n\t\t\t}else{\n\t\t\t\t//fatalError: no equal before\n\t\t\t\tthrow new Error('attribute value must after \"=\"'); // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase '/':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\ts =S_TAG_CLOSE;\n\t\t\t\tel.closed = true;\n\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\tcase S_ATTR:\n\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tel.closed = true;\n\t\t\t\tbreak;\n\t\t\t//case S_EQ:\n\t\t\tdefault:\n\t\t\t\tthrow new Error(\"attribute invalid close char('/')\") // No known test case\n\t\t\t}\n\t\t\tbreak;\n\t\tcase ''://end document\n\t\t\terrorHandler.error('unexpected end of input');\n\t\t\tif(s == S_TAG){\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\t}\n\t\t\treturn p;\n\t\tcase '>':\n\t\t\tswitch(s){\n\t\t\tcase S_TAG:\n\t\t\t\tel.setTagName(source.slice(start,p));\n\t\t\tcase S_ATTR_END:\n\t\t\tcase S_TAG_SPACE:\n\t\t\tcase S_TAG_CLOSE:\n\t\t\t\tbreak;//normal\n\t\t\tcase S_ATTR_NOQUOT_VALUE://Compatible state\n\t\t\tcase S_ATTR:\n\t\t\t\tvalue = source.slice(start,p);\n\t\t\t\tif(value.slice(-1) === '/'){\n\t\t\t\t\tel.closed = true;\n\t\t\t\t\tvalue = value.slice(0,-1)\n\t\t\t\t}\n\t\t\tcase S_ATTR_SPACE:\n\t\t\t\tif(s === S_ATTR_SPACE){\n\t\t\t\t\tvalue = attrName;\n\t\t\t\t}\n\t\t\t\tif(s == S_ATTR_NOQUOT_VALUE){\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\t}else{\n\t\t\t\t\tif(!NAMESPACE.isHTML(currentNSMap['']) || !value.match(/^(?:disabled|checked|selected)$/i)){\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed value!! \"'+value+'\" instead!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(value, value, start)\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase S_EQ:\n\t\t\t\tthrow new Error('attribute value missed!!');\n\t\t\t}\n//\t\t\tconsole.log(tagName,tagNamePattern,tagNamePattern.test(tagName))\n\t\t\treturn p;\n\t\t/*xml space '\\x20' | #x9 | #xD | #xA; */\n\t\tcase '\\u0080':\n\t\t\tc = ' ';\n\t\tdefault:\n\t\t\tif(c<= ' '){//space\n\t\t\t\tswitch(s){\n\t\t\t\tcase S_TAG:\n\t\t\t\t\tel.setTagName(source.slice(start,p));//tagName\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR:\n\t\t\t\t\tattrName = source.slice(start,p)\n\t\t\t\t\ts = S_ATTR_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_NOQUOT_VALUE:\n\t\t\t\t\tvar value = source.slice(start, p);\n\t\t\t\t\terrorHandler.warning('attribute \"'+value+'\" missed quot(\")!!');\n\t\t\t\t\taddAttribute(attrName, value, start)\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\ts = S_TAG_SPACE;\n\t\t\t\t\tbreak;\n\t\t\t\t//case S_TAG_SPACE:\n\t\t\t\t//case S_EQ:\n\t\t\t\t//case S_ATTR_SPACE:\n\t\t\t\t//\tvoid();break;\n\t\t\t\t//case S_TAG_CLOSE:\n\t\t\t\t\t//ignore warning\n\t\t\t\t}\n\t\t\t}else{//not space\n//S_TAG,\tS_ATTR,\tS_EQ,\tS_ATTR_NOQUOT_VALUE\n//S_ATTR_SPACE,\tS_ATTR_END,\tS_TAG_SPACE, S_TAG_CLOSE\n\t\t\t\tswitch(s){\n\t\t\t\t//case S_TAG:void();break;\n\t\t\t\t//case S_ATTR:void();break;\n\t\t\t\t//case S_ATTR_NOQUOT_VALUE:void();break;\n\t\t\t\tcase S_ATTR_SPACE:\n\t\t\t\t\tvar tagName = el.tagName;\n\t\t\t\t\tif (!NAMESPACE.isHTML(currentNSMap['']) || !attrName.match(/^(?:disabled|checked|selected)$/i)) {\n\t\t\t\t\t\terrorHandler.warning('attribute \"'+attrName+'\" missed value!! \"'+attrName+'\" instead2!!')\n\t\t\t\t\t}\n\t\t\t\t\taddAttribute(attrName, attrName, start);\n\t\t\t\t\tstart = p;\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_ATTR_END:\n\t\t\t\t\terrorHandler.warning('attribute space is required\"'+attrName+'\"!!')\n\t\t\t\tcase S_TAG_SPACE:\n\t\t\t\t\ts = S_ATTR;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_EQ:\n\t\t\t\t\ts = S_ATTR_NOQUOT_VALUE;\n\t\t\t\t\tstart = p;\n\t\t\t\t\tbreak;\n\t\t\t\tcase S_TAG_CLOSE:\n\t\t\t\t\tthrow new Error(\"elements closed character '/' and '>' must be connected to\");\n\t\t\t\t}\n\t\t\t}\n\t\t}//end outer switch\n\t\t//console.log('p++',p)\n\t\tp++;\n\t}\n}\n/**\n * @return true if has new namespace define\n */\nfunction appendElement(el,domBuilder,currentNSMap){\n\tvar tagName = el.tagName;\n\tvar localNSMap = null;\n\t//var currentNSMap = parseStack[parseStack.length-1].currentNSMap;\n\tvar i = el.length;\n\twhile(i--){\n\t\tvar a = el[i];\n\t\tvar qName = a.qName;\n\t\tvar value = a.value;\n\t\tvar nsp = qName.indexOf(':');\n\t\tif(nsp>0){\n\t\t\tvar prefix = a.prefix = qName.slice(0,nsp);\n\t\t\tvar localName = qName.slice(nsp+1);\n\t\t\tvar nsPrefix = prefix === 'xmlns' && localName\n\t\t}else{\n\t\t\tlocalName = qName;\n\t\t\tprefix = null\n\t\t\tnsPrefix = qName === 'xmlns' && ''\n\t\t}\n\t\t//can not set prefix,because prefix !== ''\n\t\ta.localName = localName ;\n\t\t//prefix == null for no ns prefix attribute\n\t\tif(nsPrefix !== false){//hack!!\n\t\t\tif(localNSMap == null){\n\t\t\t\tlocalNSMap = {}\n\t\t\t\t//console.log(currentNSMap,0)\n\t\t\t\t_copy(currentNSMap,currentNSMap={})\n\t\t\t\t//console.log(currentNSMap,1)\n\t\t\t}\n\t\t\tcurrentNSMap[nsPrefix] = localNSMap[nsPrefix] = value;\n\t\t\ta.uri = NAMESPACE.XMLNS\n\t\t\tdomBuilder.startPrefixMapping(nsPrefix, value)\n\t\t}\n\t}\n\tvar i = el.length;\n\twhile(i--){\n\t\ta = el[i];\n\t\tvar prefix = a.prefix;\n\t\tif(prefix){//no prefix attribute has no namespace\n\t\t\tif(prefix === 'xml'){\n\t\t\t\ta.uri = NAMESPACE.XML;\n\t\t\t}if(prefix !== 'xmlns'){\n\t\t\t\ta.uri = currentNSMap[prefix || '']\n\n\t\t\t\t//{console.log('###'+a.qName,domBuilder.locator.systemId+'',currentNSMap,a.uri)}\n\t\t\t}\n\t\t}\n\t}\n\tvar nsp = tagName.indexOf(':');\n\tif(nsp>0){\n\t\tprefix = el.prefix = tagName.slice(0,nsp);\n\t\tlocalName = el.localName = tagName.slice(nsp+1);\n\t}else{\n\t\tprefix = null;//important!!\n\t\tlocalName = el.localName = tagName;\n\t}\n\t//no prefix element has default namespace\n\tvar ns = el.uri = currentNSMap[prefix || ''];\n\tdomBuilder.startElement(ns,localName,tagName,el);\n\t//endPrefixMapping and startPrefixMapping have not any help for dom builder\n\t//localNSMap = null\n\tif(el.closed){\n\t\tdomBuilder.endElement(ns,localName,tagName);\n\t\tif(localNSMap){\n\t\t\tfor (prefix in localNSMap) {\n\t\t\t\tif (Object.prototype.hasOwnProperty.call(localNSMap, prefix)) {\n\t\t\t\t\tdomBuilder.endPrefixMapping(prefix);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}else{\n\t\tel.currentNSMap = currentNSMap;\n\t\tel.localNSMap = localNSMap;\n\t\t//parseStack.push(el);\n\t\treturn true;\n\t}\n}\nfunction parseHtmlSpecialContent(source,elStartEnd,tagName,entityReplacer,domBuilder){\n\tif(/^(?:script|textarea)$/i.test(tagName)){\n\t\tvar elEndStart = source.indexOf('</'+tagName+'>',elStartEnd);\n\t\tvar text = source.substring(elStartEnd+1,elEndStart);\n\t\tif(/[&<]/.test(text)){\n\t\t\tif(/^script$/i.test(tagName)){\n\t\t\t\t//if(!/\\]\\]>/.test(text)){\n\t\t\t\t\t//lexHandler.startCDATA();\n\t\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\t\t//lexHandler.endCDATA();\n\t\t\t\t\treturn elEndStart;\n\t\t\t\t//}\n\t\t\t}//}else{//text area\n\t\t\t\ttext = text.replace(/&#?\\w+;/g,entityReplacer);\n\t\t\t\tdomBuilder.characters(text,0,text.length);\n\t\t\t\treturn elEndStart;\n\t\t\t//}\n\n\t\t}\n\t}\n\treturn elStartEnd+1;\n}\nfunction fixSelfClosed(source,elStartEnd,tagName,closeMap){\n\t//if(tagName in closeMap){\n\tvar pos = closeMap[tagName];\n\tif(pos == null){\n\t\t//console.log(tagName)\n\t\tpos = source.lastIndexOf('</'+tagName+'>')\n\t\tif(pos<elStartEnd){//忘记闭合\n\t\t\tpos = source.lastIndexOf('</'+tagName)\n\t\t}\n\t\tcloseMap[tagName] =pos\n\t}\n\treturn pos<elStartEnd;\n\t//}\n}\n\nfunction _copy (source, target) {\n\tfor (var n in source) {\n\t\tif (Object.prototype.hasOwnProperty.call(source, n)) {\n\t\t\ttarget[n] = source[n];\n\t\t}\n\t}\n}\n\nfunction parseDCC(source,start,domBuilder,errorHandler){//sure start with '<!'\n\tvar next= source.charAt(start+2)\n\tswitch(next){\n\tcase '-':\n\t\tif(source.charAt(start + 3) === '-'){\n\t\t\tvar end = source.indexOf('-->',start+4);\n\t\t\t//append comment source.substring(4,end)//<!--\n\t\t\tif(end>start){\n\t\t\t\tdomBuilder.comment(source,start+4,end-start-4);\n\t\t\t\treturn end+3;\n\t\t\t}else{\n\t\t\t\terrorHandler.error(\"Unclosed comment\");\n\t\t\t\treturn -1;\n\t\t\t}\n\t\t}else{\n\t\t\t//error\n\t\t\treturn -1;\n\t\t}\n\tdefault:\n\t\tif(source.substr(start+3,6) == 'CDATA['){\n\t\t\tvar end = source.indexOf(']]>',start+9);\n\t\t\tdomBuilder.startCDATA();\n\t\t\tdomBuilder.characters(source,start+9,end-start-9);\n\t\t\tdomBuilder.endCDATA()\n\t\t\treturn end+3;\n\t\t}\n\t\t//<!DOCTYPE\n\t\t//startDTD(java.lang.String name, java.lang.String publicId, java.lang.String systemId)\n\t\tvar matchs = split(source,start);\n\t\tvar len = matchs.length;\n\t\tif(len>1 && /!doctype/i.test(matchs[0][0])){\n\t\t\tvar name = matchs[1][0];\n\t\t\tvar pubid = false;\n\t\t\tvar sysid = false;\n\t\t\tif(len>3){\n\t\t\t\tif(/^public$/i.test(matchs[2][0])){\n\t\t\t\t\tpubid = matchs[3][0];\n\t\t\t\t\tsysid = len>4 && matchs[4][0];\n\t\t\t\t}else if(/^system$/i.test(matchs[2][0])){\n\t\t\t\t\tsysid = matchs[3][0];\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar lastMatch = matchs[len-1]\n\t\t\tdomBuilder.startDTD(name, pubid, sysid);\n\t\t\tdomBuilder.endDTD();\n\n\t\t\treturn lastMatch.index+lastMatch[0].length\n\t\t}\n\t}\n\treturn -1;\n}\n\n\n\nfunction parseInstruction(source,start,domBuilder){\n\tvar end = source.indexOf('?>',start);\n\tif(end){\n\t\tvar match = source.substring(start,end).match(/^<\\?(\\S*)\\s*([\\s\\S]*?)\\s*$/);\n\t\tif(match){\n\t\t\tvar len = match[0].length;\n\t\t\tdomBuilder.processingInstruction(match[1], match[2]) ;\n\t\t\treturn end+2;\n\t\t}else{//error\n\t\t\treturn -1;\n\t\t}\n\t}\n\treturn -1;\n}\n\nfunction ElementAttributes(){\n\tthis.attributeNames = {}\n}\nElementAttributes.prototype = {\n\tsetTagName:function(tagName){\n\t\tif(!tagNamePattern.test(tagName)){\n\t\t\tthrow new Error('invalid tagName:'+tagName)\n\t\t}\n\t\tthis.tagName = tagName\n\t},\n\taddValue:function(qName, value, offset) {\n\t\tif(!tagNamePattern.test(qName)){\n\t\t\tthrow new Error('invalid attribute:'+qName)\n\t\t}\n\t\tthis.attributeNames[qName] = this.length;\n\t\tthis[this.length++] = {qName:qName,value:value,offset:offset}\n\t},\n\tlength:0,\n\tgetLocalName:function(i){return this[i].localName},\n\tgetLocator:function(i){return this[i].locator},\n\tgetQName:function(i){return this[i].qName},\n\tgetURI:function(i){return this[i].uri},\n\tgetValue:function(i){return this[i].value}\n//\t,getIndex:function(uri, localName)){\n//\t\tif(localName){\n//\n//\t\t}else{\n//\t\t\tvar qName = uri\n//\t\t}\n//\t},\n//\tgetValue:function(){return this.getValue(this.getIndex.apply(this,arguments))},\n//\tgetType:function(uri,localName){}\n//\tgetType:function(i){},\n}\n\n\n\nfunction split(source,start){\n\tvar match;\n\tvar buf = [];\n\tvar reg = /'[^']+'|\"[^\"]+\"|[^\\s<>\\/=]+=?|(\\/?\\s*>|<)/g;\n\treg.lastIndex = start;\n\treg.exec(source);//skip <\n\twhile(match = reg.exec(source)){\n\t\tbuf.push(match);\n\t\tif(match[1])return buf;\n\t}\n}\n\nexports.XMLReader = XMLReader;\nexports.ParseError = ParseError;\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/@xmldom/xmldom/lib/sax.js?\n}");
136
+
137
+ /***/ },
138
+
23
139
  /***/ "./node_modules/abort-controller/browser.js"
24
140
  /*!**************************************************!*\
25
141
  !*** ./node_modules/abort-controller/browser.js ***!
@@ -86,6 +202,16 @@ eval("{/*!\n * The buffer module from node.js, for the browser.\n *\n * @author
86
202
 
87
203
  /***/ },
88
204
 
205
+ /***/ "./node_modules/cross-fetch/dist/browser-ponyfill.js"
206
+ /*!***********************************************************!*\
207
+ !*** ./node_modules/cross-fetch/dist/browser-ponyfill.js ***!
208
+ \***********************************************************/
209
+ (module, exports, __webpack_require__) {
210
+
211
+ eval("{// Save global object in a variable\nvar __global__ =\n(typeof globalThis !== 'undefined' && globalThis) ||\n(typeof self !== 'undefined' && self) ||\n(typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g);\n// Create an object that extends from __global__ without the fetch function\nvar __globalThis__ = (function () {\nfunction F() {\nthis.fetch = false;\nthis.DOMException = __global__.DOMException\n}\nF.prototype = __global__; // Needed for feature detection on whatwg-fetch's code\nreturn new F();\n})();\n// Wraps whatwg-fetch with a function scope to hijack the global object\n// \"globalThis\" that's going to be patched\n(function(globalThis) {\n\nvar irrelevant = (function (exports) {\n\n /* eslint-disable no-prototype-builtins */\n var g =\n (typeof globalThis !== 'undefined' && globalThis) ||\n (typeof self !== 'undefined' && self) ||\n // eslint-disable-next-line no-undef\n (typeof __webpack_require__.g !== 'undefined' && __webpack_require__.g) ||\n {};\n\n var support = {\n searchParams: 'URLSearchParams' in g,\n iterable: 'Symbol' in g && 'iterator' in Symbol,\n blob:\n 'FileReader' in g &&\n 'Blob' in g &&\n (function() {\n try {\n new Blob();\n return true\n } catch (e) {\n return false\n }\n })(),\n formData: 'FormData' in g,\n arrayBuffer: 'ArrayBuffer' in g\n };\n\n function isDataView(obj) {\n return obj && DataView.prototype.isPrototypeOf(obj)\n }\n\n if (support.arrayBuffer) {\n var viewClasses = [\n '[object Int8Array]',\n '[object Uint8Array]',\n '[object Uint8ClampedArray]',\n '[object Int16Array]',\n '[object Uint16Array]',\n '[object Int32Array]',\n '[object Uint32Array]',\n '[object Float32Array]',\n '[object Float64Array]'\n ];\n\n var isArrayBufferView =\n ArrayBuffer.isView ||\n function(obj) {\n return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1\n };\n }\n\n function normalizeName(name) {\n if (typeof name !== 'string') {\n name = String(name);\n }\n if (/[^a-z0-9\\-#$%&'*+.^_`|~!]/i.test(name) || name === '') {\n throw new TypeError('Invalid character in header field name: \"' + name + '\"')\n }\n return name.toLowerCase()\n }\n\n function normalizeValue(value) {\n if (typeof value !== 'string') {\n value = String(value);\n }\n return value\n }\n\n // Build a destructive iterator for the value list\n function iteratorFor(items) {\n var iterator = {\n next: function() {\n var value = items.shift();\n return {done: value === undefined, value: value}\n }\n };\n\n if (support.iterable) {\n iterator[Symbol.iterator] = function() {\n return iterator\n };\n }\n\n return iterator\n }\n\n function Headers(headers) {\n this.map = {};\n\n if (headers instanceof Headers) {\n headers.forEach(function(value, name) {\n this.append(name, value);\n }, this);\n } else if (Array.isArray(headers)) {\n headers.forEach(function(header) {\n if (header.length != 2) {\n throw new TypeError('Headers constructor: expected name/value pair to be length 2, found' + header.length)\n }\n this.append(header[0], header[1]);\n }, this);\n } else if (headers) {\n Object.getOwnPropertyNames(headers).forEach(function(name) {\n this.append(name, headers[name]);\n }, this);\n }\n }\n\n Headers.prototype.append = function(name, value) {\n name = normalizeName(name);\n value = normalizeValue(value);\n var oldValue = this.map[name];\n this.map[name] = oldValue ? oldValue + ', ' + value : value;\n };\n\n Headers.prototype['delete'] = function(name) {\n delete this.map[normalizeName(name)];\n };\n\n Headers.prototype.get = function(name) {\n name = normalizeName(name);\n return this.has(name) ? this.map[name] : null\n };\n\n Headers.prototype.has = function(name) {\n return this.map.hasOwnProperty(normalizeName(name))\n };\n\n Headers.prototype.set = function(name, value) {\n this.map[normalizeName(name)] = normalizeValue(value);\n };\n\n Headers.prototype.forEach = function(callback, thisArg) {\n for (var name in this.map) {\n if (this.map.hasOwnProperty(name)) {\n callback.call(thisArg, this.map[name], name, this);\n }\n }\n };\n\n Headers.prototype.keys = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push(name);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.values = function() {\n var items = [];\n this.forEach(function(value) {\n items.push(value);\n });\n return iteratorFor(items)\n };\n\n Headers.prototype.entries = function() {\n var items = [];\n this.forEach(function(value, name) {\n items.push([name, value]);\n });\n return iteratorFor(items)\n };\n\n if (support.iterable) {\n Headers.prototype[Symbol.iterator] = Headers.prototype.entries;\n }\n\n function consumed(body) {\n if (body._noBody) return\n if (body.bodyUsed) {\n return Promise.reject(new TypeError('Already read'))\n }\n body.bodyUsed = true;\n }\n\n function fileReaderReady(reader) {\n return new Promise(function(resolve, reject) {\n reader.onload = function() {\n resolve(reader.result);\n };\n reader.onerror = function() {\n reject(reader.error);\n };\n })\n }\n\n function readBlobAsArrayBuffer(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n reader.readAsArrayBuffer(blob);\n return promise\n }\n\n function readBlobAsText(blob) {\n var reader = new FileReader();\n var promise = fileReaderReady(reader);\n var match = /charset=([A-Za-z0-9_-]+)/.exec(blob.type);\n var encoding = match ? match[1] : 'utf-8';\n reader.readAsText(blob, encoding);\n return promise\n }\n\n function readArrayBufferAsText(buf) {\n var view = new Uint8Array(buf);\n var chars = new Array(view.length);\n\n for (var i = 0; i < view.length; i++) {\n chars[i] = String.fromCharCode(view[i]);\n }\n return chars.join('')\n }\n\n function bufferClone(buf) {\n if (buf.slice) {\n return buf.slice(0)\n } else {\n var view = new Uint8Array(buf.byteLength);\n view.set(new Uint8Array(buf));\n return view.buffer\n }\n }\n\n function Body() {\n this.bodyUsed = false;\n\n this._initBody = function(body) {\n /*\n fetch-mock wraps the Response object in an ES6 Proxy to\n provide useful test harness features such as flush. However, on\n ES5 browsers without fetch or Proxy support pollyfills must be used;\n the proxy-pollyfill is unable to proxy an attribute unless it exists\n on the object before the Proxy is created. This change ensures\n Response.bodyUsed exists on the instance, while maintaining the\n semantic of setting Request.bodyUsed in the constructor before\n _initBody is called.\n */\n // eslint-disable-next-line no-self-assign\n this.bodyUsed = this.bodyUsed;\n this._bodyInit = body;\n if (!body) {\n this._noBody = true;\n this._bodyText = '';\n } else if (typeof body === 'string') {\n this._bodyText = body;\n } else if (support.blob && Blob.prototype.isPrototypeOf(body)) {\n this._bodyBlob = body;\n } else if (support.formData && FormData.prototype.isPrototypeOf(body)) {\n this._bodyFormData = body;\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this._bodyText = body.toString();\n } else if (support.arrayBuffer && support.blob && isDataView(body)) {\n this._bodyArrayBuffer = bufferClone(body.buffer);\n // IE 10-11 can't handle a DataView body.\n this._bodyInit = new Blob([this._bodyArrayBuffer]);\n } else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {\n this._bodyArrayBuffer = bufferClone(body);\n } else {\n this._bodyText = body = Object.prototype.toString.call(body);\n }\n\n if (!this.headers.get('content-type')) {\n if (typeof body === 'string') {\n this.headers.set('content-type', 'text/plain;charset=UTF-8');\n } else if (this._bodyBlob && this._bodyBlob.type) {\n this.headers.set('content-type', this._bodyBlob.type);\n } else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {\n this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');\n }\n }\n };\n\n if (support.blob) {\n this.blob = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return Promise.resolve(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(new Blob([this._bodyArrayBuffer]))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as blob')\n } else {\n return Promise.resolve(new Blob([this._bodyText]))\n }\n };\n }\n\n this.arrayBuffer = function() {\n if (this._bodyArrayBuffer) {\n var isConsumed = consumed(this);\n if (isConsumed) {\n return isConsumed\n } else if (ArrayBuffer.isView(this._bodyArrayBuffer)) {\n return Promise.resolve(\n this._bodyArrayBuffer.buffer.slice(\n this._bodyArrayBuffer.byteOffset,\n this._bodyArrayBuffer.byteOffset + this._bodyArrayBuffer.byteLength\n )\n )\n } else {\n return Promise.resolve(this._bodyArrayBuffer)\n }\n } else if (support.blob) {\n return this.blob().then(readBlobAsArrayBuffer)\n } else {\n throw new Error('could not read as ArrayBuffer')\n }\n };\n\n this.text = function() {\n var rejected = consumed(this);\n if (rejected) {\n return rejected\n }\n\n if (this._bodyBlob) {\n return readBlobAsText(this._bodyBlob)\n } else if (this._bodyArrayBuffer) {\n return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))\n } else if (this._bodyFormData) {\n throw new Error('could not read FormData body as text')\n } else {\n return Promise.resolve(this._bodyText)\n }\n };\n\n if (support.formData) {\n this.formData = function() {\n return this.text().then(decode)\n };\n }\n\n this.json = function() {\n return this.text().then(JSON.parse)\n };\n\n return this\n }\n\n // HTTP methods whose capitalization should be normalized\n var methods = ['CONNECT', 'DELETE', 'GET', 'HEAD', 'OPTIONS', 'PATCH', 'POST', 'PUT', 'TRACE'];\n\n function normalizeMethod(method) {\n var upcased = method.toUpperCase();\n return methods.indexOf(upcased) > -1 ? upcased : method\n }\n\n function Request(input, options) {\n if (!(this instanceof Request)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n\n options = options || {};\n var body = options.body;\n\n if (input instanceof Request) {\n if (input.bodyUsed) {\n throw new TypeError('Already read')\n }\n this.url = input.url;\n this.credentials = input.credentials;\n if (!options.headers) {\n this.headers = new Headers(input.headers);\n }\n this.method = input.method;\n this.mode = input.mode;\n this.signal = input.signal;\n if (!body && input._bodyInit != null) {\n body = input._bodyInit;\n input.bodyUsed = true;\n }\n } else {\n this.url = String(input);\n }\n\n this.credentials = options.credentials || this.credentials || 'same-origin';\n if (options.headers || !this.headers) {\n this.headers = new Headers(options.headers);\n }\n this.method = normalizeMethod(options.method || this.method || 'GET');\n this.mode = options.mode || this.mode || null;\n this.signal = options.signal || this.signal || (function () {\n if ('AbortController' in g) {\n var ctrl = new AbortController();\n return ctrl.signal;\n }\n }());\n this.referrer = null;\n\n if ((this.method === 'GET' || this.method === 'HEAD') && body) {\n throw new TypeError('Body not allowed for GET or HEAD requests')\n }\n this._initBody(body);\n\n if (this.method === 'GET' || this.method === 'HEAD') {\n if (options.cache === 'no-store' || options.cache === 'no-cache') {\n // Search for a '_' parameter in the query string\n var reParamSearch = /([?&])_=[^&]*/;\n if (reParamSearch.test(this.url)) {\n // If it already exists then set the value with the current time\n this.url = this.url.replace(reParamSearch, '$1_=' + new Date().getTime());\n } else {\n // Otherwise add a new '_' parameter to the end with the current time\n var reQueryString = /\\?/;\n this.url += (reQueryString.test(this.url) ? '&' : '?') + '_=' + new Date().getTime();\n }\n }\n }\n }\n\n Request.prototype.clone = function() {\n return new Request(this, {body: this._bodyInit})\n };\n\n function decode(body) {\n var form = new FormData();\n body\n .trim()\n .split('&')\n .forEach(function(bytes) {\n if (bytes) {\n var split = bytes.split('=');\n var name = split.shift().replace(/\\+/g, ' ');\n var value = split.join('=').replace(/\\+/g, ' ');\n form.append(decodeURIComponent(name), decodeURIComponent(value));\n }\n });\n return form\n }\n\n function parseHeaders(rawHeaders) {\n var headers = new Headers();\n // Replace instances of \\r\\n and \\n followed by at least one space or horizontal tab with a space\n // https://tools.ietf.org/html/rfc7230#section-3.2\n var preProcessedHeaders = rawHeaders.replace(/\\r?\\n[\\t ]+/g, ' ');\n // Avoiding split via regex to work around a common IE11 bug with the core-js 3.6.0 regex polyfill\n // https://github.com/github/fetch/issues/748\n // https://github.com/zloirock/core-js/issues/751\n preProcessedHeaders\n .split('\\r')\n .map(function(header) {\n return header.indexOf('\\n') === 0 ? header.substr(1, header.length) : header\n })\n .forEach(function(line) {\n var parts = line.split(':');\n var key = parts.shift().trim();\n if (key) {\n var value = parts.join(':').trim();\n try {\n headers.append(key, value);\n } catch (error) {\n console.warn('Response ' + error.message);\n }\n }\n });\n return headers\n }\n\n Body.call(Request.prototype);\n\n function Response(bodyInit, options) {\n if (!(this instanceof Response)) {\n throw new TypeError('Please use the \"new\" operator, this DOM object constructor cannot be called as a function.')\n }\n if (!options) {\n options = {};\n }\n\n this.type = 'default';\n this.status = options.status === undefined ? 200 : options.status;\n if (this.status < 200 || this.status > 599) {\n throw new RangeError(\"Failed to construct 'Response': The status provided (0) is outside the range [200, 599].\")\n }\n this.ok = this.status >= 200 && this.status < 300;\n this.statusText = options.statusText === undefined ? '' : '' + options.statusText;\n this.headers = new Headers(options.headers);\n this.url = options.url || '';\n this._initBody(bodyInit);\n }\n\n Body.call(Response.prototype);\n\n Response.prototype.clone = function() {\n return new Response(this._bodyInit, {\n status: this.status,\n statusText: this.statusText,\n headers: new Headers(this.headers),\n url: this.url\n })\n };\n\n Response.error = function() {\n var response = new Response(null, {status: 200, statusText: ''});\n response.ok = false;\n response.status = 0;\n response.type = 'error';\n return response\n };\n\n var redirectStatuses = [301, 302, 303, 307, 308];\n\n Response.redirect = function(url, status) {\n if (redirectStatuses.indexOf(status) === -1) {\n throw new RangeError('Invalid status code')\n }\n\n return new Response(null, {status: status, headers: {location: url}})\n };\n\n exports.DOMException = g.DOMException;\n try {\n new exports.DOMException();\n } catch (err) {\n exports.DOMException = function(message, name) {\n this.message = message;\n this.name = name;\n var error = Error(message);\n this.stack = error.stack;\n };\n exports.DOMException.prototype = Object.create(Error.prototype);\n exports.DOMException.prototype.constructor = exports.DOMException;\n }\n\n function fetch(input, init) {\n return new Promise(function(resolve, reject) {\n var request = new Request(input, init);\n\n if (request.signal && request.signal.aborted) {\n return reject(new exports.DOMException('Aborted', 'AbortError'))\n }\n\n var xhr = new XMLHttpRequest();\n\n function abortXhr() {\n xhr.abort();\n }\n\n xhr.onload = function() {\n var options = {\n statusText: xhr.statusText,\n headers: parseHeaders(xhr.getAllResponseHeaders() || '')\n };\n // This check if specifically for when a user fetches a file locally from the file system\n // Only if the status is out of a normal range\n if (request.url.indexOf('file://') === 0 && (xhr.status < 200 || xhr.status > 599)) {\n options.status = 200;\n } else {\n options.status = xhr.status;\n }\n options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');\n var body = 'response' in xhr ? xhr.response : xhr.responseText;\n setTimeout(function() {\n resolve(new Response(body, options));\n }, 0);\n };\n\n xhr.onerror = function() {\n setTimeout(function() {\n reject(new TypeError('Network request failed'));\n }, 0);\n };\n\n xhr.ontimeout = function() {\n setTimeout(function() {\n reject(new TypeError('Network request timed out'));\n }, 0);\n };\n\n xhr.onabort = function() {\n setTimeout(function() {\n reject(new exports.DOMException('Aborted', 'AbortError'));\n }, 0);\n };\n\n function fixUrl(url) {\n try {\n return url === '' && g.location.href ? g.location.href : url\n } catch (e) {\n return url\n }\n }\n\n xhr.open(request.method, fixUrl(request.url), true);\n\n if (request.credentials === 'include') {\n xhr.withCredentials = true;\n } else if (request.credentials === 'omit') {\n xhr.withCredentials = false;\n }\n\n if ('responseType' in xhr) {\n if (support.blob) {\n xhr.responseType = 'blob';\n } else if (\n support.arrayBuffer\n ) {\n xhr.responseType = 'arraybuffer';\n }\n }\n\n if (init && typeof init.headers === 'object' && !(init.headers instanceof Headers || (g.Headers && init.headers instanceof g.Headers))) {\n var names = [];\n Object.getOwnPropertyNames(init.headers).forEach(function(name) {\n names.push(normalizeName(name));\n xhr.setRequestHeader(name, normalizeValue(init.headers[name]));\n });\n request.headers.forEach(function(value, name) {\n if (names.indexOf(name) === -1) {\n xhr.setRequestHeader(name, value);\n }\n });\n } else {\n request.headers.forEach(function(value, name) {\n xhr.setRequestHeader(name, value);\n });\n }\n\n if (request.signal) {\n request.signal.addEventListener('abort', abortXhr);\n\n xhr.onreadystatechange = function() {\n // DONE (success or failure)\n if (xhr.readyState === 4) {\n request.signal.removeEventListener('abort', abortXhr);\n }\n };\n }\n\n xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);\n })\n }\n\n fetch.polyfill = true;\n\n if (!g.fetch) {\n g.fetch = fetch;\n g.Headers = Headers;\n g.Request = Request;\n g.Response = Response;\n }\n\n exports.Headers = Headers;\n exports.Request = Request;\n exports.Response = Response;\n exports.fetch = fetch;\n\n return exports;\n\n})({});\n})(__globalThis__);\n// This is a ponyfill, so...\n__globalThis__.fetch.ponyfill = true;\ndelete __globalThis__.fetch.polyfill;\n// Choose between native implementation (__global__) or custom implementation (__globalThis__)\nvar ctx = __global__.fetch ? __global__ : __globalThis__;\nexports = ctx.fetch // To enable: import fetch from 'cross-fetch'\nexports[\"default\"] = ctx.fetch // For TypeScript consumers without esModuleInterop.\nexports.fetch = ctx.fetch // To enable: import {fetch} from 'cross-fetch'\nexports.Headers = ctx.Headers\nexports.Request = ctx.Request\nexports.Response = ctx.Response\nmodule.exports = exports\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/cross-fetch/dist/browser-ponyfill.js?\n}");
212
+
213
+ /***/ },
214
+
89
215
  /***/ "./node_modules/events/events.js"
90
216
  /*!***************************************!*\
91
217
  !*** ./node_modules/events/events.js ***!
@@ -409,249 +535,788 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexp
409
535
  (__unused_webpack_module, exports) {
410
536
 
411
537
  "use strict";
412
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//# sourceMappingURL=PatternTerm.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/PatternTerm.js?\n}");
538
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//# sourceMappingURL=PatternTerm.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/PatternTerm.js?\n}");
539
+
540
+ /***/ },
541
+
542
+ /***/ "./node_modules/rdf-stores/lib/RdfStore.js"
543
+ /*!*************************************************!*\
544
+ !*** ./node_modules/rdf-stores/lib/RdfStore.js ***!
545
+ \*************************************************/
546
+ (__unused_webpack_module, exports, __webpack_require__) {
547
+
548
+ "use strict";
549
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStore = void 0;\nconst asynciterator_1 = __webpack_require__(/*! asynciterator */ \"./node_modules/asynciterator/dist/asynciterator.js\");\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_terms_1 = __webpack_require__(/*! rdf-terms */ \"./node_modules/rdf-terms/index.js\");\nconst DatasetCoreWrapper_1 = __webpack_require__(/*! ./dataset/DatasetCoreWrapper */ \"./node_modules/rdf-stores/lib/dataset/DatasetCoreWrapper.js\");\nconst TermDictionaryNumberRecordFullTerms_1 = __webpack_require__(/*! ./dictionary/TermDictionaryNumberRecordFullTerms */ \"./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecordFullTerms.js\");\nconst TermDictionaryQuotedIndexed_1 = __webpack_require__(/*! ./dictionary/TermDictionaryQuotedIndexed */ \"./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedIndexed.js\");\nconst RdfStoreIndexNestedMapQuoted_1 = __webpack_require__(/*! ./index/RdfStoreIndexNestedMapQuoted */ \"./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapQuoted.js\");\nconst OrderUtils_1 = __webpack_require__(/*! ./OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * An RDF store allows quads to be stored and fetched, based on one or more customizable indexes.\n */\nclass RdfStore {\n constructor(options) {\n this.features = { quotedTripleFiltering: true };\n this._size = 0;\n this.options = options;\n this.dataFactory = options.dataFactory;\n this.dictionary = options.dictionary;\n this.indexesWrapped = RdfStore.constructIndexesWrapped(options);\n this.indexesWrappedComponentOrders = this.indexesWrapped.map(indexThis => indexThis.componentOrder);\n }\n /**\n * Create an RDF store with default settings.\n * Concretely, this store stores triples in GSPO, GPOS, and GOSP order,\n * and makes use of in-memory number dictionary encoding.\n */\n static createDefault() {\n return new RdfStore({\n indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS,\n indexConstructor: subOptions => new RdfStoreIndexNestedMapQuoted_1.RdfStoreIndexNestedMapQuoted(subOptions),\n dictionary: new TermDictionaryQuotedIndexed_1.TermDictionaryQuotedIndexed(new TermDictionaryNumberRecordFullTerms_1.TermDictionaryNumberRecordFullTerms()),\n dataFactory: new rdf_data_factory_1.DataFactory(),\n });\n }\n /**\n * Internal helper to create index objects.\n * @param options The RDF store options object.\n */\n static constructIndexesWrapped(options) {\n const indexes = [];\n if (options.indexCombinations.length === 0) {\n throw new Error('At least one index combination is required');\n }\n for (const componentOrder of options.indexCombinations) {\n if (!RdfStore.isCombinationValid(componentOrder)) {\n throw new Error(`Invalid index combination: ${componentOrder}`);\n }\n indexes.push({\n index: options.indexConstructor(options),\n componentOrder,\n componentOrderInverse: Object.fromEntries(componentOrder.map((value, key) => [value, key])),\n });\n }\n return indexes;\n }\n /**\n * Check if a given quad term order is valid.\n * @param combination A quad term order.\n */\n static isCombinationValid(combination) {\n for (const quadTermName of rdf_terms_1.QUAD_TERM_NAMES) {\n if (!combination.includes(quadTermName)) {\n return false;\n }\n }\n return combination.length === 4;\n }\n /**\n * The number of quads in this store.\n */\n get size() {\n return this._size;\n }\n /**\n * Add a quad to the store.\n * @param quad An RDF quad.\n * @return boolean If the quad was not yet present in the index.\n */\n addQuad(quad) {\n const quadEncoded = [\n this.dictionary.encode(quad.subject),\n this.dictionary.encode(quad.predicate),\n this.dictionary.encode(quad.object),\n this.dictionary.encode(quad.graph),\n ];\n let newQuad = false;\n for (const indexWrapped of this.indexesWrapped) {\n // Before sending the quad to the index, make sure its components are ordered corresponding to the index's order.\n newQuad = indexWrapped.index\n .set((0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, quadEncoded), true);\n }\n if (newQuad) {\n this._size++;\n return true;\n }\n return false;\n }\n /**\n * Remove a quad from the store.\n * @param quad An RDF quad.\n * @return boolean If the quad was present in the index.\n */\n removeQuad(quad) {\n const quadEncoded = [\n this.dictionary.encodeOptional(quad.subject),\n this.dictionary.encodeOptional(quad.predicate),\n this.dictionary.encodeOptional(quad.object),\n this.dictionary.encodeOptional(quad.graph),\n ];\n // We can quickly return false if the quad is not present in the dictionary\n // eslint-disable-next-line unicorn/no-useless-undefined\n if (quadEncoded.includes(undefined)) {\n return false;\n }\n let wasPresent = false;\n for (const indexWrapped of this.indexesWrapped) {\n // Before sending the quad to the index, make sure its components are ordered corresponding to the index's order.\n wasPresent = indexWrapped.index\n .remove((0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, quadEncoded));\n if (!wasPresent) {\n break;\n }\n }\n if (wasPresent) {\n this._size--;\n return true;\n }\n return false;\n }\n /**\n * Removes all streamed quads.\n * @param stream A stream of quads\n */\n remove(stream) {\n stream.on('data', quad => this.removeQuad(quad));\n return stream;\n }\n /**\n * All quads matching the pattern will be removed.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n removeMatches(subject, predicate, object, graph) {\n return this.remove(this.match(subject, predicate, object, graph));\n }\n /**\n * Deletes the given named graph.\n * @param graph The graph term or string to match.\n */\n deleteGraph(graph) {\n if (typeof graph === 'string') {\n graph = this.dataFactory.namedNode(graph);\n }\n return this.removeMatches(undefined, undefined, undefined, graph);\n }\n /**\n * Import the given stream of quads into the store.\n * @param stream A stream of RDF quads.\n */\n import(stream) {\n stream.on('data', (quad) => this.addQuad(quad));\n return stream;\n }\n /**\n * Returns a generator producing all quads matching the pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n *readQuads(subject, predicate, object, graph) {\n // Check if our dictionary and our indexes have quoted pattern support\n const indexesSupportQuotedPatterns = Boolean(this.dictionary.features.quotedTriples) &&\n Object.values(this.indexesWrapped).every(wrapped => wrapped.index.features.quotedTripleFiltering);\n // Construct a quad pattern array\n const [quadComponents, requireQuotedTripleFiltering] = (0, OrderUtils_1.quadToPattern)(subject, predicate, object, graph, indexesSupportQuotedPatterns);\n // Determine the best index for this pattern\n const indexWrapped = this.indexesWrapped[(0, OrderUtils_1.getBestIndex)(this.indexesWrappedComponentOrders, quadComponents)];\n // Re-order the quad pattern based on this best index's component order\n const quadComponentsOrdered = (0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, quadComponents);\n // Call the best index's find method.\n // eslint-disable-next-line unicorn/no-array-callback-reference\n for (const decomposedQuad of indexWrapped.index.find(quadComponentsOrdered)) {\n // De-order the resulting quad components into the normal SPOG order for quad creation.\n const quad = this.dataFactory.quad(decomposedQuad[indexWrapped.componentOrderInverse.subject], decomposedQuad[indexWrapped.componentOrderInverse.predicate], decomposedQuad[indexWrapped.componentOrderInverse.object], decomposedQuad[indexWrapped.componentOrderInverse.graph]);\n if (requireQuotedTripleFiltering) {\n if ((0, rdf_terms_1.matchPattern)(quad, subject, predicate, object, graph)) {\n yield quad;\n }\n }\n else {\n yield quad;\n }\n }\n }\n /**\n * Returns an array containing all quads matching the pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n getQuads(subject, predicate, object, graph) {\n return [...this.readQuads(subject, predicate, object, graph)];\n }\n /**\n * Returns a stream that produces all quads matching the pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n match(subject, predicate, object, graph) {\n return (0, asynciterator_1.wrap)(this.readQuads(subject, predicate, object, graph));\n }\n /**\n * Returns a generator producing all quads matching the pattern.\n * @param subject The subject, which can be a variable.\n * @param predicate The predicate, which can be a variable.\n * @param object The object, which can be a variable.\n * @param graph The graph, which can be a variable.\n */\n *readBindings(bindingsFactory, subject, predicate, object, graph) {\n // Check if our dictionary and our indexes have quoted pattern support\n const indexesSupportQuotedPatterns = Boolean(this.dictionary.features.quotedTriples) &&\n Object.values(this.indexesWrapped).every(wrapped => wrapped.index.features.quotedTripleFiltering);\n // Construct a quad pattern array\n const [quadComponents, requireQuotedTripleFiltering] = (0, OrderUtils_1.quadToPattern)(subject, predicate, object, graph, indexesSupportQuotedPatterns);\n // Determine the best index for this pattern\n const indexWrapped = this.indexesWrapped[(0, OrderUtils_1.getBestIndex)(this.indexesWrappedComponentOrders, quadComponents)];\n // Re-order the quad pattern based on this best index's component order\n const quadComponentsOrdered = (0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, quadComponents);\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(quadComponentsOrdered, this.dictionary);\n // Abort if any of the terms does not exist in the dictionary\n if (!ids) {\n return;\n }\n // Collect variables to bind\n const terms = (0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, [subject, predicate, object, graph]);\n const variableIndexes = [];\n for (let i = 0; i < terms.length; i++) {\n if (terms[i].termType === 'Variable' || terms[i].termType === 'Quad') {\n variableIndexes.push(i);\n }\n }\n // Check if we need to do post-filtering for overlapping variables\n let shouldFilterIndexes = false;\n const filterIndexes = terms.map((variable, i) => {\n const equalVariables = [];\n for (let j = i + 1; j < terms.length; j++) {\n if (variable.equals(terms[j])) {\n equalVariables.push(j);\n shouldFilterIndexes = true;\n }\n }\n return equalVariables;\n });\n // Call the best index's find method.\n for (const decomposedQuadEncoded of indexWrapped.index\n .findEncoded(ids, quadComponentsOrdered)) {\n let skipBinding = false;\n let checkForBindingConflicts = false;\n const bindingsEntries = [];\n for (const i of variableIndexes) {\n // If we had overlapping variables, potentially exclude this binding if values for variable are unequal\n if (shouldFilterIndexes) {\n const filterI = filterIndexes[i];\n if (filterI) {\n for (const j of filterI) {\n if (decomposedQuadEncoded[i] !== decomposedQuadEncoded[j]) {\n skipBinding = true;\n break;\n }\n }\n }\n if (skipBinding) {\n break;\n }\n }\n const decodedTerm = this.dictionary.decode(decomposedQuadEncoded[i]);\n // Handle quoted triples\n // TODO: it may be possible to implement a more efficient of findEncoded if requireQuotedTripleFiltering is\n // false that would return bindings instead of quads. The following could then be skipped.\n // variableIndexes would also need to be changed to check requireQuotedTripleFiltering (see readQuads).\n if (terms[i].termType === 'Quad') {\n if (decodedTerm.termType === 'Quad') {\n // If the term is a quad, it may also contain nested variables,\n // so we need to extract those additional bindings.\n const additionalBindings = (0, rdf_terms_1.matchPatternMappings)(decodedTerm, terms[i], { returnMappings: true });\n if (additionalBindings) {\n checkForBindingConflicts = true;\n for (const [key, value] of Object.entries(additionalBindings)) {\n const variable = this.dataFactory.variable(key);\n if (bindingsEntries.some(entry => entry[0].equals(variable) && !entry[1].equals(value))) {\n // Skip this binding if we find conflicting variable bindings\n skipBinding = true;\n break;\n }\n bindingsEntries.push([variable, value]);\n }\n continue;\n }\n }\n skipBinding = true;\n break;\n }\n // If for the current bindings object, we previously found a quoted quad term that bound variables within it,\n // make sure that later bindings to this variable from other terms don't conflict.\n if (checkForBindingConflicts && bindingsEntries\n .some(entry => entry[0].equals(terms[i]) && !entry[1].equals(decodedTerm))) {\n // Skip this binding if we find conflicting variable bindings\n skipBinding = true;\n break;\n }\n bindingsEntries.push([terms[i], decodedTerm]);\n }\n if (!skipBinding) {\n // Create and yield the bindings object\n yield bindingsFactory.bindings(bindingsEntries);\n }\n }\n }\n /**\n * Returns an array containing all bindings matching the pattern.\n * @param bindingsFactory The factory that will be used to create bindings.\n * @param subject The subject, which can be a variable.\n * @param predicate The predicate, which can be a variable.\n * @param object The object, which can be a variable.\n * @param graph The graph, which can be a variable.\n */\n getBindings(bindingsFactory, subject, predicate, object, graph) {\n return [...this.readBindings(bindingsFactory, subject, predicate, object, graph)];\n }\n /**\n * Returns a stream that produces all quads matching the pattern.\n * @param bindingsFactory The factory that will be used to create bindings.\n * @param subject The subject, which can be a variable.\n * @param predicate The predicate, which can be a variable.\n * @param object The object, which can be a variable.\n * @param graph The graph, which can be a variable.\n */\n matchBindings(bindingsFactory, subject, predicate, object, graph) {\n return (0, asynciterator_1.wrap)(this.readBindings(bindingsFactory, subject, predicate, object, graph));\n }\n /**\n * Returns the exact cardinality of the quads matching the pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n countQuads(subject, predicate, object, graph) {\n // Check if our dictionary and our indexes have quoted pattern support\n const indexesSupportQuotedPatterns = Boolean(this.dictionary.features.quotedTriples) &&\n Object.values(this.indexesWrapped).every(wrapped => wrapped.index.features.quotedTripleFiltering);\n // Construct a quad pattern array\n const [quadComponents] = (0, OrderUtils_1.quadToPattern)(subject, predicate, object, graph, indexesSupportQuotedPatterns);\n // Optimize all-variables pattern\n if (quadComponents.every(quadComponent => quadComponent === undefined)) {\n return this.size;\n }\n // Determine the best index for this pattern\n const indexWrapped = this.indexesWrapped[(0, OrderUtils_1.getBestIndex)(this.indexesWrappedComponentOrders, quadComponents)];\n // Re-order the quad pattern based on this best index's component order\n const quadComponentsOrdered = (0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, quadComponents);\n // Call the best index's count method.\n return indexWrapped.index.count(quadComponentsOrdered);\n }\n /**\n * Wrap this store inside a DatasetCore interface.\n * Any mutations in either this store or the wrapper will propagate to each other.\n */\n asDataset() {\n return new DatasetCoreWrapper_1.DatasetCoreWrapper(this);\n }\n}\nexports.RdfStore = RdfStore;\nRdfStore.DEFAULT_INDEX_COMBINATIONS = [\n ['graph', 'subject', 'predicate', 'object'],\n ['graph', 'predicate', 'object', 'subject'],\n ['graph', 'object', 'subject', 'predicate'],\n];\n//# sourceMappingURL=RdfStore.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/RdfStore.js?\n}");
550
+
551
+ /***/ },
552
+
553
+ /***/ "./node_modules/rdf-stores/lib/dataset/DatasetCoreWrapper.js"
554
+ /*!*******************************************************************!*\
555
+ !*** ./node_modules/rdf-stores/lib/dataset/DatasetCoreWrapper.js ***!
556
+ \*******************************************************************/
557
+ (__unused_webpack_module, exports, __webpack_require__) {
558
+
559
+ "use strict";
560
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.DatasetCoreWrapper = void 0;\nconst RdfStore_1 = __webpack_require__(/*! ../RdfStore */ \"./node_modules/rdf-stores/lib/RdfStore.js\");\n/**\n * A DatasetCoreWrapper exposes an RdfStore inside an RDF.DatasetCore.\n */\nclass DatasetCoreWrapper {\n constructor(store) {\n this.store = store;\n }\n get size() {\n return this.store.size;\n }\n add(quad) {\n this.store.addQuad(quad);\n return this;\n }\n delete(quad) {\n this.store.removeQuad(quad);\n return this;\n }\n has(quad) {\n // eslint-disable-next-line no-unreachable-loop\n for (const result of this.store.readQuads(quad.subject, quad.predicate, quad.object, quad.graph)) {\n return true;\n }\n return false;\n }\n match(subject, predicate, object, graph) {\n const newStore = new RdfStore_1.RdfStore(this.store.options);\n for (const quad of this.store.readQuads(subject, predicate, object, graph)) {\n newStore.addQuad(quad);\n }\n return new DatasetCoreWrapper(newStore);\n }\n [Symbol.iterator]() {\n return this.store.readQuads();\n }\n}\nexports.DatasetCoreWrapper = DatasetCoreWrapper;\n//# sourceMappingURL=DatasetCoreWrapper.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dataset/DatasetCoreWrapper.js?\n}");
561
+
562
+ /***/ },
563
+
564
+ /***/ "./node_modules/rdf-stores/lib/dictionary/ITermDictionary.js"
565
+ /*!*******************************************************************!*\
566
+ !*** ./node_modules/rdf-stores/lib/dictionary/ITermDictionary.js ***!
567
+ \*******************************************************************/
568
+ (__unused_webpack_module, exports) {
569
+
570
+ "use strict";
571
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//# sourceMappingURL=ITermDictionary.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/ITermDictionary.js?\n}");
572
+
573
+ /***/ },
574
+
575
+ /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberMap.js"
576
+ /*!***************************************************************************!*\
577
+ !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberMap.js ***!
578
+ \***************************************************************************/
579
+ (__unused_webpack_module, exports, __webpack_require__) {
580
+
581
+ "use strict";
582
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryNumberMap = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_string_1 = __webpack_require__(/*! rdf-string */ \"./node_modules/rdf-string/index.js\");\n/**\n * A term dictionary that encodes to numbers, and stores the dictionary in memory in a Map.\n */\nclass TermDictionaryNumberMap {\n constructor(dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.lastId = 0;\n this.dictionary = new Map();\n this.reverseDictionary = new Map();\n this.features = { quotedTriples: false };\n this.dataFactory = dataFactory;\n }\n encode(term) {\n const key = (0, rdf_string_1.termToString)(term);\n let encoded = this.dictionary.get(key);\n if (encoded === undefined) {\n encoded = this.lastId++;\n this.dictionary.set(key, encoded);\n this.reverseDictionary.set(encoded, key);\n }\n return encoded;\n }\n encodeOptional(term) {\n const key = (0, rdf_string_1.termToString)(term);\n return this.dictionary.get(key);\n }\n decode(encoding) {\n const string = this.reverseDictionary.get(encoding);\n if (string === undefined) {\n throw new Error(`The value ${encoding} is not present in this dictionary`);\n }\n return (0, rdf_string_1.stringToTerm)(string, this.dataFactory);\n }\n encodings() {\n return this.reverseDictionary.keys();\n }\n findQuotedTriples(quotedTriplePattern) {\n throw new Error('findQuotedTriples is not supported');\n }\n findQuotedTriplesEncoded(quotedTriplePattern) {\n throw new Error('findQuotedTriplesEncoded is not supported');\n }\n}\nexports.TermDictionaryNumberMap = TermDictionaryNumberMap;\n//# sourceMappingURL=TermDictionaryNumberMap.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberMap.js?\n}");
583
+
584
+ /***/ },
585
+
586
+ /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecord.js"
587
+ /*!******************************************************************************!*\
588
+ !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecord.js ***!
589
+ \******************************************************************************/
590
+ (__unused_webpack_module, exports, __webpack_require__) {
591
+
592
+ "use strict";
593
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryNumberRecord = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_string_1 = __webpack_require__(/*! rdf-string */ \"./node_modules/rdf-string/index.js\");\n/**\n * A term dictionary that encodes to numbers, and stores the dictionary in memory in a Record.\n */\nclass TermDictionaryNumberRecord {\n constructor(dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.lastId = 0;\n this.dictionary = {};\n this.reverseDictionary = {};\n this.features = { quotedTriples: false };\n this.dataFactory = dataFactory;\n }\n encode(term) {\n const key = (0, rdf_string_1.termToString)(term);\n let encoded = this.dictionary[key];\n if (encoded === undefined) {\n encoded = this.lastId++;\n this.dictionary[key] = encoded;\n this.reverseDictionary[encoded] = key;\n }\n return encoded;\n }\n encodeOptional(term) {\n const key = (0, rdf_string_1.termToString)(term);\n return this.dictionary[key];\n }\n decode(encoding) {\n const string = this.reverseDictionary[encoding];\n if (string === undefined) {\n throw new Error(`The value ${encoding} is not present in this dictionary`);\n }\n return (0, rdf_string_1.stringToTerm)(string, this.dataFactory);\n }\n *encodings() {\n for (const key of Object.keys(this.reverseDictionary)) {\n yield Number.parseInt(key, 10);\n }\n }\n findQuotedTriples(quotedTriplePattern) {\n throw new Error('findQuotedTriples is not supported');\n }\n findQuotedTriplesEncoded(quotedTriplePattern) {\n throw new Error('findQuotedTriplesEncoded is not supported');\n }\n}\nexports.TermDictionaryNumberRecord = TermDictionaryNumberRecord;\n//# sourceMappingURL=TermDictionaryNumberRecord.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecord.js?\n}");
594
+
595
+ /***/ },
596
+
597
+ /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecordFullTerms.js"
598
+ /*!***************************************************************************************!*\
599
+ !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecordFullTerms.js ***!
600
+ \***************************************************************************************/
601
+ (__unused_webpack_module, exports, __webpack_require__) {
602
+
603
+ "use strict";
604
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryNumberRecordFullTerms = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_string_1 = __webpack_require__(/*! rdf-string */ \"./node_modules/rdf-string/index.js\");\n/**\n * A term dictionary that encodes to numbers, and stores the dictionary in memory in a Record.\n * The reverse dictionary will store full RDF term objects,\n * resulting in slightly better query performance at the cost of slightly higher memory usage.\n */\nclass TermDictionaryNumberRecordFullTerms {\n constructor(dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.lastId = 0;\n this.dictionary = {};\n this.reverseDictionary = {};\n this.features = { quotedTriples: false };\n this.dataFactory = dataFactory;\n }\n encode(term) {\n const key = (0, rdf_string_1.termToString)(term);\n let encoded = this.dictionary[key];\n if (encoded === undefined) {\n encoded = this.lastId++;\n this.dictionary[key] = encoded;\n this.reverseDictionary[encoded] = term;\n }\n return encoded;\n }\n encodeOptional(term) {\n const key = (0, rdf_string_1.termToString)(term);\n return this.dictionary[key];\n }\n decode(encoding) {\n const string = this.reverseDictionary[encoding];\n if (string === undefined) {\n throw new Error(`The value ${encoding} is not present in this dictionary`);\n }\n return string;\n }\n *encodings() {\n for (const key of Object.keys(this.reverseDictionary)) {\n yield Number.parseInt(key, 10);\n }\n }\n findQuotedTriples(quotedTriplePattern) {\n throw new Error('findQuotedTriples is not supported');\n }\n findQuotedTriplesEncoded(quotedTriplePattern) {\n throw new Error('findQuotedTriplesEncoded is not supported');\n }\n}\nexports.TermDictionaryNumberRecordFullTerms = TermDictionaryNumberRecordFullTerms;\n//# sourceMappingURL=TermDictionaryNumberRecordFullTerms.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecordFullTerms.js?\n}");
605
+
606
+ /***/ },
607
+
608
+ /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuoted.js"
609
+ /*!************************************************************************!*\
610
+ !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuoted.js ***!
611
+ \************************************************************************/
612
+ (__unused_webpack_module, exports, __webpack_require__) {
613
+
614
+ "use strict";
615
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryQuoted = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_terms_1 = __webpack_require__(/*! rdf-terms */ \"./node_modules/rdf-terms/index.js\");\n/**\n * A term dictionary for quoted triples.\n *\n * Plain terms and quoted triples are stored in separate dictionaries.\n *\n * Finding quoted triples is done by iterating over all quoted triples, and filtering by the matching ones.\n */\nclass TermDictionaryQuoted {\n constructor(plainTermDictionary, quotedTriplesDictionary, dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.features = { quotedTriples: true };\n this.plainTermDictionary = plainTermDictionary;\n this.quotedTriplesDictionary = quotedTriplesDictionary;\n this.dataFactory = dataFactory;\n }\n encode(term) {\n if (term.termType === 'Quad') {\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return TermDictionaryQuoted.BITMASK | (1 + this.quotedTriplesDictionary.encode(term));\n }\n return this.plainTermDictionary.encode(term);\n }\n encodeOptional(term) {\n if (term.termType === 'Quad') {\n const encoding = this.quotedTriplesDictionary.encodeOptional(term);\n if (encoding === undefined) {\n return encoding;\n }\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return TermDictionaryQuoted.BITMASK | (1 + encoding);\n }\n return this.plainTermDictionary.encodeOptional(term);\n }\n decode(encoding) {\n if (TermDictionaryQuoted.BITMASK & encoding) {\n // Term comes from the quoted triples dictionary\n const encodingBase = (~TermDictionaryQuoted.BITMASK & encoding) - 1;\n return this.quotedTriplesDictionary.decode(encodingBase);\n }\n // Term comes from the plain terms dictionary\n return this.plainTermDictionary.decode(encoding);\n }\n *encodings() {\n for (const encoding of this.plainTermDictionary.encodings()) {\n yield encoding;\n }\n for (const encoding of this.quotedTriplesDictionary.encodings()) {\n yield TermDictionaryQuoted.BITMASK | (1 + encoding);\n }\n }\n *findQuotedTriples(quotedTriplePattern) {\n for (const termEncoded of this.findQuotedTriplesEncoded(quotedTriplePattern)) {\n yield this.decode(termEncoded);\n }\n }\n *findQuotedTriplesEncoded(quotedTriplePattern) {\n for (let encodedQuotedTriple of this.quotedTriplesDictionary.encodings()) {\n encodedQuotedTriple = TermDictionaryQuoted.BITMASK | (1 + encodedQuotedTriple);\n const quotedTriple = this.decode(encodedQuotedTriple);\n if ((0, rdf_terms_1.matchPattern)(quotedTriple, quotedTriplePattern.subject, quotedTriplePattern.predicate, quotedTriplePattern.object, quotedTriplePattern.graph)) {\n yield encodedQuotedTriple;\n }\n }\n }\n}\nexports.TermDictionaryQuoted = TermDictionaryQuoted;\nTermDictionaryQuoted.BITMASK = 1 << 31;\n//# sourceMappingURL=TermDictionaryQuoted.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuoted.js?\n}");
616
+
617
+ /***/ },
618
+
619
+ /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedIndexed.js"
620
+ /*!*******************************************************************************!*\
621
+ !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedIndexed.js ***!
622
+ \*******************************************************************************/
623
+ (__unused_webpack_module, exports, __webpack_require__) {
624
+
625
+ "use strict";
626
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryQuotedIndexed = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst RdfStoreIndexNestedMap_1 = __webpack_require__(/*! ../index/RdfStoreIndexNestedMap */ \"./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMap.js\");\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * A term dictionary for quoted triples.\n *\n * Plain terms are stored in a regular dictionary.\n * Quoted triples are stored separately using an index, which is backed the same dictionary.\n *\n * Finding quoted triples is done through indexed lookups.\n */\nclass TermDictionaryQuotedIndexed {\n constructor(rawTermDictionary, dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.quotedTriplesDictionary = [];\n this.features = { quotedTriples: true };\n this.plainTermDictionary = rawTermDictionary;\n const subIndexOpts = {\n // Not required\n indexCombinations: [],\n // Not required\n indexConstructor: undefined,\n dictionary: this,\n dataFactory,\n };\n this.quotedTriplesReverseDictionaries = [\n new RdfStoreIndexNestedMap_1.RdfStoreIndexNestedMap(subIndexOpts),\n new RdfStoreIndexNestedMap_1.RdfStoreIndexNestedMap(subIndexOpts),\n new RdfStoreIndexNestedMap_1.RdfStoreIndexNestedMap(subIndexOpts),\n ];\n this.dataFactory = dataFactory;\n }\n encode(term) {\n if (term.termType === 'Quad') {\n return this.encodeQuotedTriple(term, false);\n }\n return this.plainTermDictionary.encode(term);\n }\n encodeQuotedTriple(quad, optional) {\n // Only quoted triples are supported\n if (quad.graph.termType !== 'DefaultGraph') {\n throw new Error('Encoding of quoted quads outside of the default graph is not allowed');\n }\n // Check if the quad was already encoded\n const encodedTripleOptional = (0, OrderUtils_1.encodeOptionalTerms)([quad.subject, quad.predicate, quad.object, quad.graph], this);\n const id = encodedTripleOptional && encodedTripleOptional.every(encoded => encoded !== undefined) ?\n this.quotedTriplesReverseDictionaries[0].getEncoded(encodedTripleOptional) :\n undefined;\n // Return the encoding if we found one\n if (id !== undefined || optional) {\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return (id === undefined ? undefined : TermDictionaryQuotedIndexed.BITMASK | id);\n }\n // If the quad was not encoded yet, add a new entry for it in the dictionary.\n const encodedTriple = [\n this.encode(quad.subject),\n this.encode(quad.predicate),\n this.encode(quad.object),\n ];\n const encodingBase = this.quotedTriplesDictionary.length + 1;\n this.quotedTriplesDictionary.push(encodedTriple);\n const encodedGraph = this.encode(this.dataFactory.defaultGraph());\n this.quotedTriplesReverseDictionaries[0].set([\n encodedTriple[0],\n encodedTriple[1],\n encodedTriple[2],\n encodedGraph,\n ], encodingBase);\n this.quotedTriplesReverseDictionaries[1].set([\n encodedTriple[1],\n encodedTriple[2],\n encodedTriple[0],\n encodedGraph,\n ], encodingBase);\n this.quotedTriplesReverseDictionaries[2].set([\n encodedTriple[2],\n encodedTriple[0],\n encodedTriple[1],\n encodedGraph,\n ], encodingBase);\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return TermDictionaryQuotedIndexed.BITMASK | encodingBase;\n }\n encodeOptional(term) {\n if (term.termType === 'Quad') {\n return this.encodeQuotedTriple(term, true);\n }\n return this.plainTermDictionary.encodeOptional(term);\n }\n decode(encoding) {\n if (TermDictionaryQuotedIndexed.BITMASK & encoding) {\n // Term comes from the quoted triples dictionary\n const encodingBase = (~TermDictionaryQuotedIndexed.BITMASK & encoding) - 1;\n if (encodingBase >= this.quotedTriplesDictionary.length) {\n throw new Error(`The value ${encoding} is not present in the quoted triples range of the dictionary`);\n }\n const encodedTerms = this.quotedTriplesDictionary[encodingBase];\n return this.dataFactory.quad(this.decode(encodedTerms[0]), this.decode(encodedTerms[1]), this.decode(encodedTerms[2]));\n }\n // Term comes from the plain terms dictionary\n return this.plainTermDictionary.decode(encoding);\n }\n *encodings() {\n for (const encoding of this.plainTermDictionary.encodings()) {\n yield encoding;\n }\n for (const encoding of this.quotedTriplesDictionary.keys()) {\n yield TermDictionaryQuotedIndexed.BITMASK | (1 + encoding);\n }\n }\n *findQuotedTriples(quotedTriplePattern) {\n for (const termEncoded of this.findQuotedTriplesEncoded(quotedTriplePattern)) {\n yield this.decode(termEncoded);\n }\n }\n *findQuotedTriplesEncoded(quotedTriplePattern) {\n const [patternIn, requireQuotedTripleFiltering] = (0, OrderUtils_1.quadToPattern)(quotedTriplePattern.subject, quotedTriplePattern.predicate, quotedTriplePattern.object, quotedTriplePattern.graph, true);\n // Find all matching terms iteratively\n for (const termS of this.patternToIterable(patternIn[0])) {\n for (const termP of this.patternToIterable(patternIn[1])) {\n for (const termO of this.patternToIterable(patternIn[2])) {\n for (const termG of this.patternToIterable(patternIn[3])) {\n // Find all terms matching the pattern from the reverse indexes\n // We select the reverse index according to the current triple pattern\n if ((termS && termP) || (!termP && !termO)) {\n // SPO\n const pattern = [termS, termP, termO, termG];\n for (const termEncoded of this.quotedTriplesReverseDictionaries[0].findEncoded(pattern, patternIn)) {\n yield TermDictionaryQuotedIndexed.BITMASK |\n this.quotedTriplesReverseDictionaries[0].getEncoded(termEncoded);\n }\n }\n else if (!termS && termP) {\n // POS\n const pattern = [termP, termO, termS, termG];\n for (const termEncoded of this.quotedTriplesReverseDictionaries[1].findEncoded(pattern, patternIn)) {\n yield TermDictionaryQuotedIndexed.BITMASK |\n this.quotedTriplesReverseDictionaries[1].getEncoded(termEncoded);\n }\n }\n else {\n // OSP\n const pattern = [termO, termS, termP, termG];\n for (const termEncoded of this.quotedTriplesReverseDictionaries[2].findEncoded(pattern, patternIn)) {\n yield TermDictionaryQuotedIndexed.BITMASK |\n this.quotedTriplesReverseDictionaries[2].getEncoded(termEncoded);\n }\n }\n }\n }\n }\n }\n }\n /**\n * Helper function to convert a term to an iterator over encoded terms.\n * @param patternTerm A term.\n * @protected\n */\n *patternToIterable(patternTerm) {\n // If the term is another quoted quad, recursively find other quoted triples\n if (patternTerm?.termType === 'Quad') {\n yield* this.findQuotedTriplesEncoded(patternTerm);\n return;\n }\n // Undefined terms indicate a variable\n if (patternTerm === undefined) {\n // eslint-disable-next-line unicorn/no-useless-undefined\n yield undefined;\n return;\n }\n // Defined terms indicate a precise match\n const enc = this.encodeOptional(patternTerm);\n if (enc === undefined) {\n return;\n }\n yield enc;\n }\n}\nexports.TermDictionaryQuotedIndexed = TermDictionaryQuotedIndexed;\nTermDictionaryQuotedIndexed.BITMASK = 1 << 31;\n//# sourceMappingURL=TermDictionaryQuotedIndexed.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedIndexed.js?\n}");
627
+
628
+ /***/ },
629
+
630
+ /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedReferential.js"
631
+ /*!***********************************************************************************!*\
632
+ !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedReferential.js ***!
633
+ \***********************************************************************************/
634
+ (__unused_webpack_module, exports, __webpack_require__) {
635
+
636
+ "use strict";
637
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryQuotedReferential = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_terms_1 = __webpack_require__(/*! rdf-terms */ \"./node_modules/rdf-terms/index.js\");\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * A term dictionary for quoted triples.\n *\n * Plain terms and quoted triples are stored in separate dictionaries,\n * but quoted triples are encoded using encodings from the plain term dictionary.\n *\n * Finding quoted triples is done by iterating over all quoted triples, and filtering by the matching ones.\n */\nclass TermDictionaryQuotedReferential {\n constructor(plainTermDictionary, dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.quotedTriplesDictionary = [];\n this.quotedTriplesReverseDictionary = {};\n this.features = { quotedTriples: true };\n this.plainTermDictionary = plainTermDictionary;\n this.dataFactory = dataFactory;\n }\n encode(term) {\n if (term.termType === 'Quad') {\n return this.encodeQuotedTriple(term, false);\n }\n return this.plainTermDictionary.encode(term);\n }\n encodeQuotedTriple(quad, optional) {\n // Only quoted triples are supported\n if (quad.graph.termType !== 'DefaultGraph') {\n throw new Error('Encoding of quoted quads outside of the default graph is not allowed');\n }\n // Check if the quad was already encoded\n const encodedTripleOptional = (0, OrderUtils_1.encodeOptionalTerms)([quad.subject, quad.predicate, quad.object, undefined], this)?.slice(0, 3);\n const id = encodedTripleOptional && encodedTripleOptional.every(encoded => encoded !== undefined) ?\n this.quotedTriplesReverseDictionary[encodedTripleOptional.join(TermDictionaryQuotedReferential.SEPARATOR)] :\n undefined;\n // Return the encoding if we found one\n if (id !== undefined || optional) {\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return (id === undefined ? undefined : TermDictionaryQuotedReferential.BITMASK | id);\n }\n // If the quad was not encoded yet, add a new entry for it in the dictionary.\n const encodedTriple = [\n this.encode(quad.subject),\n this.encode(quad.predicate),\n this.encode(quad.object),\n ];\n const encodingBase = this.quotedTriplesDictionary.length + 1;\n this.quotedTriplesDictionary.push(encodedTriple);\n this.quotedTriplesReverseDictionary[encodedTriple.join(TermDictionaryQuotedReferential.SEPARATOR)] = encodingBase;\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return TermDictionaryQuotedReferential.BITMASK | encodingBase;\n }\n encodeOptional(term) {\n if (term.termType === 'Quad') {\n return this.encodeQuotedTriple(term, true);\n }\n return this.plainTermDictionary.encodeOptional(term);\n }\n decode(encoding) {\n if (TermDictionaryQuotedReferential.BITMASK & encoding) {\n // Term comes from the quoted triples dictionary\n const encodingBase = (~TermDictionaryQuotedReferential.BITMASK & encoding) - 1;\n if (encodingBase >= this.quotedTriplesDictionary.length) {\n throw new Error(`The value ${encoding} is not present in the quoted triples range of the dictionary`);\n }\n const encodedTerms = this.quotedTriplesDictionary[encodingBase];\n return this.dataFactory.quad(this.decode(encodedTerms[0]), this.decode(encodedTerms[1]), this.decode(encodedTerms[2]));\n }\n // Term comes from the plain terms dictionary\n return this.plainTermDictionary.decode(encoding);\n }\n *encodings() {\n for (const encoding of this.plainTermDictionary.encodings()) {\n yield encoding;\n }\n for (const encoding of this.quotedTriplesDictionary.keys()) {\n yield TermDictionaryQuotedReferential.BITMASK | (1 + encoding);\n }\n }\n *findQuotedTriples(quotedTriplePattern) {\n for (const termEncoded of this.findQuotedTriplesEncoded(quotedTriplePattern)) {\n yield this.decode(termEncoded);\n }\n }\n *findQuotedTriplesEncoded(quotedTriplePattern) {\n for (let encodedQuotedTriple of this.quotedTriplesDictionary.keys()) {\n encodedQuotedTriple = TermDictionaryQuotedReferential.BITMASK | (1 + encodedQuotedTriple);\n const quotedTriple = this.decode(encodedQuotedTriple);\n if ((0, rdf_terms_1.matchPattern)(quotedTriple, quotedTriplePattern.subject, quotedTriplePattern.predicate, quotedTriplePattern.object, quotedTriplePattern.graph)) {\n yield encodedQuotedTriple;\n }\n }\n }\n}\nexports.TermDictionaryQuotedReferential = TermDictionaryQuotedReferential;\nTermDictionaryQuotedReferential.BITMASK = 1 << 31;\nTermDictionaryQuotedReferential.SEPARATOR = '_';\n//# sourceMappingURL=TermDictionaryQuotedReferential.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedReferential.js?\n}");
638
+
639
+ /***/ },
640
+
641
+ /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionarySymbol.js"
642
+ /*!************************************************************************!*\
643
+ !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionarySymbol.js ***!
644
+ \************************************************************************/
645
+ (__unused_webpack_module, exports, __webpack_require__) {
646
+
647
+ "use strict";
648
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionarySymbol = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_string_1 = __webpack_require__(/*! rdf-string */ \"./node_modules/rdf-string/index.js\");\n/**\n * A term dictionary that encodes and decodes using symbols.\n */\nclass TermDictionarySymbol {\n constructor(dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.features = { quotedTriples: false };\n this.dataFactory = dataFactory;\n }\n encode(term) {\n return Symbol.for(`rdf::${(0, rdf_string_1.termToString)(term)}`);\n }\n encodeOptional(term) {\n return this.encode(term);\n }\n decode(encoding) {\n const string = Symbol.keyFor(encoding);\n if (string === undefined) {\n throw new Error(`The value ${String(encoding)} is not present in this dictionary`);\n }\n return (0, rdf_string_1.stringToTerm)(string.slice(5), this.dataFactory);\n }\n encodings() {\n throw new Error('encodings is not supported');\n }\n findQuotedTriples(quotedTriplePattern) {\n throw new Error('findQuotedTriples is not supported');\n }\n findQuotedTriplesEncoded(quotedTriplePattern) {\n throw new Error('findQuotedTriplesEncoded is not supported');\n }\n}\nexports.TermDictionarySymbol = TermDictionarySymbol;\n//# sourceMappingURL=TermDictionarySymbol.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionarySymbol.js?\n}");
649
+
650
+ /***/ },
651
+
652
+ /***/ "./node_modules/rdf-stores/lib/index/IRdfStoreIndex.js"
653
+ /*!*************************************************************!*\
654
+ !*** ./node_modules/rdf-stores/lib/index/IRdfStoreIndex.js ***!
655
+ \*************************************************************/
656
+ (__unused_webpack_module, exports) {
657
+
658
+ "use strict";
659
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//# sourceMappingURL=IRdfStoreIndex.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/IRdfStoreIndex.js?\n}");
660
+
661
+ /***/ },
662
+
663
+ /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMap.js"
664
+ /*!*********************************************************************!*\
665
+ !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMap.js ***!
666
+ \*********************************************************************/
667
+ (__unused_webpack_module, exports, __webpack_require__) {
668
+
669
+ "use strict";
670
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedMap = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * An RDF store index that is implemented using nested Maps.\n */\nclass RdfStoreIndexNestedMap {\n constructor(options) {\n this.features = {\n quotedTripleFiltering: false,\n };\n this.dictionary = options.dictionary;\n this.nestedMap = new Map();\n }\n set(terms, value) {\n const map0 = this.nestedMap;\n let map1 = map0.get(terms[0]);\n if (!map1) {\n map1 = new Map();\n map0.set(terms[0], map1);\n }\n let map2 = map1.get(terms[1]);\n if (!map2) {\n map2 = new Map();\n map1.set(terms[1], map2);\n }\n let map3 = map2.get(terms[2]);\n if (!map3) {\n map3 = new Map();\n map2.set(terms[2], map3);\n }\n const contained = map3.has(terms[3]);\n if (!contained) {\n map3.set(terms[3], value);\n }\n return !contained;\n }\n remove(terms) {\n const map0 = this.nestedMap;\n const map1 = map0.get(terms[0]);\n if (!map1) {\n return false;\n }\n const map2 = map1.get(terms[1]);\n if (!map2) {\n return false;\n }\n const map3 = map2.get(terms[2]);\n if (!map3) {\n return false;\n }\n const ret = map3.delete(terms[3]);\n // Clean up intermediate maps\n if (ret && map3.size === 0) {\n map2.delete(terms[2]);\n if (map2.size === 0) {\n map1.delete(terms[1]);\n if (map1.size === 0) {\n map0.delete(terms[0]);\n }\n }\n }\n return ret;\n }\n get(key) {\n const encoded = (0, OrderUtils_1.encodeOptionalTerms)(key, this.dictionary);\n // eslint-disable-next-line unicorn/no-useless-undefined\n if (!encoded || encoded.includes(undefined)) {\n return undefined;\n }\n return this.getEncoded(encoded);\n }\n getEncoded(ids) {\n const map1 = this.nestedMap.get(ids[0]);\n if (!map1) {\n return undefined;\n }\n const map2 = map1.get(ids[1]);\n if (!map2) {\n return undefined;\n }\n const map3 = map2.get(ids[2]);\n if (!map3) {\n return undefined;\n }\n return map3.get(ids[3]);\n }\n *find(terms) {\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n let partialQuad0;\n let partialQuad1;\n let partialQuad2;\n let partialQuad3;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = id0 !== undefined ? (map0.has(id0) ? [id0] : []) : map0.keys();\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n partialQuad0 = term0 || this.dictionary.decode(key1);\n const map1Keys = id1 !== undefined ? (map1.has(id1) ? [id1] : []) : map1.keys();\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n partialQuad1 = term1 || this.dictionary.decode(key2);\n const map2Keys = id2 !== undefined ? (map2.has(id2) ? [id2] : []) : map2.keys();\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n partialQuad2 = term2 || this.dictionary.decode(key3);\n const map3Keys = id3 !== undefined ? (map3.has(id3) ? [id3] : []) : map3.keys();\n for (const key4 of map3Keys) {\n partialQuad3 = term3 || this.dictionary.decode(key4);\n yield [partialQuad0, partialQuad1, partialQuad2, partialQuad3];\n }\n }\n }\n }\n }\n // The code below is nearly identical. We duplicate because abstraction would result in a significant performance hit.\n *findEncoded(ids, terms) {\n const [id0, id1, id2, id3] = ids;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = id0 !== undefined ? (map0.has(id0) ? [id0] : []) : map0.keys();\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n const map1Keys = id1 !== undefined ? (map1.has(id1) ? [id1] : []) : map1.keys();\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n const map2Keys = id2 !== undefined ? (map2.has(id2) ? [id2] : []) : map2.keys();\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n const map3Keys = id3 !== undefined ? (map3.has(id3) ? [id3] : []) : map3.keys();\n for (const key4 of map3Keys) {\n yield [key1, key2, key3, key4];\n }\n }\n }\n }\n }\n count(terms) {\n let count = 0;\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return 0;\n }\n const id0 = ids[0];\n const id1 = ids[1];\n const id2 = ids[2];\n const id3 = ids[3];\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = id0 !== undefined ? (map0.has(id0) ? [id0] : []) : map0.keys();\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n const map1Keys = id1 !== undefined ? (map1.has(id1) ? [id1] : []) : map1.keys();\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n const map2Keys = id2 !== undefined ? (map2.has(id2) ? [id2] : []) : map2.keys();\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n if (id3 !== undefined) {\n if (map3.has(id3)) {\n count++;\n }\n }\n else {\n count += map3.size;\n }\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedMap = RdfStoreIndexNestedMap;\n//# sourceMappingURL=RdfStoreIndexNestedMap.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMap.js?\n}");
671
+
672
+ /***/ },
673
+
674
+ /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapQuoted.js"
675
+ /*!***************************************************************************!*\
676
+ !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapQuoted.js ***!
677
+ \***************************************************************************/
678
+ (__unused_webpack_module, exports, __webpack_require__) {
679
+
680
+ "use strict";
681
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedMapQuoted = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\nconst RdfStoreIndexNestedMap_1 = __webpack_require__(/*! ./RdfStoreIndexNestedMap */ \"./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMap.js\");\n/**\n * An RDF store index that is implemented using nested Maps with optimized quoted triple support.\n */\nclass RdfStoreIndexNestedMapQuoted extends RdfStoreIndexNestedMap_1.RdfStoreIndexNestedMap {\n constructor(options) {\n super(options);\n this.features = {\n quotedTripleFiltering: true,\n };\n }\n *getQuotedPatternKeys(map, term) {\n for (const quotedTripleEncoded of this.dictionary.findQuotedTriplesEncoded(term)) {\n if (map.has(quotedTripleEncoded)) {\n yield quotedTripleEncoded;\n }\n }\n }\n *find(terms) {\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let partialQuad0;\n let partialQuad1;\n let partialQuad2;\n let partialQuad3;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (map0.has(id0) ? [id0] : [])) :\n map0.keys());\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n partialQuad0 = !quotedTerm0 && term0 ? term0 : this.dictionary.decode(key1);\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (map1.has(id1) ? [id1] : [])) :\n map1.keys());\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n partialQuad1 = !quotedTerm1 && term1 ? term1 : this.dictionary.decode(key2);\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (map2.has(id2) ? [id2] : [])) :\n map2.keys());\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n partialQuad2 = !quotedTerm2 && term2 ? term2 : this.dictionary.decode(key3);\n const map3Keys = (term3 !== undefined ?\n (quotedTerm3 ? this.getQuotedPatternKeys(map3, term3) : (map3.has(id3) ? [id3] : [])) :\n map3.keys());\n for (const key4 of map3Keys) {\n partialQuad3 = !quotedTerm3 && term3 ? term3 : this.dictionary.decode(key4);\n yield [partialQuad0, partialQuad1, partialQuad2, partialQuad3];\n }\n }\n }\n }\n }\n // The code below is nearly identical. We duplicate because abstraction would result in a significant performance hit.\n *findEncoded(ids, terms) {\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (map0.has(id0) ? [id0] : [])) :\n map0.keys());\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (map1.has(id1) ? [id1] : [])) :\n map1.keys());\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (map2.has(id2) ? [id2] : [])) :\n map2.keys());\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n const map3Keys = (term3 !== undefined ?\n (quotedTerm3 ? this.getQuotedPatternKeys(map3, term3) : (map3.has(id3) ? [id3] : [])) :\n map3.keys());\n for (const key4 of map3Keys) {\n yield [\n Number.parseInt(key1, 10),\n Number.parseInt(key2, 10),\n Number.parseInt(key3, 10),\n Number.parseInt(key4, 10),\n ];\n }\n }\n }\n }\n }\n count(terms) {\n let count = 0;\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return 0;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (map0.has(id0) ? [id0] : [])) :\n map0.keys());\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (map1.has(id1) ? [id1] : [])) :\n map1.keys());\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (map2.has(id2) ? [id2] : [])) :\n map2.keys());\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n if (term3 !== undefined) {\n if (quotedTerm3) {\n count += [...this.getQuotedPatternKeys(map3, term3)].length;\n }\n else if (map3.has(id3)) {\n count++;\n }\n }\n else {\n count += map3.size;\n }\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedMapQuoted = RdfStoreIndexNestedMapQuoted;\n//# sourceMappingURL=RdfStoreIndexNestedMapQuoted.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapQuoted.js?\n}");
682
+
683
+ /***/ },
684
+
685
+ /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursive.js"
686
+ /*!******************************************************************************!*\
687
+ !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursive.js ***!
688
+ \******************************************************************************/
689
+ (__unused_webpack_module, exports, __webpack_require__) {
690
+
691
+ "use strict";
692
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedMapRecursive = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * An RDF store index that is implemented using nested Maps,\n * and finds quads components via recursive methods calls.\n */\nclass RdfStoreIndexNestedMapRecursive {\n constructor(options) {\n this.features = {\n quotedTripleFiltering: false,\n };\n this.dictionary = options.dictionary;\n this.nestedMap = new Map();\n }\n set(terms, value) {\n let map = this.nestedMap;\n let contained = false;\n for (const [i, term] of terms.entries()) {\n const mapActual = map;\n let nextMap = mapActual.get(term);\n if (!nextMap) {\n nextMap = i === terms.length - 1 ? value : new Map();\n mapActual.set(term, nextMap);\n }\n else if (i === terms.length - 1) {\n contained = true;\n }\n map = nextMap;\n }\n return !contained;\n }\n remove(terms) {\n const map0 = this.nestedMap;\n const map1 = map0.get(terms[0]);\n if (!map1) {\n return false;\n }\n const map2 = map1.get(terms[1]);\n if (!map2) {\n return false;\n }\n const map3 = map2.get(terms[2]);\n if (!map3) {\n return false;\n }\n const ret = map3.delete(terms[3]);\n // Clean up intermediate maps\n if (ret && map3.size === 0) {\n map2.delete(terms[2]);\n if (map2.size === 0) {\n map1.delete(terms[1]);\n if (map1.size === 0) {\n map0.delete(terms[0]);\n }\n }\n }\n return ret;\n }\n get(key) {\n const encoded = (0, OrderUtils_1.encodeOptionalTerms)(key, this.dictionary);\n // eslint-disable-next-line unicorn/no-useless-undefined\n if (!encoded || encoded.includes(undefined)) {\n return undefined;\n }\n return this.getEncoded(encoded);\n }\n getEncoded(ids) {\n const map1 = this.nestedMap.get(ids[0]);\n if (!map1) {\n return undefined;\n }\n const map2 = map1.get(ids[1]);\n if (!map2) {\n return undefined;\n }\n const map3 = map2.get(ids[2]);\n if (!map3) {\n return undefined;\n }\n return map3.get(ids[3]);\n }\n *find(terms) {\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return;\n }\n for (const termsEncoded of this.findEncoded(ids, terms)) {\n yield [\n ids[0] !== undefined ? terms[0] : this.dictionary.decode(termsEncoded[0]),\n ids[1] !== undefined ? terms[1] : this.dictionary.decode(termsEncoded[1]),\n ids[2] !== undefined ? terms[2] : this.dictionary.decode(termsEncoded[2]),\n ids[3] !== undefined ? terms[3] : this.dictionary.decode(termsEncoded[3]),\n ];\n }\n }\n *findEncoded(ids, terms) {\n return yield* this\n .findEncodedInner(0, ids, terms, this.nestedMap, []);\n }\n *findEncodedInner(index, ids, terms, map, partialQuad) {\n if (index === ids.length) {\n yield [...partialQuad];\n }\n else {\n const id = ids[index];\n const currentTerm = terms[index];\n // If current term is undefined, iterate over all terms at this level.\n if (!currentTerm) {\n for (const [key, subMap] of map.entries()) {\n partialQuad[index] = key;\n yield* this\n .findEncodedInner(index + 1, ids, terms, subMap, partialQuad);\n }\n }\n else {\n // If the current term is defined, find one matching map for the current term.\n const encodedTerm = id;\n if (encodedTerm !== undefined) {\n const subMap = map.get(encodedTerm);\n if (subMap) {\n partialQuad[index] = id;\n yield* this\n .findEncodedInner(index + 1, ids, terms, subMap, partialQuad);\n }\n }\n }\n }\n }\n count(terms) {\n return this.countInner(0, terms, this.nestedMap);\n }\n countInner(index, terms, map) {\n const currentTerm = terms[index];\n let count = 0;\n // If current term is undefined, iterate over all terms at this level.\n if (!currentTerm) {\n if (index === terms.length - 1) {\n return map.size;\n }\n for (const subMap of map.values()) {\n count += this.countInner(index + 1, terms, subMap);\n }\n }\n else {\n // If the current term is defined, find one matching map for the current term.\n const encodedTerm = this.dictionary.encodeOptional(currentTerm);\n if (encodedTerm !== undefined) {\n if (index === terms.length - 1) {\n if (map.has(encodedTerm)) {\n return 1;\n }\n return 0;\n }\n const subMap = map.get(encodedTerm);\n if (subMap) {\n count += this.countInner(index + 1, terms, subMap);\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedMapRecursive = RdfStoreIndexNestedMapRecursive;\n//# sourceMappingURL=RdfStoreIndexNestedMapRecursive.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursive.js?\n}");
693
+
694
+ /***/ },
695
+
696
+ /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursiveQuoted.js"
697
+ /*!************************************************************************************!*\
698
+ !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursiveQuoted.js ***!
699
+ \************************************************************************************/
700
+ (__unused_webpack_module, exports, __webpack_require__) {
701
+
702
+ "use strict";
703
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedMapRecursiveQuoted = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\nconst RdfStoreIndexNestedMapRecursive_1 = __webpack_require__(/*! ./RdfStoreIndexNestedMapRecursive */ \"./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursive.js\");\n/**\n * An RDF store index that is implemented using nested Maps,\n * and finds quads components via recursive methods calls\n * with optimized quoted triple support.\n */\nclass RdfStoreIndexNestedMapRecursiveQuoted extends RdfStoreIndexNestedMapRecursive_1.RdfStoreIndexNestedMapRecursive {\n constructor(options) {\n super(options);\n this.features = {\n quotedTripleFiltering: true,\n };\n }\n *findEncoded(ids, terms) {\n return yield* this\n .findEncodedInnerQuoted(0, ids, terms, (0, OrderUtils_1.arePatternsQuoted)(terms), this.nestedMap, []);\n }\n *findEncodedInnerQuoted(index, ids, terms, isQuotedPattern, map, partialQuad) {\n if (index === ids.length) {\n yield [...partialQuad];\n }\n else {\n const id = ids[index];\n const currentTerm = terms[index];\n // If current term is undefined, iterate over all terms at this level.\n if (!currentTerm) {\n for (const [key, subMap] of map.entries()) {\n partialQuad[index] = key;\n yield* this\n .findEncodedInnerQuoted(index + 1, ids, terms, isQuotedPattern, subMap, partialQuad);\n }\n }\n else if (isQuotedPattern[index]) {\n const quotedTriplesEncoded = this\n .dictionary.findQuotedTriplesEncoded(currentTerm);\n // Below, we perform a type of inner (hash) join between quotedTriplesEncoded and map (with hash on map)\n for (const quotedTripleEncoded of quotedTriplesEncoded) {\n const subMap = map.get(quotedTripleEncoded);\n if (subMap) {\n partialQuad[index] = quotedTripleEncoded;\n yield* this.findEncodedInnerQuoted(index + 1, ids, terms, isQuotedPattern, subMap, partialQuad);\n }\n }\n }\n else {\n // If the current term is defined, find one matching map for the current term.\n const encodedTerm = id;\n if (encodedTerm !== undefined) {\n const subMap = map.get(encodedTerm);\n if (subMap) {\n partialQuad[index] = id;\n yield* this.findEncodedInnerQuoted(index + 1, ids, terms, isQuotedPattern, subMap, partialQuad);\n }\n }\n }\n }\n }\n countInner(index, terms, map) {\n const currentTerm = terms[index];\n let count = 0;\n // If current term is undefined, iterate over all terms at this level.\n if (!currentTerm) {\n if (index === terms.length - 1) {\n return map.size;\n }\n for (const subMap of map.values()) {\n count += this.countInner(index + 1, terms, subMap);\n }\n }\n else if (currentTerm.termType === 'Quad' && (0, OrderUtils_1.quadHasVariables)(currentTerm)) {\n const quotedTriplesEncoded = this.dictionary.findQuotedTriplesEncoded(currentTerm);\n // Below, we perform a type of inner (hash) join between quotedTriplesEncoded and map (with hash on map)\n for (const quotedTripleEncoded of quotedTriplesEncoded) {\n if (index === terms.length - 1) {\n if (map.has(quotedTripleEncoded)) {\n count++;\n }\n }\n else {\n const subMap = map.get(quotedTripleEncoded);\n if (subMap) {\n count += this.countInner(index + 1, terms, subMap);\n }\n }\n }\n }\n else {\n // If the current term is defined, find one matching map for the current term.\n const encodedTerm = this.dictionary.encodeOptional(currentTerm);\n if (encodedTerm !== undefined) {\n if (index === terms.length - 1) {\n if (map.has(encodedTerm)) {\n return 1;\n }\n return 0;\n }\n const subMap = map.get(encodedTerm);\n if (subMap) {\n count += this.countInner(index + 1, terms, subMap);\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedMapRecursiveQuoted = RdfStoreIndexNestedMapRecursiveQuoted;\n//# sourceMappingURL=RdfStoreIndexNestedMapRecursiveQuoted.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursiveQuoted.js?\n}");
704
+
705
+ /***/ },
706
+
707
+ /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecord.js"
708
+ /*!************************************************************************!*\
709
+ !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecord.js ***!
710
+ \************************************************************************/
711
+ (__unused_webpack_module, exports, __webpack_require__) {
712
+
713
+ "use strict";
714
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedRecord = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * An RDF store index that is implemented using nested records.\n */\nclass RdfStoreIndexNestedRecord {\n constructor(options) {\n this.features = {\n quotedTripleFiltering: false,\n };\n this.dictionary = options.dictionary;\n this.nestedRecords = {};\n }\n set(terms, value) {\n const map0 = this.nestedRecords;\n const map1 = map0[terms[0]] || (map0[terms[0]] = {});\n const map2 = map1[terms[1]] || (map1[terms[1]] = {});\n const map3 = map2[terms[2]] || (map2[terms[2]] = {});\n if (map3[terms[3]]) {\n return false;\n }\n map3[terms[3]] = value;\n return true;\n }\n remove(terms) {\n const map0 = this.nestedRecords;\n const map1 = map0[terms[0]];\n if (!map1) {\n return false;\n }\n const map2 = map1[terms[1]];\n if (!map2) {\n return false;\n }\n const map3 = map2[terms[2]];\n if (!map3) {\n return false;\n }\n if (!map3[terms[3]]) {\n return false;\n }\n delete map3[terms[3]];\n // Clean up intermediate maps\n if (Object.keys(map3).length === 0) {\n delete map2[terms[2]];\n if (Object.keys(map2).length === 0) {\n delete map1[terms[1]];\n if (Object.keys(map1).length === 0) {\n delete map0[terms[0]];\n }\n }\n }\n return true;\n }\n get(key) {\n const encoded = (0, OrderUtils_1.encodeOptionalTerms)(key, this.dictionary);\n // eslint-disable-next-line unicorn/no-useless-undefined\n if (!encoded || encoded.includes(undefined)) {\n return undefined;\n }\n return this.getEncoded(encoded);\n }\n getEncoded(ids) {\n return this.nestedRecords[ids[0]]?.[ids[1]]?.[ids[2]]?.[ids[3]];\n }\n *find(terms) {\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n let partialQuad0;\n let partialQuad1;\n let partialQuad2;\n let partialQuad3;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = id0 !== undefined ? (id0 in map0 ? [id0] : []) : Object.keys(map0);\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n partialQuad0 = term0 || this.dictionary.decode(Number.parseInt(key1, 10));\n const map1Keys = id1 !== undefined ? (id1 in map1 ? [id1] : []) : Object.keys(map1);\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n partialQuad1 = term1 || this.dictionary.decode(Number.parseInt(key2, 10));\n const map2Keys = id2 !== undefined ? (id2 in map2 ? [id2] : []) : Object.keys(map2);\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n partialQuad2 = term2 || this.dictionary.decode(Number.parseInt(key3, 10));\n const map3Keys = id3 !== undefined ? (id3 in map3 ? [id3] : []) : Object.keys(map3);\n for (const key4 of map3Keys) {\n partialQuad3 = term3 || this.dictionary.decode(Number.parseInt(key4, 10));\n yield [partialQuad0, partialQuad1, partialQuad2, partialQuad3];\n }\n }\n }\n }\n }\n // The code below is nearly identical. We duplicate because abstraction would result in a significant performance hit.\n *findEncoded(ids, terms) {\n const [id0, id1, id2, id3] = ids;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = id0 !== undefined ? (id0 in map0 ? [id0] : []) : Object.keys(map0);\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n const map1Keys = id1 !== undefined ? (id1 in map1 ? [id1] : []) : Object.keys(map1);\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n const map2Keys = id2 !== undefined ? (id2 in map2 ? [id2] : []) : Object.keys(map2);\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n const map3Keys = id3 !== undefined ? (id3 in map3 ? [id3] : []) : Object.keys(map3);\n for (const key4 of map3Keys) {\n yield [\n Number.parseInt(key1, 10),\n Number.parseInt(key2, 10),\n Number.parseInt(key3, 10),\n Number.parseInt(key4, 10),\n ];\n }\n }\n }\n }\n }\n count(terms) {\n let count = 0;\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return 0;\n }\n const id0 = ids[0];\n const id1 = ids[1];\n const id2 = ids[2];\n const id3 = ids[3];\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = id0 !== undefined ? (id0 in map0 ? [id0] : []) : Object.keys(map0);\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n const map1Keys = id1 !== undefined ? (id1 in map1 ? [id1] : []) : Object.keys(map1);\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n const map2Keys = id2 !== undefined ? (id2 in map2 ? [id2] : []) : Object.keys(map2);\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n if (id3 !== undefined) {\n if (id3 in map3) {\n count++;\n }\n }\n else {\n count += Object.keys(map3).length;\n }\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedRecord = RdfStoreIndexNestedRecord;\n//# sourceMappingURL=RdfStoreIndexNestedRecord.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecord.js?\n}");
715
+
716
+ /***/ },
717
+
718
+ /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecordQuoted.js"
719
+ /*!******************************************************************************!*\
720
+ !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecordQuoted.js ***!
721
+ \******************************************************************************/
722
+ (__unused_webpack_module, exports, __webpack_require__) {
723
+
724
+ "use strict";
725
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedRecordQuoted = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\nconst RdfStoreIndexNestedRecord_1 = __webpack_require__(/*! ./RdfStoreIndexNestedRecord */ \"./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecord.js\");\n/**\n * An RDF store index that is implemented using nested records with optimized quoted triple support.\n */\nclass RdfStoreIndexNestedRecordQuoted extends RdfStoreIndexNestedRecord_1.RdfStoreIndexNestedRecord {\n constructor(options) {\n super(options);\n this.features = {\n quotedTripleFiltering: true,\n };\n }\n *getQuotedPatternKeys(map, term) {\n for (const quotedTripleEncoded of this.dictionary.findQuotedTriplesEncoded(term)) {\n if (quotedTripleEncoded in map) {\n yield quotedTripleEncoded;\n }\n }\n }\n *find(terms) {\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let partialQuad0;\n let partialQuad1;\n let partialQuad2;\n let partialQuad3;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (id0 in map0 ? [id0] : [])) :\n Object.keys(map0));\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n partialQuad0 = !quotedTerm0 && term0 ? term0 : this.dictionary.decode(Number.parseInt(key1, 10));\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (id1 in map1 ? [id1] : [])) :\n Object.keys(map1));\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n partialQuad1 = !quotedTerm1 && term1 ? term1 : this.dictionary.decode(Number.parseInt(key2, 10));\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (id2 in map2 ? [id2] : [])) :\n Object.keys(map2));\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n partialQuad2 = !quotedTerm2 && term2 ? term2 : this.dictionary.decode(Number.parseInt(key3, 10));\n const map3Keys = (term3 !== undefined ?\n (quotedTerm3 ? this.getQuotedPatternKeys(map3, term3) : (id3 in map3 ? [id3] : [])) :\n Object.keys(map3));\n for (const key4 of map3Keys) {\n partialQuad3 = !quotedTerm3 && term3 ? term3 : this.dictionary.decode(Number.parseInt(key4, 10));\n yield [partialQuad0, partialQuad1, partialQuad2, partialQuad3];\n }\n }\n }\n }\n }\n // The code below is nearly identical. We duplicate because abstraction would result in a significant performance hit.\n *findEncoded(ids, terms) {\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (id0 in map0 ? [id0] : [])) :\n Object.keys(map0));\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (id1 in map1 ? [id1] : [])) :\n Object.keys(map1));\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (id2 in map2 ? [id2] : [])) :\n Object.keys(map2));\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n const map3Keys = (term3 !== undefined ?\n (quotedTerm3 ? this.getQuotedPatternKeys(map3, term3) : (id3 in map3 ? [id3] : [])) :\n Object.keys(map3));\n for (const key4 of map3Keys) {\n yield [\n Number.parseInt(key1, 10),\n Number.parseInt(key2, 10),\n Number.parseInt(key3, 10),\n Number.parseInt(key4, 10),\n ];\n }\n }\n }\n }\n }\n count(terms) {\n let count = 0;\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return 0;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (id0 in map0 ? [id0] : [])) :\n Object.keys(map0));\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (id1 in map1 ? [id1] : [])) :\n Object.keys(map1));\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (id2 in map2 ? [id2] : [])) :\n Object.keys(map2));\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n if (term3 !== undefined) {\n if (quotedTerm3) {\n count += [...this.getQuotedPatternKeys(map3, term3)].length;\n }\n else if (id3 in map3) {\n count++;\n }\n }\n else {\n count += Object.keys(map3).length;\n }\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedRecordQuoted = RdfStoreIndexNestedRecordQuoted;\n//# sourceMappingURL=RdfStoreIndexNestedRecordQuoted.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecordQuoted.js?\n}");
726
+
727
+ /***/ },
728
+
729
+ /***/ "./node_modules/rdf-string/index.js"
730
+ /*!******************************************!*\
731
+ !*** ./node_modules/rdf-string/index.js ***!
732
+ \******************************************/
733
+ (__unused_webpack_module, exports, __webpack_require__) {
734
+
735
+ "use strict";
736
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.termToString = exports.stringToTerm = exports.stringQuadToQuad = exports.quadToStringQuad = exports.getLiteralValue = exports.getLiteralType = exports.getLiteralDirection = exports.getLiteralLanguage = void 0;\nconst TermUtil_1 = __webpack_require__(/*! ./lib/TermUtil */ \"./node_modules/rdf-string/lib/TermUtil.js\");\nObject.defineProperty(exports, \"getLiteralLanguage\", ({ enumerable: true, get: function () { return TermUtil_1.getLiteralLanguage; } }));\nObject.defineProperty(exports, \"getLiteralDirection\", ({ enumerable: true, get: function () { return TermUtil_1.getLiteralDirection; } }));\nObject.defineProperty(exports, \"getLiteralType\", ({ enumerable: true, get: function () { return TermUtil_1.getLiteralType; } }));\nObject.defineProperty(exports, \"getLiteralValue\", ({ enumerable: true, get: function () { return TermUtil_1.getLiteralValue; } }));\nObject.defineProperty(exports, \"quadToStringQuad\", ({ enumerable: true, get: function () { return TermUtil_1.quadToStringQuad; } }));\nObject.defineProperty(exports, \"stringQuadToQuad\", ({ enumerable: true, get: function () { return TermUtil_1.stringQuadToQuad; } }));\nObject.defineProperty(exports, \"stringToTerm\", ({ enumerable: true, get: function () { return TermUtil_1.stringToTerm; } }));\nObject.defineProperty(exports, \"termToString\", ({ enumerable: true, get: function () { return TermUtil_1.termToString; } }));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-string/index.js?\n}");
737
+
738
+ /***/ },
739
+
740
+ /***/ "./node_modules/rdf-string/lib/TermUtil.js"
741
+ /*!*************************************************!*\
742
+ !*** ./node_modules/rdf-string/lib/TermUtil.js ***!
743
+ \*************************************************/
744
+ (__unused_webpack_module, exports, __webpack_require__) {
745
+
746
+ "use strict";
747
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.termToString = termToString;\nexports.getLiteralValue = getLiteralValue;\nexports.getLiteralType = getLiteralType;\nexports.getLiteralLanguage = getLiteralLanguage;\nexports.getLiteralDirection = getLiteralDirection;\nexports.stringToTerm = stringToTerm;\nexports.quadToStringQuad = quadToStringQuad;\nexports.stringQuadToQuad = stringQuadToQuad;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst FACTORY = new rdf_data_factory_1.DataFactory();\n/**\n * Utility methods for converting between string-based RDF representations and RDFJS objects.\n *\n * RDF Terms are represented as follows:\n * * Blank nodes: '_:myBlankNode'\n * * Variables: '?myVariable'\n * * Literals: '\"myString\"', '\"myLanguageString\"@en-us', '\"myLanguageString\"@en-us--ltr', '\"3\"^^xsd:number'\n * * URIs: 'http://example.org'\n *\n * Quads/triples are represented as hashes with 'subject', 'predicate', 'object' and 'graph' (optional)\n * as keys, and string-based RDF terms as values.\n */\n/**\n * Convert an RDFJS term to a string-based representation.\n * @param {RDF.Term} term An RDFJS term.\n * @return {string} A string-based term representation.\n */\nfunction termToString(term) {\n // TODO: remove nasty any casts when this TS bug has been fixed: https://github.com/microsoft/TypeScript/issues/26933\n if (!term) {\n return undefined;\n }\n switch (term.termType) {\n case 'NamedNode': return term.value;\n case 'BlankNode': return ('_:' + term.value);\n case 'Literal':\n const literalValue = term;\n return ('\"' + literalValue.value + '\"' +\n (literalValue.datatype &&\n literalValue.datatype.value !== 'http://www.w3.org/2001/XMLSchema#string' &&\n literalValue.datatype.value !== 'http://www.w3.org/1999/02/22-rdf-syntax-ns#langString' &&\n literalValue.datatype.value !== 'http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString' ?\n '^^' + literalValue.datatype.value : '') +\n (literalValue.language ? '@' + literalValue.language : '') +\n (literalValue.direction ? '--' + literalValue.direction : ''));\n case 'Quad': return `<<${termToString(term.subject)} ${termToString(term.predicate)} ${termToString(term.object)}${term.graph.termType === 'DefaultGraph' ? '' : ' ' + termToString(term.graph)}>>`;\n case 'Variable': return ('?' + term.value);\n case 'DefaultGraph': return term.value;\n }\n}\n/**\n * Get the string value of a literal.\n * @param {string} literalValue An RDF literal enclosed by '\"'.\n * @return {string} The literal value inside the '\"'.\n */\nfunction getLiteralValue(literalValue) {\n const match = /^\"([^]*)\"/.exec(literalValue);\n if (!match) {\n throw new Error(literalValue + ' is not a literal');\n }\n return match[1];\n}\n/**\n * Get the datatype of the given literal.\n * @param {string} literalValue An RDF literal.\n * @return {string} The datatype of the literal.\n */\nfunction getLiteralType(literalValue) {\n const match = /^\"[^]*\"(?:\\^\\^([^\"]+)|(@)[^@\"]+)?$/.exec(literalValue);\n if (!match) {\n throw new Error(literalValue + ' is not a literal');\n }\n return match[1] || (match[2]\n ? 'http://www.w3.org/1999/02/22-rdf-syntax-ns#langString' : 'http://www.w3.org/2001/XMLSchema#string');\n}\n/**\n * Get the language of the given literal.\n * @param {string} literalValue An RDF literal.\n * @return {string} The language of the literal.\n */\nfunction getLiteralLanguage(literalValue) {\n const match = /^\"[^]*\"(?:@([^@\"]+)|\\^\\^[^\"]+)?$/.exec(literalValue);\n if (!match) {\n throw new Error(literalValue + ' is not a literal');\n }\n if (match[1]) {\n let ret = match[1].toLowerCase();\n // Remove everything after --, since this indicates the base direction, which will be parsed later.\n const doubleDashPos = ret.indexOf('--');\n if (doubleDashPos >= 0) {\n ret = ret.slice(0, doubleDashPos);\n }\n return ret;\n }\n return '';\n}\n/**\n * Get the direction of the given literal.\n * @param {string} literalValue An RDF literal.\n * @return {string} The direction of the literal.\n */\nfunction getLiteralDirection(literalValue) {\n const doubleDashPos = literalValue.indexOf('--', literalValue.lastIndexOf('\"'));\n if (doubleDashPos >= 0) {\n const direction = literalValue.slice(doubleDashPos + 2, literalValue.length);\n if (direction === 'ltr' || direction === 'rtl') {\n return direction;\n }\n throw new Error(literalValue + ' is not a literal with a valid direction');\n }\n return '';\n}\n/**\n * Transform a string-based RDF term to an RDFJS term.\n * @param {string} value A string-based RDF-term.\n * @param {RDF.DataFactory} dataFactory An optional datafactory to create terms with.\n * @return {RDF.Term} An RDF-JS term.\n */\nfunction stringToTerm(value, dataFactory) {\n dataFactory = dataFactory || FACTORY;\n if (!value || !value.length) {\n return dataFactory.defaultGraph();\n }\n switch (value[0]) {\n case '_': return dataFactory.blankNode(value.substr(2));\n case '?':\n if (!dataFactory.variable) {\n throw new Error(`Missing 'variable()' method on the given DataFactory`);\n }\n return dataFactory.variable(value.substr(1));\n case '\"':\n const language = getLiteralLanguage(value);\n const direction = getLiteralDirection(value);\n const type = dataFactory.namedNode(getLiteralType(value));\n return dataFactory.literal(getLiteralValue(value), language ? { language, direction } : type);\n case '<':\n default:\n if (value[0] === '<' && value.length > 4 && value[1] === '<' && value[value.length - 1] === '>' && value[value.length - 2] === '>') {\n // Iterate character-by-character to detect spaces that are *not* wrapped in <<>>\n const terms = value.slice(2, -2).trim();\n let stringTerms = [];\n let ignoreTags = 0;\n let lastIndex = 0;\n let inQuote = false;\n for (let i = 0; i < terms.length; i++) {\n const char = terms[i];\n if (char === '<')\n ignoreTags++;\n if (char === '>') {\n if (ignoreTags === 0) {\n throw new Error('Found closing tag without opening tag in ' + value);\n }\n else {\n ignoreTags--;\n }\n }\n if (char === '\"') {\n let escaped = false;\n let j = i;\n while (j-- > 0 && terms[j] === '\\\\') {\n escaped = !escaped;\n }\n if (!escaped) {\n // We have reached an unescaped quote\n inQuote = !inQuote;\n }\n }\n if (char === ' ' && !inQuote && ignoreTags === 0) {\n stringTerms.push(terms.slice(lastIndex, i));\n while (terms[i + 1] === ' ') {\n i += 1;\n }\n lastIndex = i + 1;\n }\n }\n if (ignoreTags !== 0) {\n throw new Error('Found opening tag without closing tag in ' + value);\n }\n stringTerms.push(terms.slice(lastIndex, terms.length));\n // We require 3 or 4 components\n if (stringTerms.length !== 3 && stringTerms.length !== 4) {\n throw new Error('Nested quad syntax error ' + value);\n }\n stringTerms = stringTerms.map(term => term.startsWith('<') && !term.includes(' ') ? term.slice(1, -1) : term);\n return dataFactory.quad(stringToTerm(stringTerms[0]), stringToTerm(stringTerms[1]), stringToTerm(stringTerms[2]), stringTerms[3] ? stringToTerm(stringTerms[3]) : undefined);\n }\n return dataFactory.namedNode(value);\n }\n}\n/**\n * Convert an RDFJS quad to a string-based quad representation.\n * @param {Quad} q An RDFJS quad.\n * @return {IStringQuad} A hash with string-based quad terms.\n * @template Q The type of quad, defaults to RDF.Quad.\n */\nfunction quadToStringQuad(q) {\n // tslint:disable:object-literal-sort-keys\n return {\n subject: termToString(q.subject),\n predicate: termToString(q.predicate),\n object: termToString(q.object),\n graph: termToString(q.graph),\n };\n // tslint:enable:object-literal-sort-keys\n}\n/**\n * Convert a string-based quad representation to an RDFJS quad.\n * @param {IStringQuad} stringQuad A hash with string-based quad terms.\n * @param {RDF.DataFactory} dataFactory An optional datafactory to create terms with.\n * @return {Q} An RDFJS quad.\n * @template Q The type of quad, defaults to RDF.Quad.\n */\nfunction stringQuadToQuad(stringQuad, dataFactory) {\n dataFactory = dataFactory || FACTORY;\n return dataFactory.quad(stringToTerm(stringQuad.subject, dataFactory), stringToTerm(stringQuad.predicate, dataFactory), stringToTerm(stringQuad.object, dataFactory), stringToTerm(stringQuad.graph, dataFactory));\n}\n//# sourceMappingURL=TermUtil.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-string/lib/TermUtil.js?\n}");
748
+
749
+ /***/ },
750
+
751
+ /***/ "./node_modules/rdf-terms/index.js"
752
+ /*!*****************************************!*\
753
+ !*** ./node_modules/rdf-terms/index.js ***!
754
+ \*****************************************/
755
+ (__unused_webpack_module, exports, __webpack_require__) {
756
+
757
+ "use strict";
758
+ eval("{\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n__exportStar(__webpack_require__(/*! ./lib/QuadTermUtil */ \"./node_modules/rdf-terms/lib/QuadTermUtil.js\"), exports);\n__exportStar(__webpack_require__(/*! ./lib/TermUtil */ \"./node_modules/rdf-terms/lib/TermUtil.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-terms/index.js?\n}");
759
+
760
+ /***/ },
761
+
762
+ /***/ "./node_modules/rdf-terms/lib/QuadTermUtil.js"
763
+ /*!****************************************************!*\
764
+ !*** ./node_modules/rdf-terms/lib/QuadTermUtil.js ***!
765
+ \****************************************************/
766
+ (__unused_webpack_module, exports, __webpack_require__) {
767
+
768
+ "use strict";
769
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TRIPLE_TERM_NAMES = exports.QUAD_TERM_NAMES = void 0;\nexports.getTerms = getTerms;\nexports.getTermsNested = getTermsNested;\nexports.getNamedTerms = getNamedTerms;\nexports.collectNamedTerms = collectNamedTerms;\nexports.forEachTerms = forEachTerms;\nexports.forEachTermsNested = forEachTermsNested;\nexports.filterTerms = filterTerms;\nexports.filterTermsNested = filterTermsNested;\nexports.filterQuadTermNames = filterQuadTermNames;\nexports.filterQuadTermNamesNested = filterQuadTermNamesNested;\nexports.mapTerms = mapTerms;\nexports.mapTermsNested = mapTermsNested;\nexports.reduceTerms = reduceTerms;\nexports.reduceTermsNested = reduceTermsNested;\nexports.everyTerms = everyTerms;\nexports.everyTermsNested = everyTermsNested;\nexports.someTerms = someTerms;\nexports.someTermsNested = someTermsNested;\nexports.getValueNestedPath = getValueNestedPath;\nexports.matchTerm = matchTerm;\nexports.matchPattern = matchPattern;\nexports.matchPatternComplete = matchPatternComplete;\nexports.matchPatternMappings = matchPatternMappings;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst DF = new rdf_data_factory_1.DataFactory();\n/**\n * All available quad term names.\n * @type {[string , string , string , string]}\n */\nexports.QUAD_TERM_NAMES = ['subject', 'predicate', 'object', 'graph'];\n/**\n * All available triple term names.\n * @type {[string , string , string]}\n */\nexports.TRIPLE_TERM_NAMES = ['subject', 'predicate', 'object'];\n/**\n * Get all terms in the given quad.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {boolean} ignoreDefaultGraph If true and the quad has the default graph as graph,\n * this term will not be returned in the array.\n * (default: false)\n * @return {Term[]} The available terms in the quad.\n */\nfunction getTerms(quad, ignoreDefaultGraph) {\n if (ignoreDefaultGraph && quad.graph.termType === 'DefaultGraph') {\n return [quad.subject, quad.predicate, quad.object];\n }\n return [quad.subject, quad.predicate, quad.object, quad.graph];\n}\n/**\n * Get all terms in the given quad, including nested quads.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {boolean} ignoreDefaultGraph If true and the quad has the default graph as graph,\n * this term will not be returned in the array.\n * (default: false)\n * @return {Term[]} The available terms in the nested quad, excluding quad terms.\n */\nfunction getTermsNested(quad, ignoreDefaultGraph) {\n const terms = [];\n for (const term of getTerms(quad, ignoreDefaultGraph)) {\n if (term.termType === 'Quad') {\n getTermsNested(term, ignoreDefaultGraph).forEach(subTerm => terms.push(subTerm));\n }\n else {\n terms.push(term);\n }\n }\n return terms;\n}\n/**\n * Convert the given quad to an array of named terms.\n * This is the reverse operation of {@link collectNamedTerms}.\n * @param {BaseQuad} quad An RDFJS quad.\n * @return {INamedTerm[]} An array of named terms.\n */\nfunction getNamedTerms(quad) {\n return [\n { key: 'subject', value: quad.subject },\n { key: 'predicate', value: quad.predicate },\n { key: 'object', value: quad.object },\n { key: 'graph', value: quad.graph },\n ];\n}\n/**\n * Convert an array of named terms to an RDFJS quad.\n * This is the reverse operation of {@link getNamedTerms}.\n * @param {INamedTerm[]} namedTerms An array of named terms.\n * @param {(termName: QuadTermName) => Term} defaultCb An optional callback for when\n * certain terms are not available in the array.\n * @param {RDF.DataFactory} dataFactory A custom data factory to create quads.\n * @return {Q} The resulting RDFJS quad.\n * @template Q The type of quad to output, defaults to RDF.Quad.\n */\nfunction collectNamedTerms(namedTerms, defaultCb, dataFactory) {\n const elements = {};\n namedTerms.forEach((namedTerm) => elements[namedTerm.key] = namedTerm.value);\n if (defaultCb) {\n elements.subject = elements.subject || defaultCb('subject');\n elements.predicate = elements.predicate || defaultCb('predicate');\n elements.object = elements.object || defaultCb('object');\n elements.graph = elements.graph || defaultCb('graph');\n }\n return (dataFactory || DF).quad(elements.subject, elements.predicate, elements.object, elements.graph);\n}\n/**\n * Iterates over each term.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} cb A callback function.\n */\nfunction forEachTerms(quad, cb) {\n cb(quad.subject, 'subject');\n cb(quad.predicate, 'predicate');\n cb(quad.object, 'object');\n cb(quad.graph, 'graph');\n}\n/**\n * Iterates over each leaf term, while recursing into quoted triples.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} cb A callback function.\n * @param QuadTermName[] keys The current key path.\n */\nfunction forEachTermsNested(quad, cb, keys = []) {\n if (quad.subject.termType === 'Quad') {\n forEachTermsNested(quad.subject, cb, [...keys, 'subject']);\n }\n else {\n cb(quad.subject, [...keys, 'subject']);\n }\n if (quad.predicate.termType === 'Quad') {\n forEachTermsNested(quad.predicate, cb, [...keys, 'predicate']);\n }\n else {\n cb(quad.predicate, [...keys, 'predicate']);\n }\n if (quad.object.termType === 'Quad') {\n forEachTermsNested(quad.object, cb, [...keys, 'object']);\n }\n else {\n cb(quad.object, [...keys, 'object']);\n }\n if (quad.graph.termType === 'Quad') {\n forEachTermsNested(quad.graph, cb, [...keys, 'graph']);\n }\n else {\n cb(quad.graph, [...keys, 'graph']);\n }\n}\n/**\n * Get all terms in the given quad that return true on the given filter function.\n * @param {BaseQuad} quad A quad.\n * @param {(value: Term, key: QuadTermName) => boolean} filter A filter callback.\n * @return {Term[]} The list of matching terms.\n */\nfunction filterTerms(quad, filter) {\n const terms = [];\n if (filter(quad.subject, 'subject')) {\n terms.push(quad.subject);\n }\n if (filter(quad.predicate, 'predicate')) {\n terms.push(quad.predicate);\n }\n if (filter(quad.object, 'object')) {\n terms.push(quad.object);\n }\n if (filter(quad.graph, 'graph')) {\n terms.push(quad.graph);\n }\n return terms;\n}\n/**\n * Get all terms in the given quad that return true on the given filter function, while recursing into quoted triples.\n * @param {BaseQuad} quad A quad.\n * @param {(value: Term, key: QuadTermName) => boolean} filter A filter callback.\n * @param QuadTermName[] keys The current key path.\n * @return {Term[]} The list of matching terms.\n */\nfunction filterTermsNested(quad, filter, keys = []) {\n let terms = [];\n if (quad.subject.termType === 'Quad') {\n terms = [...terms, ...filterTermsNested(quad.subject, filter, [...keys, 'subject'])];\n }\n else {\n if (filter(quad.subject, [...keys, 'subject'])) {\n terms.push(quad.subject);\n }\n }\n if (quad.predicate.termType === 'Quad') {\n terms = [...terms, ...filterTermsNested(quad.predicate, filter, [...keys, 'predicate'])];\n }\n else {\n if (filter(quad.predicate, [...keys, 'predicate'])) {\n terms.push(quad.predicate);\n }\n }\n if (quad.object.termType === 'Quad') {\n terms = [...terms, ...filterTermsNested(quad.object, filter, [...keys, 'object'])];\n }\n else {\n if (filter(quad.object, [...keys, 'object'])) {\n terms.push(quad.object);\n }\n }\n if (quad.graph.termType === 'Quad') {\n terms = [...terms, ...filterTermsNested(quad.graph, filter, [...keys, 'graph'])];\n }\n else {\n if (filter(quad.graph, [...keys, 'graph'])) {\n terms.push(quad.graph);\n }\n }\n return terms;\n}\n/**\n * Get all quad term names in the given quad that return true on the given filter function.\n * @param {BaseQuad} quad A quad.\n * @param {(value: Term, key: QuadTermName, all: INamedTerm[]) => boolean} filter A filter callback.\n * @return {QuadTermName[]} The list of matching quad term names.\n */\nfunction filterQuadTermNames(quad, filter) {\n const names = [];\n if (filter(quad.subject, 'subject')) {\n names.push('subject');\n }\n if (filter(quad.predicate, 'predicate')) {\n names.push('predicate');\n }\n if (filter(quad.object, 'object')) {\n names.push('object');\n }\n if (filter(quad.graph, 'graph')) {\n names.push('graph');\n }\n return names;\n}\n/**\n * Get all quad term names in the given quad that return true on the given filter function, while recursing into quoted triples.\n * @param {BaseQuad} quad A quad.\n * @param {(value: Term, key: QuadTermName, all: INamedTerm[]) => boolean} filter A filter callback.\n * @param QuadTermName[] keys The current key path.\n * @return {QuadTermName[]} The list of matching quad term names.\n */\nfunction filterQuadTermNamesNested(quad, filter, keys = []) {\n let names = [];\n const keysS = [...keys, 'subject'];\n if (quad.subject.termType === 'Quad') {\n names = [...names, ...filterQuadTermNamesNested(quad.subject, filter, keysS)];\n }\n else {\n if (filter(quad.subject, keysS)) {\n names.push(keysS);\n }\n }\n const keysP = [...keys, 'predicate'];\n if (quad.predicate.termType === 'Quad') {\n names = [...names, ...filterQuadTermNamesNested(quad.predicate, filter, keysP)];\n }\n else {\n if (filter(quad.predicate, keysP)) {\n names.push(keysP);\n }\n }\n const keysO = [...keys, 'object'];\n if (quad.object.termType === 'Quad') {\n names = [...names, ...filterQuadTermNamesNested(quad.object, filter, keysO)];\n }\n else {\n if (filter(quad.object, keysO)) {\n names.push(keysO);\n }\n }\n const keysG = [...keys, 'graph'];\n if (quad.graph.termType === 'Quad') {\n names = [...names, ...filterQuadTermNamesNested(quad.graph, filter, keysG)];\n }\n else {\n if (filter(quad.graph, keysG)) {\n names.push(keysG);\n }\n }\n return names;\n}\n/**\n * Map all terms of a quad.\n * @param {Quad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName) => Term} mapper A mapper function.\n * @param {RDF.DataFactory} dataFactory A custom data factory to create quads.\n * @return {Quad} A new RDFJS quad.\n * @template Q The type of quad, defaults to RDF.Quad.\n */\nfunction mapTerms(quad, mapper, dataFactory) {\n return (dataFactory || DF).quad(mapper(quad.subject, 'subject'), mapper(quad.predicate, 'predicate'), mapper(quad.object, 'object'), mapper(quad.graph, 'graph'));\n}\n/**\n * Map all terms of a quad, while recursing into quoted triples.\n * @param {Quad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName) => Term} mapper A mapper function.\n * @param {RDF.DataFactory} dataFactory A custom data factory to create quads.\n * @param QuadTermName[] keys The current key path.\n * @return {Quad} A new RDFJS quad.\n * @template Q The type of quad, defaults to RDF.Quad.\n */\nfunction mapTermsNested(quad, mapper, dataFactory, keys = []) {\n return (dataFactory || DF).quad(quad.subject.termType === 'Quad' ?\n mapTermsNested(quad.subject, mapper, dataFactory, [...keys, 'subject']) :\n mapper(quad.subject, [...keys, 'subject']), quad.predicate.termType === 'Quad' ?\n mapTermsNested(quad.predicate, mapper, dataFactory, [...keys, 'predicate']) :\n mapper(quad.predicate, [...keys, 'predicate']), quad.object.termType === 'Quad' ?\n mapTermsNested(quad.object, mapper, dataFactory, [...keys, 'object']) :\n mapper(quad.object, [...keys, 'object']), quad.graph.termType === 'Quad' ?\n mapTermsNested(quad.graph, mapper, dataFactory, [...keys, 'graph']) :\n mapper(quad.graph, [...keys, 'graph']));\n}\n/**\n * Reduce all terms of a quad.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(previousValue: U, currentValue: Term, key: QuadTermName) => U} reducer A reduce function.\n * @param {U} initialValue The initial value.\n * @return {U} The final value.\n */\nfunction reduceTerms(quad, reducer, initialValue) {\n let value = initialValue;\n value = reducer(value, quad.subject, 'subject');\n value = reducer(value, quad.predicate, 'predicate');\n value = reducer(value, quad.object, 'object');\n return reducer(value, quad.graph, 'graph');\n}\n/**\n * Reduce all terms of a quad, while recursing into quoted triples.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(previousValue: U, currentValue: Term, key: QuadTermName) => U} reducer A reduce function.\n * @param {U} initialValue The initial value.\n * @param QuadTermName[] keys The current key path.\n * @return {U} The final value.\n */\nfunction reduceTermsNested(quad, reducer, initialValue, keys = []) {\n let value = initialValue;\n if (quad.subject.termType === 'Quad') {\n value = reduceTermsNested(quad.subject, reducer, value, [...keys, 'subject']);\n }\n else {\n value = reducer(value, quad.subject, [...keys, 'subject']);\n }\n if (quad.predicate.termType === 'Quad') {\n value = reduceTermsNested(quad.predicate, reducer, value, [...keys, 'predicate']);\n }\n else {\n value = reducer(value, quad.predicate, [...keys, 'predicate']);\n }\n if (quad.object.termType === 'Quad') {\n value = reduceTermsNested(quad.object, reducer, value, [...keys, 'object']);\n }\n else {\n value = reducer(value, quad.object, [...keys, 'object']);\n }\n if (quad.graph.termType === 'Quad') {\n value = reduceTermsNested(quad.graph, reducer, value, [...keys, 'graph']);\n }\n else {\n value = reducer(value, quad.graph, [...keys, 'graph']);\n }\n return value;\n}\n/**\n * Determines whether all terms satisfy the specified test.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} checker A checker function.\n * @return {boolean} If all terms satisfy the specified test.\n */\nfunction everyTerms(quad, checker) {\n return checker(quad.subject, 'subject')\n && checker(quad.predicate, 'predicate')\n && checker(quad.object, 'object')\n && checker(quad.graph, 'graph');\n}\n/**\n * Determines whether all terms satisfy the specified test, while recursing into quoted triples.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} checker A checker function.\n * @param QuadTermName[] keys The current key path.\n * @return {boolean} If all terms satisfy the specified test.\n */\nfunction everyTermsNested(quad, checker, keys = []) {\n return (quad.subject.termType === 'Quad' ?\n everyTermsNested(quad.subject, checker, [...keys, 'subject']) :\n checker(quad.subject, [...keys, 'subject']))\n && (quad.predicate.termType === 'Quad' ?\n everyTermsNested(quad.predicate, checker, [...keys, 'predicate']) :\n checker(quad.predicate, [...keys, 'predicate']))\n && (quad.object.termType === 'Quad' ?\n everyTermsNested(quad.object, checker, [...keys, 'object']) :\n checker(quad.object, [...keys, 'object']))\n && (quad.graph.termType === 'Quad' ?\n everyTermsNested(quad.graph, checker, [...keys, 'graph']) :\n checker(quad.graph, [...keys, 'graph']));\n}\n/**\n * Determines whether at least one term satisfies the specified test.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} checker A checker function.\n * @return {boolean} If at least one term satisfies the specified test.\n */\nfunction someTerms(quad, checker) {\n return checker(quad.subject, 'subject')\n || checker(quad.predicate, 'predicate')\n || checker(quad.object, 'object')\n || checker(quad.graph, 'graph');\n}\n/**\n * Determines whether at least one term satisfies the specified test, while recursing into quoted triples.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} checker A checker function.\n * @param QuadTermName[] keys The current key path.\n * @return {boolean} If at least one term satisfies the specified test.\n */\nfunction someTermsNested(quad, checker, keys = []) {\n return (quad.subject.termType === 'Quad' ?\n someTermsNested(quad.subject, checker, [...keys, 'subject']) :\n checker(quad.subject, [...keys, 'subject']))\n || (quad.predicate.termType === 'Quad' ?\n someTermsNested(quad.predicate, checker, [...keys, 'predicate']) :\n checker(quad.predicate, [...keys, 'predicate']))\n || (quad.object.termType === 'Quad' ?\n someTermsNested(quad.object, checker, [...keys, 'object']) :\n checker(quad.object, [...keys, 'object']))\n || (quad.graph.termType === 'Quad' ?\n someTermsNested(quad.graph, checker, [...keys, 'graph']) :\n checker(quad.graph, [...keys, 'graph']));\n}\n/**\n * Get the nested value inside a quoted triple by the given path of quad keys.\n * @param term A term, that can be a quoted triple.\n * @param keys A path of quad term names.\n */\nfunction getValueNestedPath(term, keys) {\n if (keys.length === 0) {\n return term;\n }\n if (term.termType === 'Quad') {\n return getValueNestedPath(term[keys[0]], keys.slice(1));\n }\n throw new Error(`Tried to get ${keys[0]} from term of type ${term.termType}`);\n}\n/**\n * Check if the given terms match.\n *\n * At least one of the following must be true:\n * * Term B is undefined.\n * * Term B is a variable.\n * * Term A and B are quads, and return true for `matchPatternComplete`.\n * * Quad term and term are equal (`termB.equals(termA)` return true)\n *\n * @param termA A term.\n * @param termB An optional term.\n */\nfunction matchTerm(termA, termB) {\n return !termB\n || termB.termType === 'Variable'\n || (termB.termType === 'Quad' && termA.termType === 'Quad' && matchPatternComplete(termA, termB))\n || termB.equals(termA);\n}\n/**\n * Check if the given quad matches with the given quad terms.\n *\n * Each term must match at least one of the following:\n * * Term is undefined.\n * * Term is a variable.\n * * Quad term and term are both quads, and return true for `matchPatternComplete`.\n * * Quad term and term are equal (`quadTerm.equals(term)` return true)\n *\n * @param {BaseQuad} quad A quad to match with (can not contain variables).\n * @param {Term} subject An optional subject.\n * @param {Term} predicate An optional predicate.\n * @param {Term} object An optional object.\n * @param {Term} graph An optional graph.\n * @return {boolean} If the quad matches with the quad terms.\n */\nfunction matchPattern(quad, subject, predicate, object, graph) {\n return matchTerm(quad.subject, subject)\n && matchTerm(quad.predicate, predicate)\n && matchTerm(quad.object, object)\n && matchTerm(quad.graph, graph);\n}\n/**\n * Check if the first quad matches with all terms from the second quad.\n *\n * Each term must match at least one of the following:\n * * Quad2 term is a variable.\n * * Quad1 term and Quad2 term are equal (`term1.equals(term2)` return true)\n *\n * @param {BaseQuad} quad A quad (can not contain variables).\n * @param {BaseQuad} pattern A quad pattern (can contain variables).\n * @return {boolean} If the quad terms match.\n */\nfunction matchPatternComplete(quad, pattern) {\n return matchPattern(quad, pattern.subject, pattern.predicate, pattern.object, pattern.graph);\n}\nfunction matchPatternMappings(quad, pattern, opt = {}) {\n const map = {};\n function match(_pattern, _quad) {\n return everyTerms(_pattern, (t1, key) => {\n var _a, _b;\n const t2 = _quad[key];\n switch (t1.termType) {\n case 'Variable':\n return (opt.skipVarMapping && t2.termType === 'Variable')\n || ((_b = (_a = map[t1.value]) === null || _a === void 0 ? void 0 : _a.equals(t2)) !== null && _b !== void 0 ? _b : (map[t1.value] = t2, true));\n case 'Quad':\n return t2.termType === 'Quad' && match(t1, t2);\n default:\n return t1.equals(t2);\n }\n });\n }\n return match(pattern, quad) && (opt.returnMappings ? map : true);\n}\n//# sourceMappingURL=QuadTermUtil.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-terms/lib/QuadTermUtil.js?\n}");
770
+
771
+ /***/ },
772
+
773
+ /***/ "./node_modules/rdf-terms/lib/TermUtil.js"
774
+ /*!************************************************!*\
775
+ !*** ./node_modules/rdf-terms/lib/TermUtil.js ***!
776
+ \************************************************/
777
+ (__unused_webpack_module, exports, __webpack_require__) {
778
+
779
+ "use strict";
780
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TERM_TYPES = void 0;\nexports.uniqTerms = uniqTerms;\nexports.getTermsOfType = getTermsOfType;\nexports.getNamedNodes = getNamedNodes;\nexports.getBlankNodes = getBlankNodes;\nexports.getLiterals = getLiterals;\nexports.getVariables = getVariables;\nexports.getDefaultGraphs = getDefaultGraphs;\nexports.getQuads = getQuads;\nconst rdf_string_1 = __webpack_require__(/*! rdf-string */ \"./node_modules/rdf-string/index.js\");\n/**\n * All known term types.\n * @see RDF.Term\n * @type {[string , string , string , string , string, string]}\n */\nexports.TERM_TYPES = ['NamedNode', 'BlankNode', 'Literal', 'Variable', 'DefaultGraph', 'Quad'];\n/*\n * Utility methods for handling RDFJS terms.\n */\n/**\n * Create an array of unique terms from the given array.\n * @param {T[]} terms An array of RDFJS terms.\n * @return {T[]} A new array of unique RDFJS terms.\n */\nfunction uniqTerms(terms) {\n const hash = {};\n return terms.filter(term => {\n const termString = (0, rdf_string_1.termToString)(term);\n return !(termString in hash) && (hash[termString] = true);\n });\n}\n/**\n * Find all terms of the given type in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @param {\"NamedNode\" | \"BlankNode\" | \"Literal\" | \"Variable\" | \"DefaultGraph\" | \"Quad\"} termType A term type.\n * @return {Term[]} A new array with elements from the given array only containing elements of the given type.\n */\nfunction getTermsOfType(terms, termType) {\n return terms.filter((term) => term.termType === termType);\n}\n/**\n * Find all named nodes in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {NamedNode[]} A new array with elements from the given array only containing named nodes.\n */\nfunction getNamedNodes(terms) {\n return getTermsOfType(terms, 'NamedNode');\n}\n/**\n * Find all blank nodes in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {BlankNode[]} A new array with elements from the given array only containing blank nodes.\n */\nfunction getBlankNodes(terms) {\n return getTermsOfType(terms, 'BlankNode');\n}\n/**\n * Find all literals in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {Literal[]} A new array with elements from the given array only containing literals.\n */\nfunction getLiterals(terms) {\n return getTermsOfType(terms, 'Literal');\n}\n/**\n * Find all variables in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {Variable[]} A new array with elements from the given array only containing variables.\n */\nfunction getVariables(terms) {\n return getTermsOfType(terms, 'Variable');\n}\n/**\n * Find all default graphs in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {DefaultGraph[]} A new array with elements from the given array only containing default graphs.\n */\nfunction getDefaultGraphs(terms) {\n return getTermsOfType(terms, 'DefaultGraph');\n}\n/**\n * Find all quads in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {BaseQuad[]} A new array with elements from the given array only containing quads.\n */\nfunction getQuads(terms) {\n return getTermsOfType(terms, 'Quad');\n}\n//# sourceMappingURL=TermUtil.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-terms/lib/TermUtil.js?\n}");
781
+
782
+ /***/ },
783
+
784
+ /***/ "./node_modules/rdflib/esm/blank-node.js"
785
+ /*!***********************************************!*\
786
+ !*** ./node_modules/rdflib/esm/blank-node.js ***!
787
+ \***********************************************/
788
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
789
+
790
+ "use strict";
791
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ BlankNode)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _class_order__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./class-order */ \"./node_modules/rdflib/esm/class-order.js\");\n/* harmony import */ var _node_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node-internal */ \"./node_modules/rdflib/esm/node-internal.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n\n\n\n\n/**\n * An RDF blank node is a Node without a URI\n * @link https://rdf.js.org/data-model-spec/#blanknode-interface\n */\nclass BlankNode extends _node_internal__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n static getId(id) {\n if (id) {\n if (typeof id !== 'string') {\n throw new Error('Bad id argument to new blank node: ' + id);\n }\n if (id.includes('#')) {\n // Is a URI with hash fragment\n let fragments = id.split('#');\n return fragments[fragments.length - 1];\n }\n return id;\n }\n return 'n' + BlankNode.nextId++;\n }\n /**\n * Initializes this node\n * @param [id] The identifier for the blank node\n */\n constructor(id) {\n super(BlankNode.getId(id));\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"termType\", _types__WEBPACK_IMPORTED_MODULE_3__.BlankNodeTermType);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"classOrder\", _class_order__WEBPACK_IMPORTED_MODULE_1__[\"default\"].BlankNode);\n /** Whether this is a blank node */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isBlank\", 1);\n /**\n * This type of node is a variable.\n *\n * Note that the existence of this property already indicates that it is a variable.\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isVar\", 1);\n }\n\n /**\n * The identifier for the blank node\n */\n get id() {\n return this.value;\n }\n set id(value) {\n this.value = value;\n }\n compareTerm(other) {\n if (this.classOrder < other.classOrder) {\n return -1;\n }\n if (this.classOrder > other.classOrder) {\n return +1;\n }\n if (this.id < other.id) {\n return -1;\n }\n if (this.id > other.id) {\n return +1;\n }\n return 0;\n }\n\n /**\n * Gets a copy of this blank node in the specified formula\n * @param formula The formula\n */\n copy(formula) {\n // depends on the formula\n var bnodeNew = new BlankNode();\n formula.copyTo(this, bnodeNew);\n return bnodeNew;\n }\n toCanonical() {\n return BlankNode.NTAnonymousNodePrefix + this.value;\n }\n toString() {\n return BlankNode.NTAnonymousNodePrefix + this.id;\n }\n}\n/**\n * The next unique identifier for blank nodes\n */\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(BlankNode, \"nextId\", 0);\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(BlankNode, \"NTAnonymousNodePrefix\", '_:');\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/blank-node.js?\n}");
792
+
793
+ /***/ },
794
+
795
+ /***/ "./node_modules/rdflib/esm/class-order.js"
796
+ /*!************************************************!*\
797
+ !*** ./node_modules/rdflib/esm/class-order.js ***!
798
+ \************************************************/
799
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
800
+
801
+ "use strict";
802
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n* Class orders\n*/\nconst ClassOrder = {\n 'Literal': 1,\n 'Collection': 3,\n 'Graph': 4,\n 'NamedNode': 5,\n 'BlankNode': 6,\n 'Variable': 7\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ClassOrder);\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/class-order.js?\n}");
803
+
804
+ /***/ },
805
+
806
+ /***/ "./node_modules/rdflib/esm/collection.js"
807
+ /*!***********************************************!*\
808
+ !*** ./node_modules/rdflib/esm/collection.js ***!
809
+ \***********************************************/
810
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
811
+
812
+ "use strict";
813
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Collection),\n/* harmony export */ fromValue: () => (/* binding */ fromValue)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _blank_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blank-node */ \"./node_modules/rdflib/esm/blank-node.js\");\n/* harmony import */ var _class_order__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./class-order */ \"./node_modules/rdflib/esm/class-order.js\");\n/* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./literal */ \"./node_modules/rdflib/esm/literal.js\");\n/* harmony import */ var _node_internal__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./node-internal */ \"./node_modules/rdflib/esm/node-internal.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/terms */ \"./node_modules/rdflib/esm/utils/terms.js\");\n\n\n\n\n\n\n\n/**\n * Creates an RDF Node from a native javascript value.\n * RDF Nodes are returned unchanged, undefined returned as itself.\n * Arrays return Collections.\n * Strings, numbers and booleans return Literals.\n * @param value {Node|Date|String|Number|Boolean|Undefined}\n * @return {Node|Collection}\n */\nfunction fromValue(value) {\n if (typeof value === 'undefined' || value === null) {\n return value;\n }\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_6__.isTerm)(value)) {\n // a Node subclass or a Collection\n return value;\n }\n if (Array.isArray(value)) {\n return new Collection(value);\n }\n return _literal__WEBPACK_IMPORTED_MODULE_3__[\"default\"].fromValue(value);\n}\n\n/**\n * A collection of other RDF nodes\n *\n * Use generic T to control the contents of the array.\n */\nclass Collection extends _node_internal__WEBPACK_IMPORTED_MODULE_4__[\"default\"] {\n constructor(initial) {\n super((_blank_node__WEBPACK_IMPORTED_MODULE_1__[\"default\"].nextId++).toString());\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"termType\", _types__WEBPACK_IMPORTED_MODULE_5__.CollectionTermType);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"classOrder\", _class_order__WEBPACK_IMPORTED_MODULE_2__[\"default\"].Collection);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"closed\", false);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"compareTerm\", _blank_node__WEBPACK_IMPORTED_MODULE_1__[\"default\"].prototype.compareTerm);\n /**\n * The nodes in this collection\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"elements\", []);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isVar\", 0);\n if (initial && initial.length > 0) {\n initial.forEach(element => {\n this.elements.push(fromValue(element));\n });\n }\n }\n get id() {\n return this.value;\n }\n set id(value) {\n this.value = value;\n }\n\n /**\n * Appends an element to this collection\n * @param element - The new element\n */\n append(element) {\n return this.elements.push(element);\n }\n\n /**\n * Closes this collection\n */\n close() {\n this.closed = true;\n return this.closed;\n }\n\n /**\n * Removes the first element from the collection (and return it)\n */\n shift() {\n return this.elements.shift();\n }\n\n /**\n * Creates a new Collection with the substituting bindings applied\n * @param bindings - The bindings to substitute\n */\n substitute(bindings) {\n const elementsCopy = this.elements.map(ea => ea.substitute(bindings));\n return new Collection(elementsCopy);\n }\n toNT() {\n return Collection.toNT(this);\n }\n static toNT(collection) {\n // return '(' + collection.elements.map(x => x.toNT()).join(' ') + ')'\n // As lists are not in NT and toNT() must be a reversible function, we kludge it for a list\n return _blank_node__WEBPACK_IMPORTED_MODULE_1__[\"default\"].NTAnonymousNodePrefix + collection.id;\n }\n\n /**\n * Serializes the collection to a string.\n * Surrounded by (parentheses) and separated by spaces.\n */\n toString() {\n return '(' + this.elements.join(' ') + ')';\n }\n\n /**\n * Prepends the specified element to the collection's front\n * @param element - The element to prepend\n */\n unshift(element) {\n return this.elements.unshift(element);\n }\n}\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Collection, \"termType\", _types__WEBPACK_IMPORTED_MODULE_5__.CollectionTermType);\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/collection.js?\n}");
814
+
815
+ /***/ },
816
+
817
+ /***/ "./node_modules/rdflib/esm/default-graph.js"
818
+ /*!**************************************************!*\
819
+ !*** ./node_modules/rdflib/esm/default-graph.js ***!
820
+ \**************************************************/
821
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
822
+
823
+ "use strict";
824
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ DefaultGraph),\n/* harmony export */ isDefaultGraph: () => (/* binding */ isDefaultGraph)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _node_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node-internal */ \"./node_modules/rdflib/esm/node-internal.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n/* harmony import */ var _utils_default_graph_uri__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/default-graph-uri */ \"./node_modules/rdflib/esm/utils/default-graph-uri.js\");\n\n\n\n\n\n/** The RDF default graph */\nclass DefaultGraph extends _node_internal__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor() {\n super('');\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"value\", '');\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"termType\", _types__WEBPACK_IMPORTED_MODULE_2__.DefaultGraphTermType);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"uri\", _utils_default_graph_uri__WEBPACK_IMPORTED_MODULE_3__.defaultGraphURI);\n }\n toCanonical() {\n return this.value;\n }\n toString() {\n return 'DefaultGraph';\n }\n}\nfunction isDefaultGraph(object) {\n return !!object && object.termType === _types__WEBPACK_IMPORTED_MODULE_2__.DefaultGraphTermType;\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/default-graph.js?\n}");
825
+
826
+ /***/ },
827
+
828
+ /***/ "./node_modules/rdflib/esm/empty.js"
829
+ /*!******************************************!*\
830
+ !*** ./node_modules/rdflib/esm/empty.js ***!
831
+ \******************************************/
832
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
833
+
834
+ "use strict";
835
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Empty)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _node_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node-internal */ \"./node_modules/rdflib/esm/node-internal.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n\n\n\n/**\n* An empty node\n*/\nclass Empty extends _node_internal__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor() {\n super('');\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"termType\", _types__WEBPACK_IMPORTED_MODULE_2__.EmptyTermType);\n }\n toString() {\n return '()';\n }\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/empty.js?\n}");
836
+
837
+ /***/ },
838
+
839
+ /***/ "./node_modules/rdflib/esm/factories/canonical-data-factory.js"
840
+ /*!*********************************************************************!*\
841
+ !*** ./node_modules/rdflib/esm/factories/canonical-data-factory.js ***!
842
+ \*********************************************************************/
843
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
844
+
845
+ "use strict";
846
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ defaultGraphURI: () => (/* reexport safe */ _utils_default_graph_uri__WEBPACK_IMPORTED_MODULE_9__.defaultGraphURI)\n/* harmony export */ });\n/* harmony import */ var _blank_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../blank-node */ \"./node_modules/rdflib/esm/blank-node.js\");\n/* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../literal */ \"./node_modules/rdflib/esm/literal.js\");\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n/* harmony import */ var _statement__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../statement */ \"./node_modules/rdflib/esm/statement.js\");\n/* harmony import */ var _variable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../variable */ \"./node_modules/rdflib/esm/variable.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../types */ \"./node_modules/rdflib/esm/types.js\");\n/* harmony import */ var _default_graph__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../default-graph */ \"./node_modules/rdflib/esm/default-graph.js\");\n/* harmony import */ var _factory_types__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./factory-types */ \"./node_modules/rdflib/esm/factories/factory-types.js\");\n/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/terms */ \"./node_modules/rdflib/esm/utils/terms.js\");\n/* harmony import */ var _utils_default_graph_uri__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/default-graph-uri */ \"./node_modules/rdflib/esm/utils/default-graph-uri.js\");\n\n\n\n\n\n\n\n\n\n\n\n/**\n * Gets the default graph\n */\nconst defaultGraph = new _default_graph__WEBPACK_IMPORTED_MODULE_6__[\"default\"]();\n\n/** A basic internal RDFlib datafactory, which does not support Collections */\nconst CanonicalDataFactory = {\n supports: {\n [_factory_types__WEBPACK_IMPORTED_MODULE_7__.Feature.collections]: false,\n [_factory_types__WEBPACK_IMPORTED_MODULE_7__.Feature.defaultGraphType]: false,\n [_factory_types__WEBPACK_IMPORTED_MODULE_7__.Feature.equalsMethod]: true,\n [_factory_types__WEBPACK_IMPORTED_MODULE_7__.Feature.identity]: false,\n [_factory_types__WEBPACK_IMPORTED_MODULE_7__.Feature.id]: true,\n [_factory_types__WEBPACK_IMPORTED_MODULE_7__.Feature.reversibleId]: false,\n [_factory_types__WEBPACK_IMPORTED_MODULE_7__.Feature.variableType]: true\n },\n /**\n * Creates a new blank node\n * @param value - The blank node's identifier\n */\n blankNode(value) {\n return new _blank_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"](value);\n },\n defaultGraph: () => defaultGraph,\n /**\n * Compares to (rdf) objects for equality.\n */\n equals(a, b) {\n if (a === b || !a || !b) {\n return true;\n }\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_8__.isQuad)(a) || (0,_utils_terms__WEBPACK_IMPORTED_MODULE_8__.isQuad)(b)) {\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_8__.isQuad)(a) && (0,_utils_terms__WEBPACK_IMPORTED_MODULE_8__.isQuad)(b)) {\n return this.equals(a.subject, b.subject) && this.equals(a.predicate, b.predicate) && this.equals(a.object, b.object) && this.equals(a.graph, b.graph);\n }\n return false;\n }\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_8__.isTerm)(a) && (0,_utils_terms__WEBPACK_IMPORTED_MODULE_8__.isTerm)(b)) {\n return this.id(a) === this.id(b);\n }\n return false;\n },\n /**\n * Generates a uniquely identifiably *idempotent* string for the given {term}.\n *\n * Equivalent to [[Term.hashString]]\n *\n * @example Use this to associate data with a term in an object\n * { obj[id(term)] = \"myData\" }\n */\n id(term) {\n if (!term) {\n return 'undefined';\n }\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_8__.isQuad)(term)) {\n return this.quadToNQ(term);\n }\n switch (term.termType) {\n case _types__WEBPACK_IMPORTED_MODULE_5__.DefaultGraphTermType:\n return 'defaultGraph';\n case _types__WEBPACK_IMPORTED_MODULE_5__.VariableTermType:\n return _variable__WEBPACK_IMPORTED_MODULE_4__[\"default\"].toString(term);\n default:\n const nq = this.termToNQ(term);\n if (nq) {\n return nq;\n }\n throw new Error(`Can't id term with type '${term.termType}'`);\n }\n },\n isQuad(obj) {\n return obj instanceof _statement__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n },\n /**\n * Creates a new literal node. Does some JS literal parsing for ease of use.\n * @param value - The lexical value\n * @param languageOrDatatype - Either the language or the datatype\n */\n literal(value, languageOrDatatype) {\n if (typeof value !== \"string\" && !languageOrDatatype) {\n return _literal__WEBPACK_IMPORTED_MODULE_1__[\"default\"].fromValue(value);\n }\n const strValue = typeof value === 'string' ? value : '' + value;\n if (typeof languageOrDatatype === 'string') {\n if (languageOrDatatype.indexOf(':') === -1) {\n return new _literal__WEBPACK_IMPORTED_MODULE_1__[\"default\"](strValue, languageOrDatatype);\n } else {\n return new _literal__WEBPACK_IMPORTED_MODULE_1__[\"default\"](strValue, null, this.namedNode(languageOrDatatype));\n }\n } else {\n return new _literal__WEBPACK_IMPORTED_MODULE_1__[\"default\"](strValue, null, languageOrDatatype);\n }\n },\n /**\n * Creates a new named node\n * @param value - The new named node\n */\n namedNode(value) {\n return new _named_node__WEBPACK_IMPORTED_MODULE_2__[\"default\"](value);\n },\n /**\n * Creates a new statement\n * @param subject - The subject\n * @param predicate - The predicate\n * @param object - The object\n * @param graph - The containing graph\n */\n quad(subject, predicate, object, graph) {\n return new _statement__WEBPACK_IMPORTED_MODULE_3__[\"default\"](subject, predicate, object, graph || defaultGraph);\n },\n /**\n * Creates a new statement\n * @param subject - The subject\n * @param predicate - The predicate\n * @param object - The object\n * @param graph - The containing graph\n */\n triple(subject, predicate, object, graph) {\n return this.quad(subject, predicate, object, graph);\n },\n quadToNQ(q) {\n return `${this.termToNQ(q.subject)} ${this.termToNQ(q.predicate)} ${this.termToNQ(q.object)} ${this.termToNQ(q.graph)} .`;\n },\n /** Stringify a {term} to n-quads serialization. */\n termToNQ(term) {\n switch (term.termType) {\n case _types__WEBPACK_IMPORTED_MODULE_5__.BlankNodeTermType:\n return '_:' + term.value;\n case _types__WEBPACK_IMPORTED_MODULE_5__.DefaultGraphTermType:\n return '';\n case _types__WEBPACK_IMPORTED_MODULE_5__.EmptyTermType:\n return '<http://www.w3.org/1999/02/22-rdf-syntax-ns#nil>';\n case _types__WEBPACK_IMPORTED_MODULE_5__.LiteralTermType:\n return _literal__WEBPACK_IMPORTED_MODULE_1__[\"default\"].toNT(term);\n case _types__WEBPACK_IMPORTED_MODULE_5__.GraphTermType:\n case _types__WEBPACK_IMPORTED_MODULE_5__.NamedNodeTermType:\n return '<' + term.value + '>';\n case _types__WEBPACK_IMPORTED_MODULE_5__.CollectionTermType:\n return '(' + term.elements.map(t => this.termToNQ(t)).join(' ') + ')';\n default:\n throw new Error(`Can't serialize nonstandard term type (was '${term.termType}')`);\n }\n },\n /** Convert an rdf object (term or quad) to n-quads serialization. */\n toNQ(term) {\n if (this.isQuad(term)) {\n return this.quadToNQ(term);\n }\n return this.termToNQ(term);\n },\n /**\n * Creates a new variable\n * @param name - The name for the variable\n */\n variable(name) {\n return new _variable__WEBPACK_IMPORTED_MODULE_4__[\"default\"](name);\n }\n};\n\n/** Contains the factory methods as defined in the spec, plus id */\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (CanonicalDataFactory);\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/factories/canonical-data-factory.js?\n}");
847
+
848
+ /***/ },
849
+
850
+ /***/ "./node_modules/rdflib/esm/factories/extended-term-factory.js"
851
+ /*!********************************************************************!*\
852
+ !*** ./node_modules/rdflib/esm/factories/extended-term-factory.js ***!
853
+ \********************************************************************/
854
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
855
+
856
+ "use strict";
857
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../collection */ \"./node_modules/rdflib/esm/collection.js\");\n/* harmony import */ var _canonical_data_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./canonical-data-factory */ \"./node_modules/rdflib/esm/factories/canonical-data-factory.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../types */ \"./node_modules/rdflib/esm/types.js\");\n/* harmony import */ var _factory_types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./factory-types */ \"./node_modules/rdflib/esm/factories/factory-types.js\");\n/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../utils/terms */ \"./node_modules/rdflib/esm/utils/terms.js\");\n/* harmony import */ var _variable__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../variable */ \"./node_modules/rdflib/esm/variable.js\");\n\n\n\n\n\n\n/**\n * Data factory which also supports Collections\n *\n * Necessary for preventing circular dependencies.\n */\nconst ExtendedTermFactory = {\n ..._canonical_data_factory__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n supports: {\n [_factory_types__WEBPACK_IMPORTED_MODULE_3__.Feature.collections]: true,\n [_factory_types__WEBPACK_IMPORTED_MODULE_3__.Feature.defaultGraphType]: false,\n [_factory_types__WEBPACK_IMPORTED_MODULE_3__.Feature.equalsMethod]: true,\n [_factory_types__WEBPACK_IMPORTED_MODULE_3__.Feature.identity]: false,\n [_factory_types__WEBPACK_IMPORTED_MODULE_3__.Feature.id]: true,\n [_factory_types__WEBPACK_IMPORTED_MODULE_3__.Feature.reversibleId]: false,\n [_factory_types__WEBPACK_IMPORTED_MODULE_3__.Feature.variableType]: true\n },\n /**\n * Creates a new collection\n * @param elements - The initial element\n */\n collection(elements) {\n return new _collection__WEBPACK_IMPORTED_MODULE_0__[\"default\"](elements);\n },\n id(term) {\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_4__.isCollection)(term)) {\n return `( ${term.elements.map(e => {\n return this.id(e);\n }).join(', ')} )`;\n }\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_4__.isVariable)(term)) {\n return _variable__WEBPACK_IMPORTED_MODULE_5__[\"default\"].toString(term);\n }\n return _canonical_data_factory__WEBPACK_IMPORTED_MODULE_1__[\"default\"].id(term);\n },\n termToNQ(term) {\n if (term.termType === _types__WEBPACK_IMPORTED_MODULE_2__.CollectionTermType) {\n return _collection__WEBPACK_IMPORTED_MODULE_0__[\"default\"].toNT(term);\n }\n return _canonical_data_factory__WEBPACK_IMPORTED_MODULE_1__[\"default\"].termToNQ(term);\n }\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (ExtendedTermFactory);\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/factories/extended-term-factory.js?\n}");
858
+
859
+ /***/ },
860
+
861
+ /***/ "./node_modules/rdflib/esm/factories/factory-types.js"
862
+ /*!************************************************************!*\
863
+ !*** ./node_modules/rdflib/esm/factories/factory-types.js ***!
864
+ \************************************************************/
865
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
866
+
867
+ "use strict";
868
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Feature: () => (/* binding */ Feature)\n/* harmony export */ });\n/** A set of features that may be supported by a Data Factory */\n\nlet Feature = /*#__PURE__*/function (Feature) {\n /** Whether the factory supports termType:Collection terms */\n Feature[\"collections\"] = \"COLLECTIONS\";\n /** Whether the factory supports termType:DefaultGraph terms */\n Feature[\"defaultGraphType\"] = \"DEFAULT_GRAPH_TYPE\";\n /** Whether the factory supports equals on produced instances */\n Feature[\"equalsMethod\"] = \"EQUALS_METHOD\";\n /** Whether the factory can create a unique idempotent identifier for the given term. */\n Feature[\"id\"] = \"ID\";\n /**\n * Whether the factory will return the same instance for subsequent calls.\n * This implies `===`, which means methods like `indexOf` can be used.\n */\n Feature[\"identity\"] = \"IDENTITY\";\n /** Whether the factory supports mapping ids back to instances (should adhere to the identity setting) */\n Feature[\"reversibleId\"] = \"REVERSIBLE_ID\";\n /** Whether the factory supports termType:Variable terms */\n Feature[\"variableType\"] = \"VARIABLE_TYPE\";\n return Feature;\n}({});\n\n/**\n * Defines a DataFactory as used in rdflib, based on the RDF/JS: Data model specification,\n * but with additional extensions\n *\n * bnIndex is optional but useful.\n */\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/factories/factory-types.js?\n}");
869
+
870
+ /***/ },
871
+
872
+ /***/ "./node_modules/rdflib/esm/factories/rdflib-data-factory.js"
873
+ /*!******************************************************************!*\
874
+ !*** ./node_modules/rdflib/esm/factories/rdflib-data-factory.js ***!
875
+ \******************************************************************/
876
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
877
+
878
+ "use strict";
879
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../store */ \"./node_modules/rdflib/esm/store.js\");\n/* harmony import */ var _fetcher__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../fetcher */ \"./node_modules/rdflib/esm/fetcher.js\");\n/* harmony import */ var _extended_term_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./extended-term-factory */ \"./node_modules/rdflib/esm/factories/extended-term-factory.js\");\n\n\n\n/** Full RDFLib.js Data Factory */\nconst RDFlibDataFactory = {\n ..._extended_term_factory__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n /**\n * Creates a new fetcher\n * @param store - The store to use\n * @param options - The options\n */\n fetcher(store, options) {\n return new _fetcher__WEBPACK_IMPORTED_MODULE_1__[\"default\"](store, options);\n },\n /**\n * Creates a new graph (store)\n */\n graph(features = undefined, opts = undefined) {\n return new _store__WEBPACK_IMPORTED_MODULE_0__[\"default\"](features, opts || {\n rdfFactory: _extended_term_factory__WEBPACK_IMPORTED_MODULE_2__[\"default\"]\n });\n },\n /**\n * Creates a new literal node\n * @param val The lexical value\n * @param lang The language\n * @param dt The datatype\n */\n lit(val, lang, dt) {\n return this.literal('' + val, lang || dt);\n },\n /**\n * Creates a new statement\n * @param subject The subject\n * @param predicate The predicate\n * @param object The object\n * @param graph The containing graph\n */\n st(subject, predicate, object, graph) {\n return this.quad(subject, predicate, object, graph);\n }\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (RDFlibDataFactory);\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/factories/rdflib-data-factory.js?\n}");
880
+
881
+ /***/ },
882
+
883
+ /***/ "./node_modules/rdflib/esm/fetcher.js"
884
+ /*!********************************************!*\
885
+ !*** ./node_modules/rdflib/esm/fetcher.js ***!
886
+ \********************************************/
887
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
888
+
889
+ "use strict";
890
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Fetcher)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./store */ \"./node_modules/rdflib/esm/store.js\");\n/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./log */ \"./node_modules/rdflib/esm/log.js\");\n/* harmony import */ var _n3parser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./n3parser */ \"./node_modules/rdflib/esm/n3parser.js\");\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./namespace */ \"./node_modules/rdflib/esm/namespace.js\");\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parse */ \"./node_modules/rdflib/esm/parse.js\");\n/* harmony import */ var _rdfaparser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./rdfaparser */ \"./node_modules/rdflib/esm/rdfaparser.js\");\n/* harmony import */ var _rdfxmlparser__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./rdfxmlparser */ \"./node_modules/rdflib/esm/rdfxmlparser.js\");\n/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./uri */ \"./node_modules/rdflib/esm/uri.js\");\n/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./utils/terms */ \"./node_modules/rdflib/esm/utils/terms.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils-js */ \"./node_modules/rdflib/esm/utils-js.js\");\n/* harmony import */ var _serialize__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./serialize */ \"./node_modules/rdflib/esm/serialize.js\");\n/* harmony import */ var cross_fetch__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! cross-fetch */ \"./node_modules/cross-fetch/dist/browser-ponyfill.js\");\n/* harmony import */ var cross_fetch__WEBPACK_IMPORTED_MODULE_13___default = /*#__PURE__*/__webpack_require__.n(cross_fetch__WEBPACK_IMPORTED_MODULE_13__);\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n/* harmony import */ var _utils_termValue__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./utils/termValue */ \"./node_modules/rdflib/esm/utils/termValue.js\");\n/* harmony import */ var _jsonldparser__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./jsonldparser */ \"./node_modules/rdflib/esm/jsonldparser.js\");\n\n/* global $SolidTestEnvironment */\n/**\n *\n * Project: rdflib.js\n *\n * @file: fetcher.js\n *\n * Description: contains functions for requesting/fetching/retracting\n * This implements quite a lot of the web architecture.\n * A fetcher is bound to a specific quad store, into which\n * it loads stuff and into which it writes its metadata\n * @@ The metadata could be optionally a separate graph\n *\n * - implements semantics of HTTP headers, Internet Content Types\n * - selects parsers for rdf/xml, n3, rdfa, grddl\n *\n * TO do:\n * - Implement a runtime registry for parsers and serializers\n * -\n */\n\n/**\n * Things to test: callbacks on request, refresh, retract\n * loading from HTTP, HTTPS, FTP, FILE, others?\n * To do:\n * Firing up a mail client for mid: (message:) URLs\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst Parsable = {\n 'text/n3': true,\n 'text/turtle': true,\n 'application/rdf+xml': true,\n 'application/xhtml+xml': true,\n 'text/html': true,\n 'application/ld+json': true\n};\n\n// This is a minimal set to allow the use of damaged servers if necessary\nconst CONTENT_TYPE_BY_EXT = {\n 'rdf': _types__WEBPACK_IMPORTED_MODULE_14__.RDFXMLContentType,\n 'owl': _types__WEBPACK_IMPORTED_MODULE_14__.RDFXMLContentType,\n 'n3': 'text/n3',\n 'ttl': 'text/turtle',\n 'nt': 'text/n3',\n 'acl': 'text/n3',\n 'html': 'text/html',\n 'xml': 'text/xml'\n};\n\n// Convenience namespaces needed in this module.\n// These are deliberately not exported as the user application should\n// make its own list and not rely on the prefixes used here,\n// and not be tempted to add to them, and them clash with those of another\n// application.\nconst getNS = factory => {\n return {\n link: (0,_namespace__WEBPACK_IMPORTED_MODULE_5__[\"default\"])('http://www.w3.org/2007/ont/link#', factory),\n http: (0,_namespace__WEBPACK_IMPORTED_MODULE_5__[\"default\"])('http://www.w3.org/2007/ont/http#', factory),\n httph: (0,_namespace__WEBPACK_IMPORTED_MODULE_5__[\"default\"])('http://www.w3.org/2007/ont/httph#', factory),\n // headers\n rdf: (0,_namespace__WEBPACK_IMPORTED_MODULE_5__[\"default\"])('http://www.w3.org/1999/02/22-rdf-syntax-ns#', factory),\n rdfs: (0,_namespace__WEBPACK_IMPORTED_MODULE_5__[\"default\"])('http://www.w3.org/2000/01/rdf-schema#', factory),\n dc: (0,_namespace__WEBPACK_IMPORTED_MODULE_5__[\"default\"])('http://purl.org/dc/elements/1.1/', factory),\n ldp: (0,_namespace__WEBPACK_IMPORTED_MODULE_5__[\"default\"])('http://www.w3.org/ns/ldp#', factory)\n };\n};\nconst ns = getNS();\n\n/** An extended interface of Response, since RDFlib.js adds some properties. */\n\n/** tell typescript that a 'panes' child may exist on Window */\n\n/** All valid inputs for initFetchOptions */\n\n/** Initiated by initFetchOptions, which runs on load */\n\nclass Handler {\n constructor(response, dom) {\n // TODO: Document, type\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"response\", void 0);\n // TODO: Document, type\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"dom\", void 0);\n this.response = response;\n // The type assertion operator here might need to be removed.\n this.dom = dom;\n }\n}\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Handler, \"pattern\", void 0);\nclass RDFXMLHandler extends Handler {\n static toString() {\n return 'RDFXMLHandler';\n }\n static register(fetcher) {\n fetcher.mediatypes[_types__WEBPACK_IMPORTED_MODULE_14__.RDFXMLContentType] = {\n 'q': 0.9\n };\n }\n parse(fetcher, /** An XML String */\n responseText, /** Requires .original */\n options) {\n let kb = fetcher.store;\n if (!this.dom) {\n this.dom = _utils_js__WEBPACK_IMPORTED_MODULE_11__.parseXML(responseText);\n }\n let root = this.dom.documentElement;\n if (root && root.nodeName === 'parsererror') {\n // Mozilla only See issue/issue110\n // have to fail the request\n return fetcher.failFetch(options, 'Badly formed XML in ' + options.resource.value, 'parse_error');\n }\n let parser = new _rdfxmlparser__WEBPACK_IMPORTED_MODULE_8__[\"default\"](kb);\n try {\n parser.parse(this.dom, options.original.value, options.original);\n } catch (err) {\n return fetcher.failFetch(options, 'Syntax error parsing RDF/XML! ' + err, 'parse_error');\n }\n if (!options.noMeta) {\n kb.add(options.original, ns.rdf('type'), ns.link('RDFDocument'), fetcher.appNode);\n }\n return fetcher.doneFetch(options, this.response);\n }\n}\nRDFXMLHandler.pattern = new RegExp('application/rdf\\\\+xml');\nclass XHTMLHandler extends Handler {\n static toString() {\n return 'XHTMLHandler';\n }\n static register(fetcher) {\n fetcher.mediatypes[_types__WEBPACK_IMPORTED_MODULE_14__.XHTMLContentType] = {\n 'q': 0.8\n };\n }\n parse(fetcher, responseText, options) {\n let relation, reverse;\n if (!this.dom) {\n this.dom = _utils_js__WEBPACK_IMPORTED_MODULE_11__.parseXML(responseText);\n }\n let kb = fetcher.store;\n\n // dc:title\n let title = this.dom.getElementsByTagName('title');\n if (title.length > 0) {\n kb.add(options.resource, ns.dc('title'), kb.rdfFactory.literal(title[0].textContent), options.resource);\n // log.info(\"Inferring title of \" + xhr.resource)\n }\n\n // link rel\n let links = this.dom.getElementsByTagName('link');\n for (let x = links.length - 1; x >= 0; x--) {\n // @@ rev\n relation = links[x].getAttribute('rel');\n reverse = false;\n if (!relation) {\n relation = links[x].getAttribute('rev');\n reverse = true;\n }\n if (relation) {\n fetcher.linkData(options.original, relation, links[x].getAttribute('href'), options.resource, reverse);\n }\n }\n\n // Data Islands\n let scripts = this.dom.getElementsByTagName('script');\n for (let i = 0; i < scripts.length; i++) {\n let contentType = scripts[i].getAttribute('type');\n if (Parsable[contentType]) {\n // @ts-ignore incompatibility between Store.add and Formula.add\n (0,_parse__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(scripts[i].textContent, kb, options.original.value, contentType);\n // @ts-ignore incompatibility between Store.add and Formula.add\n (0,_parse__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(scripts[i].textContent, kb, options.original.value, contentType);\n }\n }\n if (!options.noMeta) {\n kb.add(options.resource, ns.rdf('type'), ns.link('WebPage'), fetcher.appNode);\n }\n if (!options.noRDFa && _rdfaparser__WEBPACK_IMPORTED_MODULE_7__.parseRDFaDOM) {\n // enable by default\n try {\n (0,_rdfaparser__WEBPACK_IMPORTED_MODULE_7__.parseRDFaDOM)(this.dom, kb, options.original.value);\n } catch (err) {\n // @ts-ignore\n let msg = 'Error trying to parse ' + options.resource + ' as RDFa:\\n' + err + ':\\n' + err.stack;\n return fetcher.failFetch(options, msg, 'parse_error');\n }\n }\n return fetcher.doneFetch(options, this.response);\n }\n}\nXHTMLHandler.pattern = new RegExp('application/xhtml');\nclass XMLHandler extends Handler {\n static toString() {\n return 'XMLHandler';\n }\n static register(fetcher) {\n fetcher.mediatypes['text/xml'] = {\n 'q': 0.5\n };\n fetcher.mediatypes['application/xml'] = {\n 'q': 0.5\n };\n }\n static isElement(node) {\n return node.nodeType === Node.ELEMENT_NODE;\n }\n parse(fetcher, responseText, options) {\n let dom = _utils_js__WEBPACK_IMPORTED_MODULE_11__.parseXML(responseText);\n\n // XML Semantics defined by root element namespace\n // figure out the root element\n for (let c = 0; c < dom.childNodes.length; c++) {\n const node = dom.childNodes[c];\n // is this node an element?\n if (XMLHandler.isElement(node)) {\n // We've found the first element, it's the root\n let ns = node.namespaceURI;\n\n // Is it RDF/XML?\n if (ns && ns === ns['rdf']) {\n fetcher.addStatus(options.req, 'Has XML root element in the RDF namespace, so assume RDF/XML.');\n let rdfHandler = new RDFXMLHandler(this.response, dom);\n return rdfHandler.parse(fetcher, responseText, options);\n }\n break;\n }\n }\n\n // Or it could be XHTML?\n // Maybe it has an XHTML DOCTYPE?\n if (dom.doctype) {\n // log.info(\"We found a DOCTYPE in \" + xhr.resource)\n if (dom.doctype.name === 'html' && dom.doctype.publicId.match(/^-\\/\\/W3C\\/\\/DTD XHTML/) && dom.doctype.systemId.match(/http:\\/\\/www.w3.org\\/TR\\/xhtml/)) {\n fetcher.addStatus(options.req, 'Has XHTML DOCTYPE. Switching to XHTML Handler.\\n');\n let xhtmlHandler = new XHTMLHandler(this.response, dom);\n return xhtmlHandler.parse(fetcher, responseText, options);\n }\n }\n\n // Or what about an XHTML namespace?\n let html = dom.getElementsByTagName('html')[0];\n if (html) {\n let xmlns = html.getAttribute('xmlns');\n if (xmlns && xmlns.match(/^http:\\/\\/www.w3.org\\/1999\\/xhtml/)) {\n fetcher.addStatus(options.req, 'Has a default namespace for ' + 'XHTML. Switching to XHTMLHandler.\\n');\n let xhtmlHandler = new XHTMLHandler(this.response, dom);\n return xhtmlHandler.parse(fetcher, responseText, options);\n }\n }\n\n // At this point we should check the namespace document (cache it!) and\n // look for a GRDDL transform\n // @@ Get namespace document <n>, parse it, look for <n> grddl:namespaceTransform ?y\n // Apply ?y to dom\n // We give up. What dialect is this?\n return fetcher.failFetch(options, 'Unsupported dialect of XML: not RDF or XHTML namespace, etc.\\n' + responseText.slice(0, 80), 901);\n }\n}\nXMLHandler.pattern = new RegExp('(text|application)/(.*)xml');\nclass HTMLHandler extends Handler {\n static toString() {\n return 'HTMLHandler';\n }\n static register(fetcher) {\n fetcher.mediatypes['text/html'] = {\n 'q': 0.8\n };\n }\n parse(fetcher, responseText, options) {\n let kb = fetcher.store;\n\n // We only handle XHTML so we have to figure out if this is XML\n // log.info(\"Sniffing HTML \" + xhr.resource + \" for XHTML.\")\n if (isXML(responseText)) {\n fetcher.addStatus(options.req, \"Has an XML declaration. We'll assume \" + \"it's XHTML as the content-type was text/html.\\n\");\n let xhtmlHandler = new XHTMLHandler(this.response);\n return xhtmlHandler.parse(fetcher, responseText, options);\n }\n\n // DOCTYPE html\n if (isXHTML(responseText)) {\n fetcher.addStatus(options.req, 'Has XHTML DOCTYPE. Switching to XHTMLHandler.\\n');\n let xhtmlHandler = new XHTMLHandler(this.response);\n return xhtmlHandler.parse(fetcher, responseText, options);\n }\n\n // xmlns\n if (isXMLNS(responseText)) {\n fetcher.addStatus(options.req, 'Has default namespace for XHTML, so switching to XHTMLHandler.\\n');\n let xhtmlHandler = new XHTMLHandler(this.response);\n return xhtmlHandler.parse(fetcher, responseText, options);\n }\n\n // dc:title\n // no need to escape '/' here\n let titleMatch = new RegExp('<title>([\\\\s\\\\S]+?)</title>', 'im').exec(responseText);\n if (titleMatch) {\n kb.add(options.resource, ns.dc('title'), kb.rdfFactory.literal(titleMatch[1]), options.resource); // think about xml:lang later\n }\n kb.add(options.resource, ns.rdf('type'), ns.link('WebPage'), fetcher.appNode);\n fetcher.addStatus(options.req, 'non-XML HTML document, not parsed for data.');\n return fetcher.doneFetch(options, this.response);\n }\n}\nHTMLHandler.pattern = new RegExp('text/html');\nclass JsonLdHandler extends Handler {\n static toString() {\n return 'JsonLdHandler';\n }\n static register(fetcher) {\n fetcher.mediatypes['application/ld+json'] = {\n 'q': 0.9\n };\n }\n async parse(fetcher, responseText, options, response) {\n const kb = fetcher.store;\n try {\n await (0,_jsonldparser__WEBPACK_IMPORTED_MODULE_16__[\"default\"])(responseText, kb, options.original.value);\n fetcher.store.add(options.original, ns.rdf('type'), ns.link('RDFDocument'), fetcher.appNode);\n return fetcher.doneFetch(options, response);\n } catch (err) {\n const msg = 'Error trying to parse ' + options.resource + ' as JSON-LD:\\n' + err; // not err.stack -- irrelevant\n return fetcher.failFetch(options, msg, 'parse_error', response);\n }\n }\n}\nJsonLdHandler.pattern = /application\\/(ld\\+json|activity\\+json)/;\nclass TextHandler extends Handler {\n static toString() {\n return 'TextHandler';\n }\n static register(fetcher) {\n fetcher.mediatypes['text/plain'] = {\n 'q': 0.5\n };\n }\n parse(fetcher, responseText, options) {\n // We only speak dialects of XML right now. Is this XML?\n\n // Look for an XML declaration\n if (isXML(responseText)) {\n fetcher.addStatus(options.req, 'Warning: ' + options.resource + \" has an XML declaration. We'll assume \" + \"it's XML but its content-type wasn't XML.\\n\");\n let xmlHandler = new XMLHandler(this.response);\n return xmlHandler.parse(fetcher, responseText, options);\n }\n\n // Look for an XML declaration\n if (responseText.slice(0, 500).match(/xmlns:/)) {\n fetcher.addStatus(options.req, \"May have an XML namespace. We'll assume \" + \"it's XML but its content-type wasn't XML.\\n\");\n let xmlHandler = new XMLHandler(this.response);\n return xmlHandler.parse(fetcher, responseText, options);\n }\n\n // We give up finding semantics - this is not an error, just no data\n fetcher.addStatus(options.req, 'Plain text document, no known RDF semantics.');\n return fetcher.doneFetch(options, this.response);\n }\n}\nTextHandler.pattern = new RegExp('text/plain');\nclass N3Handler extends Handler {\n static toString() {\n return 'N3Handler';\n }\n static register(fetcher) {\n fetcher.mediatypes['text/n3'] = {};\n fetcher.mediatypes['text/turtle'] = {};\n }\n parse(fetcher, responseText, options, response) {\n // Parse the text of this N3 file\n let kb = fetcher.store;\n let p = (0,_n3parser__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(kb, kb, options.original.value, options.original.value, null, null, '', null);\n // p.loadBuf(xhr.responseText)\n try {\n p.loadBuf(responseText);\n } catch (err) {\n let msg = 'Error trying to parse ' + options.resource + ' as Notation3:\\n' + err; // not err.stack -- irrelevant\n return fetcher.failFetch(options, msg, 'parse_error', response);\n }\n fetcher.addStatus(options.req, 'N3 parsed: ' + p.statementCount + ' triples in ' + p.lines + ' lines.');\n fetcher.store.add(options.original, ns.rdf('type'), ns.link('RDFDocument'), fetcher.appNode);\n return fetcher.doneFetch(options, this.response);\n }\n}\nN3Handler.pattern = new RegExp('(application|text)/(x-)?(rdf\\\\+)?(n3|turtle)');\nconst defaultHandlers = {\n RDFXMLHandler,\n XHTMLHandler,\n XMLHandler,\n HTMLHandler,\n TextHandler,\n N3Handler,\n JsonLdHandler\n};\nfunction isXHTML(responseText) {\n const docTypeStart = responseText.indexOf('<!DOCTYPE html');\n const docTypeEnd = responseText.indexOf('>');\n if (docTypeStart === -1 || docTypeEnd === -1 || docTypeStart > docTypeEnd) {\n return false;\n }\n return responseText.substr(docTypeStart, docTypeEnd - docTypeStart).indexOf('XHTML') !== -1;\n}\nfunction isXML(responseText) {\n const match = responseText.match(/\\s*<\\?xml\\s+version\\s*=[^<>]+\\?>/);\n return !!match;\n}\nfunction isXMLNS(responseText) {\n const match = responseText.match(/[^(<html)]*<html\\s+[^<]*xmlns=['\"]http:\\/\\/www.w3.org\\/1999\\/xhtml[\"'][^<]*>/);\n return !!match;\n}\n\n// Not sure about the shapes of this. Response? FetchError?\n\n/** Differs from normal Fetch, has an extended Response type */\n\n/** Fetcher\n *\n * The Fetcher object is a helper object for a quadstore\n * which turns it from an offline store to an online store.\n * The fetcher deals with loading data files rom the web,\n * figuring how to parse them. It will also refresh, remove, the data\n * and put back the data to the web.\n */\nclass Fetcher {\n constructor(store, options = {}) {\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"store\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"timeout\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_fetch\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"mediatypes\", void 0);\n /** Denoting this session */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"appNode\", void 0);\n /**\n * this.requested[uri] states:\n * undefined no record of web access or records reset\n * true has been requested, fetch in progress\n * 'done' received, Ok\n * 401 Not logged in\n * 403 HTTP status unauthorized\n * 404 Resource does not exist. Can be created etc.\n * 'redirected' In attempt to counter CORS problems retried.\n * 'parse_error' Parse error\n * 'unsupported_protocol' URI is not a protocol Fetcher can deal with\n * other strings mean various other errors.\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"requested\", void 0);\n /** List of timeouts associated with a requested URL */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"timeouts\", void 0);\n /** Redirected from *key uri* to *value uri* */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"redirectedTo\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"fetchQueue\", void 0);\n /** fetchCallbacks[uri].push(callback) */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"fetchCallbacks\", void 0);\n /** Keep track of explicit 404s -> we can overwrite etc */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"nonexistent\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"lookedUp\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"handlers\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"ns\", void 0);\n /** Methods added by calling Util.callbackify in the constructor*/\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"fireCallbacks\", void 0);\n this.store = store || new _store__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n this.ns = getNS(this.store.rdfFactory);\n this.timeout = options.timeout || 30000;\n\n // solidFetcher is deprecated\n let fetchFunc = options.fetch || typeof __webpack_require__.g !== 'undefined' && (__webpack_require__.g.solidFetcher || __webpack_require__.g.solidFetch) || typeof window !== 'undefined' && (window.solidFetcher || window.solidFetch) || (cross_fetch__WEBPACK_IMPORTED_MODULE_13___default());\n if (!fetchFunc) {\n throw new Error('No _fetch function available for Fetcher');\n }\n // Bind fetch to its context to avoid \"Illegal invocation\" errors\n // Check if it's the native browser fetch or global fetch that needs binding\n if (typeof window !== 'undefined' && fetchFunc === window.fetch) {\n this._fetch = fetchFunc.bind(window);\n } else if (typeof __webpack_require__.g !== 'undefined' && fetchFunc === __webpack_require__.g.fetch) {\n this._fetch = fetchFunc.bind(__webpack_require__.g);\n } else {\n this._fetch = fetchFunc;\n }\n // This is the name of the graph we store all the HTTP metadata in\n this.appNode = this.store.sym('chrome://TheCurrentSession');\n // this.appNode = this.store.rdfFactory.blankNode() // Needs to have a URI in tests\n this.store.fetcher = this; // Bi-linked\n this.requested = {};\n this.timeouts = {};\n this.redirectedTo = {};\n this.fetchQueue = {};\n this.fetchCallbacks = {};\n this.nonexistent = {};\n this.lookedUp = {};\n this.handlers = [];\n this.mediatypes = {\n 'image/*': {\n 'q': 0.9\n },\n '*/*': {\n 'q': 0.1\n } // Must allow access to random content\n };\n\n // Util.callbackify(this, ['request', 'recv', 'headers', 'load', 'fail',\n // 'refresh', 'retract', 'done'])\n // In switching to fetch(), 'recv', 'headers' and 'load' do not make sense\n _utils_js__WEBPACK_IMPORTED_MODULE_11__.callbackify(this, ['request', 'fail', 'refresh', 'retract', 'done']);\n Object.keys(options.handlers || defaultHandlers).map(key => this.addHandler(defaultHandlers[key]));\n }\n static crossSiteProxy(uri) {\n if (Fetcher.crossSiteProxyTemplate) {\n return Fetcher.crossSiteProxyTemplate.replace('{uri}', encodeURIComponent(uri));\n } else {\n return undefined;\n }\n }\n static offlineOverride(uri) {\n // Map the URI to a localhost proxy if we are running on localhost\n // This is used for working offline, e.g. on planes.\n // Is the script itself is running in localhost, then access all\n // data in a localhost mirror.\n // Do not remove without checking with TimBL\n let requestedURI = uri;\n var UI;\n if (typeof window !== 'undefined' && window.panes && (UI = window.panes.UI) && UI.preferences && UI.preferences.get('offlineModeUsingLocalhost')) {\n if (requestedURI.slice(0, 7) === 'http://' && requestedURI.slice(7, 17) !== 'localhost/') {\n requestedURI = 'http://localhost/' + requestedURI.slice(7);\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].warn('Localhost kludge for offline use: actually getting <' + requestedURI + '>');\n } else {\n // log.warn(\"Localhost kludge NOT USED <\" + requestedURI + \">\")\n }\n } else {\n // log.warn(\"Localhost kludge OFF offline use: actually getting <\" +\n // requestedURI + \">\")\n }\n return requestedURI;\n }\n static proxyIfNecessary(uri) {\n var UI;\n if (typeof window !== 'undefined' && window.panes && (UI = window.panes.UI) && UI.isExtension) {\n return uri;\n } // Extension does not need proxy\n\n if (typeof $SolidTestEnvironment !== 'undefined' && $SolidTestEnvironment.localSiteMap) {\n // nested dictionaries of URI parts from origin down\n let hostpath = uri.split('/').slice(2); // the bit after the //\n\n const lookup = (parts, index) => {\n let z = index[parts.shift()];\n if (!z) {\n return null;\n }\n if (typeof z === 'string') {\n return z + parts.join('/');\n }\n if (!parts) {\n return null;\n }\n return lookup(parts, z);\n };\n const y = lookup(hostpath, $SolidTestEnvironment.localSiteMap);\n if (y) {\n return y;\n }\n }\n\n // browser does 2014 on as https browser script not trusted\n // If the web app origin is https: then the mixed content rules\n // prevent it loading insecure http: stuff so we need proxy.\n if (Fetcher.crossSiteProxyTemplate && typeof document !== 'undefined' && document.location && ('' + document.location).slice(0, 6) === 'https:' &&\n // origin is secure\n uri.slice(0, 5) === 'http:') {\n // requested data is not\n return Fetcher.crossSiteProxyTemplate.replace('{uri}', encodeURIComponent(uri));\n }\n return uri;\n }\n\n /**\n * Tests whether the uri's protocol is supported by the Fetcher.\n * @param uri\n */\n static unsupportedProtocol(uri) {\n let pcol = _uri__WEBPACK_IMPORTED_MODULE_9__.protocol(uri);\n return pcol === 'tel' || pcol === 'mailto' || pcol === 'urn';\n }\n\n /** Decide on credentials using old XXHR api or new fetch() one\n * @param requestedURI\n * @param options\n */\n static setCredentials(requestedURI, options = {}) {\n // 2014 CORS problem:\n // XMLHttpRequest cannot load http://www.w3.org/People/Berners-Lee/card.\n // A wildcard '*' cannot be used in the 'Access-Control-Allow-Origin'\n // header when the credentials flag is true.\n // @ Many ontology files under http: and need CORS wildcard ->\n // can't have credentials\n if (options.credentials === undefined) {\n // Caller using new fetch convention\n if (options.withCredentials !== undefined) {\n // XHR style is what Fetcher specified before\n options.credentials = options.withCredentials ? 'include' : 'omit';\n } else {\n options.credentials = 'include'; // default is to be logged on\n }\n }\n }\n\n /**\n * Promise-based load function\n *\n * Loads a web resource or resources into the store.\n *\n * A resource may be given as NamedNode object, or as a plain URI.\n * an array of resources will be given, in which they will be fetched in parallel.\n * By default, the HTTP headers are recorded also, in the same store, in a separate graph.\n * This allows code like editable() for example to test things about the resource.\n *\n * @param uri {Array<RDFlibNamedNode>|Array<string>|RDFlibNamedNode|string}\n *\n * @param [options={}] {Object}\n *\n * @param [options.fetch] {Function}\n *\n * @param [options.referringTerm] {RDFlibNamedNode} Referring term, the resource which\n * referred to this (for tracking bad links)\n *\n * @param [options.contentType] {string} Provided content type (for writes)\n *\n * @param [options.forceContentType] {string} Override the incoming header to\n * force the data to be treated as this content-type (for reads)\n *\n * @param [options.force] {boolean} Load the data even if loaded before.\n * Also sets the `Cache-Control:` header to `no-cache`\n *\n * @param [options.baseURI=docuri] {Node|string} Original uri to preserve\n * through proxying etc (`xhr.original`).\n *\n * @param [options.proxyUsed] {boolean} Whether this request is a retry via\n * a proxy (generally done from an error handler)\n *\n * @param [options.withCredentials] {boolean} flag for XHR/CORS etc\n *\n * @param [options.clearPreviousData] {boolean} Before we parse new data,\n * clear old, but only on status 200 responses\n *\n * @param [options.noMeta] {boolean} Prevents the addition of various metadata\n * triples (about the fetch request) to the store\n *\n * @param [options.noRDFa] {boolean}\n *\n * @returns {Promise<Result>}\n */\n load(uri, options = {}) {\n options = Object.assign({}, options); // Take a copy as we add stuff to the options!!\n if (uri instanceof Array) {\n return Promise.all(uri.map(x => {\n return this.load(x, Object.assign({}, options));\n }));\n }\n const uriIn = uri;\n let docuri = (0,_utils_termValue__WEBPACK_IMPORTED_MODULE_15__.termValue)(uriIn);\n docuri = docuri.split('#')[0];\n options = this.initFetchOptions(docuri, options);\n // if metadata flaged clear cache and removeDocument\n const meta = this.appNode;\n const kb = this.store;\n const requests = kb.statementsMatching(undefined, this.ns.link('requestedURI'), kb.sym(docuri), meta).map(st => st.subject);\n for (const request of requests) {\n const response = kb.any(request, this.ns.link('response'), null, meta);\n if (response != undefined) {\n // ts\n const quad = kb.statementsMatching(response, this.ns.link('outOfDate'), true, meta);\n kb.remove(quad);\n options.force = true;\n options.clearPreviousData = true;\n }\n }\n const initialisedOptions = this.initFetchOptions(docuri, options);\n return this.pendingFetchPromise(docuri, initialisedOptions.baseURI, initialisedOptions);\n }\n async pendingFetchPromise(uri, originalUri, options) {\n let pendingPromise;\n\n // Check to see if some request is already dealing with this uri\n if (!options.force && (await this.fetchQueue[originalUri])) {\n pendingPromise = this.fetchQueue[originalUri];\n } else {\n pendingPromise = Promise.race([this.setRequestTimeout(uri, options), this.fetchUri(uri, options)]);\n this.fetchQueue[originalUri] = pendingPromise;\n\n // Clean up the queued promise after a time, if it's resolved\n this.cleanupFetchRequest(originalUri, undefined, this.timeout);\n }\n return pendingPromise.then(x => {\n if (uri in this.timeouts) {\n this.timeouts[uri].forEach(clearTimeout);\n delete this.timeouts[uri];\n }\n return x;\n });\n }\n\n /**\n * @param _options - DEPRECATED\n */\n cleanupFetchRequest(originalUri, _options, timeout) {\n if (_options !== undefined) {\n console.warn(\"_options is deprecated\");\n }\n this.timeouts[originalUri] = (this.timeouts[originalUri] || []).concat(setTimeout(() => {\n if (!this.isPending(originalUri)) {\n delete this.fetchQueue[originalUri];\n }\n }, timeout));\n }\n initFetchOptions(uri, options) {\n let kb = this.store;\n let isGet = !options.method || options.method.toUpperCase() === 'GET';\n if (!isGet) {\n options.force = true;\n }\n options.resource = kb.rdfFactory.namedNode(uri); // This might be proxified\n options.baseURI = options.baseURI || uri; // Preserve though proxying etc\n options.original = kb.rdfFactory.namedNode(options.baseURI);\n options.req = kb.bnode();\n options.headers = options.headers || {};\n if (options.contentType) {\n // @ts-ignore\n options.headers['content-type'] = options.contentType;\n }\n if (options.force) {\n options.cache = 'no-cache';\n }\n let acceptString = this.acceptString();\n // @ts-ignore\n options.headers['accept'] = acceptString;\n let requestedURI = Fetcher.offlineOverride(uri);\n options.requestedURI = requestedURI;\n Fetcher.setCredentials(requestedURI, options);\n let actualProxyURI = Fetcher.proxyIfNecessary(requestedURI);\n if (requestedURI !== actualProxyURI) {\n options.proxyUsed = true;\n }\n options.actualProxyURI = actualProxyURI;\n return options;\n }\n\n /**\n * (The promise chain ends in either a `failFetch()` or a `doneFetch()`)\n *\n * @param docuri {string}\n * @param options {Object}\n *\n * @returns {Promise<Object>} fetch() result or an { error, status } object\n */\n fetchUri(docuri, options) {\n if (!docuri) {\n return Promise.reject(new Error('Cannot fetch an empty uri'));\n }\n if (Fetcher.unsupportedProtocol(docuri)) {\n return this.failFetch(options, 'fetcher: Unsupported protocol', 'unsupported_protocol');\n }\n let state = this.getState(docuri);\n if (!options.force) {\n if (state === 'fetched') {\n // URI already fetched and added to store\n return Promise.resolve(\n // @ts-ignore This is not a valid response object\n this.doneFetch(options, {\n status: 200,\n ok: true,\n statusText: 'Already loaded into quadstore.'\n }));\n }\n if (state === 'failed' && this.requested[docuri] === 404) {\n // Remember nonexistence\n let message = 'Previously failed: ' + this.requested[docuri];\n // @ts-ignore This is not a valid response object\n let dummyResponse = {\n url: docuri,\n // This does not comply to Fetch spec, it can be a string value in rdflib\n status: this.requested[docuri],\n statusText: message,\n responseText: message,\n headers: new cross_fetch__WEBPACK_IMPORTED_MODULE_13__.Headers(),\n // Headers() ???\n ok: false,\n body: null,\n bodyUsed: false,\n size: 0,\n timeout: 0\n };\n return this.failFetch(options, message, this.requested[docuri], dummyResponse);\n }\n } else {\n // options.force == true\n delete this.nonexistent[docuri];\n }\n this.fireCallbacks('request', [docuri]);\n this.requested[docuri] = true; // mark this uri as 'requested'\n\n if (!options.noMeta) {\n this.saveRequestMetadata(docuri, options);\n }\n let {\n actualProxyURI\n } = options;\n\n // Map might get mistakenly added into headers\n // error TS2339: Property 'map' does not exist on type 'Headers'.\n /* let map\n if (options.headers && map in options.headers) {\n delete options.headers.map\n } */\n\n return this._fetch(actualProxyURI, options).then(response => this.handleResponse(response, docuri, options), error => {\n // @@ handleError?\n // @ts-ignore Invalid response object\n let dummyResponse = {\n url: actualProxyURI,\n status: 999,\n // @@ what number/string should fetch failures report?\n statusText: (error.name || 'network failure') + ': ' + (error.errno || error.code || error.type),\n responseText: error.message,\n headers: new cross_fetch__WEBPACK_IMPORTED_MODULE_13__.Headers(),\n // Headers() ???\n ok: false,\n body: null,\n bodyUsed: false,\n size: 0,\n timeout: 0\n };\n // console.log('Fetcher: <' + actualProxyURI + '> Non-HTTP fetch exception: ' + error)\n return this.handleError(dummyResponse, docuri, options); // possible credentials retry\n // return this.failFetch(options, 'fetch failed: ' + error, 999, dummyResponse) // Fake status code: fetch exception\n\n // handleError expects a response so we fake some important bits.\n /*\n this.handleError(, docuri, options)\n */\n });\n }\n\n /**\n * Asks for a doc to be loaded if necessary then calls back\n *\n * Calling methods:\n * nowOrWhenFetched (uri, userCallback)\n * nowOrWhenFetched (uri, options, userCallback)\n * nowOrWhenFetched (uri, referringTerm, userCallback, options) <-- old\n * nowOrWhenFetched (uri, referringTerm, userCallback) <-- old\n *\n * Options include:\n * referringTerm The document in which this link was found.\n * this is valuable when finding the source of bad URIs\n * force boolean. Never mind whether you have tried before,\n * load this from scratch.\n * forceContentType Override the incoming header to force the data to be\n * treated as this content-type.\n *\n * Callback function takes:\n *\n * ok True if the fetch worked, and got a 200 response.\n * False if any error happened\n *\n * errmessage Text error message if not OK.\n *\n * response The fetch Response object (was: XHR) if there was was one\n * includes response.status as the HTTP status if any.\n */\n nowOrWhenFetched(uriIn, p2, userCallback, options = {}) {\n const uri = (0,_utils_termValue__WEBPACK_IMPORTED_MODULE_15__.termValue)(uriIn);\n if (typeof p2 === 'function') {\n // nowOrWhenFetched (uri, userCallback)\n userCallback = p2;\n } else if (typeof p2 === 'undefined') {// original calling signature\n // referringTerm = undefined\n } else if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_10__.isNamedNode)(p2)) {\n // referringTerm = p2\n options.referringTerm = p2;\n } else {\n // nowOrWhenFetched (uri, options, userCallback)\n options = p2;\n }\n this.load(uri, options).then(fetchResponse => {\n if (userCallback) {\n if (fetchResponse) {\n if (fetchResponse.ok) {\n userCallback(true, 'OK', fetchResponse);\n } else {\n let oops = 'HTTP error: Status ' + fetchResponse.status + ' (' + fetchResponse.statusText + ')';\n if (fetchResponse.responseText) {\n oops += ' ' + fetchResponse.responseText; // not in 404, dns error, nock failure\n }\n userCallback(false, oops, fetchResponse);\n }\n } else {\n let oops = '@@ nowOrWhenFetched: no response object!';\n userCallback(false, oops);\n }\n }\n }, function (err) {\n var message = err.message || err.statusText;\n message = 'Failed to load <' + uri + '> ' + message;\n if (err.response && err.response.status) {\n message += ' status: ' + err.response.status;\n }\n userCallback(false, message, err.response);\n });\n }\n\n /**\n * Records a status message (as a literal node) by appending it to the\n * request's metadata status collection.\n *\n */\n addStatus(req, statusMessage) {\n // <Debug about=\"parsePerformance\">\n let now = new Date();\n statusMessage = '[' + now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds() + '.' + now.getMilliseconds() + '] ' + statusMessage;\n // </Debug>\n let kb = this.store;\n const statusNode = kb.the(req, this.ns.link('status'));\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_10__.isCollection)(statusNode)) {\n statusNode.append(kb.rdfFactory.literal(statusMessage));\n } else {\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].warn('web.js: No list to add to: ' + statusNode + ',' + statusMessage);\n }\n }\n\n /**\n * Records errors in the system on failure:\n *\n * - Adds an entry to the request status collection\n * - Adds an error triple with the fail message to the metadata\n * - Fires the 'fail' callback\n * - Rejects with an error result object, which has a response object if any\n */\n failFetch(options, errorMessage, statusCode, response) {\n this.addStatus(options.req, errorMessage);\n if (!options.noMeta) {\n this.store.add(options.original, this.ns.link('error'), this.store.rdfFactory.literal(errorMessage));\n }\n let meth = (options.method || 'GET').toUpperCase();\n let isGet = meth === 'GET' || meth === 'HEAD';\n if (isGet) {\n // only cache the status code on GET or HEAD\n if (!options.resource.equals(options.original)) {\n // console.log('@@ Recording failure ' + meth + ' original ' + options.original +option '( as ' + options.resource + ') : ' + statusCode)\n } else {\n // console.log('@@ Recording ' + meth + ' failure for ' + options.original + ': ' + statusCode)\n }\n this.requested[_uri__WEBPACK_IMPORTED_MODULE_9__.docpart(options.original.value)] = statusCode;\n this.fireCallbacks('fail', [options.original.value, errorMessage]);\n }\n var err = new Error('Fetcher: ' + errorMessage);\n\n // err.ok = false // Is taken as a response, will work too @@ phase out?\n err.status = statusCode;\n err.statusText = errorMessage;\n err.response = response;\n return Promise.reject(err);\n }\n\n // in the why part of the quad distinguish between HTML and HTTP header\n // Reverse is set iif the link was rev= as opposed to rel=\n linkData(originalUri, rel, uri, why, reverse) {\n if (!uri) return;\n let kb = this.store;\n let predicate;\n // See http://www.w3.org/TR/powder-dr/#httplink for describedby 2008-12-10\n let obj = kb.rdfFactory.namedNode(_uri__WEBPACK_IMPORTED_MODULE_9__.join(uri, originalUri.value));\n if (rel === 'alternate' || rel === 'seeAlso' || rel === 'meta' || rel === 'describedby') {\n if (obj.value === originalUri.value) {\n return;\n }\n predicate = this.ns.rdfs('seeAlso');\n } else if (rel === 'type') {\n predicate = kb.rdfFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type');\n } else {\n // See https://www.iana.org/assignments/link-relations/link-relations.xml\n // Alas not yet in RDF yet for each predicate\n // encode space in e.g. rel=\"shortcut icon\"\n predicate = kb.rdfFactory.namedNode(_uri__WEBPACK_IMPORTED_MODULE_9__.join(encodeURIComponent(rel), 'http://www.iana.org/assignments/link-relations/'));\n }\n if (reverse) {\n kb.add(obj, predicate, originalUri, why);\n } else {\n kb.add(originalUri, predicate, obj, why);\n }\n }\n parseLinkHeader(linkHeader, originalUri, reqNode) {\n if (!linkHeader) {\n return;\n }\n\n // const linkexp = /<[^>]*>\\s*(\\s*;\\s*[^()<>@,;:\"/[\\]?={} \\t]+=(([^()<>@,;:\"/[]?={} \\t]+)|(\"[^\"]*\")))*(,|$)/g\n // const paramexp = /[^()<>@,;:\"/[]?={} \\t]+=(([^()<>@,;:\"/[]?={} \\t]+)|(\"[^\"]*\"))/g\n\n // From https://www.dcode.fr/regular-expression-simplificator:\n // const linkexp = /<[^>]*>\\s*(\\s*;\\s*[^()<>@,;:\"/[\\]?={} t]+=[\"]))*[,$]/g\n // const paramexp = /[^\\\\<>@,;:\"\\/\\[\\]?={} \\t]+=[\"])/g\n // Original:\n const linkexp = /<[^>]*>\\s*(\\s*;\\s*[^()<>@,;:\"/[\\]?={} \\t]+=(([^\\(\\)<>@,;:\"\\/\\[\\]\\?={} \\t]+)|(\"[^\"]*\")))*(,|$)/g;\n const paramexp = /[^\\(\\)<>@,;:\"\\/\\[\\]\\?={} \\t]+=(([^\\(\\)<>@,;:\"\\/\\[\\]\\?={} \\t]+)|(\"[^\"]*\"))/g;\n const matches = linkHeader.match(linkexp);\n if (matches == null) return;\n for (let i = 0; i < matches.length; i++) {\n let split = matches[i].split('>');\n let href = split[0].substring(1);\n let ps = split[1];\n let s = ps.match(paramexp);\n if (s == null) return;\n for (let j = 0; j < s.length; j++) {\n let p = s[j];\n let paramsplit = p.split('=');\n // var name = paramsplit[0]\n let rel = paramsplit[1].replace(/[\"']/g, ''); // '\"\n this.linkData(originalUri, rel, href, reqNode);\n }\n }\n }\n doneFetch(options, response) {\n this.addStatus(options.req, 'Done.');\n this.requested[options.original.value] = 'done';\n this.fireCallbacks('done', [options.original.value]);\n response.req = options.req; // Set the request meta blank node\n\n return response;\n }\n\n /**\n * Note two nodes are now smushed\n * If only one was flagged as looked up, then the new node is looked up again,\n * which will make sure all the URIs are dereferenced\n */\n nowKnownAs(was, now) {\n if (this.lookedUp[was.value]) {\n // Transfer userCallback\n if (!this.lookedUp[now.value]) {\n this.lookUpThing(now, was);\n }\n } else if (this.lookedUp[now.value]) {\n if (!this.lookedUp[was.value]) {\n this.lookUpThing(was, now);\n }\n }\n }\n\n /**\n * Writes back to the web what we have in the store for this uri\n */\n putBack(uri, options = {}) {\n const uriSting = (0,_utils_termValue__WEBPACK_IMPORTED_MODULE_15__.termValue)(uri);\n let doc = new _named_node__WEBPACK_IMPORTED_MODULE_4__[\"default\"](uriSting).doc(); // strip off #\n options.contentType = options[\"content-type\"] || options[\"Content-Type\"] || options.contentType || _types__WEBPACK_IMPORTED_MODULE_14__.TurtleContentType;\n if (options.contentType === 'application/ld+json') {\n return new Promise((resolve, reject) => {\n (0,_serialize__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(doc, this.store, doc.uri, options.contentType, (err, jsonString) => {\n if (err) {\n reject(err);\n } else {\n // @ts-ignore\n options.data = jsonString;\n this.webOperation('PUT', uri, options).then(res => resolve(res)).catch(error => reject(error));\n }\n });\n });\n }\n options.data = (0,_serialize__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(doc, this.store, doc.value, options.contentType);\n return this.webOperation('PUT', uriSting, options);\n }\n webCopy(here, there, contentType) {\n return this.webOperation('GET', here).then(result => {\n return this.webOperation('PUT',\n // change to binary from text\n there, {\n data: result.responseText,\n contentType\n });\n });\n }\n delete(uri, options) {\n return this.webOperation('DELETE', uri, options).then(response => {\n this.requested[uri] = 404;\n this.nonexistent[uri] = true;\n this.unload(this.store.rdfFactory.namedNode(uri));\n return response;\n });\n }\n\n /** Create an empty resource if it really does not exist\n * Be absolutely sure something does not exist before creating a new empty file\n * as otherwise existing could be deleted.\n * @param doc - The resource\n */\n async createIfNotExists(doc, contentType = _types__WEBPACK_IMPORTED_MODULE_14__.TurtleContentType, data = '') {\n const fetcher = this;\n try {\n var response = await fetcher.load(doc);\n } catch (err) {\n // @ts-ignore\n if (err.response.status === 404) {\n // console.log('createIfNotExists: doc does NOT exist, will create... ' + doc)\n try {\n response = await fetcher.webOperation('PUT', doc.value, {\n data,\n contentType\n });\n } catch (err) {\n // console.log('createIfNotExists doc FAILED: ' + doc + ': ' + err)\n throw err;\n }\n delete fetcher.requested[doc.value]; // delete cached 404 error\n // console.log('createIfNotExists doc created ok ' + doc)\n return response;\n } else {\n // console.log('createIfNotExists doc load error NOT 404: ' + doc + ': ' + err)\n throw err;\n }\n }\n // console.log('createIfNotExists: doc exists, all good: ' + doc)\n return response;\n }\n\n /**\n * @param parentURI URI of parent container\n * @param folderName - Optional folder name (slug)\n * @param data - Optional folder metadata\n */\n createContainer(parentURI, folderName, data) {\n let headers = {\n // Force the right mime type for containers\n 'content-type': _types__WEBPACK_IMPORTED_MODULE_14__.TurtleContentType,\n 'link': this.ns.ldp('BasicContainer') + '; rel=\"type\"'\n };\n if (folderName) {\n headers['slug'] = folderName;\n }\n\n // @ts-ignore These headers lack some of the required operators.\n let options = {\n headers\n };\n if (data) {\n options.body = data;\n }\n return this.webOperation('POST', parentURI, options);\n }\n invalidateCache(iri) {\n const uri = (0,_utils_termValue__WEBPACK_IMPORTED_MODULE_15__.termValue)(iri);\n const fetcher = this;\n // @ts-ignore\n if (fetcher.fetchQueue && fetcher.fetchQueue[uri]) {\n // console.log('Internal error - fetchQueue exists ' + uri)\n var promise = fetcher.fetchQueue[uri];\n if (promise['PromiseStatus'] === 'resolved') {\n delete fetcher.fetchQueue[uri];\n } else {\n // pending\n delete fetcher.fetchQueue[uri];\n // console.log('*** Fetcher: pending fetchQueue deleted ' + uri)\n }\n }\n if (fetcher.requested[uri] && fetcher.requested[uri] !== 'done' && fetcher.requested[uri] !== 'failed' && fetcher.requested[uri] !== 404) {\n let msg = `Rdflib: fetcher: Destructive operation on <${fetcher.requested[uri]}> file being fetched! ` + uri;\n console.error(msg);\n // alert(msg)\n } else {\n delete fetcher.requested[uri]; // invalidate read cache -- @@ messes up logic if request in progress ??\n delete fetcher.nonexistent[uri];\n }\n }\n\n /**\n * A generic web operation, at the fetch() level.\n * does not involve the quad store.\n *\n * Returns promise of Response\n * If data is returned, copies it to response.responseText before returning\n */\n webOperation(method, uriIn,\n // Not sure about this type. Maybe this Options is different?\n options = {}) {\n const uri = (0,_utils_termValue__WEBPACK_IMPORTED_MODULE_15__.termValue)(uriIn);\n options.method = method;\n options.body = options.data || options.body;\n options.force = true;\n const fetcher = this;\n if (options.body && !options.contentType) {\n throw new Error('Web operation sending data must have a defined contentType.');\n }\n if (options.contentType) {\n options.headers = options.headers || {};\n options.headers['content-type'] = options.contentType;\n }\n Fetcher.setCredentials(uri, options);\n return new Promise(function (resolve, reject) {\n fetcher._fetch(uri, options).then(response => {\n if (response.ok) {\n if (method === 'PUT' || method === 'PATCH' || method === 'POST' || method === 'DELETE') {\n fetcher.invalidateCache(uri);\n } // response.body with Chrome can't be relied on\n if (response.text) {\n // Was: response.body https://github.com/linkeddata/rdflib.js/issues/506\n response.text().then(data => {\n response.responseText = data;\n resolve(response);\n });\n } else {\n resolve(response);\n }\n } else {\n let msg = 'Web error: ' + response.status;\n if (response.statusText) msg += ' (' + response.statusText + ')';\n msg += ' on ' + method + ' of <' + uri + '>';\n if (response.responseText) msg += ': ' + response.responseText;\n let e2 = new Error(msg);\n e2.response = response;\n reject(e2);\n }\n }, err => {\n let msg = 'Fetch error for ' + method + ' of <' + uri + '>:' + err;\n reject(new Error(msg));\n });\n });\n }\n\n /**\n * Looks up something.\n * Looks up all the URIs a things has.\n *\n * @param term - canonical term for the thing whose URI is\n * to be dereferenced\n * @param rterm - the resource which referred to this\n * (for tracking bad links)\n */\n lookUpThing(term, rterm) {\n let uris = this.store.uris(term); // Get all URIs\n uris = uris.map(u => _uri__WEBPACK_IMPORTED_MODULE_9__.docpart(u)); // Drop hash fragments\n\n uris.forEach(u => {\n this.lookedUp[u] = true;\n });\n\n // @ts-ignore Recursive type\n return this.load(uris, {\n referringTerm: rterm\n });\n }\n\n /**\n * Looks up response header.\n *\n * @returns {Array|undefined} a list of header values found in a stored HTTP\n * response, or [] if response was found but no header found,\n * or undefined if no response is available.\n * Looks for { [] link:requestedURI ?uri; link:response [ httph:header-name ?value ] }\n */\n getHeader(doc, header) {\n const kb = this.store; // look for the URI (AS A STRING NOT A NODE) for a stored request\n const docuri = doc.value;\n const requests = kb.each(undefined, this.ns.link('requestedURI'), kb.rdfFactory.literal(docuri));\n for (let r = 0; r < requests.length; r++) {\n let request = requests[r];\n if (request !== undefined) {\n let response = kb.any(request, this.ns.link('response'));\n if (response !== undefined && kb.anyValue(response, this.ns.http('status')) && kb.anyValue(response, this.ns.http('status')).startsWith('2')) {\n // Only look at success returns - not 401 error messagess etc\n let results = kb.each(response, this.ns.httph(header.toLowerCase()));\n if (results.length) {\n return results.map(v => {\n return v.value;\n });\n }\n return [];\n }\n }\n }\n return undefined;\n }\n saveRequestMetadata(docuri, options) {\n let req = options.req;\n let kb = this.store;\n let rterm = options.referringTerm;\n this.addStatus(options.req, 'Accept: ' + options.headers['accept']);\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_10__.isNamedNode)(rterm)) {\n kb.add(kb.rdfFactory.namedNode(docuri), this.ns.link('requestedBy'), rterm, this.appNode);\n }\n if (options.original && options.original.value !== docuri) {\n kb.add(req, this.ns.link('orginalURI'), kb.rdfFactory.literal(options.original.value), this.appNode);\n }\n const now = new Date();\n const timeNow = '[' + now.getHours() + ':' + now.getMinutes() + ':' + now.getSeconds() + '] ';\n kb.add(req, this.ns.rdfs('label'), kb.rdfFactory.literal(timeNow + ' Request for ' + docuri), this.appNode);\n // We store the docuri as a string, not as a node,\n // see https://github.com/linkeddata/rdflib.js/pull/427#pullrequestreview-447910061\n kb.add(req, this.ns.link('requestedURI'), kb.rdfFactory.literal(docuri), this.appNode);\n kb.add(req, this.ns.link('status'), kb.collection(), this.appNode);\n }\n saveResponseMetadata(response, options) {\n const kb = this.store;\n let responseNode = kb.bnode();\n kb.add(options.req, this.ns.link('response'), responseNode, this.appNode);\n kb.add(responseNode, this.ns.http('status'), kb.rdfFactory.literal(response.status), this.appNode);\n kb.add(responseNode, this.ns.http('statusText'), kb.rdfFactory.literal(response.statusText), this.appNode);\n\n // Save the response headers\n response.headers.forEach((value, header) => {\n kb.add(responseNode, this.ns.httph(header), this.store.rdfFactory.literal(value), this.appNode);\n if (header === 'content-type') {\n kb.add(options.resource, this.ns.rdf('type'), kb.rdfFactory.namedNode(_utils_js__WEBPACK_IMPORTED_MODULE_11__.mediaTypeClass(value).value), this.appNode // responseNode\n );\n }\n });\n return responseNode;\n }\n objectRefresh(term) {\n let uris = this.store.uris(term); // Get all URIs\n if (typeof uris !== 'undefined') {\n for (let i = 0; i < uris.length; i++) {\n this.refresh(this.store.rdfFactory.namedNode(_uri__WEBPACK_IMPORTED_MODULE_9__.docpart(uris[i])));\n // what about rterm?\n }\n }\n }\n\n /* refresh Reload data from a given document\n **\n ** @param term - An RDF Named Node for the eodcument in question\n ** @param userCallback - A function userCallback(ok, message, response)\n */\n refresh(term, userCallback) {\n // sources_refresh\n this.fireCallbacks('refresh', arguments);\n this.nowOrWhenFetched(term, {\n force: true,\n clearPreviousData: true\n }, userCallback);\n }\n\n /* refreshIfExpired Conditional refresh if Expired\n **\n ** @param term - An RDF Named Node for the eodcument in question\n ** @param userCallback - A function userCallback(ok, message, response)\n */\n refreshIfExpired(term, userCallback) {\n let exp = this.getHeader(term, 'Expires');\n if (!exp || new Date(exp[0]).getTime() <= new Date().getTime()) {\n this.refresh(term, userCallback);\n } else {\n userCallback(true, 'Not expired', {});\n }\n }\n retract(term) {\n // sources_retract\n this.store.removeMany(undefined, undefined, undefined, term);\n if (term.value) {\n delete this.requested[_uri__WEBPACK_IMPORTED_MODULE_9__.docpart(term.value)];\n }\n this.fireCallbacks('retract', arguments);\n }\n getState(docuri) {\n if (typeof this.requested[docuri] === 'undefined') {\n return 'unrequested';\n } else if (this.requested[docuri] === true) {\n return 'requested';\n } else if (this.requested[docuri] === 'done') {\n return 'fetched';\n } else if (this.requested[docuri] === 'redirected') {\n return this.getState(this.redirectedTo[docuri]);\n } else {\n // An non-200 HTTP error status\n return 'failed';\n }\n }\n isPending(docuri) {\n // sources_pending\n // doing anyStatementMatching is wasting time\n // if it's not pending: false -> flailed\n // 'done' -> done 'redirected' -> redirected\n return this.requested[docuri] === true;\n }\n unload(term) {\n this.store.removeDocument(term);\n delete this.requested[term.value]; // So it can be load2ed again\n }\n addHandler(handler) {\n this.handlers.push(handler);\n handler.register(this);\n }\n retryNoCredentials(docuri, options) {\n // console.log('Fetcher: CORS: RETRYING with NO CREDENTIALS for ' + options.resource)\n\n options.retriedWithNoCredentials = true; // protect against being called twice\n\n delete this.requested[docuri]; // forget the original request happened\n delete this.fetchQueue[docuri];\n // Note: XHR property was withCredentials, but fetch property is just credentials\n let newOptions = Object.assign({}, options, {\n credentials: 'omit'\n });\n this.addStatus(options.req, 'Abort: Will retry with credentials SUPPRESSED to see if that helps');\n return this.load(docuri, newOptions);\n }\n\n /**\n * Tests whether a request is being made to a cross-site URI (for purposes\n * of retrying with a proxy)\n */\n isCrossSite(uri) {\n // Mashup situation, not node etc\n if (typeof document === 'undefined' || !document.location) {\n return false;\n }\n const hostpart = _uri__WEBPACK_IMPORTED_MODULE_9__.hostpart;\n const here = '' + document.location;\n return (hostpart(here) && hostpart(uri) && hostpart(here)) !== hostpart(uri);\n }\n\n /**\n * Called when there's a network error in fetch(), or a response\n * with status of 0.\n */\n handleError(response, docuri, options) {\n if (this.isCrossSite(docuri)) {\n // Make sure we haven't retried already\n if (options.credentials && options.credentials === 'include' && !options.retriedWithNoCredentials) {\n return this.retryNoCredentials(docuri, options);\n }\n\n // Now attempt retry via proxy\n let proxyUri = Fetcher.crossSiteProxy(docuri);\n if (proxyUri && !options.proxyUsed) {\n // console.log('web: Direct failed so trying proxy ' + proxyUri)\n return this.redirectToProxy(proxyUri, options);\n }\n }\n var message;\n if (response instanceof Error) {\n message = 'Fetch error: ' + response.message;\n } else {\n message = response.statusText;\n if (response.responseText) {\n message += ` ${response.responseText}`;\n }\n }\n\n // This is either not a CORS error, or retries have been made\n return this.failFetch(options, message, response.status || 998, response);\n }\n\n // deduce some things from the HTTP transaction\n addType(rdfType, req, kb, locURI) {\n // add type to all redirected resources too\n let prev = req;\n if (locURI) {\n var reqURI = kb.any(prev, this.ns.link('requestedURI'));\n if (reqURI && reqURI.value !== locURI) {\n kb.add(kb.rdfFactory.namedNode(locURI), this.ns.rdf('type'), rdfType, this.appNode);\n }\n }\n for (;;) {\n const doc = kb.any(prev, this.ns.link('requestedURI'));\n if (doc && doc.value) {\n kb.add(kb.rdfFactory.namedNode(doc.value), this.ns.rdf('type'), rdfType, this.appNode);\n } // convert Literal\n prev = kb.any(undefined, kb.rdfFactory.namedNode('http://www.w3.org/2007/ont/link#redirectedRequest'), prev);\n if (!prev) {\n break;\n }\n var response = kb.any(prev, kb.rdfFactory.namedNode('http://www.w3.org/2007/ont/link#response'));\n if (!response) {\n break;\n }\n var redirection = kb.any(response, kb.rdfFactory.namedNode('http://www.w3.org/2007/ont/http#status'));\n if (!redirection) {\n break;\n }\n // @ts-ignore always true?\n if (redirection !== '301' && redirection !== '302') {\n break;\n }\n }\n }\n\n /**\n * Handle fetch() response\n */\n handleResponse(response, docuri, options) {\n const kb = this.store;\n const headers = response.headers;\n const reqNode = options.req;\n const responseNode = this.saveResponseMetadata(response, options);\n const contentType = this.normalizedContentType(options, headers) || '';\n let contentLocation = headers.get('content-location');\n\n // this.fireCallbacks('recv', xhr.args)\n // this.fireCallbacks('headers', [{uri: docuri, headers: xhr.headers}])\n\n // Check for masked errors (CORS, etc)\n if (response.status === 0) {\n // console.log('Masked error - status 0 for ' + docuri)\n return this.handleError(response, docuri, options);\n }\n if (response.status >= 400) {\n if (response.status === 404) {\n this.nonexistent[options.original.value] = true;\n this.nonexistent[docuri] = true;\n }\n return this.saveErrorResponse(response, responseNode).then(() => {\n let errorMessage = options.resource + ' ' + response.statusText;\n return this.failFetch(options, errorMessage, response.status, response);\n });\n }\n var diffLocation = null;\n var absContentLocation = null;\n if (contentLocation) {\n absContentLocation = _uri__WEBPACK_IMPORTED_MODULE_9__.join(contentLocation, docuri);\n if (absContentLocation !== docuri) {\n diffLocation = absContentLocation;\n }\n }\n if (response.status === 200) {\n this.addType(this.ns.link('Document'), reqNode, kb, docuri);\n if (diffLocation) {\n this.addType(this.ns.link('Document'), reqNode, kb, diffLocation);\n }\n\n // Before we parse new data clear old but only on 200\n if (options.clearPreviousData) {\n // kb.removeDocument(options.resource)\n // only remove content, keep metatdata\n const sts = kb.statementsMatching(undefined, undefined, undefined, options.resource).slice(); // Take a copy as this is the actual index\n for (let i = 0; i < sts.length; i++) {\n kb.removeStatement(sts[i]);\n }\n }\n let isImage = contentType.includes('image/') || contentType.includes('application/pdf');\n if (contentType && isImage) {\n this.addType(kb.rdfFactory.namedNode('http://purl.org/dc/terms/Image'), reqNode, kb, docuri);\n if (diffLocation) {\n this.addType(kb.rdfFactory.namedNode('http://purl.org/dc/terms/Image'), reqNode, kb, diffLocation);\n }\n }\n }\n\n // If we have already got the thing at this location, abort\n if (contentLocation) {\n if (!options.force && diffLocation && this.requested[absContentLocation] === 'done') {\n // we have already fetched this\n // should we smush too?\n // log.info(\"HTTP headers indicate we have already\" + \" retrieved \" +\n // xhr.resource + \" as \" + absContentLocation + \". Aborting.\")\n return this.doneFetch(options, response);\n }\n this.requested[absContentLocation] = true;\n }\n this.parseLinkHeader(headers.get('link'), options.original, reqNode);\n let handler = this.handlerForContentType(contentType, response);\n if (!handler) {\n // Not a problem, we just don't extract data\n this.addStatus(reqNode, 'Fetch over. No data handled.');\n return this.doneFetch(options, response);\n }\n return response.text()\n // @ts-ignore Types seem right\n .then(responseText => {\n response.responseText = responseText;\n return handler.parse(this, responseText, options, response);\n });\n }\n saveErrorResponse(response, responseNode) {\n let kb = this.store;\n return response.text().then(content => {\n if (content.length > 10) {\n kb.add(responseNode, this.ns.http('content'), kb.rdfFactory.literal(content), responseNode);\n }\n });\n }\n handlerForContentType(contentType, response) {\n if (!contentType) {\n return null;\n }\n let Handler = this.handlers.find(handler => {\n return contentType.match(handler.pattern);\n });\n\n // @ts-ignore in practice all Handlers have constructors.\n return Handler ? new Handler(response) : null;\n }\n guessContentType(uri) {\n return CONTENT_TYPE_BY_EXT[uri.split('.').pop()];\n }\n normalizedContentType(options, headers) {\n if (options.forceContentType) {\n return options.forceContentType;\n }\n let contentType = headers.get('content-type');\n if (!contentType || contentType.includes('application/octet-stream')) {\n let guess = this.guessContentType(options.resource.value);\n if (guess) {\n return guess;\n }\n }\n let protocol = _uri__WEBPACK_IMPORTED_MODULE_9__.protocol(options.resource.value);\n if (!contentType && ['file', 'chrome'].includes(protocol)) {\n return 'text/xml';\n }\n return contentType;\n }\n\n /**\n * Sends a new request to the specified uri. (Extracted from `onerrorFactory()`)\n */\n redirectToProxy(newURI, options) {\n this.addStatus(options.req, 'BLOCKED -> Cross-site Proxy to <' + newURI + '>');\n options.proxyUsed = true;\n const kb = this.store;\n const oldReq = options.req; // request metadata blank node\n\n if (!options.noMeta) {\n kb.add(oldReq, this.ns.link('redirectedTo'), kb.rdfFactory.namedNode(newURI), oldReq);\n this.addStatus(oldReq, 'redirected to new request'); // why\n }\n this.requested[options.resource.value] = 'redirected';\n this.redirectedTo[options.resource.value] = newURI;\n let newOptions = Object.assign({}, options);\n newOptions.baseURI = options.resource.value;\n return this.fetchUri(newURI, newOptions).then(response => {\n if (!newOptions.noMeta) {\n kb.add(oldReq, this.ns.link('redirectedRequest'), newOptions.req, this.appNode);\n }\n return response;\n });\n }\n setRequestTimeout(uri, options) {\n return new Promise(resolve => {\n this.timeouts[uri] = (this.timeouts[uri] || []).concat(setTimeout(() => {\n if (this.isPending(uri) && !options.retriedWithNoCredentials && !options.proxyUsed) {\n resolve(this.failFetch(options, `Request to ${uri} timed out`, 'timeout'));\n }\n }, this.timeout));\n });\n }\n addFetchCallback(uri, callback) {\n if (!this.fetchCallbacks[uri]) {\n this.fetchCallbacks[uri] = [callback];\n } else {\n this.fetchCallbacks[uri].push(callback);\n }\n }\n acceptString() {\n let acceptstring = '';\n for (let mediaType in this.mediatypes) {\n if (acceptstring !== '') {\n acceptstring += ', ';\n }\n acceptstring += mediaType;\n for (let property in this.mediatypes[mediaType]) {\n acceptstring += ';' + property + '=' + this.mediatypes[mediaType][property];\n }\n }\n return acceptstring;\n }\n // var updatesVia = new $rdf.UpdatesVia(this) // Subscribe to headers\n // @@@@@@@@ This is turned off because it causes a websocket to be set up for ANY fetch\n // whether we want to track it ot not. including ontologies loaed though the XSSproxy\n}\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Fetcher, \"HANDLERS\", void 0);\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Fetcher, \"CONTENT_TYPE_BY_EXT\", void 0);\n// TODO: Document this\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Fetcher, \"crossSiteProxyTemplate\", void 0);\nFetcher.HANDLERS = defaultHandlers;\nFetcher.CONTENT_TYPE_BY_EXT = CONTENT_TYPE_BY_EXT;\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/fetcher.js?\n}");
891
+
892
+ /***/ },
893
+
894
+ /***/ "./node_modules/rdflib/esm/formula.js"
895
+ /*!********************************************!*\
896
+ !*** ./node_modules/rdflib/esm/formula.js ***!
897
+ \********************************************/
898
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
899
+
900
+ "use strict";
901
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Formula)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _class_order__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./class-order */ \"./node_modules/rdflib/esm/class-order.js\");\n/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./collection */ \"./node_modules/rdflib/esm/collection.js\");\n/* harmony import */ var _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./factories/canonical-data-factory */ \"./node_modules/rdflib/esm/factories/canonical-data-factory.js\");\n/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./log */ \"./node_modules/rdflib/esm/log.js\");\n/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./namespace */ \"./node_modules/rdflib/esm/namespace.js\");\n/* harmony import */ var _node_internal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./node-internal */ \"./node_modules/rdflib/esm/node-internal.js\");\n/* harmony import */ var _serialize__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./serialize */ \"./node_modules/rdflib/esm/serialize.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/terms */ \"./node_modules/rdflib/esm/utils/terms.js\");\n/* harmony import */ var _variable__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./variable */ \"./node_modules/rdflib/esm/variable.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils */ \"./node_modules/rdflib/esm/utils.js\");\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * A formula, or store of RDF statements\n */\nclass Formula extends _node_internal__WEBPACK_IMPORTED_MODULE_6__[\"default\"] {\n /**\n * Initializes this formula\n * @constructor\n * @param statements - Initial array of statements\n * @param constraints - initial array of constraints\n * @param initBindings - initial bindings used in Query\n * @param optional - optional\n * @param opts\n * @param opts.rdfFactory - The rdf factory that should be used by the store\n */\n constructor(statements = [], constraints = [], initBindings = [], optional = [], opts = {}) {\n super('');\n this.statements = statements;\n this.constraints = constraints;\n this.initBindings = initBindings;\n this.optional = optional;\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"termType\", _types__WEBPACK_IMPORTED_MODULE_8__.GraphTermType);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"classOrder\", _class_order__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Graph);\n /**\n * The accompanying fetcher instance.\n *\n * Is set by the fetcher when initialized.\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"fetcher\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isVar\", 0);\n /**\n * A namespace for the specified namespace's URI\n * @param nsuri The URI for the namespace\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"ns\", _namespace__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n /** The factory used to generate statements and terms */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"rdfFactory\", void 0);\n this.rdfFactory = opts && opts.rdfFactory || _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n // Enable default factory methods on this while preserving factory context.\n for (const factoryMethod of _utils__WEBPACK_IMPORTED_MODULE_11__.appliedFactoryMethods) {\n this[factoryMethod] = (...args) => this.rdfFactory[factoryMethod](...args);\n }\n }\n\n /** Add a statement from its parts\n * @param subject - the first part of the statement\n * @param predicate - the second part of the statement\n * @param object - the third part of the statement\n * @param graph - the last part of the statement\n */\n add(subject, predicate, object, graph) {\n if (arguments.length === 1) {\n subject.forEach(st => this.add(st.subject, st.predicate, st.object, st.graph));\n }\n return this.statements.push(this.rdfFactory.quad(subject, predicate, object, graph));\n }\n\n /** Add a statment object\n * @param {Statement} statement - An existing constructed statement to add\n */\n addStatement(statement) {\n return this.add(statement);\n }\n\n /**\n * Shortcut for adding blankNodes\n * @param [id]\n */\n bnode(id) {\n return this.rdfFactory.blankNode(id);\n }\n\n /**\n * Adds all the statements to this formula\n * @param statements - A collection of statements\n */\n addAll(statements) {\n statements.forEach(quad => {\n this.add(quad.subject, quad.predicate, quad.object, quad.graph);\n });\n }\n\n /** Follow link from one node, using one wildcard, looking for one\n *\n * For example, any(me, knows, null, profile) - a person I know accoring to my profile .\n * any(me, knows, null, null) - a person I know accoring to anything in store .\n * any(null, knows, me, null) - a person who know me accoring to anything in store .\n *\n * @param s - A node to search for as subject, or if null, a wildcard\n * @param p - A node to search for as predicate, or if null, a wildcard\n * @param o - A node to search for as object, or if null, a wildcard\n * @param g - A node to search for as graph, or if null, a wildcard\n * @returns A node which match the wildcard position, or null\n */\n any(s, p, o, g) {\n const st = this.anyStatementMatching(s, p, o, g);\n if (st == null) {\n return null;\n } else if (s == null) {\n return st.subject;\n } else if (p == null) {\n return st.predicate;\n } else if (o == null) {\n return st.object;\n }\n return null;\n }\n\n /**\n * Gets the value of a node that matches the specified pattern\n * @param s The subject\n * @param p The predicate\n * @param o The object\n * @param g The graph that contains the statement\n */\n anyValue(s, p, o, g) {\n const y = this.any(s, p, o, g);\n return y ? y.value : void 0;\n }\n\n /**\n * Gets the first JavaScript object equivalent to a node based on the specified pattern\n * @param s The subject\n * @param p The predicate\n * @param o The object\n * @param g The graph that contains the statement\n */\n anyJS(s, p, o, g) {\n const y = this.any(s, p, o, g);\n return y ? _node_internal__WEBPACK_IMPORTED_MODULE_6__[\"default\"].toJS(y) : void 0;\n }\n\n /**\n * Gets the first statement that matches the specified pattern\n */\n anyStatementMatching(s, p, o, g) {\n let x = this.statementsMatching(s, p, o, g, true);\n if (!x || x.length === 0) {\n return undefined;\n }\n return x[0];\n }\n\n /**\n * Returns a unique index-safe identifier for the given term.\n *\n * Falls back to the rdflib hashString implementation if the given factory doesn't support id.\n */\n id(term) {\n return this.rdfFactory.id(term);\n }\n\n /**\n * Search the Store\n * This is really a teaching method as to do this properly you would use IndexedFormula\n *\n * @param s - A node to search for as subject, or if null, a wildcard\n * @param p - A node to search for as predicate, or if null, a wildcard\n * @param o - A node to search for as object, or if null, a wildcard\n * @param g - A node to search for as graph, or if null, a wildcard\n * @param justOne - flag - stop when found one rather than get all of them?\n * @returns {Array<Node>} - An array of nodes which match the wildcard position\n */\n statementsMatching(s, p, o, g, justOne) {\n const sts = this.statements.filter(st => (!s || s.equals(st.subject)) && (!p || p.equals(st.predicate)) && (!o || o.equals(st.object)) && (!g || g.equals(st.graph)));\n if (justOne) {\n return sts.length === 0 ? [] : [sts[0]];\n }\n return sts;\n }\n\n /**\n * Finds the types in the list which have no *stored* subtypes\n * These are a set of classes which provide by themselves complete\n * information -- the other classes are redundant for those who\n * know the class DAG.\n * @param types A map of the types\n */\n bottomTypeURIs(types) {\n let bots;\n let bottom;\n let elt;\n let i;\n let len;\n let ref;\n let subs;\n let v;\n bots = [];\n for (let k in types) {\n if (!types.hasOwnProperty(k)) continue;\n v = types[k];\n subs = this.each(void 0, this.rdfFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#subClassOf'), this.rdfFactory.namedNode(k));\n bottom = true;\n i = 0;\n for (len = subs.length; i < len; i++) {\n elt = subs[i];\n ref = elt.uri;\n if (ref in types) {\n // the subclass is one we know\n bottom = false;\n break;\n }\n }\n if (bottom) {\n bots[k] = v;\n }\n }\n return bots;\n }\n\n /** Creates a new collection */\n collection() {\n return new _collection__WEBPACK_IMPORTED_MODULE_2__[\"default\"]();\n }\n\n /** Follow links from one node, using one wildcard.\n *\n * For example, each(me, knows, null, profile) - people I know accoring to my profile .\n * each(me, knows, null, null) - people I know accoring to anything in store .\n * each(null, knows, me, null) - people who know me accoring to anything in store .\n *\n * @param s - A node to search for as subject, or if null, a wildcard\n * @param p - A node to search for as predicate, or if null, a wildcard\n * @param o - A node to search for as object, or if null, a wildcard\n * @param g - A node to search for as graph, or if null, a wildcard\n * @returns {Array<Node>} - An array of nodes which match the wildcard position\n */\n each(s, p, o, g) {\n const results = [];\n let sts = this.statementsMatching(s, p, o, g, false);\n if (s == null) {\n for (let i = 0, len = sts.length; i < len; i++) {\n results.push(sts[i].subject);\n }\n } else if (p == null) {\n for (let l = 0, len1 = sts.length; l < len1; l++) {\n results.push(sts[l].predicate);\n }\n } else if (o == null) {\n for (let m = 0, len2 = sts.length; m < len2; m++) {\n results.push(sts[m].object);\n }\n } else if (g == null) {\n for (let q = 0, len3 = sts.length; q < len3; q++) {\n results.push(new _named_node__WEBPACK_IMPORTED_MODULE_12__[\"default\"](sts[q].graph.value));\n }\n }\n return results;\n }\n\n /**\n * Test whether this formula is equals to {other}\n * @param other - The other formula\n */\n equals(other) {\n if (!other) {\n return false;\n }\n return this.hashString() === other.hashString();\n }\n\n /**\n * For thisClass or any subclass, anything which has it is its type\n * or is the object of something which has the type as its range, or subject\n * of something which has the type as its domain\n * We don't bother doing subproperty (yet?)as it doesn't seeem to be used\n * much.\n * Get all the Classes of which we can RDFS-infer the subject is a member\n * @return a hash of URIs\n */\n findMembersNT(thisClass) {\n let len2;\n let len4;\n let m;\n let members;\n let pred;\n let ref;\n let ref1;\n let ref2;\n let ref3;\n let ref4;\n let ref5;\n let seeds;\n let st;\n let u;\n seeds = {};\n seeds[thisClass.toNT()] = true;\n members = {};\n ref = this.transitiveClosure(seeds, this.rdfFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#subClassOf'), true);\n for (let t in ref) {\n if (!ref.hasOwnProperty(t)) continue;\n ref1 = this.statementsMatching(void 0, this.rdfFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), this.fromNT(t));\n for (let i = 0, len = ref1.length; i < len; i++) {\n st = ref1[i];\n members[st.subject.toNT()] = st;\n }\n ref2 = this.each(void 0, this.rdfFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#domain'), this.fromNT(t));\n for (let l = 0, len1 = ref2.length; l < len1; l++) {\n pred = ref2[l];\n ref3 = this.statementsMatching(void 0, pred);\n for (m = 0, len2 = ref3.length; m < len2; m++) {\n st = ref3[m];\n members[st.subject.toNT()] = st;\n }\n }\n ref4 = this.each(void 0, this.rdfFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#range'), this.fromNT(t));\n for (let q = 0, len3 = ref4.length; q < len3; q++) {\n pred = ref4[q];\n ref5 = this.statementsMatching(void 0, pred);\n for (u = 0, len4 = ref5.length; u < len4; u++) {\n st = ref5[u];\n members[st.object.toNT()] = st;\n }\n }\n }\n return members;\n }\n\n /**\n * For thisClass or any subclass, anything which has it is its type\n * or is the object of something which has the type as its range, or subject\n * of something which has the type as its domain\n * We don't bother doing subproperty (yet?)as it doesn't seeem to be used\n * much.\n * Get all the Classes of which we can RDFS-infer the subject is a member\n * @param subject - A named node\n */\n findMemberURIs(subject) {\n return this.NTtoURI(this.findMembersNT(subject));\n }\n\n /**\n * Get all the Classes of which we can RDFS-infer the subject is a superclass\n * Returns a hash table where key is NT of type and value is statement why we\n * think so.\n * Does NOT return terms, returns URI strings.\n * We use NT representations in this version because they handle blank nodes.\n */\n findSubClassesNT(subject) {\n let types = {};\n types[subject.toNT()] = true;\n return this.transitiveClosure(types, this.rdfFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#subClassOf'), true);\n }\n\n /**\n * Get all the Classes of which we can RDFS-infer the subject is a subclass\n * @param {RDFlibNamedNode} subject - The thing whose classes are to be found\n * @returns a hash table where key is NT of type and value is statement why we\n * think so.\n * Does NOT return terms, returns URI strings.\n * We use NT representations in this version because they handle blank nodes.\n */\n findSuperClassesNT(subject) {\n let types = {};\n types[subject.toNT()] = true;\n return this.transitiveClosure(types, this.rdfFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#subClassOf'), false);\n }\n\n /**\n * Get all the Classes of which we can RDFS-infer the subject is a member\n * todo: This will loop is there is a class subclass loop (Sublass loops are\n * not illegal)\n * @param {RDFlibNamedNode} subject - The thing whose classes are to be found\n * @returns a hash table where key is NT of type and value is statement why we think so.\n * Does NOT return terms, returns URI strings.\n * We use NT representations in this version because they handle blank nodes.\n */\n findTypesNT(subject) {\n let domain;\n let range;\n let rdftype;\n let ref;\n let ref1;\n let ref2;\n let ref3;\n let st;\n let types;\n rdftype = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type';\n types = [];\n ref = this.statementsMatching(subject, void 0, void 0);\n for (let i = 0, len = ref.length; i < len; i++) {\n st = ref[i];\n if (st.predicate.uri === rdftype) {\n types[st.object.toNT()] = st;\n } else {\n ref1 = this.each(st.predicate, this.rdfFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#domain'));\n for (let l = 0, len1 = ref1.length; l < len1; l++) {\n range = ref1[l];\n types[range.toNT()] = st;\n }\n }\n }\n ref2 = this.statementsMatching(void 0, void 0, subject);\n for (let m = 0, len2 = ref2.length; m < len2; m++) {\n st = ref2[m];\n ref3 = this.each(st.predicate, this.rdfFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#range'));\n for (let q = 0, len3 = ref3.length; q < len3; q++) {\n domain = ref3[q];\n types[domain.toNT()] = st;\n }\n }\n return this.transitiveClosure(types, this.rdfFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#subClassOf'), false);\n }\n\n /**\n * Get all the Classes of which we can RDFS-infer the subject is a member\n * todo: This will loop is there is a class subclass loop (Sublass loops are\n * not illegal)\n * Returns a hash table where key is NT of type and value is statement why we\n * think so.\n * Does NOT return terms, returns URI strings.\n * We use NT representations in this version because they handle blank nodes.\n * @param subject - A subject node\n */\n findTypeURIs(subject) {\n return this.NTtoURI(this.findTypesNT(subject));\n }\n\n /** Trace statements which connect directly, or through bnodes\n *\n * @param subject - The node to start looking for statments\n * @param doc - The document to be searched, or null to search all documents\n * @returns an array of statements, duplicate statements are suppresssed.\n */\n connectedStatements(subject, doc, excludePredicateURIs) {\n excludePredicateURIs = excludePredicateURIs || [];\n let todo = [subject];\n let done = {};\n let doneArcs = {};\n let result = [];\n let self = this;\n let follow = function (x) {\n let queue = function (x) {\n if (x.termType === 'BlankNode' && !done[x.value]) {\n done[x.value] = true;\n todo.push(x);\n }\n };\n let sts = self.statementsMatching(null, null, x, doc).concat(self.statementsMatching(x, null, null, doc));\n sts = sts.filter(function (st) {\n if (excludePredicateURIs[st.predicate.value]) return false;\n let hash = st.toNT();\n if (doneArcs[hash]) return false;\n doneArcs[hash] = true;\n return true;\n });\n sts.forEach(function (st) {\n queue(st.subject);\n queue(st.object);\n });\n result = result.concat(sts);\n };\n while (todo.length) {\n follow(todo.shift());\n }\n return result;\n }\n\n /**\n * Creates a new empty formula\n *\n * @param _features - Not applicable, but necessary for typing to pass\n */\n formula(_features) {\n return new Formula();\n }\n\n /**\n * Transforms an NTriples string format into a Node.\n * The blank node bit should not be used on program-external values; designed\n * for internal work such as storing a blank node id in an HTML attribute.\n * This will only parse the strings generated by the various toNT() methods.\n */\n fromNT(str) {\n let dt, k, lang;\n switch (str[0]) {\n case '<':\n return this.sym(str.slice(1, -1));\n case '\"':\n lang = void 0;\n dt = void 0;\n k = str.lastIndexOf('\"');\n if (k < str.length - 1) {\n if (str[k + 1] === '@') {\n lang = str.slice(k + 2);\n } else if (str.slice(k + 1, k + 3) === '^^') {\n dt = this.fromNT(str.slice(k + 3));\n } else {\n throw new Error(\"Can't convert string from NT: \" + str);\n }\n }\n str = str.slice(1, k);\n str = str.replace(/\\\\\"/g, '\"');\n str = str.replace(/\\\\n/g, '\\n');\n str = str.replace(/\\\\\\\\/g, '\\\\');\n return this.rdfFactory.literal(str, lang || dt);\n case '_':\n return this.rdfFactory.blankNode(str.slice(2));\n case '?':\n return new _variable__WEBPACK_IMPORTED_MODULE_10__[\"default\"](str.slice(1));\n }\n throw new Error(\"Can't convert from NT: \" + str);\n }\n\n /** Returns true if this formula holds the specified statement(s) */\n holds(s, p, o, g) {\n let i;\n if (arguments.length === 1) {\n if (!s) {\n return true;\n }\n if (s instanceof Array) {\n for (i = 0; i < s.length; i++) {\n if (!this.holds(s[i])) {\n return false;\n }\n }\n return true;\n } else if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_9__.isStatement)(s)) {\n return this.holds(s.subject, s.predicate, s.object, s.graph);\n } else if (s.statements) {\n return this.holds(s.statements);\n }\n }\n let st = this.anyStatementMatching(s, p, o, g);\n return st != null;\n }\n\n /**\n * Returns true if this formula holds the specified {statement}\n */\n holdsStatement(statement) {\n return this.holds(statement.subject, statement.predicate, statement.object, statement.graph);\n }\n\n /**\n * Used by the n3parser to generate list elements\n * @param values - The values of the collection\n * @param context - The store\n * @return {BlankNode|Collection} - The term for the statement\n */\n list(values, context) {\n if (context.rdfFactory.supports[\"COLLECTIONS\"]) {\n const collection = context.rdfFactory.collection();\n values.forEach(function (val) {\n collection.append(val);\n });\n return collection;\n } else {\n const node = context.rdfFactory.blankNode();\n const statements = (0,_utils__WEBPACK_IMPORTED_MODULE_11__.arrayToStatements)(context.rdfFactory, node, values);\n context.addAll(statements);\n return node;\n }\n }\n\n /**\n * Transform a collection of NTriple URIs into their URI strings\n * @param t - Some iterable collection of NTriple URI strings\n * @return A collection of the URIs as strings\n * todo: explain why it is important to go through NT\n */\n NTtoURI(t) {\n let k, v;\n let uris = {};\n for (k in t) {\n if (!t.hasOwnProperty(k)) continue;\n v = t[k];\n if (k[0] === '<') {\n uris[k.slice(1, -1)] = v;\n }\n }\n return uris;\n }\n\n /**\n * Serializes this formula\n * @param base - The base string\n * @param contentType - The content type of the syntax to use\n * @param provenance - The provenance URI\n * @param options - options to pass to the serializer, as defined in serialize method\n */\n serialize(base, contentType, provenance, options) {\n // delegate the graph serialization to the implementation in ./serialize\n return (0,_serialize__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(provenance, this, base, contentType, undefined, options);\n }\n\n /**\n * Creates a new formula with the substituting bindings applied\n * @param bindings - The bindings to substitute\n */\n substitute(bindings) {\n let statementsCopy = this.statements.map(function (ea) {\n return ea.substitute(bindings);\n });\n // console.log('Formula subs statmnts:' + statementsCopy)\n const y = new Formula();\n y.addAll(statementsCopy);\n // console.log('indexed-form subs formula:' + y)\n return y;\n }\n sym(uri, name) {\n if (name) {\n throw new Error('This feature (kb.sym with 2 args) is removed. Do not assume prefix mappings.');\n }\n return this.rdfFactory.namedNode(uri);\n }\n\n /**\n * Gets the node matching the specified pattern. Throws when no match could be made.\n * @param s - The subject\n * @param p - The predicate\n * @param o - The object\n * @param g - The graph that contains the statement\n */\n the(s, p, o, g) {\n let x = this.any(s, p, o, g);\n if (x == null) {\n _log__WEBPACK_IMPORTED_MODULE_4__[\"default\"].error('No value found for the() {' + s + ' ' + p + ' ' + o + '}.');\n }\n return x;\n }\n\n /**\n * RDFS Inference\n * These are hand-written implementations of a backward-chaining reasoner\n * over the RDFS axioms.\n * @param seeds - A hash of NTs of classes to start with\n * @param predicate - The property to trace though\n * @param inverse - Trace inverse direction\n */\n transitiveClosure(seeds, predicate, inverse) {\n let elt, i, len, s, sups, t;\n let agenda = {};\n Object.assign(agenda, seeds); // make a copy\n let done = {}; // classes we have looked up\n while (true) {\n t = function () {\n for (let p in agenda) {\n if (!agenda.hasOwnProperty(p)) continue;\n return p;\n }\n }();\n if (t == null) {\n return done;\n }\n sups = inverse ? this.each(void 0, predicate, this.fromNT(t)) : this.each(this.fromNT(t), predicate);\n for (i = 0, len = sups.length; i < len; i++) {\n elt = sups[i];\n s = elt.toNT();\n if (s in done) {\n continue;\n }\n if (s in agenda) {\n continue;\n }\n agenda[s] = agenda[t];\n }\n done[t] = agenda[t];\n delete agenda[t];\n }\n }\n\n /**\n * Finds the types in the list which have no *stored* supertypes\n * We exclude the universal class, owl:Things and rdf:Resource, as it is\n * information-free.\n * @param types - The types\n */\n topTypeURIs(types) {\n let i;\n let j;\n let k;\n let len;\n let n;\n let ref;\n let tops;\n let v;\n tops = [];\n for (k in types) {\n if (!types.hasOwnProperty(k)) continue;\n v = types[k];\n n = 0;\n ref = this.each(this.rdfFactory.namedNode(k), this.rdfFactory.namedNode('http://www.w3.org/2000/01/rdf-schema#subClassOf'));\n for (i = 0, len = ref.length; i < len; i++) {\n j = ref[i];\n if (j.uri !== 'http://www.w3.org/2000/01/rdf-schema#Resource') {\n n++;\n break;\n }\n }\n if (!n) {\n tops[k] = v;\n }\n }\n if (tops['http://www.w3.org/2000/01/rdf-schema#Resource']) {\n delete tops['http://www.w3.org/2000/01/rdf-schema#Resource'];\n }\n if (tops['http://www.w3.org/2002/07/owl#Thing']) {\n delete tops['http://www.w3.org/2002/07/owl#Thing'];\n }\n return tops;\n }\n\n /**\n * Serializes this formula to a string\n */\n toString() {\n return '{' + this.statements.join('\\n') + '}';\n }\n\n /**\n * Gets a new variable\n * @param name - The variable's name\n */\n variable(name) {\n return new _variable__WEBPACK_IMPORTED_MODULE_10__[\"default\"](name);\n }\n\n /**\n * Gets the number of statements in this formula that matches the specified pattern\n * @param s - The subject\n * @param p - The predicate\n * @param o - The object\n * @param g - The graph that contains the statement\n */\n whether(s, p, o, g) {\n return this.statementsMatching(s, p, o, g, false).length;\n }\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/formula.js?\n}");
902
+
903
+ /***/ },
904
+
905
+ /***/ "./node_modules/rdflib/esm/index.js"
906
+ /*!******************************************!*\
907
+ !*** ./node_modules/rdflib/esm/index.js ***!
908
+ \******************************************/
909
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
910
+
911
+ "use strict";
912
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BlankNode: () => (/* reexport safe */ _blank_node__WEBPACK_IMPORTED_MODULE_1__[\"default\"]),\n/* harmony export */ Collection: () => (/* reexport safe */ _collection__WEBPACK_IMPORTED_MODULE_2__[\"default\"]),\n/* harmony export */ ConnectedStore: () => (/* binding */ ConnectedStore),\n/* harmony export */ DataFactory: () => (/* reexport safe */ _factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__[\"default\"]),\n/* harmony export */ Empty: () => (/* reexport safe */ _empty__WEBPACK_IMPORTED_MODULE_3__[\"default\"]),\n/* harmony export */ Fetcher: () => (/* reexport safe */ _fetcher__WEBPACK_IMPORTED_MODULE_4__[\"default\"]),\n/* harmony export */ Formula: () => (/* reexport safe */ _formula__WEBPACK_IMPORTED_MODULE_5__[\"default\"]),\n/* harmony export */ IndexedFormula: () => (/* reexport safe */ _store__WEBPACK_IMPORTED_MODULE_6__[\"default\"]),\n/* harmony export */ Literal: () => (/* reexport safe */ _literal__WEBPACK_IMPORTED_MODULE_8__[\"default\"]),\n/* harmony export */ LiveStore: () => (/* binding */ LiveStore),\n/* harmony export */ N3Parser: () => (/* reexport safe */ _n3parser__WEBPACK_IMPORTED_MODULE_10__[\"default\"]),\n/* harmony export */ NamedNode: () => (/* reexport safe */ _named_node__WEBPACK_IMPORTED_MODULE_11__[\"default\"]),\n/* harmony export */ Namespace: () => (/* reexport safe */ _namespace__WEBPACK_IMPORTED_MODULE_12__[\"default\"]),\n/* harmony export */ NextId: () => (/* binding */ NextId),\n/* harmony export */ Node: () => (/* reexport safe */ _node__WEBPACK_IMPORTED_MODULE_13__[\"default\"]),\n/* harmony export */ Query: () => (/* reexport safe */ _query__WEBPACK_IMPORTED_MODULE_15__.Query),\n/* harmony export */ RDFParser: () => (/* reexport safe */ _rdfxmlparser__WEBPACK_IMPORTED_MODULE_18__[\"default\"]),\n/* harmony export */ RDFaProcessor: () => (/* reexport safe */ _rdfaparser__WEBPACK_IMPORTED_MODULE_17__[\"default\"]),\n/* harmony export */ SPARQLToQuery: () => (/* reexport safe */ _sparql_to_query__WEBPACK_IMPORTED_MODULE_21__[\"default\"]),\n/* harmony export */ Serializer: () => (/* reexport safe */ _serializer__WEBPACK_IMPORTED_MODULE_20__[\"default\"]),\n/* harmony export */ Statement: () => (/* reexport safe */ _statement__WEBPACK_IMPORTED_MODULE_23__[\"default\"]),\n/* harmony export */ Store: () => (/* reexport safe */ _store__WEBPACK_IMPORTED_MODULE_6__[\"default\"]),\n/* harmony export */ UpdateManager: () => (/* reexport safe */ _update_manager__WEBPACK_IMPORTED_MODULE_24__[\"default\"]),\n/* harmony export */ UpdatesSocket: () => (/* reexport safe */ _updates_via__WEBPACK_IMPORTED_MODULE_25__.UpdatesSocket),\n/* harmony export */ UpdatesVia: () => (/* reexport safe */ _updates_via__WEBPACK_IMPORTED_MODULE_25__.UpdatesVia),\n/* harmony export */ Util: () => (/* reexport module object */ _utils_js__WEBPACK_IMPORTED_MODULE_27__),\n/* harmony export */ Variable: () => (/* reexport safe */ _variable__WEBPACK_IMPORTED_MODULE_28__[\"default\"]),\n/* harmony export */ blankNode: () => (/* binding */ blankNode),\n/* harmony export */ defaultGraph: () => (/* binding */ defaultGraph),\n/* harmony export */ fetcher: () => (/* binding */ fetcher),\n/* harmony export */ fromNT: () => (/* binding */ fromNT),\n/* harmony export */ graph: () => (/* binding */ graph),\n/* harmony export */ isBlankNode: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isBlankNode),\n/* harmony export */ isCollection: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isCollection),\n/* harmony export */ isGraph: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isGraph),\n/* harmony export */ isLiteral: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isLiteral),\n/* harmony export */ isNamedNode: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isNamedNode),\n/* harmony export */ isPredicate: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isPredicate),\n/* harmony export */ isQuad: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isQuad),\n/* harmony export */ isRDFObject: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isRDFObject),\n/* harmony export */ isRDFlibObject: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isRDFlibObject),\n/* harmony export */ isRDFlibPredicate: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isRDFlibPredicate),\n/* harmony export */ isRDFlibSubject: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isRDFlibSubject),\n/* harmony export */ isStatement: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isStatement),\n/* harmony export */ isStore: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isStore),\n/* harmony export */ isSubject: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isSubject),\n/* harmony export */ isTerm: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isTerm),\n/* harmony export */ isVariable: () => (/* reexport safe */ _utils_terms__WEBPACK_IMPORTED_MODULE_30__.isVariable),\n/* harmony export */ jsonParser: () => (/* reexport safe */ _jsonparser__WEBPACK_IMPORTED_MODULE_7__[\"default\"]),\n/* harmony export */ lit: () => (/* binding */ lit),\n/* harmony export */ literal: () => (/* binding */ literal),\n/* harmony export */ log: () => (/* reexport safe */ _log__WEBPACK_IMPORTED_MODULE_9__[\"default\"]),\n/* harmony export */ namedNode: () => (/* binding */ namedNode),\n/* harmony export */ parse: () => (/* reexport safe */ _parse__WEBPACK_IMPORTED_MODULE_14__[\"default\"]),\n/* harmony export */ quad: () => (/* binding */ quad),\n/* harmony export */ queryToSPARQL: () => (/* reexport safe */ _query_to_sparql__WEBPACK_IMPORTED_MODULE_16__[\"default\"]),\n/* harmony export */ serialize: () => (/* reexport safe */ _serialize__WEBPACK_IMPORTED_MODULE_19__[\"default\"]),\n/* harmony export */ sparqlUpdateParser: () => (/* reexport safe */ _patch_parser__WEBPACK_IMPORTED_MODULE_22__[\"default\"]),\n/* harmony export */ st: () => (/* binding */ st),\n/* harmony export */ sym: () => (/* binding */ namedNode),\n/* harmony export */ term: () => (/* binding */ term),\n/* harmony export */ termValue: () => (/* reexport safe */ _utils_termValue__WEBPACK_IMPORTED_MODULE_31__.termValue),\n/* harmony export */ triple: () => (/* binding */ triple),\n/* harmony export */ uri: () => (/* reexport module object */ _uri__WEBPACK_IMPORTED_MODULE_26__),\n/* harmony export */ variable: () => (/* binding */ variable)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _blank_node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./blank-node */ \"./node_modules/rdflib/esm/blank-node.js\");\n/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./collection */ \"./node_modules/rdflib/esm/collection.js\");\n/* harmony import */ var _empty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./empty */ \"./node_modules/rdflib/esm/empty.js\");\n/* harmony import */ var _fetcher__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fetcher */ \"./node_modules/rdflib/esm/fetcher.js\");\n/* harmony import */ var _formula__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./formula */ \"./node_modules/rdflib/esm/formula.js\");\n/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./store */ \"./node_modules/rdflib/esm/store.js\");\n/* harmony import */ var _jsonparser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./jsonparser */ \"./node_modules/rdflib/esm/jsonparser.js\");\n/* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./literal */ \"./node_modules/rdflib/esm/literal.js\");\n/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./log */ \"./node_modules/rdflib/esm/log.js\");\n/* harmony import */ var _n3parser__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./n3parser */ \"./node_modules/rdflib/esm/n3parser.js\");\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./namespace */ \"./node_modules/rdflib/esm/namespace.js\");\n/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./node */ \"./node_modules/rdflib/esm/node.js\");\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./parse */ \"./node_modules/rdflib/esm/parse.js\");\n/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./query */ \"./node_modules/rdflib/esm/query.js\");\n/* harmony import */ var _query_to_sparql__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./query-to-sparql */ \"./node_modules/rdflib/esm/query-to-sparql.js\");\n/* harmony import */ var _rdfaparser__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./rdfaparser */ \"./node_modules/rdflib/esm/rdfaparser.js\");\n/* harmony import */ var _rdfxmlparser__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./rdfxmlparser */ \"./node_modules/rdflib/esm/rdfxmlparser.js\");\n/* harmony import */ var _serialize__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./serialize */ \"./node_modules/rdflib/esm/serialize.js\");\n/* harmony import */ var _serializer__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./serializer */ \"./node_modules/rdflib/esm/serializer.js\");\n/* harmony import */ var _sparql_to_query__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./sparql-to-query */ \"./node_modules/rdflib/esm/sparql-to-query.js\");\n/* harmony import */ var _patch_parser__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./patch-parser */ \"./node_modules/rdflib/esm/patch-parser.js\");\n/* harmony import */ var _statement__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./statement */ \"./node_modules/rdflib/esm/statement.js\");\n/* harmony import */ var _update_manager__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./update-manager */ \"./node_modules/rdflib/esm/update-manager.js\");\n/* harmony import */ var _updates_via__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./updates-via */ \"./node_modules/rdflib/esm/updates-via.js\");\n/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./uri */ \"./node_modules/rdflib/esm/uri.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./utils-js */ \"./node_modules/rdflib/esm/utils-js.js\");\n/* harmony import */ var _variable__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./variable */ \"./node_modules/rdflib/esm/variable.js\");\n/* harmony import */ var _factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./factories/rdflib-data-factory */ \"./node_modules/rdflib/esm/factories/rdflib-data-factory.js\");\n/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./utils/terms */ \"./node_modules/rdflib/esm/utils/terms.js\");\n/* harmony import */ var _utils_termValue__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./utils/termValue */ \"./node_modules/rdflib/esm/utils/termValue.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// Prepare bound versions of data factory methods for export\nconst boundDataFactory = {};\nfor (const name in _factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__[\"default\"]) {\n if (typeof _factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__[\"default\"][name] === 'function') boundDataFactory[name] = _factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__[\"default\"][name].bind(_factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_29__[\"default\"]);\n}\nconst {\n fetcher,\n graph,\n lit,\n st,\n namedNode,\n variable,\n blankNode,\n defaultGraph,\n literal,\n quad,\n triple\n} = boundDataFactory;\nconst formula = new _formula__WEBPACK_IMPORTED_MODULE_5__[\"default\"]();\nconst fromNT = str => formula.fromNT(str);\nconst term = _node__WEBPACK_IMPORTED_MODULE_13__[\"default\"].fromValue;\n\n// TODO: this export is broken;\n// it exports the _current_ value of nextId, which is always 0\nconst NextId = _blank_node__WEBPACK_IMPORTED_MODULE_1__[\"default\"].nextId;\n\n\n\nclass ConnectedStore extends _store__WEBPACK_IMPORTED_MODULE_6__[\"default\"] {\n constructor(features) {\n super(features);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"fetcher\", void 0);\n this.fetcher = new _fetcher__WEBPACK_IMPORTED_MODULE_4__[\"default\"](this, {});\n }\n}\nclass LiveStore extends ConnectedStore {\n constructor(features) {\n super(features);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"updater\", void 0);\n this.updater = new _update_manager__WEBPACK_IMPORTED_MODULE_24__[\"default\"](this);\n }\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/index.js?\n}");
913
+
914
+ /***/ },
915
+
916
+ /***/ "./node_modules/rdflib/esm/jsonldparser.js"
917
+ /*!*************************************************!*\
918
+ !*** ./node_modules/rdflib/esm/jsonldparser.js ***!
919
+ \*************************************************/
920
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
921
+
922
+ "use strict";
923
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ jsonldParser),\n/* harmony export */ jsonldObjectToTerm: () => (/* binding */ jsonldObjectToTerm)\n/* harmony export */ });\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils */ \"./node_modules/rdflib/esm/utils.js\");\n\n\n/**\n * Parses json-ld formatted JS objects to a rdf Term.\n * @param kb - The DataFactory to use.\n * @param obj - The json-ld object to process.\n * @return {Literal|NamedNode|BlankNode|Collection}\n */\nfunction jsonldObjectToTerm(kb, obj) {\n if (typeof obj === 'string') {\n return kb.rdfFactory.literal(obj);\n }\n if (Object.prototype.hasOwnProperty.call(obj, '@list')) {\n if (kb.rdfFactory.supports[\"COLLECTIONS\"] === true) {\n return listToCollection(kb, obj['@list']);\n }\n return listToStatements(kb, obj);\n }\n if (Object.prototype.hasOwnProperty.call(obj, '@id')) {\n return nodeType(kb, obj);\n }\n if (Object.prototype.hasOwnProperty.call(obj, '@language')) {\n return kb.rdfFactory.literal(obj['@value'], obj['@language']);\n }\n if (Object.prototype.hasOwnProperty.call(obj, '@type')) {\n return kb.rdfFactory.literal(obj['@value'], kb.rdfFactory.namedNode(obj['@type']));\n }\n if (Object.prototype.hasOwnProperty.call(obj, '@value')) {\n return kb.rdfFactory.literal(obj['@value']);\n }\n return kb.rdfFactory.literal(obj);\n}\n\n/**\n * Adds the statements in a json-ld list object to {kb}.\n */\nfunction listToStatements(kb, obj) {\n const listId = obj['@id'] ? nodeType(kb, obj) : kb.rdfFactory.blankNode();\n const items = obj['@list'].map(listItem => jsonldObjectToTerm(kb, listItem));\n const statements = (0,_utils__WEBPACK_IMPORTED_MODULE_0__.arrayToStatements)(kb.rdfFactory, listId, items);\n kb.addAll(statements);\n return listId;\n}\nfunction listToCollection(kb, obj) {\n if (!Array.isArray(obj)) {\n throw new TypeError(\"Object must be an array\");\n }\n return kb.rdfFactory.collection(obj.map(o => jsonldObjectToTerm(kb, o)));\n}\n\n/**\n * Takes a json-ld formatted string {str} and adds its statements to {kb}.\n *\n * Ensure that {kb.rdfFactory} is a DataFactory.\n */\nasync function jsonldParser(str, kb, base) {\n const baseString = base && Object.prototype.hasOwnProperty.call(base, 'termType') ? base.value : base;\n const jsonld = await __webpack_require__.e(/*! import() */ \"vendors-node_modules_jsonld_lib_jsonld_js\").then(__webpack_require__.t.bind(__webpack_require__, /*! jsonld */ \"./node_modules/jsonld/lib/jsonld.js\", 23));\n // ⚠ Unit tests also work without accessing `jsonld.default` explicitly, but real browser usage will fail with\n // just calling `jsonld.flatten`, so please do not remove `default`\n const flattened = await jsonld.default.flatten(JSON.parse(str), null, {\n base: baseString\n });\n return flattened.reduce((store, flatResource) => processResource(store, base, flatResource), kb);\n}\nfunction nodeType(kb, obj) {\n if (obj['@id'].startsWith('_:')) {\n // This object is a Blank Node. Pass the id without the `_:` prefix\n return kb.rdfFactory.blankNode(obj['@id'].substring(2));\n } else {\n // This object is a Named Node\n return kb.rdfFactory.namedNode(obj['@id']);\n }\n}\nfunction processResource(kb, base, flatResource) {\n const id = flatResource['@id'] ? nodeType(kb, flatResource) : kb.rdfFactory.blankNode();\n for (const property of Object.keys(flatResource)) {\n if (property === '@id') {\n continue;\n } else if (property == '@graph') {\n // the JSON-LD flattened structure may contain nested graphs\n // the id value for this object is the new base (named graph id) for all nested flat resources\n const graphId = id;\n // this is an array of resources\n const nestedFlatResources = flatResource[property];\n\n // recursively process all flat resources in the array, but with the graphId as base.\n for (let i = 0; i < nestedFlatResources.length; i++) {\n kb = processResource(kb, graphId, nestedFlatResources[i]);\n }\n }\n const value = flatResource[property];\n if (Array.isArray(value)) {\n for (let i = 0; i < value.length; i++) {\n kb.addStatement(createStatement(kb, id, property, value[i], base));\n }\n } else {\n kb.addStatement(createStatement(kb, id, property, value, base));\n }\n }\n return kb;\n}\n\n/**\n * Create statement quad depending on @type being a type node\n * @param kb\n * @param subject id\n * @param property\n * @param value\n * @return quad statement\n */\nfunction createStatement(kb, id, property, value, base) {\n let predicate, object;\n if (property === \"@type\") {\n predicate = kb.rdfFactory.namedNode(\"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\");\n object = kb.rdfFactory.namedNode(value);\n } else {\n predicate = kb.rdfFactory.namedNode(property);\n object = jsonldObjectToTerm(kb, value);\n }\n return kb.rdfFactory.quad(id, predicate, object, kb.rdfFactory.namedNode(base));\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/jsonldparser.js?\n}");
924
+
925
+ /***/ },
926
+
927
+ /***/ "./node_modules/rdflib/esm/jsonparser.js"
928
+ /*!***********************************************!*\
929
+ !*** ./node_modules/rdflib/esm/jsonparser.js ***!
930
+ \***********************************************/
931
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
932
+
933
+ "use strict";
934
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ((function () {\n return {\n parseJSON: function (data, source, store) {\n var subject, predicate, object;\n var bnodes = {};\n var why = store.sym(source);\n for (var x in data) {\n if (x.indexOf('_:') === 0) {\n if (bnodes[x]) {\n subject = bnodes[x];\n } else {\n subject = store.bnode(x);\n bnodes[x] = subject;\n }\n } else {\n subject = store.sym(x);\n }\n var preds = data[x];\n for (var y in preds) {\n var objects = preds[y];\n predicate = store.sym(y);\n for (var z in objects) {\n var obj = objects[z];\n if (obj.type === 'uri') {\n object = store.sym(obj.value);\n store.add(subject, predicate, object, why);\n } else if (obj.type === 'BlankNode') {\n if (bnodes[obj.value]) {\n object = bnodes[obj.value];\n } else {\n object = store.bnode(obj.value);\n bnodes[obj.value] = object;\n }\n store.add(subject, predicate, object, why);\n } else if (obj.type === 'Literal') {\n // var datatype\n if (obj.datatype) {\n object = store.literal(obj.value, undefined, store.sym(obj.datatype));\n } else if (obj.lang) {\n object = store.literal(obj.value, obj.lang);\n } else {\n object = store.literal(obj.value);\n }\n store.add(subject, predicate, object, why);\n } else {\n throw new Error('error: unexpected termtype: ' + z.type);\n }\n }\n }\n }\n }\n };\n})());\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/jsonparser.js?\n}");
935
+
936
+ /***/ },
937
+
938
+ /***/ "./node_modules/rdflib/esm/lists.js"
939
+ /*!******************************************!*\
940
+ !*** ./node_modules/rdflib/esm/lists.js ***!
941
+ \******************************************/
942
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
943
+
944
+ "use strict";
945
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ convertFirstRestNil: () => (/* binding */ convertFirstRestNil),\n/* harmony export */ substituteInDoc: () => (/* binding */ substituteInDoc),\n/* harmony export */ substituteNillsInDoc: () => (/* binding */ substituteNillsInDoc)\n/* harmony export */ });\n/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./collection */ \"./node_modules/rdflib/esm/collection.js\");\n/* harmony import */ var _statement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./statement */ \"./node_modules/rdflib/esm/statement.js\");\n/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./namespace */ \"./node_modules/rdflib/esm/namespace.js\");\n/* Lists form conversion\n*/\n\n// import DataFactory from './factories/extended-term-factory'\n// import jsonldParser from './jsonldparser'\n// @ts-ignore is this injected?\n// @@ Goal: remove this dependency\n// import N3Parser from './n3parser'\n// import { parseRDFaDOM } from './rdfaparser'\n// import RDFParser from './rdfxmlparser'\n// import sparqlUpdateParser from './patch-parser'\n// import * as Util from './utils-js'\n\n// import BlankNode from './blank-node'\n// import NamedNode from './named-node'\n\n\n// import Formula from './formula'\n\n// import { ContentType, TurtleContentType, N3ContentType, RDFXMLContentType, XHTMLContentType, HTMLContentType, SPARQLUpdateContentType, SPARQLUpdateSingleMatchContentType, JSONLDContentType, NQuadsContentType, NQuadsAltContentType } from './types'\n\n// import { Quad } from './tf-types'\n\n\nconst RDF = (0,_namespace__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('http://www.w3.org/1999/02/22-rdf-syntax-ns#');\n\n/* Replace a given node with another node throughout a given document\n*\n* we do the predicate as well for complenesss though we don't expect Collections to use it\n*/\nfunction substituteInDoc(store, x, y, doc) {\n // console.log(`substituteInDoc put ${x} for ${y} in ${doc}}`)\n for (const quad of store.statementsMatching(y, null, null, doc)) {\n const newStatement = new _statement__WEBPACK_IMPORTED_MODULE_1__[\"default\"](x, quad.predicate, quad.object, doc);\n store.remove(quad);\n store.add(newStatement);\n }\n for (const quad of store.statementsMatching(null, y, null, doc)) {\n store.remove(quad);\n // console.log(` substituteInDoc predicate ${x} in ${quad}}`)\n store.add(new _statement__WEBPACK_IMPORTED_MODULE_1__[\"default\"](quad.subject, x, quad.object, doc));\n }\n for (const quad of store.statementsMatching(null, null, y, doc)) {\n store.remove(quad);\n store.add(new _statement__WEBPACK_IMPORTED_MODULE_1__[\"default\"](quad.subject, quad.predicate, x, doc));\n }\n}\n\n/* Change all lone rdf:nil nodes into empty Collections\n*/\nfunction substituteNillsInDoc(store, doc) {\n const x = RDF('nil');\n for (const quad of store.statementsMatching(x, null, null, doc)) {\n store.remove(quad);\n const y = new _collection__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n store.add(new _statement__WEBPACK_IMPORTED_MODULE_1__[\"default\"](y, quad.predicate, quad.object, doc));\n }\n for (const quad of store.statementsMatching(null, null, x, doc)) {\n if (!quad.predicate.sameTerm(RDF('rest'))) {\n // If not a tail\n store.remove(quad);\n const y = new _collection__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n store.add(new _statement__WEBPACK_IMPORTED_MODULE_1__[\"default\"](quad.subject, quad.predicate, y, doc));\n }\n }\n}\n/**\n * Convert lists reified as rdf:first, rest\n * Normal method is sync.\n * Unfortunately jsdonld is currently written to need to be called async.\n * Hence the mess below with executeCallback.\n * @param store - The quadstore\n * @param doc - The document in which the conversion is done\n */\n\nfunction convertFirstRestNil(store, doc // Do whole store?\n) {\n function preceding(ele, listSoFar, trash) {\n const rests = store.statementsMatching(ele, RDF('rest'), null, doc);\n if (rests.length !== 1) throw new Error(`Bad list structure: no rest at ${ele}`);\n const firsts = store.statementsMatching(ele, RDF('first'), null, doc);\n if (firsts.length !== 1) throw new Error(`Bad list structure: rest but ${firsts.length} firsts at ${ele}`);\n const value = firsts[0].object;\n const total = [value].concat(listSoFar);\n // console.log(' List now is: ', total)\n const totalTrash = trash.concat(rests).concat(firsts);\n const pres = store.statementsMatching(null, RDF('rest'), ele, doc);\n if (pres.length === 0) {\n // Head of the list\n const newList = new _collection__WEBPACK_IMPORTED_MODULE_0__[\"default\"](total);\n store.remove(totalTrash);\n // Replace old list with new list:\n substituteInDoc(store, newList, ele, doc);\n return;\n }\n if (pres.length !== 1) throw new Error(`Bad list structure: ${pres.length} pres at ${ele}`);\n const pre = pres[0].subject;\n if (pre.termType !== 'BlankNode') throw new Error(`Bad list element node ${pre} type: ${pre.termType} `);\n preceding(pre, total, totalTrash);\n return;\n }\n substituteNillsInDoc(store, doc); // lone ones only\n\n const tails = store.statementsMatching(null, RDF('rest'), RDF('nil'), doc);\n tails.forEach(tail => {\n if (tail.subject.termType !== 'BlankNode') throw new Error(`Bad list element node ${tail.subject} type: ${tail.subject.termType} `);\n preceding(tail.subject, [], []);\n });\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/lists.js?\n}");
946
+
947
+ /***/ },
948
+
949
+ /***/ "./node_modules/rdflib/esm/literal.js"
950
+ /*!********************************************!*\
951
+ !*** ./node_modules/rdflib/esm/literal.js ***!
952
+ \********************************************/
953
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
954
+
955
+ "use strict";
956
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Literal)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _class_order__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./class-order */ \"./node_modules/rdflib/esm/class-order.js\");\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n/* harmony import */ var _node_internal__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./node-internal */ \"./node_modules/rdflib/esm/node-internal.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/terms */ \"./node_modules/rdflib/esm/utils/terms.js\");\n/* harmony import */ var _xsd_internal__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./xsd-internal */ \"./node_modules/rdflib/esm/xsd-internal.js\");\n\n\n\n\n\n\n\n/**\n * An RDF literal, containing some value which isn't expressed as an IRI.\n * @link https://rdf.js.org/data-model-spec/#literal-interface\n */\nclass Literal extends _node_internal__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\n /**\n * Initializes a literal\n * @param value - The literal's lexical value\n * @param language - The language for the literal. Defaults to ''.\n * @param datatype - The literal's datatype as a named node. Defaults to xsd:string.\n */\n constructor(value, language, datatype) {\n super(value);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"termType\", _types__WEBPACK_IMPORTED_MODULE_4__.LiteralTermType);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"classOrder\", _class_order__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Literal);\n /**\n * The literal's datatype as a named node\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"datatype\", _xsd_internal__WEBPACK_IMPORTED_MODULE_6__[\"default\"].string);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isVar\", 0);\n /**\n * The language for the literal\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"language\", '');\n if (language) {\n this.language = language;\n this.datatype = _xsd_internal__WEBPACK_IMPORTED_MODULE_6__[\"default\"].langString;\n } else if (datatype) {\n this.datatype = _named_node__WEBPACK_IMPORTED_MODULE_2__[\"default\"].fromValue(datatype);\n } else {\n this.datatype = _xsd_internal__WEBPACK_IMPORTED_MODULE_6__[\"default\"].string;\n }\n }\n\n /**\n * Gets a copy of this literal\n */\n copy() {\n return new Literal(this.value, this.lang, this.datatype);\n }\n\n /**\n * Gets whether two literals are the same\n * @param other The other statement\n */\n equals(other) {\n if (!other) {\n return false;\n }\n return this.termType === other.termType && this.value === other.value && this.language === other.language && (!this.datatype && !other.datatype || this.datatype && this.datatype.equals(other.datatype));\n }\n\n /**\n * The language for the literal\n * @deprecated use {language} instead\n */\n get lang() {\n return this.language;\n }\n set lang(language) {\n this.language = language || '';\n }\n toNT() {\n return Literal.toNT(this);\n }\n\n /** Serializes a literal to an N-Triples string */\n static toNT(literal) {\n if (typeof literal.value === 'number') {\n return '' + literal.value;\n } else if (typeof literal.value !== 'string') {\n throw new Error('Value of RDF literal is not string or number: ' + literal.value);\n }\n var str = literal.value;\n // #x22 (\"), #x5C (\\), #x0A (\\n) and #xD (\\r) are disallowed and need to be replaced\n // see https://www.w3.org/TR/n-triples/#grammar-production-STRING_LITERAL_QUOTE\n str = str.replace(/\\\\/g, '\\\\\\\\');\n str = str.replace(/\\\"/g, '\\\\\"');\n str = str.replace(/\\n/g, '\\\\n');\n str = str.replace(/\\r/g, '\\\\r');\n str = '\"' + str + '\"';\n if (literal.language) {\n str += '@' + literal.language;\n } else if (!literal.datatype.equals(_xsd_internal__WEBPACK_IMPORTED_MODULE_6__[\"default\"].string)) {\n // Only add datatype if it's not a string\n str += '^^' + literal.datatype.toCanonical();\n }\n return str;\n }\n toString() {\n return '' + this.value;\n }\n\n /**\n * Builds a literal node from a boolean value\n * @param value - The value\n */\n static fromBoolean(value) {\n let strValue = value ? '1' : '0';\n return new Literal(strValue, null, _xsd_internal__WEBPACK_IMPORTED_MODULE_6__[\"default\"].boolean);\n }\n\n /**\n * Builds a literal node from a date value\n * @param value The value\n */\n static fromDate(value) {\n if (!(value instanceof Date)) {\n throw new TypeError('Invalid argument to Literal.fromDate()');\n }\n let d2 = function (x) {\n return ('' + (100 + x)).slice(1, 3);\n };\n let date = '' + value.getUTCFullYear() + '-' + d2(value.getUTCMonth() + 1) + '-' + d2(value.getUTCDate()) + 'T' + d2(value.getUTCHours()) + ':' + d2(value.getUTCMinutes()) + ':' + d2(value.getUTCSeconds()) + 'Z';\n return new Literal(date, null, _xsd_internal__WEBPACK_IMPORTED_MODULE_6__[\"default\"].dateTime);\n }\n\n /**\n * Builds a literal node from a number value\n * @param value - The value\n */\n static fromNumber(value) {\n if (typeof value !== 'number') {\n throw new TypeError('Invalid argument to Literal.fromNumber()');\n }\n let datatype;\n const strValue = value.toString();\n if (strValue.indexOf('e') < 0 && Math.abs(value) <= Number.MAX_SAFE_INTEGER) {\n datatype = Number.isInteger(value) ? _xsd_internal__WEBPACK_IMPORTED_MODULE_6__[\"default\"].integer : _xsd_internal__WEBPACK_IMPORTED_MODULE_6__[\"default\"].decimal;\n } else {\n datatype = _xsd_internal__WEBPACK_IMPORTED_MODULE_6__[\"default\"].double;\n }\n return new Literal(strValue, null, datatype);\n }\n\n /**\n * Builds a literal node from an input value\n * @param value - The input value\n */\n static fromValue(value) {\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_5__.isLiteral)(value)) {\n return value;\n }\n switch (typeof value) {\n case 'object':\n if (value instanceof Date) {\n return Literal.fromDate(value);\n }\n case 'boolean':\n return Literal.fromBoolean(value);\n case 'number':\n return Literal.fromNumber(value);\n case 'string':\n return new Literal(value);\n }\n throw new Error(\"Can't make literal from \" + value + ' of type ' + typeof value);\n }\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/literal.js?\n}");
957
+
958
+ /***/ },
959
+
960
+ /***/ "./node_modules/rdflib/esm/log.js"
961
+ /*!****************************************!*\
962
+ !*** ./node_modules/rdflib/esm/log.js ***!
963
+ \****************************************/
964
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
965
+
966
+ "use strict";
967
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/**\n * A Dummy log\n * @module log\n */\nconst log = {\n debug(x) {},\n warn(x) {},\n info(x) {},\n error(x) {},\n success(x) {},\n msg(x) {}\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (log);\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/log.js?\n}");
968
+
969
+ /***/ },
970
+
971
+ /***/ "./node_modules/rdflib/esm/n3parser.js"
972
+ /*!*********************************************!*\
973
+ !*** ./node_modules/rdflib/esm/n3parser.js ***!
974
+ \*********************************************/
975
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
976
+
977
+ "use strict";
978
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ SinkParser: () => (/* binding */ SinkParser),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uri */ \"./node_modules/rdflib/esm/uri.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils */ \"./node_modules/rdflib/esm/utils.js\");\n/* harmony import */ var _lists__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lists */ \"./node_modules/rdflib/esm/lists.js\");\n/**\n*\n* UTF-8 data encode / decode\n* http://www.webtoolkit.info/\n*\n**/\n\n\n\nfunction hexify(str) {\n // also used in parser\n return encodeURI(str);\n}\nvar Utf8 = {\n // public method for url encoding\n encode: function (string) {\n string = string.replace(/\\r\\n/g, \"\\n\");\n var utftext = \"\";\n for (var n = 0; n < string.length; n++) {\n var c = string.charCodeAt(n);\n if (c < 128) {\n utftext += String.fromCharCode(c);\n } else if (c > 127 && c < 2048) {\n utftext += String.fromCharCode(c >> 6 | 192);\n utftext += String.fromCharCode(c & 63 | 128);\n } else {\n utftext += String.fromCharCode(c >> 12 | 224);\n utftext += String.fromCharCode(c >> 6 & 63 | 128);\n utftext += String.fromCharCode(c & 63 | 128);\n }\n }\n return utftext;\n },\n // public method for url decoding\n decode: function (utftext) {\n var string = \"\";\n var i = 0;\n while (i < utftext.length) {\n var c = utftext.charCodeAt(i);\n if (c < 128) {\n string += String.fromCharCode(c);\n i++;\n } else if (c > 191 && c < 224) {\n string += String.fromCharCode((c & 31) << 6 | utftext.charCodeAt(i + 1) & 63);\n i += 2;\n } else {\n string += String.fromCharCode((c & 15) << 12 | (utftext.charCodeAt(i + 1) & 63) << 6 | utftext.charCodeAt(i + 2) & 63);\n i += 3;\n }\n }\n return string;\n }\n}; // Things we need to define to make converted pythn code work in js\n// environment of $rdf\n\nvar RDFSink_forSomeSym = \"http://www.w3.org/2000/10/swap/log#forSome\";\nvar RDFSink_forAllSym = \"http://www.w3.org/2000/10/swap/log#forAll\";\nvar Logic_NS = \"http://www.w3.org/2000/10/swap/log#\";\n\n// pyjs seems to reference runtime library which I didn't find\n\nvar pyjslib_Tuple = function (theList) {\n return theList;\n};\nvar pyjslib_List = function (theList) {\n return theList;\n};\nvar pyjslib_Dict = function (listOfPairs) {\n if (listOfPairs.length > 0) throw \"missing.js: oops nnonempty dict not imp\";\n return [];\n};\nvar pyjslib_len = function (s) {\n return s.length;\n};\nvar pyjslib_slice = function (str, i, j) {\n if (typeof str.slice == 'undefined') throw '@@ mising.js: No .slice function for ' + str + ' of type ' + typeof str;\n if (typeof j == 'undefined' || j == null) return str.slice(i);\n return str.slice(i, j); // @ exactly the same spec?\n};\nvar StopIteration = Error('dummy error stop iteration');\nvar pyjslib_Iterator = function (theList) {\n this.last = 0;\n this.li = theList;\n this.next = function () {\n if (this.last == this.li.length) throw StopIteration;\n return this.li[this.last++];\n };\n return this;\n};\nvar ord = function (str) {\n return str.charCodeAt(0);\n};\nvar string_find = function (str, s) {\n return str.indexOf(s);\n};\nvar assertFudge = function (condition, desc) {\n if (condition) return;\n if (desc) throw \"python Assertion failed: \" + desc;\n throw \"(python) Assertion failed.\";\n};\nvar stringFromCharCode = function (uesc) {\n return String.fromCharCode(uesc);\n};\nString.prototype.encode = function (encoding) {\n if (encoding != 'utf-8') throw \"UTF8_converter: can only do utf-8\";\n return Utf8.encode(this);\n};\nString.prototype.decode = function (encoding) {\n if (encoding != 'utf-8') throw \"UTF8_converter: can only do utf-8\";\n //return Utf8.decode(this);\n return this;\n};\nvar uripath_join = function (base, given) {\n return _uri__WEBPACK_IMPORTED_MODULE_0__.join(given, base); // sad but true\n};\nvar becauseSubexpression = null; // No reason needed\nvar diag_tracking = 0;\nvar diag_chatty_flag = 0;\nvar diag_progress = function (str) {/*$rdf.log.debug(str);*/};\n\n// why_BecauseOfData = function(doc, reason) { return doc };\n\nvar RDF_type_URI = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#type\";\nvar RDF_nil_URI = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#nil\";\nvar DAML_sameAs_URI = \"http://www.w3.org/2002/07/owl#sameAs\";\n\n/*\nfunction SyntaxError(details) {\n return new __SyntaxError(details);\n}\n*/\n\nfunction __SyntaxError(details) {\n this.details = details;\n}\n\n/*\n\n$Id: n3parser.js 14561 2008-02-23 06:37:26Z kennyluck $\n\nHAND EDITED FOR CONVERSION TO JAVASCRIPT\n\nThis module implements a Nptation3 parser, and the final\npart of a notation3 serializer.\n\nSee also:\n\nNotation 3\nhttp://www.w3.org/DesignIssues/Notation3\n\nClosed World Machine - and RDF Processor\nhttp://www.w3.org/2000/10/swap/cwm\n\nTo DO: See also \"@@\" in comments\n\n- Clean up interfaces\n______________________________________________\n\nModule originally by Dan Connolly, includeing notation3\nparser and RDF generator. TimBL added RDF stream model\nand N3 generation, replaced stream model with use\nof common store/formula API. Yosi Scharf developped\nthe module, including tests and test harness.\n\n*/\n\nvar ADDED_HASH = \"#\";\nvar LOG_implies_URI = \"http://www.w3.org/2000/10/swap/log#implies\";\nvar INTEGER_DATATYPE = \"http://www.w3.org/2001/XMLSchema#integer\";\nvar FLOAT_DATATYPE = \"http://www.w3.org/2001/XMLSchema#double\";\nvar DECIMAL_DATATYPE = \"http://www.w3.org/2001/XMLSchema#decimal\";\nvar DATE_DATATYPE = \"http://www.w3.org/2001/XMLSchema#date\";\nvar DATETIME_DATATYPE = \"http://www.w3.org/2001/XMLSchema#dateTime\";\nvar BOOLEAN_DATATYPE = \"http://www.w3.org/2001/XMLSchema#boolean\";\nvar option_noregen = 0;\nvar _notQNameChars = \"\\t\\r\\n !\\\"#$%&'()*.,+/;<=>?@[\\\\]^`{|}~\";\nvar _notNameChars = _notQNameChars + \":\";\nvar _rdfns = \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\";\nvar N3CommentCharacter = \"#\";\nvar eol = new RegExp(\"^[ \\\\t]*(#[^\\\\n]*)?\\\\r?\\\\n\", 'g');\nvar eof = new RegExp(\"^[ \\\\t]*(#[^\\\\n]*)?$\", 'g');\nvar ws = new RegExp(\"^[ \\\\t]*\", 'g');\nvar signed_integer = new RegExp(\"^[-+]?[0-9]+\", 'g');\nvar number_syntax = new RegExp(\"^([-+]?[0-9]+)(\\\\.[0-9]+)?([eE][-+]?[0-9]+)?\", 'g');\nvar datetime_syntax = new RegExp('^[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9](T[0-9][0-9]:[0-9][0-9](:[0-9][0-9](\\\\.[0-9]*)?)?)?Z?');\n\n// Reused in tight loops to detect whitespace or comment after a dot\nvar wsOrHash = new RegExp(\"[\\\\s#]\");\nvar digitstring = new RegExp(\"^[0-9]+\", 'g');\nvar interesting = new RegExp(\"[\\\\\\\\\\\\r\\\\n\\\\\\\"]\", 'g');\nvar langcode = new RegExp(\"^[a-zA-Z0-9]+(-[a-zA-Z0-9]+)*\", 'g');\n\n// Returns true when a dot at position i should terminate a name,\n// i.e., when the next character is whitespace, a comment start, or EOF\nfunction dotTerminatesName(str, i) {\n var next = str.charAt(i + 1);\n return next === '' || wsOrHash.test(next);\n}\nfunction createSinkParser(store, openFormula, thisDoc, baseURI, genPrefix, metaURI, flags, why) {\n return new SinkParser(store, openFormula, thisDoc, baseURI, genPrefix, metaURI, flags, why);\n}\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (createSinkParser);\nclass SinkParser {\n constructor(store, openFormula, thisDoc, baseURI, genPrefix, metaURI, flags, why) {\n if (typeof openFormula == 'undefined') openFormula = null;\n if (typeof thisDoc == 'undefined') thisDoc = \"\";\n if (typeof baseURI == 'undefined') baseURI = null;\n if (typeof genPrefix == 'undefined') genPrefix = \"\";\n if (typeof metaURI == 'undefined') metaURI = null;\n if (typeof flags == 'undefined') flags = \"\";\n if (typeof why == 'undefined') why = null;\n /*\n note: namespace names should *not* end in #;\n the # will get added during qname processing */\n\n this._bindings = new pyjslib_Dict([]);\n this._flags = flags;\n if (thisDoc != \"\") {\n assertFudge(thisDoc.indexOf(\":\") >= 0, \"Document URI not absolute: \" + thisDoc);\n this._bindings[\"\"] = thisDoc + \"#\";\n }\n this._store = store;\n if (genPrefix) {\n store.setGenPrefix(genPrefix);\n }\n this._thisDoc = thisDoc;\n this.source = store.sym(thisDoc);\n this.lines = 0;\n this.statementCount = 0;\n this.hasNil = false;\n this.startOfLine = 0;\n this.previousLine = 0;\n this._genPrefix = genPrefix;\n this.keywords = new pyjslib_List([\"a\", \"this\", \"bind\", \"has\", \"is\", \"of\", \"true\", \"false\"]);\n this.keywordsSet = 0;\n this._anonymousNodes = new pyjslib_Dict([]);\n this._variables = new pyjslib_Dict([]);\n this._parentVariables = new pyjslib_Dict([]);\n this._reason = why;\n this._reason2 = null;\n if (diag_tracking) {\n this._reason2 = why_BecauseOfData(store.sym(thisDoc), this._reason);\n }\n if (baseURI) {\n this._baseURI = baseURI;\n } else {\n if (thisDoc) {\n this._baseURI = thisDoc;\n } else {\n this._baseURI = null;\n }\n }\n assertFudge(!this._baseURI || this._baseURI.indexOf(\":\") >= 0);\n if (!this._genPrefix) {\n if (this._thisDoc) {\n this._genPrefix = this._thisDoc + \"#_g\";\n } else {\n this._genPrefix = RDFSink_uniqueURI();\n }\n }\n if (openFormula == null) {\n if (this._thisDoc) {\n this._formula = store.formula(thisDoc + \"#_formula\");\n } else {\n this._formula = store.formula();\n }\n } else {\n this._formula = openFormula;\n }\n this._context = this._formula;\n this._parentContext = null;\n }\n here(i) {\n return this._genPrefix + \"_L\" + this.lines + \"C\" + (i - this.startOfLine + 1);\n }\n formula() {\n return this._formula;\n }\n loadStream(stream) {\n return this.loadBuf(stream.read());\n }\n loadBuf(buf) {\n /*\n Parses a buffer and returns its top level formula*/\n\n this.startDoc();\n this.feed(buf);\n return this.endDoc();\n }\n feed(octets) {\n /*\n Feed an octet stream tothe parser\n if BadSyntax is raised, the string\n passed in the exception object is the\n remainder after any statements have been parsed.\n So if there is more data to feed to the\n parser, it should be straightforward to recover.*/\n\n var str = octets.decode(\"utf-8\");\n var i = 0;\n while (i >= 0) {\n var j = this.skipSpace(str, i);\n if (j < 0) {\n return;\n }\n var i = this.directiveOrStatement(str, j);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"expected directive or statement\");\n }\n }\n }\n directiveOrStatement(str, h) {\n var i = this.skipSpace(str, h);\n if (i < 0) {\n return i;\n }\n var j = this.directive(str, i);\n if (j >= 0) {\n return this.checkDot(str, j);\n }\n var j = this.statement(str, i);\n if (j >= 0) {\n return this.checkDot(str, j);\n }\n return j;\n }\n tok(tok, str, i) {\n /*\n Check for keyword. Space must have been stripped on entry and\n we must not be at end of file.*/\n var whitespace = \"\\t\\n\\v\\f\\r \";\n if (str.slice(i, i + 1) == \"@\") {\n var i = i + 1;\n } else {\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_1__.ArrayIndexOf)(this.keywords, tok) < 0) {\n return -1;\n }\n }\n var k = i + pyjslib_len(tok);\n if (str.slice(i, k) == tok && _notQNameChars.indexOf(str.charAt(k)) >= 0) {\n return k;\n } else {\n return -1;\n }\n }\n directive(str, i) {\n var j = this.skipSpace(str, i);\n if (j < 0) {\n return j;\n }\n var res = new pyjslib_List([]);\n var j = this.tok(\"bind\", str, i);\n if (j > 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"keyword bind is obsolete: use @prefix\");\n }\n var j = this.tok(\"keywords\", str, i);\n if (j > 0) {\n var i = this.commaSeparatedList(str, j, res, false);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"'@keywords' needs comma separated list of words\");\n }\n this.setKeywords(pyjslib_slice(res, null, null));\n if (diag_chatty_flag > 80) {\n diag_progress(\"Keywords \", this.keywords);\n }\n return i;\n }\n var j = this.tok(\"forAll\", str, i);\n if (j > 0) {\n var i = this.commaSeparatedList(str, j, res, true);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"Bad variable list after @forAll\");\n }\n var __x = new pyjslib_Iterator(res);\n try {\n while (true) {\n var x = __x.next();\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_1__.ArrayIndexOf)(this._variables, x) < 0 || (0,_utils__WEBPACK_IMPORTED_MODULE_1__.ArrayIndexOf)(this._parentVariables, x) >= 0) {\n this._variables[x] = this._context.newUniversal(x);\n }\n }\n } catch (e) {\n if (e != StopIteration) {\n throw e;\n }\n }\n return i;\n }\n var j = this.tok(\"forSome\", str, i);\n if (j > 0) {\n var i = this.commaSeparatedList(str, j, res, this.uri_ref2);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"Bad variable list after @forSome\");\n }\n var __x = new pyjslib_Iterator(res);\n try {\n while (true) {\n var x = __x.next();\n this._context.declareExistential(x);\n }\n } catch (e) {\n if (e != StopIteration) {\n throw e;\n }\n }\n return i;\n }\n var j = this.tok(\"prefix\", str, i);\n if (j >= 0) {\n var t = new pyjslib_List([]);\n var i = this.qname(str, j, t);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"expected qname after @prefix\");\n }\n var j = this.uri_ref2(str, i, t);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"expected <uriref> after @prefix _qname_\");\n }\n var ns = t[1].uri;\n if (this._baseURI) {\n var ns = uripath_join(this._baseURI, ns);\n } else {\n assertFudge(ns.indexOf(\":\") >= 0, \"With no base URI, cannot handle relative URI for NS\");\n }\n assertFudge(ns.indexOf(\":\") >= 0);\n this._bindings[t[0][0]] = ns;\n this.bind(t[0][0], hexify(ns));\n return j;\n }\n var j = this.tok(\"base\", str, i);\n if (j >= 0) {\n var t = new pyjslib_List([]);\n var i = this.uri_ref2(str, j, t);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"expected <uri> after @base \");\n }\n var ns = t[0].uri;\n if (this._baseURI) {\n var ns = uripath_join(this._baseURI, ns);\n } else {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"With no previous base URI, cannot use relative URI in @base <\" + ns + \">\");\n }\n assertFudge(ns.indexOf(\":\") >= 0);\n this._baseURI = ns;\n return i;\n }\n return -1;\n }\n bind(qn, uri) {\n if (qn == \"\") {} else {\n this._store.setPrefixForURI(qn, uri);\n }\n }\n setKeywords(k) {\n /*\n Takes a list of strings*/\n\n if (k == null) {\n this.keywordsSet = 0;\n } else {\n this.keywords = k;\n this.keywordsSet = 1;\n }\n }\n startDoc() {}\n /* Signal end of document and stop parsing. returns formula */\n endDoc() {\n if (this.hasNil && this._store.rdfFactory.supports[\"COLLECTIONS\"]) {\n (0,_lists__WEBPACK_IMPORTED_MODULE_2__.convertFirstRestNil)(this._store, this.source);\n }\n return this._formula;\n }\n makeStatement(quad) {\n quad[0].add(quad[2], quad[1], quad[3], this.source);\n if (quad[2].uri && quad[2].uri === RDF_nil_URI || quad[3].uri && quad[3].uri === RDF_nil_URI) {\n this.hasNil = true;\n }\n this.statementCount += 1;\n }\n statement(str, i) {\n var r = new pyjslib_List([]);\n var i = this.object(str, i, r);\n if (i < 0) {\n return i;\n }\n var j = this.property_list(str, i, r[0]);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"expected propertylist\");\n }\n return j;\n }\n subject(str, i, res) {\n return this.item(str, i, res);\n }\n verb(str, i, res) {\n /*\n has _prop_\n is _prop_ of\n a\n =\n _prop_\n >- prop ->\n <- prop -<\n _operator_*/\n\n var j = this.skipSpace(str, i);\n if (j < 0) {\n return j;\n }\n var r = new pyjslib_List([]);\n var j = this.tok(\"has\", str, i);\n if (j >= 0) {\n var i = this.prop(str, j, r);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"expected property after 'has'\");\n }\n res.push(new pyjslib_Tuple([\"->\", r[0]]));\n return i;\n }\n var j = this.tok(\"is\", str, i);\n if (j >= 0) {\n var i = this.prop(str, j, r);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"expected <property> after 'is'\");\n }\n var j = this.skipSpace(str, i);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"End of file found, expected property after 'is'\");\n // removed by dead control flow\n\n }\n var i = j;\n var j = this.tok(\"of\", str, i);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"expected 'of' after 'is' <prop>\");\n }\n res.push(new pyjslib_Tuple([\"<-\", r[0]]));\n return j;\n }\n var j = this.tok(\"a\", str, i);\n if (j >= 0) {\n res.push(new pyjslib_Tuple([\"->\", this._store.sym(RDF_type_URI)]));\n return j;\n }\n if (str.slice(i, i + 2) == \"<=\") {\n res.push(new pyjslib_Tuple([\"<-\", this._store.sym(Logic_NS + \"implies\")]));\n return i + 2;\n }\n if (str.slice(i, i + 1) == \"=\") {\n if (str.slice(i + 1, i + 2) == \">\") {\n res.push(new pyjslib_Tuple([\"->\", this._store.sym(Logic_NS + \"implies\")]));\n return i + 2;\n }\n res.push(new pyjslib_Tuple([\"->\", this._store.sym(DAML_sameAs_URI)]));\n return i + 1;\n }\n if (str.slice(i, i + 2) == \":=\") {\n res.push(new pyjslib_Tuple([\"->\", Logic_NS + \"becomes\"]));\n return i + 2;\n }\n var j = this.prop(str, i, r);\n if (j >= 0) {\n res.push(new pyjslib_Tuple([\"->\", r[0]]));\n return j;\n }\n if (str.slice(i, i + 2) == \">-\" || str.slice(i, i + 2) == \"<-\") {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \">- ... -> syntax is obsolete.\");\n }\n return -1;\n }\n prop(str, i, res) {\n return this.item(str, i, res);\n }\n item(str, i, res) {\n return this.path(str, i, res);\n }\n blankNode(uri) {\n return this._context.bnode(uri, this._reason2);\n }\n path(str, i, res) {\n /*\n Parse the path production.\n */\n\n var j = this.nodeOrLiteral(str, i, res);\n if (j < 0) {\n return j;\n }\n while (\"!^.\".indexOf(str.slice(j, j + 1)) >= 0) {\n var ch = str.slice(j, j + 1);\n if (ch == \".\") {\n if (dotTerminatesName(str, j)) {\n break;\n }\n }\n var subj = res.pop();\n var obj = this.blankNode(this.here(j));\n var j = this.node(str, j + 1, res);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"EOF found in middle of path syntax\");\n }\n var pred = res.pop();\n if (ch == \"^\") {\n this.makeStatement(new pyjslib_Tuple([this._context, pred, obj, subj]));\n } else {\n this.makeStatement(new pyjslib_Tuple([this._context, pred, subj, obj]));\n }\n res.push(obj);\n }\n return j;\n }\n anonymousNode(ln) {\n /*\n Remember or generate a term for one of these _: anonymous nodes*/\n\n var term = this._anonymousNodes[ln];\n if (term) {\n return term;\n }\n var term = this._store.bnode(ln);\n // var term = this._store.bnode(this._context, this._reason2); eh?\n this._anonymousNodes[ln] = term;\n return term;\n }\n node(str, i, res, subjectAlready) {\n if (typeof subjectAlready == 'undefined') subjectAlready = null;\n /*\n Parse the <node> production.\n Space is now skipped once at the beginning\n instead of in multipe calls to self.skipSpace().\n */\n\n var subj = subjectAlready;\n var j = this.skipSpace(str, i);\n if (j < 0) {\n return j;\n }\n var i = j;\n var ch = str.slice(i, i + 1);\n if (ch == \"[\") {\n var bnodeID = this.here(i);\n var j = this.skipSpace(str, i + 1);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"EOF after '['\");\n }\n if (str.slice(j, j + 1) == \"=\") {\n var i = j + 1;\n var objs = new pyjslib_List([]);\n var j = this.objectList(str, i, objs);\n if (j >= 0) {\n var subj = objs[0];\n if (pyjslib_len(objs) > 1) {\n var __obj = new pyjslib_Iterator(objs);\n try {\n while (true) {\n var obj = __obj.next();\n this.makeStatement(new pyjslib_Tuple([this._context, this._store.sym(DAML_sameAs_URI), subj, obj]));\n }\n } catch (e) {\n if (e != StopIteration) {\n throw e;\n }\n }\n }\n var j = this.skipSpace(str, j);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"EOF when objectList expected after [ = \");\n }\n if (str.slice(j, j + 1) == \";\") {\n var j = j + 1;\n }\n } else {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"objectList expected after [= \");\n }\n }\n if (subj == null) {\n var subj = this.blankNode(bnodeID);\n }\n var i = this.property_list(str, j, subj);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"property_list expected\");\n }\n var j = this.skipSpace(str, i);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"EOF when ']' expected after [ <propertyList>\");\n }\n if (str.slice(j, j + 1) == \".\") {\n // If a dot is found after a blank node, treat it as a statement terminator.\n // Do NOT consume the '.' here: statement terminators are handled centrally by\n // checkDot() (called by directiveOrStatement after statement()). Consuming the dot\n // locally would bypass that unified logic and could cause inconsistencies.\n // We do consume ']' below because it is a structural closer of the blank node,\n // not a statement terminator.\n res.push(subj);\n return j; // leave '.' for checkDot()\n }\n if (str.slice(j, j + 1) != \"]\") {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"']' expected\");\n }\n res.push(subj);\n return j + 1;\n }\n if (ch == \"{\") {\n var ch2 = str.slice(i + 1, i + 2);\n if (ch2 == \"$\") {\n i += 1;\n var j = i + 1;\n var mylist = new pyjslib_List([]);\n var first_run = true;\n while (1) {\n var i = this.skipSpace(str, j);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"needed '$}', found end.\");\n }\n if (str.slice(i, i + 2) == \"$}\") {\n var j = i + 2;\n break;\n }\n if (!first_run) {\n if (str.slice(i, i + 1) == \",\") {\n i += 1;\n } else {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"expected: ','\");\n }\n } else {\n var first_run = false;\n }\n var item = new pyjslib_List([]);\n var j = this.item(str, i, item);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"expected item in set or '$}'\");\n }\n mylist.push(item[0]);\n }\n res.push(this._store.newSet(mylist, this._context));\n return j;\n } else {\n var j = i + 1;\n var oldParentContext = this._parentContext;\n this._parentContext = this._context;\n var parentAnonymousNodes = this._anonymousNodes;\n var grandParentVariables = this._parentVariables;\n this._parentVariables = this._variables;\n this._anonymousNodes = new pyjslib_Dict([]);\n this._variables = this._variables.slice();\n var reason2 = this._reason2;\n this._reason2 = becauseSubexpression;\n if (subj == null) {\n var subj = this._store.formula();\n }\n this._context = subj;\n while (1) {\n var i = this.skipSpace(str, j);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"needed '}', found end.\");\n }\n if (str.slice(i, i + 1) == \"}\") {\n var j = i + 1;\n break;\n }\n var j = this.directiveOrStatement(str, i);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"expected statement or '}'\");\n }\n }\n this._anonymousNodes = parentAnonymousNodes;\n this._variables = this._parentVariables;\n this._parentVariables = grandParentVariables;\n this._context = this._parentContext;\n this._reason2 = reason2;\n this._parentContext = oldParentContext;\n res.push(subj.close());\n return j;\n }\n }\n if (ch == \"(\") {\n var thing_type = this._store.list;\n var ch2 = str.slice(i + 1, i + 2);\n if (ch2 == \"$\") {\n var thing_type = this._store.newSet;\n i += 1;\n }\n var j = i + 1;\n var mylist = new pyjslib_List([]);\n while (1) {\n var i = this.skipSpace(str, j);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"needed ')', found end.\");\n }\n if (str.slice(i, i + 1) == \")\") {\n var j = i + 1;\n break;\n }\n var item = new pyjslib_List([]);\n var j = this.item(str, i, item);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"expected item in list or ')'\");\n }\n mylist.push(item[0]);\n }\n res.push(thing_type(mylist, this._context));\n return j;\n }\n var j = this.tok(\"this\", str, i);\n if (j >= 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"Keyword 'this' was ancient N3. Now use @forSome and @forAll keywords.\");\n // removed by dead control flow\n\n // removed by dead control flow\n\n }\n var j = this.tok(\"true\", str, i);\n if (j >= 0) {\n res.push(true);\n return j;\n }\n var j = this.tok(\"false\", str, i);\n if (j >= 0) {\n res.push(false);\n return j;\n }\n if (subj == null) {\n var j = this.uri_ref2(str, i, res);\n if (j >= 0) {\n return j;\n }\n }\n return -1;\n }\n property_list(str, i, subj) {\n /*\n Parse property list\n Leaves the terminating punctuation in the buffer\n */\n\n while (1) {\n var j = this.skipSpace(str, i);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"EOF found when expected verb in property list\");\n // removed by dead control flow\n\n }\n if (str.slice(j, j + 2) == \":-\") {\n var i = j + 2;\n var res = new pyjslib_List([]);\n var j = this.node(str, i, res, subj);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"bad {} or () or [] node after :- \");\n }\n var i = j;\n continue;\n }\n var i = j;\n var v = new pyjslib_List([]);\n var j = this.verb(str, i, v);\n if (j <= 0) {\n return i;\n }\n var objs = new pyjslib_List([]);\n var i = this.objectList(str, j, objs);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"objectList expected\");\n }\n var __obj = new pyjslib_Iterator(objs);\n try {\n while (true) {\n var obj = __obj.next();\n var pairFudge = v[0];\n var dir = pairFudge[0];\n var sym = pairFudge[1];\n if (dir == \"->\") {\n this.makeStatement(new pyjslib_Tuple([this._context, sym, subj, obj]));\n } else {\n this.makeStatement(new pyjslib_Tuple([this._context, sym, obj, subj]));\n }\n }\n } catch (e) {\n if (e != StopIteration) {\n throw e;\n }\n }\n var j = this.skipSpace(str, i);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"EOF found in list of objects\");\n // removed by dead control flow\n\n }\n if (str.slice(i, i + 1) != \";\") {\n return i;\n }\n var i = i + 1;\n }\n }\n commaSeparatedList(str, j, res, ofUris) {\n /*\n return value: -1 bad syntax; >1 new position in str\n res has things found appended\n Used to use a final value of the function to be called, e.g. this.bareWord\n but passing the function didn't work fo js converion pyjs\n */\n\n var i = this.skipSpace(str, j);\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"EOF found expecting comma sep list\");\n // removed by dead control flow\n\n }\n if (str.charAt(i) == \".\") {\n return j;\n }\n if (ofUris) {\n var i = this.uri_ref2(str, i, res);\n } else {\n var i = this.bareWord(str, i, res);\n }\n if (i < 0) {\n return -1;\n }\n while (1) {\n var j = this.skipSpace(str, i);\n if (j < 0) {\n return j;\n }\n var ch = str.slice(j, j + 1);\n if (ch != \",\") {\n if (ch != \".\") {\n return -1;\n }\n return j;\n }\n if (ofUris) {\n var i = this.uri_ref2(str, j + 1, res);\n } else {\n var i = this.bareWord(str, j + 1, res);\n }\n if (i < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"bad list content\");\n // removed by dead control flow\n\n }\n }\n }\n objectList(str, i, res) {\n var i = this.object(str, i, res);\n if (i < 0) {\n return -1;\n }\n while (1) {\n var j = this.skipSpace(str, i);\n if (j < 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"EOF found after object\");\n // removed by dead control flow\n\n }\n if (str.slice(j, j + 1) != \",\") {\n return j;\n }\n var i = this.object(str, j + 1, res);\n if (i < 0) {\n return i;\n }\n }\n }\n checkDot(str, i) {\n var j = this.skipSpace(str, i);\n if (j < 0) {\n return j;\n }\n if (str.slice(j, j + 1) == \".\") {\n return j + 1;\n }\n if (str.slice(j, j + 1) == \"}\") {\n return j;\n }\n if (str.slice(j, j + 1) == \"]\") {\n return j;\n }\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"expected '.' or '}' or ']' at end of statement\");\n // removed by dead control flow\n\n }\n uri_ref2(str, i, res) {\n /*\n Generate uri from n3 representation.\n Note that the RDF convention of directly concatenating\n NS and local name is now used though I prefer inserting a '#'\n to make the namesapces look more like what XML folks expect.\n */\n\n var qn = new pyjslib_List([]);\n var j = this.qname(str, i, qn);\n if (j >= 0) {\n var pairFudge = qn[0];\n var pfx = pairFudge[0];\n var ln = pairFudge[1];\n if (pfx == null) {\n assertFudge(0, \"not used?\");\n var ns = this._baseURI + ADDED_HASH;\n } else {\n var ns = this._bindings[pfx];\n if (!ns) {\n if (pfx == \"_\") {\n res.push(this.anonymousNode(ln));\n return j;\n }\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"Prefix \" + pfx + \" not bound.\");\n }\n }\n var symb = this._store.sym(ns + ln);\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_1__.ArrayIndexOf)(this._variables, symb) >= 0) {\n res.push(this._variables[symb]);\n } else {\n res.push(symb);\n }\n return j;\n }\n var i = this.skipSpace(str, i);\n if (i < 0) {\n return -1;\n }\n if (str.charAt(i) == \"?\") {\n var v = new pyjslib_List([]);\n var j = this.variable(str, i, v);\n if (j > 0) {\n res.push(v[0]);\n return j;\n }\n return -1;\n } else if (str.charAt(i) == \"<\") {\n var i = i + 1;\n var st = i;\n while (i < pyjslib_len(str)) {\n if (str.charAt(i) == \">\") {\n var uref = str.slice(st, i);\n if (this._baseURI) {\n var uref = uripath_join(this._baseURI, uref);\n } else {\n assertFudge(uref.indexOf(\":\") >= 0, \"With no base URI, cannot deal with relative URIs\");\n }\n if (str.slice(i - 1, i) == \"#\" && !(pyjslib_slice(uref, -1, null) == \"#\")) {\n var uref = uref + \"#\";\n }\n var symb = this._store.sym(uref);\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_1__.ArrayIndexOf)(this._variables, symb) >= 0) {\n res.push(this._variables[symb]);\n } else {\n res.push(symb);\n }\n return i + 1;\n }\n var i = i + 1;\n }\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"unterminated URI reference\");\n } else if (this.keywordsSet) {\n var v = new pyjslib_List([]);\n var j = this.bareWord(str, i, v);\n if (j < 0) {\n return -1;\n }\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_1__.ArrayIndexOf)(this.keywords, v[0]) >= 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"Keyword \\\"\" + v[0] + \"\\\" not allowed here.\");\n }\n res.push(this._store.sym(this._bindings[\"\"] + v[0]));\n return j;\n } else {\n return -1;\n }\n }\n skipSpace(str, i) {\n /*\n Skip white space, newlines and comments.\n return -1 if EOF, else position of first non-ws character*/\n\n var whitespace = ' \\n\\r\\t\\f\\x0b\\xa0\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u200b\\u2028\\u2029\\u3000';\n for (var j = i ? i : 0; j < str.length; j++) {\n var ch = str.charAt(j);\n // console.log(\" skipspace j= \"+j + \" i= \" + i + \" n= \" + str.length);\n // console.log(\" skipspace ch <\" + ch + \">\");\n if (whitespace.indexOf(ch) < 0) {\n //not ws\n // console.log(\" skipspace 2 ch <\" + ch + \">\");\n if (str.charAt(j) === '#') {\n for (;; j++) {\n // console.log(\" skipspace2 j= \"+j + \" i= \" + i + \" n= \" + str.length);\n if (j === str.length) {\n return -1; // EOF\n }\n if (str.charAt(j) === '\\n') {\n this.lines = this.lines + 1;\n break;\n }\n }\n ;\n } else {\n // Not hash - something interesting\n // console.log(\" skipspace 3 ch <\" + ch + \">\");\n return j;\n }\n } else {\n // Whitespace\n // console.log(\" skipspace 5 ch <\" + ch + \">\");\n if (str.charAt(j) === '\\n') {\n this.lines = this.lines + 1;\n }\n }\n } // next j\n return -1; // EOF\n }\n variable(str, i, res) {\n /*\n ?abc -> variable(:abc)\n */\n\n var j = this.skipSpace(str, i);\n if (j < 0) {\n return -1;\n }\n if (str.slice(j, j + 1) != \"?\") {\n return -1;\n }\n var j = j + 1;\n var i = j;\n if (\"0123456789-\".indexOf(str.charAt(j)) >= 0) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"Varible name can't start with '\" + str.charAt(j) + \"s'\");\n // removed by dead control flow\n\n }\n while (i < pyjslib_len(str) && _notNameChars.indexOf(str.charAt(i)) < 0) {\n var i = i + 1;\n }\n if (this._parentContext == null) {\n throw BadSyntax(this._thisDoc, this.lines, str, j, \"Can't use ?xxx syntax for variable in outermost level: \" + str.slice(j - 1, i));\n }\n res.push(this._store.variable(str.slice(j, i)));\n return i;\n }\n bareWord(str, i, res) {\n /*\n abc -> :abc\n */\n\n var j = this.skipSpace(str, i);\n if (j < 0) {\n return -1;\n }\n var ch = str.charAt(j);\n if (\"0123456789-\".indexOf(ch) >= 0) {\n return -1;\n }\n if (_notNameChars.indexOf(ch) >= 0) {\n return -1;\n }\n var i = j;\n while (i < pyjslib_len(str)) {\n var c = str.charAt(i);\n if (c === '.') {\n if (dotTerminatesName(str, i)) {\n break; // treat as statement terminator, not part of name\n }\n // else: accept '.' as part of name\n } else if (_notNameChars.indexOf(c) >= 0) {\n // Other invalid characters terminate the name\n break;\n }\n var i = i + 1;\n }\n res.push(str.slice(j, i));\n return i;\n }\n qname(str, i, res) {\n /*\n xyz:def -> ('xyz', 'def')\n If not in keywords and keywordsSet: def -> ('', 'def')\n :def -> ('', 'def')\n */\n\n var i = this.skipSpace(str, i);\n if (i < 0) {\n return -1;\n }\n var c = str.charAt(i);\n if (\"0123456789-+\".indexOf(c) >= 0) {\n return -1;\n }\n if (_notNameChars.indexOf(c) < 0) {\n var ln = c;\n var i = i + 1;\n while (i < pyjslib_len(str)) {\n var c = str.charAt(i);\n if (c === '.') {\n if (dotTerminatesName(str, i)) {\n break; // dot ends the name here\n }\n } else if (_notNameChars.indexOf(c) >= 0) {\n break;\n }\n var ln = ln + c;\n var i = i + 1;\n }\n } else {\n var ln = \"\";\n }\n if (i < pyjslib_len(str) && str.charAt(i) == \":\") {\n var pfx = ln;\n var i = i + 1;\n var ln = \"\";\n while (i < pyjslib_len(str)) {\n var c = str.charAt(i);\n if (c === '.') {\n if (dotTerminatesName(str, i)) {\n break; // dot ends the name here\n }\n } else if (_notNameChars.indexOf(c) >= 0) {\n break;\n }\n var ln = ln + c;\n var i = i + 1;\n }\n res.push(new pyjslib_Tuple([pfx, ln]));\n return i;\n } else {\n if (ln && this.keywordsSet && (0,_utils__WEBPACK_IMPORTED_MODULE_1__.ArrayIndexOf)(this.keywords, ln) < 0) {\n res.push(new pyjslib_Tuple([\"\", ln]));\n return i;\n }\n return -1;\n }\n }\n object(str, i, res) {\n var j = this.subject(str, i, res);\n if (j >= 0) {\n return j;\n } else {\n var j = this.skipSpace(str, i);\n if (j < 0) {\n return -1;\n } else {\n var i = j;\n }\n var delim = null;\n let ch = str.charAt(i);\n if (ch == \"\\\"\" || ch == \"'\") {\n if (str.slice(i, i + 3 == ch + ch)) {\n delim = ch + ch + ch;\n } else {\n delim = ch;\n }\n var i = i + pyjslib_len(delim);\n var pairFudge = this.strconst(str, i, delim);\n var j = pairFudge[0];\n var s = pairFudge[1];\n res.push(this._store.literal(s));\n diag_progress(\"New string const \", s, j);\n return j;\n } else {\n return -1;\n }\n }\n }\n nodeOrLiteral(str, i, res) {\n var j = this.node(str, i, res);\n if (j >= 0) {\n return j;\n } else {\n var j = this.skipSpace(str, i);\n if (j < 0) {\n return -1;\n } else {\n var i = j;\n }\n var ch = str.charAt(i);\n if (\"-+0987654321\".indexOf(ch) >= 0) {\n datetime_syntax.lastIndex = 0;\n var m = datetime_syntax.exec(str.slice(i));\n if (m != null) {\n // j = ( i + datetime_syntax.lastIndex ) ;\n var val = m[0];\n j = i + val.length;\n if (val.indexOf(\"T\") >= 0) {\n res.push(this._store.literal(val, this._store.sym(DATETIME_DATATYPE)));\n } else {\n res.push(this._store.literal(val, this._store.sym(DATE_DATATYPE)));\n }\n } else {\n number_syntax.lastIndex = 0;\n var m = number_syntax.exec(str.slice(i));\n if (m == null) {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"Bad number or date syntax\");\n }\n j = i + number_syntax.lastIndex;\n var val = str.slice(i, j);\n if (val.indexOf(\"e\") >= 0) {\n res.push(this._store.literal(parseFloat(val), this._store.sym(FLOAT_DATATYPE)));\n } else if (str.slice(i, j).indexOf(\".\") >= 0) {\n res.push(this._store.literal(parseFloat(val), this._store.sym(DECIMAL_DATATYPE)));\n } else {\n res.push(this._store.literal(parseInt(val), this._store.sym(INTEGER_DATATYPE)));\n }\n }\n ;\n return j; // Where we have got up to\n }\n if (str.charAt(i) == \"\\\"\") {\n if (str.slice(i, i + 3) == \"\\\"\\\"\\\"\") {\n var delim = \"\\\"\\\"\\\"\";\n } else {\n var delim = \"\\\"\";\n }\n var i = i + pyjslib_len(delim);\n var dt = null;\n var pairFudge = this.strconst(str, i, delim);\n var j = pairFudge[0];\n var s = pairFudge[1];\n var lang = null;\n if (str.slice(j, j + 1) == \"@\") {\n langcode.lastIndex = 0;\n var m = langcode.exec(str.slice(j + 1));\n if (m == null) {\n throw BadSyntax(this._thisDoc, startline, str, i, \"Bad language code syntax on string literal, after @\");\n }\n var i = langcode.lastIndex + j + 1;\n var lang = str.slice(j + 1, i);\n var j = i;\n }\n if (str.slice(j, j + 2) == \"^^\") {\n var res2 = new pyjslib_List([]);\n var j = this.uri_ref2(str, j + 2, res2);\n var dt = res2[0];\n }\n res.push(this._store.literal(s, lang || dt));\n return j;\n } else {\n return -1;\n }\n }\n }\n strconst(str, i, delim) {\n /*\n parse an N3 string constant delimited by delim.\n return index, val\n */\n\n var j = i;\n var ustr = \"\";\n var startline = this.lines;\n while (j < pyjslib_len(str)) {\n var i = j + pyjslib_len(delim);\n if (str.slice(j, i) == delim) {\n return new pyjslib_Tuple([i, ustr]);\n }\n if (str.charAt(j) == \"\\\"\") {\n var ustr = ustr + \"\\\"\";\n var j = j + 1;\n continue;\n }\n interesting.lastIndex = 0;\n var m = interesting.exec(str.slice(j));\n if (!m) {\n throw BadSyntax(this._thisDoc, startline, str, j, \"Closing quote missing in string at ^ in \" + str.slice(j - 20, j) + \"^\" + str.slice(j, j + 20));\n }\n var i = j + interesting.lastIndex - 1;\n var ustr = ustr + str.slice(j, i);\n var ch = str.charAt(i);\n if (ch == \"\\\"\") {\n var j = i;\n continue;\n } else if (ch == \"\\r\") {\n var j = i + 1;\n continue;\n } else if (ch == \"\\n\") {\n if (delim == \"\\\"\") {\n throw BadSyntax(this._thisDoc, startline, str, i, \"newline found in string literal\");\n }\n this.lines = this.lines + 1;\n var ustr = ustr + ch;\n var j = i + 1;\n this.previousLine = this.startOfLine;\n this.startOfLine = j;\n } else if (ch == \"\\\\\") {\n var j = i + 1;\n var ch = str.slice(j, j + 1);\n if (!ch) {\n throw BadSyntax(this._thisDoc, startline, str, i, \"unterminated string literal (2)\");\n }\n var k = string_find(\"abfrtvn\\\\\\\"\", ch);\n if (k >= 0) {\n var uch = \"\\a\\b\\f\\r\\t\\v\\n\\\\\\\"\".charAt(k);\n var ustr = ustr + uch;\n var j = j + 1;\n } else if (ch == \"u\") {\n var pairFudge = this.uEscape(str, j + 1, startline);\n var j = pairFudge[0];\n var ch = pairFudge[1];\n var ustr = ustr + ch;\n } else if (ch == \"U\") {\n var pairFudge = this.UEscape(str, j + 1, startline);\n var j = pairFudge[0];\n var ch = pairFudge[1];\n var ustr = ustr + ch;\n } else {\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"bad escape\");\n }\n }\n }\n throw BadSyntax(this._thisDoc, this.lines, str, i, \"unterminated string literal\");\n }\n uEscape(str, i, startline) {\n var j = i;\n var count = 0;\n var value = 0;\n while (count < 4) {\n var chFudge = str.slice(j, j + 1);\n var ch = chFudge.toLowerCase();\n var j = j + 1;\n if (ch == \"\") {\n throw BadSyntax(this._thisDoc, startline, str, i, \"unterminated string literal(3)\");\n }\n var k = string_find(\"0123456789abcdef\", ch);\n if (k < 0) {\n throw BadSyntax(this._thisDoc, startline, str, i, \"bad string literal hex escape\");\n }\n var value = value * 16 + k;\n var count = count + 1;\n }\n var uch = String.fromCharCode(value);\n return new pyjslib_Tuple([j, uch]);\n }\n UEscape(str, i, startline) {\n var j = i;\n var count = 0;\n var value = \"\\\\U\";\n while (count < 8) {\n var chFudge = str.slice(j, j + 1);\n var ch = chFudge.toLowerCase();\n var j = j + 1;\n if (ch == \"\") {\n throw BadSyntax(this._thisDoc, startline, str, i, \"unterminated string literal(3)\");\n }\n var k = string_find(\"0123456789abcdef\", ch);\n if (k < 0) {\n throw BadSyntax(this._thisDoc, startline, str, i, \"bad string literal hex escape\");\n }\n var value = value + ch;\n var count = count + 1;\n }\n var uch = stringFromCharCode(\"0x\" + pyjslib_slice(value, 2, 10) - 0);\n return new pyjslib_Tuple([j, uch]);\n }\n}\nfunction OLD_BadSyntax(uri, lines, str, i, why) {\n return new __OLD_BadSyntax(uri, lines, str, i, why);\n}\nfunction __OLD_BadSyntax(uri, lines, str, i, why) {\n this._str = str.encode(\"utf-8\");\n this._str = str;\n this._i = i;\n this._why = why;\n this.lines = lines;\n this._uri = uri;\n}\n__OLD_BadSyntax.prototype.toString = function () {\n var str = this._str;\n var i = this._i;\n var st = 0;\n if (i > 60) {\n var pre = \"...\";\n var st = i - 60;\n } else {\n var pre = \"\";\n }\n if (pyjslib_len(str) - i > 60) {\n var post = \"...\";\n } else {\n var post = \"\";\n }\n return \"Line %i of <%s>: Bad syntax (%s) at ^ in:\\n\\\"%s%s^%s%s\\\"\" % new pyjslib_Tuple([this.lines + 1, this._uri, this._why, pre, str.slice(st, i), str.slice(i, i + 60), post]);\n};\nfunction BadSyntax(uri, lines, str, i, why) {\n let lineNo = lines + 1;\n let msg = \"Line \" + lineNo + \" of <\" + uri + \">: Bad syntax: \" + why + \"\\nat: \\\"\" + str.slice(i, i + 30) + \"\\\"\";\n let e = new SyntaxError(msg, uri, lineNo);\n e.lineNo = lineNo;\n e.characterInFile = i;\n e.syntaxProblem = why;\n return e;\n}\nfunction stripCR(str) {\n var res = \"\";\n var __ch = new pyjslib_Iterator(str);\n try {\n while (true) {\n var ch = __ch.next();\n if (ch != \"\\r\") {\n var res = res + ch;\n }\n }\n } catch (e) {\n if (e != StopIteration) {\n throw e;\n }\n }\n return res;\n}\nfunction dummyWrite(x) {}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/n3parser.js?\n}");
979
+
980
+ /***/ },
981
+
982
+ /***/ "./node_modules/rdflib/esm/named-node.js"
983
+ /*!***********************************************!*\
984
+ !*** ./node_modules/rdflib/esm/named-node.js ***!
985
+ \***********************************************/
986
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
987
+
988
+ "use strict";
989
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ NamedNode)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _class_order__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./class-order */ \"./node_modules/rdflib/esm/class-order.js\");\n/* harmony import */ var _node_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node-internal */ \"./node_modules/rdflib/esm/node-internal.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n/* harmony import */ var _utils_termValue__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/termValue */ \"./node_modules/rdflib/esm/utils/termValue.js\");\n/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils/terms */ \"./node_modules/rdflib/esm/utils/terms.js\");\n\n\n\n\n\n\n\n/**\n * A named (IRI) RDF node\n */\nclass NamedNode extends _node_internal__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * Create a named (IRI) RDF Node\n * @constructor\n * @param iri - The IRI for this node\n */\n constructor(iri) {\n super((0,_utils_termValue__WEBPACK_IMPORTED_MODULE_4__.termValue)(iri));\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"termType\", _types__WEBPACK_IMPORTED_MODULE_3__.NamedNodeTermType);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"classOrder\", _class_order__WEBPACK_IMPORTED_MODULE_1__[\"default\"].NamedNode);\n if (!this.value) {\n throw new Error('Missing IRI for NamedNode');\n }\n if (!this.value.includes(':')) {\n throw new Error('NamedNode IRI \"' + iri + '\" must be absolute.');\n }\n if (this.value.includes(' ')) {\n var message = 'Error: NamedNode IRI \"' + iri + '\" must not contain unencoded spaces.';\n throw new Error(message);\n }\n }\n\n /**\n * Returns an $rdf node for the containing directory, ending in slash.\n */\n dir() {\n var str = this.value.split('#')[0];\n var p = str.slice(0, -1).lastIndexOf('/');\n var q = str.indexOf('//');\n if (q >= 0 && p < q + 2 || p < 0) return null;\n return new NamedNode(str.slice(0, p + 1));\n }\n\n /**\n * Returns an NN for the whole web site, ending in slash.\n * Contrast with the \"origin\" which does NOT have a trailing slash\n */\n site() {\n var str = this.value.split('#')[0];\n var p = str.indexOf('//');\n if (p < 0) throw new Error('This URI does not have a web site part (origin)');\n var q = str.indexOf('/', p + 2);\n if (q < 0) {\n return new NamedNode(str.slice(0) + '/'); // Add slash to a bare origin\n } else {\n return new NamedNode(str.slice(0, q + 1));\n }\n }\n\n /**\n * Creates the fetchable named node for the document.\n * Removes everything from the # anchor tag.\n */\n doc() {\n if (this.value.indexOf('#') < 0) {\n return this;\n } else {\n return new NamedNode(this.value.split('#')[0]);\n }\n }\n\n /**\n * Returns the URI including <brackets>\n */\n toString() {\n return '<' + this.value + '>';\n }\n\n /** The local identifier with the document */\n id() {\n return this.value.split('#')[1];\n }\n\n /** Alias for value, favored by Tim */\n get uri() {\n return this.value;\n }\n set uri(uri) {\n this.value = uri;\n }\n\n /**\n * Creates a named node from the specified input value\n * @param value - An input value\n */\n static fromValue(value) {\n if (typeof value === 'undefined' || value === null) {\n return value;\n }\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_5__.isTerm)(value)) {\n return value;\n }\n return new NamedNode(value);\n }\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/named-node.js?\n}");
990
+
991
+ /***/ },
992
+
993
+ /***/ "./node_modules/rdflib/esm/namespace.js"
994
+ /*!**********************************************!*\
995
+ !*** ./node_modules/rdflib/esm/namespace.js ***!
996
+ \**********************************************/
997
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
998
+
999
+ "use strict";
1000
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Namespace)\n/* harmony export */ });\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n\n/**\n * Gets a namespace for the specified namespace's URI\n * @param nsuri - The URI for the namespace\n * @param [factory] - The factory for creating named nodes with\n */\nfunction Namespace(nsuri, factory) {\n const dataFactory = factory || {\n namedNode: value => new _named_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"](value)\n };\n return function (ln) {\n return dataFactory.namedNode(nsuri + (ln || ''));\n };\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/namespace.js?\n}");
1001
+
1002
+ /***/ },
1003
+
1004
+ /***/ "./node_modules/rdflib/esm/node-internal.js"
1005
+ /*!**************************************************!*\
1006
+ !*** ./node_modules/rdflib/esm/node-internal.js ***!
1007
+ \**************************************************/
1008
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1009
+
1010
+ "use strict";
1011
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Node)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n\n/**\n * The superclass of all RDF Statement objects, that is\n * NamedNode, Literal, BlankNode, etc.\n * Should not be instantiated directly.\n * Also called Term.\n * @link https://rdf.js.org/data-model-spec/#term-interface\n * @class Node\n */\nclass Node {\n constructor(value) {\n /** The type of node */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"termType\", void 0);\n /** The class order for this node */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"classOrder\", void 0);\n /** The node's value */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"value\", void 0);\n this.value = value;\n }\n\n /**\n * Creates the substituted node for this one, according to the specified bindings\n * @param bindings - Bindings of identifiers to nodes\n */\n substitute(bindings) {\n return this;\n }\n\n /**\n * Compares this node with another\n * @see {equals} to check if two nodes are equal\n * @param other - The other node\n */\n compareTerm(other) {\n if (this.classOrder < other.classOrder) {\n return -1;\n }\n if (this.classOrder > other.classOrder) {\n return +1;\n }\n if (this.value < other.value) {\n return -1;\n }\n if (this.value > other.value) {\n return +1;\n }\n return 0;\n }\n\n /**\n * Compares whether the two nodes are equal\n * @param other The other node\n */\n equals(other) {\n if (!other) {\n return false;\n }\n return this.termType === other.termType && this.value === other.value;\n }\n\n /**\n * Creates a hash for this node\n * @deprecated use {rdfFactory.id} instead if possible\n */\n hashString() {\n return this.toCanonical();\n }\n\n /**\n * Compares whether this node is the same as the other one\n * @param other - Another node\n */\n sameTerm(other) {\n return this.equals(other);\n }\n\n /**\n * Creates a canonical string representation of this node\n */\n toCanonical() {\n return this.toNT();\n }\n\n /**\n * Creates a n-triples string representation of this node\n */\n toNT() {\n return this.toString();\n }\n\n /**\n * Creates a n-quads string representation of this node\n */\n toNQ() {\n return this.toNT();\n }\n\n /**\n * Creates a string representation of this node\n */\n toString() {\n throw new Error('Node.toString() is abstract - see the subclasses instead');\n }\n}\n// Specified in './node.ts' to prevent circular dependency\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Node, \"fromValue\", void 0);\n// Specified in './node.ts' to prevent circular dependency\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Node, \"toJS\", void 0);\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/node-internal.js?\n}");
1012
+
1013
+ /***/ },
1014
+
1015
+ /***/ "./node_modules/rdflib/esm/node.js"
1016
+ /*!*****************************************!*\
1017
+ !*** ./node_modules/rdflib/esm/node.js ***!
1018
+ \*****************************************/
1019
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1020
+
1021
+ "use strict";
1022
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _collection__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./collection */ \"./node_modules/rdflib/esm/collection.js\");\n/* harmony import */ var _node_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node-internal */ \"./node_modules/rdflib/esm/node-internal.js\");\n/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./namespace */ \"./node_modules/rdflib/esm/namespace.js\");\n/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/terms */ \"./node_modules/rdflib/esm/utils/terms.js\");\n// This file attaches all functionality to Node\n// that would otherwise require circular dependencies.\n\n\n\n\n/**\n * Creates an RDF Node from a native javascript value.\n * RDF Nodes are returned unchanged, undefined returned as itself.\n * @method fromValue\n * @static\n * @param value {Node|Date|String|Number|Boolean|Undefined}\n * @return {Node|Collection}\n */\n_node_internal__WEBPACK_IMPORTED_MODULE_1__[\"default\"].fromValue = _collection__WEBPACK_IMPORTED_MODULE_0__.fromValue;\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (_node_internal__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\nconst ns = {\n xsd: (0,_namespace__WEBPACK_IMPORTED_MODULE_2__[\"default\"])('http://www.w3.org/2001/XMLSchema#')\n};\n\n/**\n * Gets the javascript object equivalent to a node\n * @param term The RDF node\n */\n_node_internal__WEBPACK_IMPORTED_MODULE_1__[\"default\"].toJS = function (term) {\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_3__.isCollection)(term)) {\n return term.elements.map(_node_internal__WEBPACK_IMPORTED_MODULE_1__[\"default\"].toJS); // Array node (not standard RDFJS)\n }\n if (!(0,_utils_terms__WEBPACK_IMPORTED_MODULE_3__.isLiteral)(term)) return term;\n if (term.datatype.equals(ns.xsd('boolean'))) {\n return term.value === '1' || term.value === 'true';\n }\n if (term.datatype.equals(ns.xsd('dateTime')) || term.datatype.equals(ns.xsd('date'))) {\n return new Date(term.value);\n }\n if (term.datatype.equals(ns.xsd('integer')) || term.datatype.equals(ns.xsd('float')) || term.datatype.equals(ns.xsd('decimal'))) {\n return Number(term.value);\n }\n return term.value;\n};\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/node.js?\n}");
1023
+
1024
+ /***/ },
1025
+
1026
+ /***/ "./node_modules/rdflib/esm/parse.js"
1027
+ /*!******************************************!*\
1028
+ !*** ./node_modules/rdflib/esm/parse.js ***!
1029
+ \******************************************/
1030
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1031
+
1032
+ "use strict";
1033
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ parse)\n/* harmony export */ });\n/* harmony import */ var _factories_extended_term_factory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./factories/extended-term-factory */ \"./node_modules/rdflib/esm/factories/extended-term-factory.js\");\n/* harmony import */ var _jsonldparser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jsonldparser */ \"./node_modules/rdflib/esm/jsonldparser.js\");\n/* harmony import */ var n3__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! n3 */ \"./node_modules/rdflib/node_modules/n3/src/N3Parser.js\");\n/* harmony import */ var _n3parser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./n3parser */ \"./node_modules/rdflib/esm/n3parser.js\");\n/* harmony import */ var _rdfaparser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./rdfaparser */ \"./node_modules/rdflib/esm/rdfaparser.js\");\n/* harmony import */ var _rdfxmlparser__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rdfxmlparser */ \"./node_modules/rdflib/esm/rdfxmlparser.js\");\n/* harmony import */ var _patch_parser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./patch-parser */ \"./node_modules/rdflib/esm/patch-parser.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils-js */ \"./node_modules/rdflib/esm/utils-js.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n\n\n// @ts-ignore is this injected?\n // @@ Goal: remove this dependency\n\n\n\n\n\n\n/**\n * Parse a string and put the result into the graph kb.\n * Normal method is sync.\n * Unfortunately jsdonld is currently written to need to be called async.\n * If you are parsing JSON-LD and want to know when and whether it succeeded, you need to use the callback param.\n * @param str - The input string to parse\n * @param kb - The store to use\n * @param base - The base URI to use\n * @param contentType - The MIME content type string for the input - defaults to text/turtle\n * @param [callback] - The callback to call when the data has been loaded\n */\nfunction parse(str, kb, base, contentType = 'text/turtle', callback) {\n contentType = contentType || _types__WEBPACK_IMPORTED_MODULE_8__.TurtleContentType;\n contentType = contentType.split(';')[0];\n try {\n if (contentType === _types__WEBPACK_IMPORTED_MODULE_8__.N3ContentType || contentType === _types__WEBPACK_IMPORTED_MODULE_8__.TurtleContentType) {\n var p = (0,_n3parser__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(kb, kb, base, base, null, null, '', null);\n p.loadBuf(str);\n executeCallback();\n } else if (contentType === _types__WEBPACK_IMPORTED_MODULE_8__.RDFXMLContentType) {\n var parser = new _rdfxmlparser__WEBPACK_IMPORTED_MODULE_5__[\"default\"](kb);\n parser.parse(_utils_js__WEBPACK_IMPORTED_MODULE_7__.parseXML(str), base, kb.sym(base));\n executeCallback();\n } else if (contentType === _types__WEBPACK_IMPORTED_MODULE_8__.XHTMLContentType) {\n (0,_rdfaparser__WEBPACK_IMPORTED_MODULE_4__.parseRDFaDOM)(_utils_js__WEBPACK_IMPORTED_MODULE_7__.parseXML(str, {\n contentType: _types__WEBPACK_IMPORTED_MODULE_8__.XHTMLContentType\n }), kb, base);\n executeCallback();\n } else if (contentType === _types__WEBPACK_IMPORTED_MODULE_8__.HTMLContentType) {\n (0,_rdfaparser__WEBPACK_IMPORTED_MODULE_4__.parseRDFaDOM)(_utils_js__WEBPACK_IMPORTED_MODULE_7__.parseXML(str, {\n contentType: _types__WEBPACK_IMPORTED_MODULE_8__.HTMLContentType\n }), kb, base);\n executeCallback();\n } else if (contentType === _types__WEBPACK_IMPORTED_MODULE_8__.SPARQLUpdateContentType || contentType === _types__WEBPACK_IMPORTED_MODULE_8__.SPARQLUpdateSingleMatchContentType) {\n // @@ we handle a subset\n (0,_patch_parser__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(str, kb, base);\n executeCallback();\n } else if (contentType === _types__WEBPACK_IMPORTED_MODULE_8__.JSONLDContentType) {\n // since we do not await the promise here, rejections will not be covered by the surrounding try catch\n // we do not use await, because parse() should stay sync\n // so, to not lose the async error, we need to catch the rejection and call the error callback here too\n (0,_jsonldparser__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(str, kb, base).then(executeCallback).catch(executeErrorCallback);\n } else if (contentType === _types__WEBPACK_IMPORTED_MODULE_8__.NQuadsContentType || contentType === _types__WEBPACK_IMPORTED_MODULE_8__.NQuadsAltContentType) {\n var n3Parser = new n3__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n factory: _factories_extended_term_factory__WEBPACK_IMPORTED_MODULE_0__[\"default\"]\n });\n nquadCallback(null, str);\n } else if (contentType === undefined) {\n throw new Error(\"contentType is undefined\");\n } else {\n throw new Error(\"Don't know how to parse \" + contentType + ' yet');\n }\n } catch (e) {\n // @ts-ignore\n executeErrorCallback(e);\n }\n parse.handled = {\n 'text/n3': true,\n 'text/turtle': true,\n 'application/rdf+xml': true,\n 'application/xhtml+xml': true,\n 'text/html': true,\n 'application/sparql-update': true,\n 'application/sparql-update-single-match': true,\n 'application/ld+json': true,\n 'application/nquads': true,\n 'application/n-quads': true\n };\n function executeCallback() {\n if (callback) {\n callback(null, kb);\n } else {\n return;\n }\n }\n function executeErrorCallback(e) {\n if (\n // TODO: Always true, what is the right behavior\n contentType !== _types__WEBPACK_IMPORTED_MODULE_8__.JSONLDContentType ||\n // @ts-ignore always true?\n contentType !== _types__WEBPACK_IMPORTED_MODULE_8__.NQuadsContentType ||\n // @ts-ignore always true?\n contentType !== _types__WEBPACK_IMPORTED_MODULE_8__.NQuadsAltContentType) {\n if (callback) {\n callback(e, kb);\n } else {\n let e2 = new Error('' + e + ' while trying to parse <' + base + '> as ' + contentType);\n //@ts-ignore .cause is not a default error property\n e2.cause = e;\n throw e2;\n }\n }\n }\n /*\n function setJsonLdBase (doc, base) {\n if (doc instanceof Array) {\n return\n }\n if (!('@context' in doc)) {\n doc['@context'] = {}\n }\n doc['@context']['@base'] = base\n }\n */\n function nquadCallback(err, nquads) {\n if (err) {\n callback(err, kb);\n }\n try {\n n3Parser.parse(nquads, tripleCallback);\n } catch (err) {\n callback(err, kb);\n }\n }\n function tripleCallback(err, triple) {\n if (triple) {\n kb.add(triple.subject, triple.predicate, triple.object, triple.graph);\n } else {\n callback(err, kb);\n }\n }\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/parse.js?\n}");
1034
+
1035
+ /***/ },
1036
+
1037
+ /***/ "./node_modules/rdflib/esm/patch-parser.js"
1038
+ /*!*************************************************!*\
1039
+ !*** ./node_modules/rdflib/esm/patch-parser.js ***!
1040
+ \*************************************************/
1041
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1042
+
1043
+ "use strict";
1044
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ sparqlUpdateParser)\n/* harmony export */ });\n/* harmony import */ var _n3parser__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./n3parser */ \"./node_modules/rdflib/esm/n3parser.js\");\n/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./namespace */ \"./node_modules/rdflib/esm/namespace.js\");\n// Parse a simple SPARL-Update subset syntax for patches.\n//\n// This parses\n// WHERE {xxx} DELETE {yyy} INSERT DATA {zzz}\n// (not necessarily in that order)\n// as though it were the n3\n// <#query> patch:where {xxx}; patch:delete {yyy}; patch:insert {zzz}.\n\n\nfunction sparqlUpdateParser(str, kb, base) {\n var i, j, k;\n var keywords = ['INSERT', 'DELETE', 'WHERE'];\n var SQNS = (0,_namespace__WEBPACK_IMPORTED_MODULE_1__[\"default\"])('http://www.w3.org/ns/pim/patch#');\n var p = (0,_n3parser__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(kb, kb, base, base, null, null, '', null);\n var clauses = {};\n var badSyntax = function (uri, lines, str, i, why) {\n return 'Line ' + (lines + 1) + ' of <' + uri + '>: Bad syntax:\\n ' + why + '\\n at: \"' + str.slice(i, i + 30) + '\"';\n };\n\n // var check = function (next, last, message) {\n // if (next < 0) {\n // throw badSyntax(p._thisDoc, p.lines, str, j, last, message)\n // }\n // return next\n // }\n i = 0;\n var query = kb.sym(base + '#query'); // Invent a URI for the query\n clauses['query'] = query; // A way of accessing it in its N3 model.\n\n while (true) {\n // console.log(\"A Now at i = \" + i)\n j = p.skipSpace(str, i);\n if (j < 0) {\n return clauses;\n }\n // console.log(\"B After space at j= \" + j)\n if (str[j] === ';') {\n i = p.skipSpace(str, j + 1);\n if (i < 0) {\n return clauses; // Allow end in a\n }\n j = i;\n }\n var found = false;\n for (k = 0; k < keywords.length; k++) {\n var key = keywords[k];\n if (str.slice(j, j + key.length) === key) {\n i = p.skipSpace(str, j + key.length);\n if (i < 0) {\n throw badSyntax(p._thisDoc, p.lines, str, j + key.length, 'found EOF, needed {...} after ' + key);\n }\n if ((key === 'INSERT' || key === 'DELETE') && str.slice(i, i + 4) === 'DATA') {\n // Some wanted 'DATA'. Whatever\n j = p.skipSpace(str, i + 4);\n if (j < 0) {\n throw badSyntax(p._thisDoc, p.lines, str, i + 4, 'needed {...} after INSERT DATA ' + key);\n }\n i = j;\n }\n var res2 = [];\n j = p.node(str, i, res2); // Parse all the complexity of the clause\n\n if (j < 0) {\n throw badSyntax(p._thisDoc, p.lines, str, i, 'bad syntax or EOF in {...} after ' + key);\n }\n clauses[key.toLowerCase()] = res2[0];\n kb.add(query, SQNS(key.toLowerCase()), res2[0]); // , kb.sym(base)\n // key is the keyword and res2 has the contents\n found = true;\n i = j;\n }\n }\n if (!found && str.slice(j, j + 7) === '@prefix') {\n i = p.directive(str, j);\n if (i < 0) {\n throw badSyntax(p._thisDoc, p.lines, str, i, 'bad syntax or EOF after @prefix ');\n }\n // console.log(\"P before dot i= \" + i)\n i = p.checkDot(str, i);\n // console.log(\"Q after dot i= \" + i)\n found = true;\n }\n if (!found) {\n // console.log(\"Bad syntax \" + j)\n throw badSyntax(p._thisDoc, p.lines, str, j, \"Unknown syntax at start of statememt: '\" + str.slice(j).slice(0, 20) + \"'\");\n }\n } // while\n // return clauses\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/patch-parser.js?\n}");
1045
+
1046
+ /***/ },
1047
+
1048
+ /***/ "./node_modules/rdflib/esm/query-to-sparql.js"
1049
+ /*!****************************************************!*\
1050
+ !*** ./node_modules/rdflib/esm/query-to-sparql.js ***!
1051
+ \****************************************************/
1052
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1053
+
1054
+ "use strict";
1055
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ queryToSPARQL)\n/* harmony export */ });\n/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./log */ \"./node_modules/rdflib/esm/log.js\");\n\nfunction queryToSPARQL(query) {\n var indent = 0;\n function getSelect(query) {\n var str = addIndent() + 'SELECT ';\n for (var i = 0; i < query.vars.length; i++) {\n str += query.vars[i] + ' ';\n }\n str += '\\n';\n return str;\n }\n function getPattern(pat) {\n var str = '';\n var st = pat.statements;\n for (var x in st) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debug('Found statement: ' + st);\n str += addIndent() + st[x] + '\\n';\n }\n return str;\n }\n function getConstraints(pat) {\n var str = '';\n for (var v in pat.constraints) {\n var foo = pat.constraints[v];\n str += addIndent() + 'FILTER ( ' + foo.describe(v) + ' ) ' + '\\n';\n }\n return str;\n }\n function getOptionals(pat) {\n var str = '';\n for (var x = 0; x < pat.optional.length; x++) {\n // alert(pat.optional.termType)\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debug('Found optional query');\n str += addIndent() + 'OPTIONAL { ' + '\\n';\n indent++;\n str += getPattern(pat.optional[x]);\n str += getConstraints(pat.optional[x]);\n str += getOptionals(pat.optional[x]);\n indent--;\n str += addIndent() + '}' + '\\n';\n }\n return str;\n }\n function getWhere(pat) {\n var str = addIndent() + 'WHERE \\n' + '{ \\n';\n indent++;\n str += getPattern(pat);\n str += getConstraints(pat);\n str += getOptionals(pat);\n indent--;\n str += '}';\n return str;\n }\n function addIndent() {\n var str = '';\n for (var i = 0; i < indent; i++) {\n str += ' ';\n }\n return str;\n }\n function getSPARQL(query) {\n return getSelect(query) + getWhere(query.pat);\n }\n return getSPARQL(query);\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/query-to-sparql.js?\n}");
1056
+
1057
+ /***/ },
1058
+
1059
+ /***/ "./node_modules/rdflib/esm/query.js"
1060
+ /*!******************************************!*\
1061
+ !*** ./node_modules/rdflib/esm/query.js ***!
1062
+ \******************************************/
1063
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1064
+
1065
+ "use strict";
1066
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Query: () => (/* binding */ Query),\n/* harmony export */ indexedFormulaQuery: () => (/* binding */ indexedFormulaQuery)\n/* harmony export */ });\n/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./store */ \"./node_modules/rdflib/esm/store.js\");\n/* harmony import */ var _utils_default_graph_uri__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/default-graph-uri */ \"./node_modules/rdflib/esm/utils/default-graph-uri.js\");\n/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./log */ \"./node_modules/rdflib/esm/log.js\");\n/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./uri */ \"./node_modules/rdflib/esm/uri.js\");\n// Matching a formula against another formula\n// Assync as well as Synchronously\n//\n// W3C open source licence 2005.\n//\n// This builds on term.js, match.js (and identity.js?)\n// to allow a query of a formula.\n//\n// Here we introduce for the first time a subclass of term: variable.\n//\n// SVN ID: $Id: query.js 25116 2008-11-15 16:13:48Z timbl $\n\n// Variable\n//\n// Compare with BlankNode. They are similar, but a variable\n// stands for something whose value is to be returned.\n// Also, users name variables and want the same name back when stuff is printed\n/* jsl:option explicit */ // Turn on JavaScriptLint variable declaration checking\n\n\n\n\n\n\n/**\n * Query class, for tracking queries the user has in the UI.\n */\nclass Query {\n constructor(name, id) {\n this.pat = new _store__WEBPACK_IMPORTED_MODULE_0__[\"default\"](); // The pattern to search for\n this.vars = []; // Used by UI code but not in query.js\n // this.orderBy = [] // Not used yet\n this.name = name;\n this.id = id;\n }\n}\n\n/**\n * This function will match a pattern to the current Store\n *\n * The callback function is called whenever a match is found\n * When fetcher is supplied this will be called to load from the web\n * any new nodes as they are discovered. This will cause the query to traverse the\n * graph of linked data, sometimes called \"Link Following Query\"\n *\n * @param myQuery - a knowledgebase containing a pattern to use as query\n * @param callback - whenever the pattern in myQuery is met this is called with\n * the new bindings as parameter\n * @param fetcher? - If and only if, you want link following, give a fetcher\n * which has been created for the quadstore being queried.\n * @param onDone - callback when query finished\n */\nfunction indexedFormulaQuery(myQuery, callback, fetcher, onDone) {\n /** Debug strings\n */\n function bindingDebug(b) {\n var str = '';\n var v;\n for (v in b) {\n if (b.hasOwnProperty(v)) {\n str += ' ' + v + ' -> ' + b[v];\n }\n }\n return str;\n }\n function bindingsDebug(nbs) {\n var str = 'Bindings: ';\n var i;\n var n = nbs.length;\n for (i = 0; i < n; i++) {\n str += bindingDebug(nbs[i][0]) + ';\\n\\t';\n }\n return str;\n } // bindingsDebug\n\n /** Unification\n *\n * Unification finds all bindings such that when the binding is applied\n * to one term it is equal to the other.\n * @returns {Arrray}- a list of bindings, where a binding is an associative array\n * mapping variuable to value.\n */\n function unifyTerm(self, other, bindings, formula) {\n var actual = bindings[self];\n if (actual === undefined) {\n // Not mapped\n if (self.isVar) {\n var b = [];\n b[self] = other;\n return [[b, null]]; // Match\n }\n actual = self;\n }\n if (!actual.complexType) {\n if (formula.redirections[actual]) {\n actual = formula.redirections[actual];\n }\n if (formula.redirections[other]) {\n other = formula.redirections[other];\n }\n if (actual.equals(other) || actual.uri && actual.uri === _utils_default_graph_uri__WEBPACK_IMPORTED_MODULE_1__.defaultGraphURI) {\n // Used to mean 'any graph' in a query\n return [[[], null]];\n }\n return [];\n }\n if (self instanceof Array) {\n if (!(other instanceof Array)) {\n return [];\n }\n return unifyContents(self, other, bindings);\n }\n throw new Error('query.js: oops - code not written yet');\n // return undefined; // for lint - no jslint objects to unreachables\n // return actual.unifyContents(other, bindings)\n } // unifyTerm\n\n function unifyContents(self, other, bindings, formula) {\n var nbs2;\n if (self.length !== other.length) {\n return []; // no way\n }\n if (!self.length) {\n return [[[], null]]; // Success\n }\n var nbs = unifyTerm(self[0], other[0], bindings, formula);\n if (nbs.length === 0) {\n return nbs;\n }\n var res = [];\n var i;\n var n = nbs.length;\n var nb;\n var j;\n var m;\n var v;\n var nb2;\n var bindings2;\n for (i = 0; i < n; i++) {\n // for each possibility from the first term\n nb = nbs[i][0]; // new bindings\n bindings2 = [];\n for (v in nb) {\n if (nb.hasOwnProperty(v)) {\n bindings2[v] = nb[v]; // copy\n }\n }\n for (v in bindings) {\n if (bindings.hasOwnProperty(v)) {\n bindings2[v] = bindings[v]; // copy\n }\n }\n nbs2 = unifyContents(self.slice(1), other.slice(1), bindings2, formula);\n m = nbs2.length;\n for (j = 0; j < m; j++) {\n nb2 = nbs2[j][0]; // @@@@ no idea whether this is used or right\n for (v in nb) {\n if (nb.hasOwnProperty(v)) {\n nb2[v] = nb[v];\n }\n }\n res.push([nb2, null]);\n }\n }\n return res;\n } // unifyContents\n\n // Matching\n //\n // Matching finds all bindings such that when the binding is applied\n // to one term it is equal to the other term. We only match formulae.\n\n /** if x is not in the bindings array, return the var; otherwise, return the bindings **/\n function bind(x, binding) {\n var y = binding[x];\n if (y === undefined) {\n return x;\n }\n return y;\n }\n\n // When there are OPTIONAL clauses, we must return bindings without them if none of them\n // succeed. However, if any of them do succeed, we should not. (This is what branchCount()\n // tracked. The problem currently is (2011/7) that when several optionals exist, and they\n // all match, multiple sets of bindings are returned, each with one optional filled in.)\n\n function union(a, b) {\n var c = {};\n var x;\n for (x in a) {\n if (a.hasOwnProperty(x)) {\n c[x] = a[x];\n }\n }\n for (x in b) {\n if (b.hasOwnProperty(x)) {\n c[x] = b[x];\n }\n }\n return c;\n }\n function OptionalBranchJunction(originalCallback, trunkBindings) {\n this.trunkBindings = trunkBindings;\n this.originalCallback = originalCallback;\n this.branches = [];\n // this.results = []; // result[i] is an array of bindings for branch i\n // this.done = {}; // done[i] means all/any results are in for branch i\n // this.count = {}\n return this;\n }\n OptionalBranchJunction.prototype.checkAllDone = function () {\n var i;\n for (i = 0; i < this.branches.length; i++) {\n if (!this.branches[i].done) {\n return;\n }\n }\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug('OPTIONAL BIDNINGS ALL DONE:');\n this.doCallBacks(this.branches.length - 1, this.trunkBindings);\n };\n // Recrursively generate the cross product of the bindings\n OptionalBranchJunction.prototype.doCallBacks = function (b, bindings) {\n var j;\n if (b < 0) {\n return this.originalCallback(bindings);\n }\n for (j = 0; j < this.branches[b].results.length; j++) {\n this.doCallBacks(b - 1, union(bindings, this.branches[b].results[j]));\n }\n };\n\n // A mandatory branch is the normal one, where callbacks\n // are made immediately and no junction is needed.\n // Might be useful for onFinsihed callback for query API.\n function MandatoryBranch(callback, onDone) {\n this.count = 0;\n this.success = false;\n this.done = false;\n // this.results = []\n this.callback = callback;\n this.onDone = onDone;\n // this.junction = junction\n // junction.branches.push(this)\n return this;\n }\n MandatoryBranch.prototype.reportMatch = function (bindings) {\n // log.error(\"@@@@ query.js 1\"); // @@\n this.callback(bindings);\n this.success = true;\n };\n MandatoryBranch.prototype.reportDone = function () {\n this.done = true;\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].info('Mandatory query branch finished.***');\n if (this.onDone !== undefined) {\n this.onDone();\n }\n };\n\n // An optional branch hoards its results.\n var OptionalBranch = function (junction) {\n this.count = 0;\n this.done = false;\n this.results = [];\n this.junction = junction;\n junction.branches.push(this);\n return this;\n };\n OptionalBranch.prototype.reportMatch = function (bindings) {\n this.results.push(bindings);\n };\n OptionalBranch.prototype.reportDone = function () {\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug('Optional branch finished - results.length = ' + this.results.length);\n if (this.results.length === 0) {\n // This is what optional means: if no hits,\n this.results.push({}); // mimic success, but with no bindings\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug(\"Optional branch FAILED - that's OK.\");\n }\n this.done = true;\n this.junction.checkAllDone();\n };\n\n /** prepare -- sets the index of the item to the possible matches\n * @param f - formula\n * @param item - an Statement, possibly w/ vars in it\n * @param bindings - Bindings so far\n * @returns false if the query fails -- there are no items that match\n */\n function prepare(f, item, bindings) {\n var terms, termIndex, i, ind;\n item.nvars = 0;\n item.index = null;\n // if (!f.statements) log.warn(\"@@@ prepare: f is \"+f)\n // log.debug(\"Prepare: f has \"+ f.statements.length)\n // log.debug(\"Prepare: Kb size \"+f.statements.length+\" Preparing \"+item)\n\n terms = [item.subject, item.predicate, item.object, item.why];\n ind = [f.subjectIndex, f.predicateIndex, f.objectIndex, f.whyIndex];\n for (i = 0; i < 4; i++) {\n let t = terms[i];\n // console.log(\" Prepare (\" + t + \") \"+(t in bindings))\n if (t.uri && t.uri === _utils_default_graph_uri__WEBPACK_IMPORTED_MODULE_1__.defaultGraphURI) {// chrome:session\n // console.log(' query: Ignoring slot ' + i)\n } else if (t.isVar && !(bindings[t] !== undefined)) {\n item.nvars++;\n } else {\n t = bind(terms[i], bindings); // returns the RDF binding if bound, otherwise itself\n // if (terms[i]!=bind(terms[i],bindings) alert(\"Term: \"+terms[i]+\"Binding: \"+bind(terms[i], bindings))\n if (f.redirections[f.id(t)]) {\n t = f.redirections[f.id(t)]; // redirect\n }\n termIndex = ind[i][f.id(t)];\n if (!termIndex) {\n item.index = [];\n return false; // Query line cannot match\n }\n if (item.index === null || item.index.length > termIndex.length) {\n // Find smallest index\n item.index = termIndex;\n }\n }\n }\n if (item.index === null) {\n // All 4 are variables?\n item.index = f.statements;\n }\n return true;\n } // prepare\n\n /** sorting function -- negative if self is easier **/\n // We always prefer to start with a URI to be able to browse a graph\n // this is why we put off items with more variables till later.\n function easiestQuery(self, other) {\n if (self.nvars !== other.nvars) {\n return self.nvars - other.nvars;\n }\n return self.index.length - other.index.length;\n }\n var matchIndex = 0; // index\n /** matches a pattern formula against the knowledge base, e.g. to find matches for table-view\n *\n * @param f - knowledge base formula\n * @param g - pattern formula (may have vars)\n * @param bindingsSoFar - bindings accumulated in matching to date\n * @param level - spaces to indent stuff also lets you know what level of recursion you're at\n * @param fetcher - function (term, requestedBy) If you want link following\n * @param localCallback - function(bindings, pattern, branch) called on sucess\n * @returns nothing\n *\n * Will fetch linked data from the web iff the knowledge base an associated source fetcher (f.fetcher)\n ***/\n var match = function (f, g, bindingsSoFar, level, fetcher, localCallback, branch) {\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug('Match begins, Branch count now: ' + branch.count + ' for ' + branch.pattern_debug);\n\n // log.debug(\"match: f has \"+f.statements.length+\", g has \"+g.statements.length)\n var pattern = g.statements;\n if (pattern.length === 0) {\n // when it's satisfied all the pattern triples\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug('FOUND MATCH WITH BINDINGS:' + bindingDebug(bindingsSoFar));\n if (g.optional.length === 0) {\n branch.reportMatch(bindingsSoFar);\n } else {\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug('OPTIONAL: ' + g.optional);\n var junction = new OptionalBranchJunction(callback, bindingsSoFar); // @@ won't work with nested optionals? nest callbacks\n var br = [];\n var b;\n for (b = 0; b < g.optional.length; b++) {\n br[b] = new OptionalBranch(junction); // Allocate branches to prevent premature ending\n br[b].pattern_debug = g.optional[b]; // for diagnotics only\n }\n for (b = 0; b < g.optional.length; b++) {\n br[b].count = br[b].count + 1; // Count how many matches we have yet to complete\n match(f, g.optional[b], bindingsSoFar, '', fetcher, callback, br[b]);\n }\n }\n branch.count--;\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug('Match ends -- success , Branch count now: ' + branch.count + ' for ' + branch.pattern_debug);\n return; // Success\n }\n var item;\n var i;\n var n = pattern.length;\n // log.debug(level + \"Match \"+n+\" left, bs so far:\"+bindingDebug(bindingsSoFar))\n\n // Follow links from variables in query\n if (fetcher) {\n // Fetcher is used to fetch URIs, function first term is a URI term, second is the requester\n var id = 'match' + matchIndex++;\n var fetchResource = function (requestedTerm, id) {\n var docuri = requestedTerm.uri.split('#')[0];\n fetcher.nowOrWhenFetched(docuri, undefined, function (ok, body, xhr) {\n if (!ok) {\n console.log('Error following link to <' + requestedTerm.uri + '> in query: ' + body);\n }\n match(f, g, bindingsSoFar, level, fetcher,\n // match not match2 to look up any others necessary.\n localCallback, branch);\n });\n };\n for (i = 0; i < n; i++) {\n item = pattern[i]; // for each of the triples in the query\n if (bindingsSoFar[item.subject] !== undefined && bindingsSoFar[item.subject].uri && fetcher && fetcher.getState((0,_uri__WEBPACK_IMPORTED_MODULE_3__.docpart)(bindingsSoFar[item.subject].uri)) === 'unrequested') {\n // fetch the subject info and return to id\n fetchResource(bindingsSoFar[item.subject], id);\n return; // only look up one per line this time, but we will come back again though match\n }\n if (bindingsSoFar[item.object] !== undefined && bindingsSoFar[item.object].uri && fetcher && fetcher.getState((0,_uri__WEBPACK_IMPORTED_MODULE_3__.docpart)(bindingsSoFar[item.object].uri)) === 'unrequested') {\n fetchResource(bindingsSoFar[item.object], id);\n return;\n }\n }\n } // if fetcher\n match2(f, g, bindingsSoFar, level, fetcher, localCallback, branch);\n }; // match\n\n var constraintsSatisfied = function (bindings, constraints) {\n var res = true;\n var x;\n var test;\n for (x in bindings) {\n if (bindings.hasOwnProperty(x)) {\n if (constraints[x]) {\n test = constraints[x].test;\n if (test && !test(bindings[x])) {\n res = false;\n }\n }\n }\n }\n return res;\n };\n\n /** match2 -- stuff after the fetch **/\n var match2 = function (f, g, bindingsSoFar, level, fetcher, callback, branch) {\n // post fetch\n var pattern = g.statements;\n var n = pattern.length;\n var i;\n var k;\n var nk;\n var v;\n var bindings2;\n var newBindings1;\n var item;\n for (i = 0; i < n; i++) {\n // For each statement left in the query, run prepare\n item = pattern[i];\n // log.info('match2: item=' + item + ', bindingsSoFar=' + bindingDebug(bindingsSoFar))\n prepare(f, item, bindingsSoFar);\n // if (item.index) console.log(' item.index.length ' + item.index.length)\n }\n pattern.sort(easiestQuery);\n item = pattern[0];\n // log.debug(\"Sorted pattern:\\n\"+pattern)\n var rest = f.formula();\n rest.optional = g.optional;\n rest.constraints = g.constraints;\n rest.statements = pattern.slice(1); // No indexes: we will not query g.\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug(level + 'match2 searching ' + item.index.length + ' for ' + item + '; bindings so far=' + bindingDebug(bindingsSoFar));\n // var results = []\n var c;\n var nc = item.index.length;\n var nbs1;\n var st;\n var onward = 0;\n // var x\n for (c = 0; c < nc; c++) {\n // For each candidate statement\n st = item.index[c]; // for each statement in the item's index, spawn a new match with that binding\n nbs1 = unifyContents([item.subject, item.predicate, item.object, item.why], [st.subject, st.predicate, st.object, st.why], bindingsSoFar, f);\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].info(level + ' From first: ' + nbs1.length + ': ' + bindingsDebug(nbs1));\n nk = nbs1.length;\n // branch.count += nk\n // log.debug(\"Branch count bumped \"+nk+\" to: \"+branch.count)\n for (k = 0; k < nk; k++) {\n // For each way that statement binds\n bindings2 = [];\n newBindings1 = nbs1[k][0];\n if (!constraintsSatisfied(newBindings1, g.constraints)) {\n // branch.count--\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug('Branch count CS: ' + branch.count);\n } else {\n for (v in newBindings1) {\n if (newBindings1.hasOwnProperty(v)) {\n bindings2[v] = newBindings1[v]; // copy\n }\n }\n for (v in bindingsSoFar) {\n if (bindingsSoFar.hasOwnProperty(v)) {\n bindings2[v] = bindingsSoFar[v]; // copy\n }\n }\n branch.count++; // Count how many matches we have yet to complete\n onward++;\n match(f, rest, bindings2, level + ' ', fetcher, callback, branch); // call match\n }\n }\n }\n branch.count--;\n if (onward === 0) {\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug('Match2 fails completely on ' + item);\n }\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug('Match2 ends, Branch count: ' + branch.count + ' for ' + branch.pattern_debug);\n if (branch.count === 0) {\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug('Branch finished.');\n branch.reportDone();\n }\n }; // match2\n // ////////////////////////// Body of query() ///////////////////////\n var f = this;\n _log__WEBPACK_IMPORTED_MODULE_2__[\"default\"].debug('Query on ' + this.statements.length);\n var trunck = new MandatoryBranch(callback, onDone);\n trunck.count++; // count one branch to complete at the moment\n if (myQuery.sync) {\n match(f, myQuery.pat, myQuery.pat.initBindings, '', fetcher, callback, trunck);\n } else {\n // Give up thread: Allow other activities to run\n setTimeout(function () {\n match(f, myQuery.pat, myQuery.pat.initBindings, '', fetcher, callback, trunck);\n }, 0);\n }\n\n // returns nothing; callback does the work\n} // query\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/query.js?\n}");
1067
+
1068
+ /***/ },
1069
+
1070
+ /***/ "./node_modules/rdflib/esm/rdfaparser.js"
1071
+ /*!***********************************************!*\
1072
+ !*** ./node_modules/rdflib/esm/rdfaparser.js ***!
1073
+ \***********************************************/
1074
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
1075
+
1076
+ "use strict";
1077
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ RDFaProcessor),\n/* harmony export */ parseRDFaDOM: () => (/* binding */ parseRDFaDOM)\n/* harmony export */ });\n/* harmony import */ var _blank_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./blank-node */ \"./node_modules/rdflib/esm/blank-node.js\");\n/* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./literal */ \"./node_modules/rdflib/esm/literal.js\");\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./uri */ \"./node_modules/rdflib/esm/uri.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils-js */ \"./node_modules/rdflib/esm/utils-js.js\");\n/* harmony import */ var _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./factories/canonical-data-factory */ \"./node_modules/rdflib/esm/factories/canonical-data-factory.js\");\n// RDFa Parser for rdflib.js\n\n// Originally by: Alex Milowski\n// From https://github.com/alexmilowski/green-turtle\n// Converted: timbl 2015-08-25 not yet working\n// Added wrapper: csarven 2016-05-09 working\n\n// RDFaProcessor.prototype = new Object() // Was URIResolver\n\n// RDFaProcessor.prototype.constructor=RDFaProcessor\n\n// options.base = base URI not really an option, shopuld always be set.\n//\n\n\n\n\n\n\n\nif (typeof Node === 'undefined') {\n // @@@@@@ Global. Interface to xmldom.\n var Node = {\n ELEMENT_NODE: 1,\n ATTRIBUTE_NODE: 2,\n TEXT_NODE: 3,\n CDATA_SECTION_NODE: 4,\n ENTITY_REFERENCE_NODE: 5,\n ENTITY_NODE: 6,\n PROCESSING_INSTRUCTION_NODE: 7,\n COMMENT_NODE: 8,\n DOCUMENT_NODE: 9,\n DOCUMENT_TYPE_NODE: 10,\n DOCUMENT_FRAGMENT_NODE: 11,\n NOTATION_NODE: 12\n };\n}\nclass RDFaProcessor {\n constructor(kb, options) {\n this.options = options || {};\n this.kb = kb;\n this.target = options.target || {\n graph: {\n subjects: {},\n prefixes: {},\n terms: {}\n }\n };\n // XXX: Added to track bnodes\n this.blankNodes = [];\n // XXX: Added for normalisation\n this.htmlOptions = {\n 'selfClosing': 'br img input area base basefont col colgroup source wbr isindex link meta param hr'\n };\n this.theOne = '_:' + new Date().getTime();\n this.language = null;\n this.vocabulary = null;\n this.blankCounter = 0;\n this.langAttributes = [{\n namespaceURI: 'http://www.w3.org/XML/1998/namespace',\n localName: 'lang'\n }];\n this.inXHTMLMode = false;\n this.absURIRE = /[\\w\\_\\-]+:\\S+/;\n this.finishedHandlers = [];\n this.init();\n }\n addTriple(origin, subject, predicate, object) {\n var su, ob, pr, or;\n if (typeof subject === 'undefined') {\n su = _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].namedNode(this.options.base);\n } else {\n su = this.toRDFNodeObject(subject);\n }\n pr = this.toRDFNodeObject(predicate);\n ob = this.toRDFNodeObject(object);\n or = _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].namedNode(this.options.base);\n // console.log('Adding { ' + su + ' ' + pr + ' ' + ob + ' ' + or + ' }')\n this.kb.add(su, pr, ob, or);\n }\n ancestorPath(node) {\n var path = '';\n while (node && node.nodeType !== Node.DOCUMENT_NODE) {\n path = '/' + node.localName + path;\n node = node.parentNode;\n }\n return path;\n }\n copyMappings(mappings) {\n var newMappings = {};\n for (var k in mappings) {\n newMappings[k] = mappings[k];\n }\n return newMappings;\n }\n copyProperties() {}\n deriveDateTimeType(value) {\n for (var i = 0; i < RDFaProcessor.dateTimeTypes.length; i++) {\n // console.log(\"Checking \"+value+\" against \"+RDFaProcessor.dateTimeTypes[i].type)\n var matched = RDFaProcessor.dateTimeTypes[i].pattern.exec(value);\n if (matched && matched[0].length === value.length) {\n // console.log(\"Matched!\")\n return RDFaProcessor.dateTimeTypes[i].type;\n }\n }\n return null;\n }\n init() {}\n newBlankNode() {\n this.blankCounter++;\n return '_:' + this.blankCounter;\n }\n newSubjectOrigin(origin, subject) {}\n parseCURIE(value, prefixes, base) {\n var colon = value.indexOf(':');\n var uri;\n if (colon >= 0) {\n var prefix = value.substring(0, colon);\n if (prefix === '') {\n // default prefix\n uri = prefixes[''];\n return uri ? uri + value.substring(colon + 1) : null;\n } else if (prefix === '_') {\n // blank node\n return '_:' + value.substring(colon + 1);\n } else if (RDFaProcessor.NCNAME.test(prefix)) {\n uri = prefixes[prefix];\n if (uri) {\n return uri + value.substring(colon + 1);\n }\n }\n }\n return null;\n }\n parseCURIEOrURI(value, prefixes, base) {\n var curie = this.parseCURIE(value, prefixes, base);\n if (curie) {\n return curie;\n }\n return this.resolveAndNormalize(base, value);\n }\n parsePredicate(value, defaultVocabulary, terms, prefixes, base, ignoreTerms) {\n if (value === '') {\n return null;\n }\n var predicate = this.parseTermOrCURIEOrAbsURI(value, defaultVocabulary, ignoreTerms ? null : terms, prefixes, base);\n if (predicate && predicate.indexOf('_:') === 0) {\n return null;\n }\n return predicate;\n }\n parsePrefixMappings(str, target) {\n var values = this.tokenize(str);\n var prefix = null;\n // var uri = null\n for (var i = 0; i < values.length; i++) {\n if (values[i][values[i].length - 1] === ':') {\n prefix = values[i].substring(0, values[i].length - 1);\n } else if (prefix) {\n target[prefix] = this.options.base ? _uri__WEBPACK_IMPORTED_MODULE_3__.join(values[i], this.options.base) : values[i];\n prefix = null;\n }\n }\n }\n static parseRDFaDOM(dom, kb, base) {\n var p = new RDFaProcessor(kb, {\n 'base': base\n });\n // Cannot assign to read only property 'baseURI' of object '#<XMLDocument>':\n if (!dom.baseURI) {\n // Note this became a read-only attribute some time before 2018\n dom.baseURI = base; // oinly set if not already set\n }\n p.process(dom, {\n baseURI: base\n });\n }\n parseSafeCURIEOrCURIEOrURI(value, prefixes, base) {\n value = this.trim(value);\n if (value.charAt(0) === '[' && value.charAt(value.length - 1) === ']') {\n value = value.substring(1, value.length - 1);\n value = value.trim(value);\n if (value.length === 0) {\n return null;\n }\n if (value === '_:') {\n // the one node\n return this.theOne;\n }\n return this.parseCURIE(value, prefixes, base);\n } else {\n return this.parseCURIEOrURI(value, prefixes, base);\n }\n }\n parseTermOrCURIEOrAbsURI(value, defaultVocabulary, terms, prefixes, base) {\n // alert(\"Parsing \"+value+\" with default vocab \"+defaultVocabulary)\n value = this.trim(value);\n var curie = this.parseCURIE(value, prefixes, base);\n if (curie) {\n return curie;\n } else if (terms) {\n if (defaultVocabulary && !this.absURIRE.exec(value)) {\n return defaultVocabulary + value;\n }\n var term = terms[value];\n if (term) {\n return term;\n }\n var lcvalue = value.toLowerCase();\n term = terms[lcvalue];\n if (term) {\n return term;\n }\n }\n if (this.absURIRE.exec(value)) {\n return this.resolveAndNormalize(base, value);\n }\n return null;\n }\n parseTermOrCURIEOrURI(value, defaultVocabulary, terms, prefixes, base) {\n // alert(\"Parsing \"+value+\" with default vocab \"+defaultVocabulary)\n value = this.trim(value);\n var curie = this.parseCURIE(value, prefixes, base);\n if (curie) {\n return curie;\n } else {\n var term = terms[value];\n if (term) {\n return term;\n }\n var lcvalue = value.toLowerCase();\n term = terms[lcvalue];\n if (term) {\n return term;\n }\n if (defaultVocabulary && !this.absURIRE.exec(value)) {\n return defaultVocabulary + value;\n }\n }\n return this.resolveAndNormalize(base, value);\n }\n parseURI(uri) {\n return uri; // We just use strings as URIs, not objects now.\n }\n process(node, options) {\n /*\n if (!window.console) {\n window.console = { log: function() {} }\n } */\n options = options || {};\n var base;\n if (node.nodeType === Node.DOCUMENT_NODE) {\n if (node.baseURI && !options.baseURI) {\n options.baseURI = node.baseURI; // be defensive as DOM implementations vary\n }\n base = node.baseURI;\n node = node.documentElement;\n if (!node.baseURI) {\n node.baseURI = base;\n }\n this.setContext(node);\n } else if (node.parentNode.nodeType === Node.DOCUMENT_NODE) {\n this.setContext(node);\n }\n var queue = [];\n // Fix for Firefox that includes the hash in the base URI\n var removeHash = function (baseURI) {\n // Fix for undefined baseURI property\n if (!baseURI && options && options.baseURI) {\n return options.baseURI;\n }\n var hash = baseURI.indexOf('#');\n if (hash >= 0) {\n baseURI = baseURI.substring(0, hash);\n }\n if (options && options.baseURIMap) {\n baseURI = options.baseURIMap(baseURI);\n }\n return baseURI;\n };\n queue.push({\n current: node,\n context: this.push(null, removeHash(node.baseURI))\n });\n while (queue.length > 0) {\n var item = queue.shift();\n if (item.parent) {\n // Sequence Step 14: list triple generation\n if (item.context.parent && item.context.parent.listMapping === item.listMapping) {\n // Skip a child context with exactly the same mapping\n continue;\n }\n // console.log(\"Generating lists for \"+item.subject+\", tag \"+item.parent.localName)\n for (let predicate in item.listMapping) {\n var list = item.listMapping[predicate];\n if (list.length === 0) {\n this.addTriple(item.parent, item.subject, predicate, {\n type: RDFaProcessor.objectURI,\n value: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'\n });\n continue;\n }\n var bnodes = [];\n for (let i = 0; i < list.length; i++) {\n bnodes.push(this.newBlankNode());\n // this.newSubject(item.parent,bnodes[i])\n }\n for (let i = 0; i < bnodes.length; i++) {\n this.addTriple(item.parent, bnodes[i], 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first', list[i]);\n this.addTriple(item.parent, bnodes[i], 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest', {\n type: RDFaProcessor.objectURI,\n value: i + 1 < bnodes.length ? bnodes[i + 1] : 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'\n });\n }\n this.addTriple(item.parent, item.subject, predicate, {\n type: RDFaProcessor.objectURI,\n value: bnodes[0]\n });\n }\n continue;\n }\n var current = item.current;\n var context = item.context;\n // console.log(\"Tag: \"+current.localName+\", listMapping=\"+JSON.stringify(context.listMapping))\n // Sequence Step 1\n var skip = false;\n var newSubject = null;\n var currentObjectResource = null;\n var typedResource = null;\n var prefixes = context.prefixes;\n var prefixesCopied = false;\n var incomplete = [];\n var listMapping = context.listMapping;\n var listMappingDifferent = !context.parent;\n var language = context.language;\n var vocabulary = context.vocabulary;\n // TODO: the \"base\" element may be used for HTML+RDFa 1.1\n base = this.parseURI(removeHash(current.baseURI));\n current.item = null;\n // Sequence Step 2: set the default vocabulary\n var vocabAtt = current.getAttributeNode('vocab');\n if (vocabAtt) {\n let value = this.trim(vocabAtt.value);\n if (value.length > 0) {\n vocabulary = value;\n var baseSubject = base.spec;\n // this.newSubject(current,baseSubject)\n this.addTriple(current, baseSubject, 'http://www.w3.org/ns/rdfa#usesVocabulary', {\n type: RDFaProcessor.objectURI,\n value: vocabulary\n });\n } else {\n vocabulary = this.vocabulary;\n }\n }\n // Sequence Step 3: IRI mappings\n // handle xmlns attributes\n for (var i = 0; i < current.attributes.length; i++) {\n var att = current.attributes[i];\n // if (att.namespaceURI==\"http://www.w3.org/2000/xmlns/\") {\n if (att.nodeName.charAt(0) === 'x' && att.nodeName.indexOf('xmlns:') === 0) {\n if (!prefixesCopied) {\n prefixes = this.copyMappings(prefixes);\n prefixesCopied = true;\n }\n var prefix = att.nodeName.substring(6);\n // TODO: resolve relative?\n var ref = RDFaProcessor.trim(att.value);\n prefixes[prefix] = this.options.base ? _uri__WEBPACK_IMPORTED_MODULE_3__.join(ref, this.options.base) : ref;\n }\n }\n // Handle prefix mappings (@prefix)\n var prefixAtt = current.getAttributeNode('prefix');\n if (prefixAtt) {\n if (!prefixesCopied) {\n prefixes = this.copyMappings(prefixes);\n prefixesCopied = true;\n }\n this.parsePrefixMappings(prefixAtt.value, prefixes);\n }\n // Sequence Step 4: language\n var xmlLangAtt = null;\n for (let i = 0; !xmlLangAtt && i < this.langAttributes.length; i++) {\n xmlLangAtt = current.getAttributeNodeNS(this.langAttributes[i].namespaceURI, this.langAttributes[i].localName);\n }\n if (xmlLangAtt) {\n let value = RDFaProcessor.trim(xmlLangAtt.value);\n if (value.length > 0) {\n language = value;\n } else {\n language = null;\n }\n }\n var relAtt = current.getAttributeNode('rel');\n var revAtt = current.getAttributeNode('rev');\n var typeofAtt = current.getAttributeNode('typeof');\n var propertyAtt = current.getAttributeNode('property');\n var datatypeAtt = current.getAttributeNode('datatype');\n var datetimeAtt = this.inHTMLMode ? current.getAttributeNode('datetime') : null;\n var contentAtt = current.getAttributeNode('content');\n var aboutAtt = current.getAttributeNode('about');\n var srcAtt = current.getAttributeNode('src');\n var resourceAtt = current.getAttributeNode('resource');\n var hrefAtt = current.getAttributeNode('href');\n var inlistAtt = current.getAttributeNode('inlist');\n var relAttPredicates = [];\n var predicate, values;\n if (relAtt) {\n values = this.tokenize(relAtt.value);\n for (let i = 0; i < values.length; i++) {\n predicate = this.parsePredicate(values[i], vocabulary, context.terms, prefixes, base, this.inHTMLMode && propertyAtt !== null);\n if (predicate) {\n relAttPredicates.push(predicate);\n }\n }\n }\n var revAttPredicates = [];\n if (revAtt) {\n values = this.tokenize(revAtt.value);\n for (let i = 0; i < values.length; i++) {\n predicate = this.parsePredicate(values[i], vocabulary, context.terms, prefixes, base, this.inHTMLMode && propertyAtt);\n if (predicate) {\n revAttPredicates.push(predicate);\n }\n }\n }\n // Section 3.1, bullet 7\n if (this.inHTMLMode && (relAtt || revAtt) && propertyAtt) {\n if (relAttPredicates.length === 0) {\n relAtt = null;\n }\n if (revAttPredicates.length === 0) {\n revAtt = null;\n }\n }\n if (relAtt || revAtt) {\n // Sequence Step 6: establish new subject and value\n if (aboutAtt) {\n newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);\n }\n if (typeofAtt) {\n typedResource = newSubject;\n }\n if (!newSubject) {\n if (current.parentNode.nodeType === Node.DOCUMENT_NODE) {\n newSubject = removeHash(current.baseURI);\n } else if (context.parentObject) {\n // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI\n newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;\n }\n }\n if (resourceAtt) {\n currentObjectResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);\n }\n if (!currentObjectResource) {\n if (hrefAtt) {\n currentObjectResource = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));\n } else if (srcAtt) {\n currentObjectResource = this.resolveAndNormalize(base, encodeURI(srcAtt.value));\n } else if (typeofAtt && !aboutAtt && !(this.inXHTMLMode && (current.localName === 'head' || current.localName === 'body'))) {\n currentObjectResource = this.newBlankNode();\n }\n }\n if (typeofAtt && !aboutAtt && this.inXHTMLMode && (current.localName === 'head' || current.localName === 'body')) {\n typedResource = newSubject;\n } else if (typeofAtt && !aboutAtt) {\n typedResource = currentObjectResource;\n }\n } else if (propertyAtt && !contentAtt && !datatypeAtt) {\n // Sequence Step 5.1: establish a new subject\n if (aboutAtt) {\n newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);\n if (typeofAtt) {\n typedResource = newSubject;\n }\n }\n if (!newSubject && current.parentNode.nodeType === Node.DOCUMENT_NODE) {\n newSubject = removeHash(current.baseURI);\n if (typeofAtt) {\n typedResource = newSubject;\n }\n } else if (!newSubject && context.parentObject) {\n // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI\n newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;\n }\n if (typeofAtt && !typedResource) {\n if (resourceAtt) {\n typedResource = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);\n }\n if (!typedResource && hrefAtt) {\n typedResource = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));\n }\n if (!typedResource && srcAtt) {\n typedResource = this.resolveAndNormalize(base, encodeURI(srcAtt.value));\n }\n if (!typedResource && (this.inXHTMLMode || this.inHTMLMode) && (current.localName === 'head' || current.localName === 'body')) {\n typedResource = newSubject;\n }\n if (!typedResource) {\n typedResource = this.newBlankNode();\n }\n currentObjectResource = typedResource;\n }\n // console.log(current.localName+\", newSubject=\"+newSubject+\", typedResource=\"+typedResource+\", currentObjectResource=\"+currentObjectResource)\n } else {\n // Sequence Step 5.2: establish a new subject\n if (aboutAtt) {\n newSubject = this.parseSafeCURIEOrCURIEOrURI(aboutAtt.value, prefixes, base);\n }\n if (!newSubject && resourceAtt) {\n newSubject = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);\n }\n if (!newSubject && hrefAtt) {\n newSubject = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));\n }\n if (!newSubject && srcAtt) {\n newSubject = this.resolveAndNormalize(base, encodeURI(srcAtt.value));\n }\n if (!newSubject) {\n if (current.parentNode.nodeType === Node.DOCUMENT_NODE) {\n newSubject = removeHash(current.baseURI);\n } else if ((this.inXHTMLMode || this.inHTMLMode) && (current.localName === 'head' || current.localName === 'body')) {\n newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;\n } else if (typeofAtt) {\n newSubject = this.newBlankNode();\n } else if (context.parentObject) {\n // TODO: Verify: If the xml:base has been set and the parentObject is the baseURI of the parent, then the subject needs to be the new base URI\n newSubject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;\n if (!propertyAtt) {\n skip = true;\n }\n }\n }\n if (typeofAtt) {\n typedResource = newSubject;\n }\n }\n // console.log(current.tagName+\": newSubject=\"+newSubject+\", currentObjectResource=\"+currentObjectResource+\", typedResource=\"+typedResource+\", skip=\"+skip)\n // var rdfaData = null\n if (newSubject) {\n // this.newSubject(current,newSubject)\n if (aboutAtt || resourceAtt || typedResource) {\n var id = newSubject;\n if (typeofAtt && !aboutAtt && !resourceAtt && currentObjectResource) {\n id = currentObjectResource;\n }\n // console.log(\"Setting data attribute for \"+current.localName+\" for subject \"+id)\n this.newSubjectOrigin(current, id);\n }\n }\n // Sequence Step 7: generate type triple\n if (typedResource) {\n values = this.tokenize(typeofAtt.value);\n for (let i = 0; i < values.length; i++) {\n var object = this.parseTermOrCURIEOrAbsURI(values[i], vocabulary, context.terms, prefixes, base);\n if (object) {\n this.addTriple(current, typedResource, RDFaProcessor.typeURI, {\n type: RDFaProcessor.objectURI,\n value: object\n });\n }\n }\n }\n // Sequence Step 8: new list mappings if there is a new subject\n // console.log(\"Step 8: newSubject=\"+newSubject+\", context.parentObject=\"+context.parentObject)\n if (newSubject && newSubject !== context.parentObject) {\n // console.log(\"Generating new list mapping for \"+newSubject)\n listMapping = {};\n listMappingDifferent = true;\n }\n // Sequence Step 9: generate object triple\n if (currentObjectResource) {\n if (relAtt && inlistAtt) {\n for (let i = 0; i < relAttPredicates.length; i++) {\n let list = listMapping[relAttPredicates[i]];\n if (!list) {\n list = [];\n listMapping[relAttPredicates[i]] = list;\n }\n list.push({\n type: RDFaProcessor.objectURI,\n value: currentObjectResource\n });\n }\n } else if (relAtt) {\n for (let i = 0; i < relAttPredicates.length; i++) {\n this.addTriple(current, newSubject, relAttPredicates[i], {\n type: RDFaProcessor.objectURI,\n value: currentObjectResource\n });\n }\n }\n if (revAtt) {\n for (let i = 0; i < revAttPredicates.length; i++) {\n this.addTriple(current, currentObjectResource, revAttPredicates[i], {\n type: RDFaProcessor.objectURI,\n value: newSubject\n });\n }\n }\n } else {\n // Sequence Step 10: incomplete triples\n if (newSubject && !currentObjectResource && (relAtt || revAtt)) {\n currentObjectResource = this.newBlankNode();\n // alert(current.tagName+\": generated blank node, newSubject=\"+newSubject+\" currentObjectResource=\"+currentObjectResource)\n }\n if (relAtt && inlistAtt) {\n for (let i = 0; i < relAttPredicates.length; i++) {\n let list = listMapping[relAttPredicates[i]];\n if (!list) {\n list = [];\n listMapping[predicate] = list;\n }\n // console.log(\"Adding incomplete list for \"+predicate)\n incomplete.push({\n predicate: relAttPredicates[i],\n list: list\n });\n }\n } else if (relAtt) {\n for (let i = 0; i < relAttPredicates.length; i++) {\n incomplete.push({\n predicate: relAttPredicates[i],\n forward: true\n });\n }\n }\n if (revAtt) {\n for (let i = 0; i < revAttPredicates.length; i++) {\n incomplete.push({\n predicate: revAttPredicates[i],\n forward: false\n });\n }\n }\n }\n // Step 11: Current property values\n if (propertyAtt) {\n var datatype = null;\n var content = null;\n if (datatypeAtt) {\n datatype = datatypeAtt.value === '' ? RDFaProcessor.PlainLiteralURI : this.parseTermOrCURIEOrAbsURI(datatypeAtt.value, vocabulary, context.terms, prefixes, base);\n if (datetimeAtt && !contentAtt) {\n content = datetimeAtt.value;\n } else {\n content = datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI ? null : contentAtt ? contentAtt.value : current.textContent;\n }\n } else if (contentAtt) {\n datatype = RDFaProcessor.PlainLiteralURI;\n content = contentAtt.value;\n } else if (datetimeAtt) {\n content = datetimeAtt.value;\n datatype = RDFaProcessor.deriveDateTimeType(content);\n if (!datatype) {\n datatype = RDFaProcessor.PlainLiteralURI;\n }\n } else if (!relAtt && !revAtt) {\n if (resourceAtt) {\n content = this.parseSafeCURIEOrCURIEOrURI(resourceAtt.value, prefixes, base);\n }\n if (!content && hrefAtt) {\n content = this.resolveAndNormalize(base, encodeURI(hrefAtt.value));\n } else if (!content && srcAtt) {\n content = this.resolveAndNormalize(base, encodeURI(srcAtt.value));\n }\n if (content) {\n datatype = RDFaProcessor.objectURI;\n }\n }\n if (!datatype) {\n if (typeofAtt && !aboutAtt) {\n datatype = RDFaProcessor.objectURI;\n content = typedResource;\n } else {\n content = current.textContent;\n if (this.inHTMLMode && current.localName === 'time') {\n datatype = RDFaProcessor.deriveDateTimeType(content);\n }\n if (!datatype) {\n datatype = RDFaProcessor.PlainLiteralURI;\n }\n }\n }\n values = this.tokenize(propertyAtt.value);\n for (let i = 0; i < values.length; i++) {\n let predicate = this.parsePredicate(values[i], vocabulary, context.terms, prefixes, base);\n if (predicate) {\n if (inlistAtt) {\n let list = listMapping[predicate];\n if (!list) {\n list = [];\n listMapping[predicate] = list;\n }\n list.push(datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI ? {\n type: datatype,\n value: current.childNodes\n } : {\n type: datatype || RDFaProcessor.PlainLiteralURI,\n value: content,\n language: language\n });\n } else {\n if (datatype === RDFaProcessor.XMLLiteralURI || datatype === RDFaProcessor.HTMLLiteralURI) {\n this.addTriple(current, newSubject, predicate, {\n type: datatype,\n value: current.childNodes\n });\n } else {\n this.addTriple(current, newSubject, predicate, {\n type: datatype || RDFaProcessor.PlainLiteralURI,\n value: content,\n language: language\n });\n // console.log(newSubject+\" \"+predicate+\"=\"+content)\n }\n }\n }\n }\n }\n // Sequence Step 12: complete incomplete triples with new subject\n if (newSubject && !skip) {\n for (let i = 0; i < context.incomplete.length; i++) {\n if (context.incomplete[i].list) {\n // console.log(\"Adding subject \"+newSubject+\" to list for \"+context.incomplete[i].predicate)\n // TODO: it is unclear what to do here\n context.incomplete[i].list.push({\n type: RDFaProcessor.objectURI,\n value: newSubject\n });\n } else if (context.incomplete[i].forward) {\n // console.log(current.tagName+\": completing forward triple \"+context.incomplete[i].predicate+\" with object=\"+newSubject)\n this.addTriple(current, context.subject, context.incomplete[i].predicate, {\n type: RDFaProcessor.objectURI,\n value: newSubject\n });\n } else {\n // console.log(current.tagName+\": completing reverse triple with object=\"+context.subject)\n this.addTriple(current, newSubject, context.incomplete[i].predicate, {\n type: RDFaProcessor.objectURI,\n value: context.subject\n });\n }\n }\n }\n var childContext = null;\n var listSubject = newSubject;\n if (skip) {\n // TODO: should subject be null?\n childContext = this.push(context, context.subject);\n // TODO: should the entObject be passed along? If not, then intermediary children will keep properties from being associated with incomplete triples.\n // TODO: Verify: if the current baseURI has changed and the parentObject is the parent's base URI, then the baseURI should change\n childContext.parentObject = removeHash(current.parentNode.baseURI) === context.parentObject ? removeHash(current.baseURI) : context.parentObject;\n childContext.incomplete = context.incomplete;\n childContext.language = language;\n childContext.prefixes = prefixes;\n childContext.vocabulary = vocabulary;\n } else {\n childContext = this.push(context, newSubject);\n childContext.parentObject = currentObjectResource || newSubject || context.subject;\n childContext.prefixes = prefixes;\n childContext.incomplete = incomplete;\n if (currentObjectResource) {\n // console.log(\"Generating new list mapping for \"+currentObjectResource)\n listSubject = currentObjectResource;\n listMapping = {};\n listMappingDifferent = true;\n }\n childContext.listMapping = listMapping;\n childContext.language = language;\n childContext.vocabulary = vocabulary;\n }\n if (listMappingDifferent) {\n // console.log(\"Pushing list parent \"+current.localName)\n queue.unshift({\n parent: current,\n context: context,\n subject: listSubject,\n listMapping: listMapping\n });\n }\n for (var child = current.lastChild; child; child = child.previousSibling) {\n if (child.nodeType === Node.ELEMENT_NODE) {\n // console.log(\"Pushing child \"+child.localName)\n // child.baseURI = current.baseURI\n queue.unshift({\n current: child,\n context: childContext\n });\n }\n }\n }\n if (this.inHTMLMode) {\n this.copyProperties();\n }\n for (let i = 0; i < this.finishedHandlers.length; i++) {\n this.finishedHandlers[i](node);\n }\n }\n push(parent, subject) {\n return {\n parent: parent,\n subject: subject || (parent ? parent.subject : null),\n parentObject: null,\n incomplete: [],\n listMapping: parent ? parent.listMapping : {},\n language: parent ? parent.language : this.language,\n prefixes: parent ? parent.prefixes : this.target.graph.prefixes,\n terms: parent ? parent.terms : this.target.graph.terms,\n vocabulary: parent ? parent.vocabulary : this.vocabulary\n };\n }\n resolveAndNormalize(base, uri) {\n // console.log(\"Joining \" + uri + \" to \" + base + \" making \" + Uri.join(uri, base))\n return _uri__WEBPACK_IMPORTED_MODULE_3__.join(uri, base); // @@ normalize?\n }\n setContext(node) {\n // We only recognized XHTML+RDFa 1.1 if the version is set propertyly\n if (node.localName === 'html' && node.getAttribute('version') === 'XHTML+RDFa 1.1') {\n this.setXHTMLContext();\n } else if (node.localName === 'html' || node.namespaceURI === 'http://www.w3.org/1999/xhtml') {\n if (typeof document !== 'undefined' && document.doctype) {\n if (document.doctype.publicId === '-//W3C//DTD XHTML+RDFa 1.0//EN' && document.doctype.systemId === 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd') {\n console.log('WARNING: RDF 1.0 is not supported. Defaulting to HTML5 mode.');\n this.setHTMLContext();\n } else if (document.doctype.publicId === '-//W3C//DTD XHTML+RDFa 1.1//EN' && document.doctype.systemId === 'http://www.w3.org/MarkUp/DTD/xhtml-rdfa-2.dtd') {\n this.setXHTMLContext();\n } else {\n this.setHTMLContext();\n }\n } else {\n this.setHTMLContext();\n }\n } else {\n this.setXMLContext();\n }\n }\n setHTMLContext() {\n this.setInitialContext();\n this.langAttributes = [{\n namespaceURI: 'http://www.w3.org/XML/1998/namespace',\n localName: 'lang'\n }, {\n namespaceURI: null,\n localName: 'lang'\n }];\n this.inXHTMLMode = false;\n this.inHTMLMode = true;\n }\n setInitialContext() {\n this.vocabulary = null;\n // By default, the prefixes are terms are loaded to the RDFa 1.1. standard within the graph constructor\n this.langAttributes = [{\n namespaceURI: 'http://www.w3.org/XML/1998/namespace',\n localName: 'lang'\n }];\n }\n setXHTMLContext() {\n this.setInitialContext();\n this.inXHTMLMode = true;\n this.inHTMLMode = false;\n this.langAttributes = [{\n namespaceURI: 'http://www.w3.org/XML/1998/namespace',\n localName: 'lang'\n }, {\n namespaceURI: null,\n localName: 'lang'\n }];\n // From http://www.w3.org/2011/rdfa-context/xhtml-rdfa-1.1\n this.target.graph.terms['alternate'] = 'http://www.w3.org/1999/xhtml/vocab#alternate';\n this.target.graph.terms['appendix'] = 'http://www.w3.org/1999/xhtml/vocab#appendix';\n this.target.graph.terms['bookmark'] = 'http://www.w3.org/1999/xhtml/vocab#bookmark';\n this.target.graph.terms['cite'] = 'http://www.w3.org/1999/xhtml/vocab#cite';\n this.target.graph.terms['chapter'] = 'http://www.w3.org/1999/xhtml/vocab#chapter';\n this.target.graph.terms['contents'] = 'http://www.w3.org/1999/xhtml/vocab#contents';\n this.target.graph.terms['copyright'] = 'http://www.w3.org/1999/xhtml/vocab#copyright';\n this.target.graph.terms['first'] = 'http://www.w3.org/1999/xhtml/vocab#first';\n this.target.graph.terms['glossary'] = 'http://www.w3.org/1999/xhtml/vocab#glossary';\n this.target.graph.terms['help'] = 'http://www.w3.org/1999/xhtml/vocab#help';\n this.target.graph.terms['icon'] = 'http://www.w3.org/1999/xhtml/vocab#icon';\n this.target.graph.terms['index'] = 'http://www.w3.org/1999/xhtml/vocab#index';\n this.target.graph.terms['last'] = 'http://www.w3.org/1999/xhtml/vocab#last';\n this.target.graph.terms['license'] = 'http://www.w3.org/1999/xhtml/vocab#license';\n this.target.graph.terms['meta'] = 'http://www.w3.org/1999/xhtml/vocab#meta';\n this.target.graph.terms['next'] = 'http://www.w3.org/1999/xhtml/vocab#next';\n this.target.graph.terms['prev'] = 'http://www.w3.org/1999/xhtml/vocab#prev';\n this.target.graph.terms['previous'] = 'http://www.w3.org/1999/xhtml/vocab#previous';\n this.target.graph.terms['section'] = 'http://www.w3.org/1999/xhtml/vocab#section';\n this.target.graph.terms['stylesheet'] = 'http://www.w3.org/1999/xhtml/vocab#stylesheet';\n this.target.graph.terms['subsection'] = 'http://www.w3.org/1999/xhtml/vocab#subsection';\n this.target.graph.terms['start'] = 'http://www.w3.org/1999/xhtml/vocab#start';\n this.target.graph.terms['top'] = 'http://www.w3.org/1999/xhtml/vocab#top';\n this.target.graph.terms['up'] = 'http://www.w3.org/1999/xhtml/vocab#up';\n this.target.graph.terms['p3pv1'] = 'http://www.w3.org/1999/xhtml/vocab#p3pv1';\n // other\n this.target.graph.terms['related'] = 'http://www.w3.org/1999/xhtml/vocab#related';\n this.target.graph.terms['role'] = 'http://www.w3.org/1999/xhtml/vocab#role';\n this.target.graph.terms['transformation'] = 'http://www.w3.org/1999/xhtml/vocab#transformation';\n }\n setXMLContext() {\n this.setInitialContext();\n this.inXHTMLMode = false;\n this.inHTMLMode = false;\n }\n tokenize(str) {\n return this.trim(str).split(/\\s+/);\n }\n static tokenize(str) {\n return this.trim(str).split(/\\s+/);\n }\n toRDFNodeObject(x) {\n if (typeof x === 'undefined') return undefined;\n if (typeof x === 'string') {\n if (x.substring(0, 2) === '_:') {\n if (typeof this.blankNodes[x.substring(2)] === 'undefined') {\n this.blankNodes[x.substring(2)] = new _blank_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"](x.substring(2));\n }\n return this.blankNodes[x.substring(2)];\n }\n return _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].namedNode(x);\n }\n switch (x.type) {\n case RDFaProcessor.objectURI:\n if (x.value.substring(0, 2) === '_:') {\n if (typeof this.blankNodes[x.value.substring(2)] === 'undefined') {\n this.blankNodes[x.value.substring(2)] = new _blank_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"](x.value.substring(2));\n }\n return this.blankNodes[x.value.substring(2)];\n }\n return _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_5__[\"default\"].namedNode(x.value);\n case RDFaProcessor.PlainLiteralURI:\n return new _literal__WEBPACK_IMPORTED_MODULE_1__[\"default\"](x.value, x.language || '');\n case RDFaProcessor.XMLLiteralURI:\n case RDFaProcessor.HTMLLiteralURI:\n var string = '';\n Object.keys(x.value).forEach(i => {\n string += _utils_js__WEBPACK_IMPORTED_MODULE_4__.domToString(x.value[i], this.htmlOptions);\n });\n return new _literal__WEBPACK_IMPORTED_MODULE_1__[\"default\"](string, '', new _named_node__WEBPACK_IMPORTED_MODULE_2__[\"default\"](x.type));\n default:\n return new _literal__WEBPACK_IMPORTED_MODULE_1__[\"default\"](x.value, '', new _named_node__WEBPACK_IMPORTED_MODULE_2__[\"default\"](x.type));\n }\n }\n trim(str) {\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }\n static trim(str) {\n return str.replace(/^\\s\\s*/, '').replace(/\\s\\s*$/, '');\n }\n}\nRDFaProcessor.XMLLiteralURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral';\nRDFaProcessor.HTMLLiteralURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#HTML';\nRDFaProcessor.PlainLiteralURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#PlainLiteral';\nRDFaProcessor.objectURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#object';\nRDFaProcessor.typeURI = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type';\nRDFaProcessor.nameChar = '[-A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\u10000-\\uEFFFF\\.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]';\nRDFaProcessor.nameStartChar = '[\\u0041-\\u005A\\u0061-\\u007A\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u00FF\\u0100-\\u0131\\u0134-\\u013E\\u0141-\\u0148\\u014A-\\u017E\\u0180-\\u01C3\\u01CD-\\u01F0\\u01F4-\\u01F5\\u01FA-\\u0217\\u0250-\\u02A8\\u02BB-\\u02C1\\u0386\\u0388-\\u038A\\u038C\\u038E-\\u03A1\\u03A3-\\u03CE\\u03D0-\\u03D6\\u03DA\\u03DC\\u03DE\\u03E0\\u03E2-\\u03F3\\u0401-\\u040C\\u040E-\\u044F\\u0451-\\u045C\\u045E-\\u0481\\u0490-\\u04C4\\u04C7-\\u04C8\\u04CB-\\u04CC\\u04D0-\\u04EB\\u04EE-\\u04F5\\u04F8-\\u04F9\\u0531-\\u0556\\u0559\\u0561-\\u0586\\u05D0-\\u05EA\\u05F0-\\u05F2\\u0621-\\u063A\\u0641-\\u064A\\u0671-\\u06B7\\u06BA-\\u06BE\\u06C0-\\u06CE\\u06D0-\\u06D3\\u06D5\\u06E5-\\u06E6\\u0905-\\u0939\\u093D\\u0958-\\u0961\\u0985-\\u098C\\u098F-\\u0990\\u0993-\\u09A8\\u09AA-\\u09B0\\u09B2\\u09B6-\\u09B9\\u09DC-\\u09DD\\u09DF-\\u09E1\\u09F0-\\u09F1\\u0A05-\\u0A0A\\u0A0F-\\u0A10\\u0A13-\\u0A28\\u0A2A-\\u0A30\\u0A32-\\u0A33\\u0A35-\\u0A36\\u0A38-\\u0A39\\u0A59-\\u0A5C\\u0A5E\\u0A72-\\u0A74\\u0A85-\\u0A8B\\u0A8D\\u0A8F-\\u0A91\\u0A93-\\u0AA8\\u0AAA-\\u0AB0\\u0AB2-\\u0AB3\\u0AB5-\\u0AB9\\u0ABD\\u0AE0\\u0B05-\\u0B0C\\u0B0F-\\u0B10\\u0B13-\\u0B28\\u0B2A-\\u0B30\\u0B32-\\u0B33\\u0B36-\\u0B39\\u0B3D\\u0B5C-\\u0B5D\\u0B5F-\\u0B61\\u0B85-\\u0B8A\\u0B8E-\\u0B90\\u0B92-\\u0B95\\u0B99-\\u0B9A\\u0B9C\\u0B9E-\\u0B9F\\u0BA3-\\u0BA4\\u0BA8-\\u0BAA\\u0BAE-\\u0BB5\\u0BB7-\\u0BB9\\u0C05-\\u0C0C\\u0C0E-\\u0C10\\u0C12-\\u0C28\\u0C2A-\\u0C33\\u0C35-\\u0C39\\u0C60-\\u0C61\\u0C85-\\u0C8C\\u0C8E-\\u0C90\\u0C92-\\u0CA8\\u0CAA-\\u0CB3\\u0CB5-\\u0CB9\\u0CDE\\u0CE0-\\u0CE1\\u0D05-\\u0D0C\\u0D0E-\\u0D10\\u0D12-\\u0D28\\u0D2A-\\u0D39\\u0D60-\\u0D61\\u0E01-\\u0E2E\\u0E30\\u0E32-\\u0E33\\u0E40-\\u0E45\\u0E81-\\u0E82\\u0E84\\u0E87-\\u0E88\\u0E8A\\u0E8D\\u0E94-\\u0E97\\u0E99-\\u0E9F\\u0EA1-\\u0EA3\\u0EA5\\u0EA7\\u0EAA-\\u0EAB\\u0EAD-\\u0EAE\\u0EB0\\u0EB2-\\u0EB3\\u0EBD\\u0EC0-\\u0EC4\\u0F40-\\u0F47\\u0F49-\\u0F69\\u10A0-\\u10C5\\u10D0-\\u10F6\\u1100\\u1102-\\u1103\\u1105-\\u1107\\u1109\\u110B-\\u110C\\u110E-\\u1112\\u113C\\u113E\\u1140\\u114C\\u114E\\u1150\\u1154-\\u1155\\u1159\\u115F-\\u1161\\u1163\\u1165\\u1167\\u1169\\u116D-\\u116E\\u1172-\\u1173\\u1175\\u119E\\u11A8\\u11AB\\u11AE-\\u11AF\\u11B7-\\u11B8\\u11BA\\u11BC-\\u11C2\\u11EB\\u11F0\\u11F9\\u1E00-\\u1E9B\\u1EA0-\\u1EF9\\u1F00-\\u1F15\\u1F18-\\u1F1D\\u1F20-\\u1F45\\u1F48-\\u1F4D\\u1F50-\\u1F57\\u1F59\\u1F5B\\u1F5D\\u1F5F-\\u1F7D\\u1F80-\\u1FB4\\u1FB6-\\u1FBC\\u1FBE\\u1FC2-\\u1FC4\\u1FC6-\\u1FCC\\u1FD0-\\u1FD3\\u1FD6-\\u1FDB\\u1FE0-\\u1FEC\\u1FF2-\\u1FF4\\u1FF6-\\u1FFC\\u2126\\u212A-\\u212B\\u212E\\u2180-\\u2182\\u3041-\\u3094\\u30A1-\\u30FA\\u3105-\\u312C\\uAC00-\\uD7A3\\u4E00-\\u9FA5\\u3007\\u3021-\\u3029_]';\nRDFaProcessor.NCNAME = new RegExp('^' + RDFaProcessor.nameStartChar + RDFaProcessor.nameChar + '*$');\n\n/*\nRDFaProcessor.prototype.resolveAndNormalize = function(base,href) {\n var u = base.resolve(href)\n var parsed = this.parseURI(u)\n parsed.normalize()\n return parsed.spec\n}\n*/\n\nRDFaProcessor.dateTimeTypes = [{\n pattern: /-?P(?:[0-9]+Y)?(?:[0-9]+M)?(?:[0-9]+D)?(?:T(?:[0-9]+H)?(?:[0-9]+M)?(?:[0-9]+(?:\\.[0-9]+)?S)?)?/,\n type: 'http://www.w3.org/2001/XMLSchema#duration'\n}, {\n pattern: /-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9]T(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]+)?(?:Z|[+\\-][0-9][0-9]:[0-9][0-9])?/,\n type: 'http://www.w3.org/2001/XMLSchema#dateTime'\n}, {\n pattern: /-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]-[0-9][0-9](?:Z|[+\\-][0-9][0-9]:[0-9][0-9])?/,\n type: 'http://www.w3.org/2001/XMLSchema#date'\n}, {\n pattern: /(?:[0-1][0-9]|2[0-4]):[0-5][0-9]:[0-5][0-9](?:\\.[0-9]+)?(?:Z|[+\\-][0-9][0-9]:[0-9][0-9])?/,\n type: 'http://www.w3.org/2001/XMLSchema#time'\n}, {\n pattern: /-?(?:[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9])-[0-9][0-9]/,\n type: 'http://www.w3.org/2001/XMLSchema#gYearMonth'\n}, {\n pattern: /-?[1-9][0-9][0-9][0-9]|0[1-9][0-9][0-9]|00[1-9][0-9]|000[1-9]/,\n type: 'http://www.w3.org/2001/XMLSchema#gYear'\n}];\nconst parseRDFaDOM = RDFaProcessor.parseRDFaDOM;\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/rdfaparser.js?\n}");
413
1078
 
414
1079
  /***/ },
415
1080
 
416
- /***/ "./node_modules/rdf-stores/lib/RdfStore.js"
1081
+ /***/ "./node_modules/rdflib/esm/rdfxmlparser.js"
417
1082
  /*!*************************************************!*\
418
- !*** ./node_modules/rdf-stores/lib/RdfStore.js ***!
1083
+ !*** ./node_modules/rdflib/esm/rdfxmlparser.js ***!
419
1084
  \*************************************************/
420
- (__unused_webpack_module, exports, __webpack_require__) {
1085
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
421
1086
 
422
1087
  "use strict";
423
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStore = void 0;\nconst asynciterator_1 = __webpack_require__(/*! asynciterator */ \"./node_modules/asynciterator/dist/asynciterator.js\");\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_terms_1 = __webpack_require__(/*! rdf-terms */ \"./node_modules/rdf-terms/index.js\");\nconst DatasetCoreWrapper_1 = __webpack_require__(/*! ./dataset/DatasetCoreWrapper */ \"./node_modules/rdf-stores/lib/dataset/DatasetCoreWrapper.js\");\nconst TermDictionaryNumberRecordFullTerms_1 = __webpack_require__(/*! ./dictionary/TermDictionaryNumberRecordFullTerms */ \"./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecordFullTerms.js\");\nconst TermDictionaryQuotedIndexed_1 = __webpack_require__(/*! ./dictionary/TermDictionaryQuotedIndexed */ \"./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedIndexed.js\");\nconst RdfStoreIndexNestedMapQuoted_1 = __webpack_require__(/*! ./index/RdfStoreIndexNestedMapQuoted */ \"./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapQuoted.js\");\nconst OrderUtils_1 = __webpack_require__(/*! ./OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * An RDF store allows quads to be stored and fetched, based on one or more customizable indexes.\n */\nclass RdfStore {\n constructor(options) {\n this.features = { quotedTripleFiltering: true };\n this._size = 0;\n this.options = options;\n this.dataFactory = options.dataFactory;\n this.dictionary = options.dictionary;\n this.indexesWrapped = RdfStore.constructIndexesWrapped(options);\n this.indexesWrappedComponentOrders = this.indexesWrapped.map(indexThis => indexThis.componentOrder);\n }\n /**\n * Create an RDF store with default settings.\n * Concretely, this store stores triples in GSPO, GPOS, and GOSP order,\n * and makes use of in-memory number dictionary encoding.\n */\n static createDefault() {\n return new RdfStore({\n indexCombinations: RdfStore.DEFAULT_INDEX_COMBINATIONS,\n indexConstructor: subOptions => new RdfStoreIndexNestedMapQuoted_1.RdfStoreIndexNestedMapQuoted(subOptions),\n dictionary: new TermDictionaryQuotedIndexed_1.TermDictionaryQuotedIndexed(new TermDictionaryNumberRecordFullTerms_1.TermDictionaryNumberRecordFullTerms()),\n dataFactory: new rdf_data_factory_1.DataFactory(),\n });\n }\n /**\n * Internal helper to create index objects.\n * @param options The RDF store options object.\n */\n static constructIndexesWrapped(options) {\n const indexes = [];\n if (options.indexCombinations.length === 0) {\n throw new Error('At least one index combination is required');\n }\n for (const componentOrder of options.indexCombinations) {\n if (!RdfStore.isCombinationValid(componentOrder)) {\n throw new Error(`Invalid index combination: ${componentOrder}`);\n }\n indexes.push({\n index: options.indexConstructor(options),\n componentOrder,\n componentOrderInverse: Object.fromEntries(componentOrder.map((value, key) => [value, key])),\n });\n }\n return indexes;\n }\n /**\n * Check if a given quad term order is valid.\n * @param combination A quad term order.\n */\n static isCombinationValid(combination) {\n for (const quadTermName of rdf_terms_1.QUAD_TERM_NAMES) {\n if (!combination.includes(quadTermName)) {\n return false;\n }\n }\n return combination.length === 4;\n }\n /**\n * The number of quads in this store.\n */\n get size() {\n return this._size;\n }\n /**\n * Add a quad to the store.\n * @param quad An RDF quad.\n * @return boolean If the quad was not yet present in the index.\n */\n addQuad(quad) {\n const quadEncoded = [\n this.dictionary.encode(quad.subject),\n this.dictionary.encode(quad.predicate),\n this.dictionary.encode(quad.object),\n this.dictionary.encode(quad.graph),\n ];\n let newQuad = false;\n for (const indexWrapped of this.indexesWrapped) {\n // Before sending the quad to the index, make sure its components are ordered corresponding to the index's order.\n newQuad = indexWrapped.index\n .set((0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, quadEncoded), true);\n }\n if (newQuad) {\n this._size++;\n return true;\n }\n return false;\n }\n /**\n * Remove a quad from the store.\n * @param quad An RDF quad.\n * @return boolean If the quad was present in the index.\n */\n removeQuad(quad) {\n const quadEncoded = [\n this.dictionary.encodeOptional(quad.subject),\n this.dictionary.encodeOptional(quad.predicate),\n this.dictionary.encodeOptional(quad.object),\n this.dictionary.encodeOptional(quad.graph),\n ];\n // We can quickly return false if the quad is not present in the dictionary\n // eslint-disable-next-line unicorn/no-useless-undefined\n if (quadEncoded.includes(undefined)) {\n return false;\n }\n let wasPresent = false;\n for (const indexWrapped of this.indexesWrapped) {\n // Before sending the quad to the index, make sure its components are ordered corresponding to the index's order.\n wasPresent = indexWrapped.index\n .remove((0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, quadEncoded));\n if (!wasPresent) {\n break;\n }\n }\n if (wasPresent) {\n this._size--;\n return true;\n }\n return false;\n }\n /**\n * Removes all streamed quads.\n * @param stream A stream of quads\n */\n remove(stream) {\n stream.on('data', quad => this.removeQuad(quad));\n return stream;\n }\n /**\n * All quads matching the pattern will be removed.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n removeMatches(subject, predicate, object, graph) {\n return this.remove(this.match(subject, predicate, object, graph));\n }\n /**\n * Deletes the given named graph.\n * @param graph The graph term or string to match.\n */\n deleteGraph(graph) {\n if (typeof graph === 'string') {\n graph = this.dataFactory.namedNode(graph);\n }\n return this.removeMatches(undefined, undefined, undefined, graph);\n }\n /**\n * Import the given stream of quads into the store.\n * @param stream A stream of RDF quads.\n */\n import(stream) {\n stream.on('data', (quad) => this.addQuad(quad));\n return stream;\n }\n /**\n * Returns a generator producing all quads matching the pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n *readQuads(subject, predicate, object, graph) {\n // Check if our dictionary and our indexes have quoted pattern support\n const indexesSupportQuotedPatterns = Boolean(this.dictionary.features.quotedTriples) &&\n Object.values(this.indexesWrapped).every(wrapped => wrapped.index.features.quotedTripleFiltering);\n // Construct a quad pattern array\n const [quadComponents, requireQuotedTripleFiltering] = (0, OrderUtils_1.quadToPattern)(subject, predicate, object, graph, indexesSupportQuotedPatterns);\n // Determine the best index for this pattern\n const indexWrapped = this.indexesWrapped[(0, OrderUtils_1.getBestIndex)(this.indexesWrappedComponentOrders, quadComponents)];\n // Re-order the quad pattern based on this best index's component order\n const quadComponentsOrdered = (0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, quadComponents);\n // Call the best index's find method.\n // eslint-disable-next-line unicorn/no-array-callback-reference\n for (const decomposedQuad of indexWrapped.index.find(quadComponentsOrdered)) {\n // De-order the resulting quad components into the normal SPOG order for quad creation.\n const quad = this.dataFactory.quad(decomposedQuad[indexWrapped.componentOrderInverse.subject], decomposedQuad[indexWrapped.componentOrderInverse.predicate], decomposedQuad[indexWrapped.componentOrderInverse.object], decomposedQuad[indexWrapped.componentOrderInverse.graph]);\n if (requireQuotedTripleFiltering) {\n if ((0, rdf_terms_1.matchPattern)(quad, subject, predicate, object, graph)) {\n yield quad;\n }\n }\n else {\n yield quad;\n }\n }\n }\n /**\n * Returns an array containing all quads matching the pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n getQuads(subject, predicate, object, graph) {\n return [...this.readQuads(subject, predicate, object, graph)];\n }\n /**\n * Returns a stream that produces all quads matching the pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n match(subject, predicate, object, graph) {\n return (0, asynciterator_1.wrap)(this.readQuads(subject, predicate, object, graph));\n }\n /**\n * Returns a generator producing all quads matching the pattern.\n * @param subject The subject, which can be a variable.\n * @param predicate The predicate, which can be a variable.\n * @param object The object, which can be a variable.\n * @param graph The graph, which can be a variable.\n */\n *readBindings(bindingsFactory, subject, predicate, object, graph) {\n // Check if our dictionary and our indexes have quoted pattern support\n const indexesSupportQuotedPatterns = Boolean(this.dictionary.features.quotedTriples) &&\n Object.values(this.indexesWrapped).every(wrapped => wrapped.index.features.quotedTripleFiltering);\n // Construct a quad pattern array\n const [quadComponents, requireQuotedTripleFiltering] = (0, OrderUtils_1.quadToPattern)(subject, predicate, object, graph, indexesSupportQuotedPatterns);\n // Determine the best index for this pattern\n const indexWrapped = this.indexesWrapped[(0, OrderUtils_1.getBestIndex)(this.indexesWrappedComponentOrders, quadComponents)];\n // Re-order the quad pattern based on this best index's component order\n const quadComponentsOrdered = (0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, quadComponents);\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(quadComponentsOrdered, this.dictionary);\n // Abort if any of the terms does not exist in the dictionary\n if (!ids) {\n return;\n }\n // Collect variables to bind\n const terms = (0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, [subject, predicate, object, graph]);\n const variableIndexes = [];\n for (let i = 0; i < terms.length; i++) {\n if (terms[i].termType === 'Variable' || terms[i].termType === 'Quad') {\n variableIndexes.push(i);\n }\n }\n // Check if we need to do post-filtering for overlapping variables\n let shouldFilterIndexes = false;\n const filterIndexes = terms.map((variable, i) => {\n const equalVariables = [];\n for (let j = i + 1; j < terms.length; j++) {\n if (variable.equals(terms[j])) {\n equalVariables.push(j);\n shouldFilterIndexes = true;\n }\n }\n return equalVariables;\n });\n // Call the best index's find method.\n for (const decomposedQuadEncoded of indexWrapped.index\n .findEncoded(ids, quadComponentsOrdered)) {\n let skipBinding = false;\n let checkForBindingConflicts = false;\n const bindingsEntries = [];\n for (const i of variableIndexes) {\n // If we had overlapping variables, potentially exclude this binding if values for variable are unequal\n if (shouldFilterIndexes) {\n const filterI = filterIndexes[i];\n if (filterI) {\n for (const j of filterI) {\n if (decomposedQuadEncoded[i] !== decomposedQuadEncoded[j]) {\n skipBinding = true;\n break;\n }\n }\n }\n if (skipBinding) {\n break;\n }\n }\n const decodedTerm = this.dictionary.decode(decomposedQuadEncoded[i]);\n // Handle quoted triples\n // TODO: it may be possible to implement a more efficient of findEncoded if requireQuotedTripleFiltering is\n // false that would return bindings instead of quads. The following could then be skipped.\n // variableIndexes would also need to be changed to check requireQuotedTripleFiltering (see readQuads).\n if (terms[i].termType === 'Quad') {\n if (decodedTerm.termType === 'Quad') {\n // If the term is a quad, it may also contain nested variables,\n // so we need to extract those additional bindings.\n const additionalBindings = (0, rdf_terms_1.matchPatternMappings)(decodedTerm, terms[i], { returnMappings: true });\n if (additionalBindings) {\n checkForBindingConflicts = true;\n for (const [key, value] of Object.entries(additionalBindings)) {\n const variable = this.dataFactory.variable(key);\n if (bindingsEntries.some(entry => entry[0].equals(variable) && !entry[1].equals(value))) {\n // Skip this binding if we find conflicting variable bindings\n skipBinding = true;\n break;\n }\n bindingsEntries.push([variable, value]);\n }\n continue;\n }\n }\n skipBinding = true;\n break;\n }\n // If for the current bindings object, we previously found a quoted quad term that bound variables within it,\n // make sure that later bindings to this variable from other terms don't conflict.\n if (checkForBindingConflicts && bindingsEntries\n .some(entry => entry[0].equals(terms[i]) && !entry[1].equals(decodedTerm))) {\n // Skip this binding if we find conflicting variable bindings\n skipBinding = true;\n break;\n }\n bindingsEntries.push([terms[i], decodedTerm]);\n }\n if (!skipBinding) {\n // Create and yield the bindings object\n yield bindingsFactory.bindings(bindingsEntries);\n }\n }\n }\n /**\n * Returns an array containing all bindings matching the pattern.\n * @param bindingsFactory The factory that will be used to create bindings.\n * @param subject The subject, which can be a variable.\n * @param predicate The predicate, which can be a variable.\n * @param object The object, which can be a variable.\n * @param graph The graph, which can be a variable.\n */\n getBindings(bindingsFactory, subject, predicate, object, graph) {\n return [...this.readBindings(bindingsFactory, subject, predicate, object, graph)];\n }\n /**\n * Returns a stream that produces all quads matching the pattern.\n * @param bindingsFactory The factory that will be used to create bindings.\n * @param subject The subject, which can be a variable.\n * @param predicate The predicate, which can be a variable.\n * @param object The object, which can be a variable.\n * @param graph The graph, which can be a variable.\n */\n matchBindings(bindingsFactory, subject, predicate, object, graph) {\n return (0, asynciterator_1.wrap)(this.readBindings(bindingsFactory, subject, predicate, object, graph));\n }\n /**\n * Returns the exact cardinality of the quads matching the pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n countQuads(subject, predicate, object, graph) {\n // Check if our dictionary and our indexes have quoted pattern support\n const indexesSupportQuotedPatterns = Boolean(this.dictionary.features.quotedTriples) &&\n Object.values(this.indexesWrapped).every(wrapped => wrapped.index.features.quotedTripleFiltering);\n // Construct a quad pattern array\n const [quadComponents] = (0, OrderUtils_1.quadToPattern)(subject, predicate, object, graph, indexesSupportQuotedPatterns);\n // Optimize all-variables pattern\n if (quadComponents.every(quadComponent => quadComponent === undefined)) {\n return this.size;\n }\n // Determine the best index for this pattern\n const indexWrapped = this.indexesWrapped[(0, OrderUtils_1.getBestIndex)(this.indexesWrappedComponentOrders, quadComponents)];\n // Re-order the quad pattern based on this best index's component order\n const quadComponentsOrdered = (0, OrderUtils_1.orderQuadComponents)(indexWrapped.componentOrder, quadComponents);\n // Call the best index's count method.\n return indexWrapped.index.count(quadComponentsOrdered);\n }\n /**\n * Wrap this store inside a DatasetCore interface.\n * Any mutations in either this store or the wrapper will propagate to each other.\n */\n asDataset() {\n return new DatasetCoreWrapper_1.DatasetCoreWrapper(this);\n }\n}\nexports.RdfStore = RdfStore;\nRdfStore.DEFAULT_INDEX_COMBINATIONS = [\n ['graph', 'subject', 'predicate', 'object'],\n ['graph', 'predicate', 'object', 'subject'],\n ['graph', 'object', 'subject', 'predicate'],\n];\n//# sourceMappingURL=RdfStore.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/RdfStore.js?\n}");
1088
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ RDFParser)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uri */ \"./node_modules/rdflib/esm/uri.js\");\n\n/**\n * RDF/XML PARSER\n *\n * Parser believed to be in full positive RDF/XML parsing compliance\n * with the possible exception of handling deprecated RDF attributes\n * appropriately. Parser is believed to comply fully with other W3C\n * and industry standards where appropriate (DOM, ECMAScript, &c.)\n *\n * Author: David Sheets <dsheets@mit.edu>\n *\n * W3C® SOFTWARE NOTICE AND LICENSE\n * http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231\n * This work (and included software, documentation such as READMEs, or\n * other related items) is being provided by the copyright holders under\n * the following license. By obtaining, using and/or copying this work,\n * you (the licensee) agree that you have read, understood, and will\n * comply with the following terms and conditions.\n *\n * Permission to copy, modify, and distribute this software and its\n * documentation, with or without modification, for any purpose and\n * without fee or royalty is hereby granted, provided that you include\n * the following on ALL copies of the software and documentation or\n * portions thereof, including modifications:\n *\n * 1. The full text of this NOTICE in a location viewable to users of\n * the redistributed or derivative work.\n * 2. Any pre-existing intellectual property disclaimers, notices, or terms and\n * conditions. If none exist, the W3C Software Short Notice should be\n * included (hypertext is preferred, text is permitted) within the body\n * of any redistributed or derivative code.\n * 3. Notice of any changes or modifications to the files, including the\n * date changes were made. (We recommend you provide URIs to the location\n * from which the code is derived.)\n *\n * THIS SOFTWARE AND DOCUMENTATION IS PROVIDED \"AS IS,\" AND COPYRIGHT\n * HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED,\n * INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS\n * FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR\n * DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS,\n * TRADEMARKS OR OTHER RIGHTS.\n *\n * COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL\n * OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR\n * DOCUMENTATION.\n *\n * The name and trademarks of copyright holders may NOT be used in\n * advertising or publicity pertaining to the software without specific,\n * written prior permission. Title to copyright in this software and any\n * associated documentation will at all times remain with copyright\n * holders.\n */\n/**\n * @class RDFParser resource object tied to an RDFStore\n *\n * @author David Sheets <dsheets@mit.edu>\n *\n*/\n\nclass RDFParser {\n /*\n * @constructor\n * @param {RDFStore} store An RDFStore object\n */\n constructor(store) {\n /** Our triple store reference @private */\n\n this.store = store; /** Our identified blank nodes @private */\n this.bnodes = {}; /** A context for context-aware stores @private */\n this.why = null; /** Reification flag */\n this.reify = false;\n }\n\n /** Standard namespaces that we know how to handle @final\n * @member RDFParser\n */\n\n /**\n * Frame class for namespace and base URI lookups\n * Base lookups will always resolve because the parser knows\n * the default base.\n *\n * @private\n */\n\n frameFactory(parser, parent, element) {\n return {\n 'NODE': 1,\n 'ARC': 2,\n 'parent': parent,\n 'parser': parser,\n 'store': parser.store,\n 'element': element,\n 'lastChild': 0,\n 'base': null,\n 'lang': null,\n 'node': null,\n 'nodeType': null,\n 'listIndex': 1,\n 'rdfid': null,\n 'datatype': null,\n 'collection': false,\n /** Terminate the frame and notify the store that we're done */\n 'terminateFrame': function () {\n if (this.collection) {\n this.node.close();\n }\n },\n /** Add a symbol of a certain type to the this frame */'addSymbol': function (type, uri) {\n uri = _uri__WEBPACK_IMPORTED_MODULE_1__.join(uri, this.base);\n this.node = this.store.sym(uri);\n this.nodeType = type;\n },\n /** Load any constructed triples into the store */'loadTriple': function () {\n if (this.parent.parent.collection) {\n this.parent.parent.node.append(this.node);\n } else {\n this.store.add(this.parent.parent.node, this.parent.node, this.node, this.parser.why);\n }\n if (this.parent.rdfid != null) {\n // reify\n var triple = this.store.sym(_uri__WEBPACK_IMPORTED_MODULE_1__.join('#' + this.parent.rdfid, this.base));\n this.store.add(triple, this.store.sym(RDFParser.ns.RDF + 'type'), this.store.sym(RDFParser.ns.RDF + 'Statement'), this.parser.why);\n this.store.add(triple, this.store.sym(RDFParser.ns.RDF + 'subject'), this.parent.parent.node, this.parser.why);\n this.store.add(triple, this.store.sym(RDFParser.ns.RDF + 'predicate'), this.parent.node, this.parser.why);\n this.store.add(triple, this.store.sym(RDFParser.ns.RDF + 'object'), this.node, this.parser.why);\n }\n },\n /** Check if it's OK to load a triple */'isTripleToLoad': function () {\n return this.parent != null && this.parent.parent != null && this.nodeType === this.NODE && this.parent.nodeType === this.ARC && this.parent.parent.nodeType === this.NODE;\n },\n /** Add a symbolic node to this frame */'addNode': function (uri) {\n this.addSymbol(this.NODE, uri);\n if (this.isTripleToLoad()) {\n this.loadTriple();\n }\n },\n /** Add a collection node to this frame */'addCollection': function () {\n this.nodeType = this.NODE;\n this.node = this.store.collection();\n this.collection = true;\n if (this.isTripleToLoad()) {\n this.loadTriple();\n }\n },\n /** Add a collection arc to this frame */'addCollectionArc': function () {\n this.nodeType = this.ARC;\n },\n /** Add a bnode to this frame */'addBNode': function (id) {\n if (id != null) {\n if (this.parser.bnodes[id] != null) {\n this.node = this.parser.bnodes[id];\n } else {\n this.node = this.parser.bnodes[id] = this.store.bnode();\n }\n } else {\n this.node = this.store.bnode();\n }\n this.nodeType = this.NODE;\n if (this.isTripleToLoad()) {\n this.loadTriple();\n }\n },\n /** Add an arc or property to this frame */'addArc': function (uri) {\n if (uri === RDFParser.ns.RDF + 'li') {\n uri = RDFParser.ns.RDF + '_' + this.parent.listIndex;\n this.parent.listIndex++;\n }\n this.addSymbol(this.ARC, uri);\n },\n /** Add a literal to this frame */'addLiteral': function (value) {\n if (this.parent.datatype && this.parent.datatype !== RDFParser.ns.RDF + 'langString') {\n this.node = this.store.literal(value, this.store.sym(this.parent.datatype));\n } else {\n this.node = this.store.literal(value, this.lang);\n }\n this.nodeType = this.NODE;\n if (this.isTripleToLoad()) {\n this.loadTriple();\n }\n }\n };\n }\n\n // from the OpenLayers source .. needed to get around IE problems.\n getAttributeNodeNS(node, uri, name) {\n var attributeNode = null;\n if (node.getAttributeNodeNS) {\n attributeNode = node.getAttributeNodeNS(uri, name);\n } else {\n var attributes = node.attributes;\n var potentialNode, fullName;\n for (var i = 0; i < attributes.length; ++i) {\n potentialNode = attributes[i];\n if (potentialNode.namespaceURI === uri) {\n fullName = potentialNode.prefix ? potentialNode.prefix + ':' + name : name;\n if (fullName === potentialNode.nodeName) {\n attributeNode = potentialNode;\n break;\n }\n }\n }\n }\n return attributeNode;\n }\n\n /**\n * Build our initial scope frame and parse the DOM into triples\n * @param {HTMLDocument} document The DOM to parse\n * @param {String} base The base URL to use\n * @param {Object} why The context to which this resource belongs\n */\n\n parse(document, base, why) {\n var children = document.childNodes; // clean up for the next run\n this.cleanParser(); // figure out the root element\n var root;\n if (document.nodeType === RDFParser.nodeType.DOCUMENT) {\n for (var c = 0; c < children.length; c++) {\n if (children[c].nodeType === RDFParser.nodeType.ELEMENT) {\n root = children[c];\n break;\n }\n }\n } else if (document.nodeType === RDFParser.nodeType.ELEMENT) {\n root = document;\n } else {\n throw new Error(\"RDFParser: can't find root in \" + base + '. Halting. ');\n // return false\n }\n this.why = why; // our topmost frame\n var f = this.frameFactory(this);\n this.base = base;\n f.base = base;\n f.lang = null; // was '' but can't have langs like that 2015 (!)\n this.parseDOM(this.buildFrame(f, root));\n return true;\n }\n parseDOM(frame) {\n // a DOM utility function used in parsing\n var rdfid;\n var elementURI = function (el) {\n var result = '';\n if (el.namespaceURI == null) {\n throw new Error('RDF/XML syntax error: No namespace for ' + el.localName + ' in ' + this.base);\n }\n if (el.namespaceURI) {\n result = result + el.namespaceURI;\n }\n if (el.localName) {\n result = result + el.localName;\n } else if (el.nodeName) {\n if (el.nodeName.indexOf(':') >= 0) result = result + el.nodeName.split(':')[1];else result = result + el.nodeName;\n }\n return result;\n }.bind(this);\n var dig = true; // if we'll dig down in the tree on the next iter\n while (frame.parent) {\n var dom = frame.element;\n var attrs = dom.attributes;\n if (dom.nodeType === RDFParser.nodeType.TEXT || dom.nodeType === RDFParser.nodeType.CDATA_SECTION) {\n // we have a literal\n if (frame.parent.nodeType === frame.NODE) {\n // must have had attributes, store as rdf:value\n frame.addArc(RDFParser.ns.RDF + 'value');\n frame = this.buildFrame(frame);\n }\n frame.addLiteral(dom.nodeValue);\n } else if (elementURI(dom) !== RDFParser.ns.RDF + 'RDF') {\n // not root\n if (frame.parent && frame.parent.collection) {\n // we're a collection element\n frame.addCollectionArc();\n frame = this.buildFrame(frame, frame.element);\n frame.parent.element = null;\n }\n if (!frame.parent || !frame.parent.nodeType || frame.parent.nodeType === frame.ARC) {\n // we need a node\n var about = this.getAttributeNodeNS(dom, RDFParser.ns.RDF, 'about');\n rdfid = this.getAttributeNodeNS(dom, RDFParser.ns.RDF, 'ID');\n if (about && rdfid) {\n throw new Error('RDFParser: ' + dom.nodeName + ' has both rdf:id and rdf:about.' + ' Halting. Only one of these' + ' properties may be specified on a' + ' node.');\n }\n if (!about && rdfid) {\n frame.addNode('#' + rdfid.nodeValue);\n dom.removeAttributeNode(rdfid);\n } else if (about == null && rdfid == null) {\n var bnid = this.getAttributeNodeNS(dom, RDFParser.ns.RDF, 'nodeID');\n if (bnid) {\n frame.addBNode(bnid.nodeValue);\n dom.removeAttributeNode(bnid);\n } else {\n frame.addBNode();\n }\n } else {\n frame.addNode(about.nodeValue);\n dom.removeAttributeNode(about);\n }\n // Typed nodes\n var rdftype = this.getAttributeNodeNS(dom, RDFParser.ns.RDF, 'type');\n if (RDFParser.ns.RDF + 'Description' !== elementURI(dom)) {\n rdftype = {\n 'nodeValue': elementURI(dom)\n };\n }\n if (rdftype != null) {\n this.store.add(frame.node, this.store.sym(RDFParser.ns.RDF + 'type'), this.store.sym(_uri__WEBPACK_IMPORTED_MODULE_1__.join(rdftype.nodeValue, frame.base)), this.why);\n if (rdftype.nodeName) {\n dom.removeAttributeNode(rdftype);\n }\n }\n // Property Attributes\n for (var x = attrs.length - 1; x >= 0; x--) {\n this.store.add(frame.node, this.store.sym(elementURI(attrs[x])), this.store.literal(attrs[x].nodeValue, frame.lang), this.why);\n }\n } else {\n // we should add an arc (or implicit bnode+arc)\n frame.addArc(elementURI(dom)); // save the arc's rdf:ID if it has one\n if (this.reify) {\n rdfid = this.getAttributeNodeNS(dom, RDFParser.ns.RDF, 'ID');\n if (rdfid) {\n frame.rdfid = rdfid.nodeValue;\n dom.removeAttributeNode(rdfid);\n }\n }\n var parsetype = this.getAttributeNodeNS(dom, RDFParser.ns.RDF, 'parseType');\n var datatype = this.getAttributeNodeNS(dom, RDFParser.ns.RDF, 'datatype');\n if (datatype) {\n frame.datatype = datatype.nodeValue;\n dom.removeAttributeNode(datatype);\n }\n if (parsetype) {\n var nv = parsetype.nodeValue;\n if (nv === 'Literal') {\n frame.datatype = RDFParser.ns.RDF + 'XMLLiteral';\n frame = this.buildFrame(frame);\n // Don't include the literal node, only its children\n // see https://github.com/linkeddata/rdflib.js/issues/75\n frame.addLiteral(dom.innerHTML || dom.childNodes);\n dig = false;\n } else if (nv === 'Resource') {\n frame = this.buildFrame(frame, frame.element);\n frame.parent.element = null;\n frame.addBNode();\n } else if (nv === 'Collection') {\n frame = this.buildFrame(frame, frame.element);\n frame.parent.element = null;\n frame.addCollection();\n }\n dom.removeAttributeNode(parsetype);\n }\n if (attrs.length !== 0) {\n var resource = this.getAttributeNodeNS(dom, RDFParser.ns.RDF, 'resource');\n var bnid2 = this.getAttributeNodeNS(dom, RDFParser.ns.RDF, 'nodeID');\n frame = this.buildFrame(frame);\n if (resource) {\n frame.addNode(resource.nodeValue);\n dom.removeAttributeNode(resource);\n } else {\n if (bnid2) {\n frame.addBNode(bnid2.nodeValue);\n dom.removeAttributeNode(bnid2);\n } else {\n frame.addBNode();\n }\n }\n for (var x1 = attrs.length - 1; x1 >= 0; x1--) {\n var f = this.buildFrame(frame);\n f.addArc(elementURI(attrs[x1]));\n if (elementURI(attrs[x1]) === RDFParser.ns.RDF + 'type') {\n this.buildFrame(f).addNode(attrs[x1].nodeValue);\n } else {\n this.buildFrame(f).addLiteral(attrs[x1].nodeValue);\n }\n }\n } else if (dom.childNodes.length === 0) {\n this.buildFrame(frame).addLiteral('');\n }\n }\n } // rdf:RDF\n // dig dug\n dom = frame.element;\n while (frame.parent) {\n var pframe = frame;\n while (dom == null) {\n frame = frame.parent;\n dom = frame.element;\n }\n var candidate = dom.childNodes && dom.childNodes[frame.lastChild];\n if (!candidate || !dig) {\n frame.terminateFrame();\n if (!(frame = frame.parent)) {\n break;\n } // done\n dom = frame.element;\n dig = true;\n } else if (candidate.nodeType !== RDFParser.nodeType.ELEMENT && candidate.nodeType !== RDFParser.nodeType.TEXT && candidate.nodeType !== RDFParser.nodeType.CDATA_SECTION || (candidate.nodeType === RDFParser.nodeType.TEXT || candidate.nodeType === RDFParser.nodeType.CDATA_SECTION) && dom.childNodes.length !== 1) {\n frame.lastChild++;\n } else {\n // not a leaf\n frame.lastChild++;\n frame = this.buildFrame(pframe, dom.childNodes[frame.lastChild - 1]);\n break;\n }\n }\n } // while\n }\n\n /**\n * Cleans out state from a previous parse run\n * @private\n */\n cleanParser() {\n this.bnodes = {};\n this.why = null;\n }\n\n /**\n * Builds scope frame\n * @private\n */\n buildFrame(parent, element) {\n var frame = this.frameFactory(this, parent, element);\n if (parent) {\n frame.base = parent.base;\n frame.lang = parent.lang;\n }\n if (!element || element.nodeType === RDFParser.nodeType.TEXT || element.nodeType === RDFParser.nodeType.CDATA_SECTION) {\n return frame;\n }\n var attrs = element.attributes;\n var base = element.getAttributeNode('xml:base');\n if (base != null) {\n frame.base = base.nodeValue;\n element.removeAttribute('xml:base');\n }\n var lang = element.getAttributeNode('xml:lang');\n if (lang != null) {\n frame.lang = lang.nodeValue;\n element.removeAttribute('xml:lang');\n }\n // remove all extraneous xml and xmlns attributes\n for (var x = attrs.length - 1; x >= 0; x--) {\n if (attrs[x].nodeName.substr(0, 3) === 'xml') {\n if (attrs[x].name.slice(0, 6) === 'xmlns:') {\n var uri = attrs[x].nodeValue; // alert('base for namespac attr:'+this.base)\n if (this.base) uri = _uri__WEBPACK_IMPORTED_MODULE_1__.join(uri, this.base);\n this.store.setPrefixForURI(attrs[x].name.slice(6), uri);\n }\n //\t\talert('rdfparser: xml atribute: '+attrs[x].name) //@@\n element.removeAttributeNode(attrs[x]);\n }\n }\n return frame;\n }\n}\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(RDFParser, \"ns\", {\n 'RDF': 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n 'RDFS': 'http://www.w3.org/2000/01/rdf-schema#'\n});\n/** DOM Level 2 node type magic numbers @final\n * @member RDFParser\n */\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(RDFParser, \"nodeType\", {\n 'ELEMENT': 1,\n 'ATTRIBUTE': 2,\n 'TEXT': 3,\n 'CDATA_SECTION': 4,\n 'ENTITY_REFERENCE': 5,\n 'ENTITY': 6,\n 'PROCESSING_INSTRUCTION': 7,\n 'COMMENT': 8,\n 'DOCUMENT': 9,\n 'DOCUMENT_TYPE': 10,\n 'DOCUMENT_FRAGMENT': 11,\n 'NOTATION': 12\n});\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/rdfxmlparser.js?\n}");
424
1089
 
425
1090
  /***/ },
426
1091
 
427
- /***/ "./node_modules/rdf-stores/lib/dataset/DatasetCoreWrapper.js"
428
- /*!*******************************************************************!*\
429
- !*** ./node_modules/rdf-stores/lib/dataset/DatasetCoreWrapper.js ***!
430
- \*******************************************************************/
431
- (__unused_webpack_module, exports, __webpack_require__) {
1092
+ /***/ "./node_modules/rdflib/esm/serialize.js"
1093
+ /*!**********************************************!*\
1094
+ !*** ./node_modules/rdflib/esm/serialize.js ***!
1095
+ \**********************************************/
1096
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
432
1097
 
433
1098
  "use strict";
434
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.DatasetCoreWrapper = void 0;\nconst RdfStore_1 = __webpack_require__(/*! ../RdfStore */ \"./node_modules/rdf-stores/lib/RdfStore.js\");\n/**\n * A DatasetCoreWrapper exposes an RdfStore inside an RDF.DatasetCore.\n */\nclass DatasetCoreWrapper {\n constructor(store) {\n this.store = store;\n }\n get size() {\n return this.store.size;\n }\n add(quad) {\n this.store.addQuad(quad);\n return this;\n }\n delete(quad) {\n this.store.removeQuad(quad);\n return this;\n }\n has(quad) {\n // eslint-disable-next-line no-unreachable-loop\n for (const result of this.store.readQuads(quad.subject, quad.predicate, quad.object, quad.graph)) {\n return true;\n }\n return false;\n }\n match(subject, predicate, object, graph) {\n const newStore = new RdfStore_1.RdfStore(this.store.options);\n for (const quad of this.store.readQuads(subject, predicate, object, graph)) {\n newStore.addQuad(quad);\n }\n return new DatasetCoreWrapper(newStore);\n }\n [Symbol.iterator]() {\n return this.store.readQuads();\n }\n}\nexports.DatasetCoreWrapper = DatasetCoreWrapper;\n//# sourceMappingURL=DatasetCoreWrapper.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dataset/DatasetCoreWrapper.js?\n}");
1099
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ serialize)\n/* harmony export */ });\n/* harmony import */ var _serializer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./serializer */ \"./node_modules/rdflib/esm/serializer.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n\n\n/**\n * Serialize to the appropriate format\n */\nfunction serialize(/** The graph or nodes that should be serialized */\ntarget, /** The store */\nkb, base,\n/**\n * The mime type.\n * Defaults to Turtle.\n */\ncontentType, callback, options) {\n base = base || target?.value;\n const opts = options || {};\n contentType = contentType || _types__WEBPACK_IMPORTED_MODULE_1__.TurtleContentType; // text/n3 if complex?\n var documentString = undefined;\n try {\n var sz = (0,_serializer__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(kb);\n if (opts.flags) sz.setFlags(opts.flags);\n var newSts = kb.statementsMatching(undefined, undefined, undefined, target);\n\n // If an IndexedFormula, use the namespaces from the given graph as suggestions\n if ('namespaces' in kb) {\n sz.suggestNamespaces(kb.namespaces);\n }\n\n // use the provided options.namespaces are mandatory prefixes\n if (opts.namespaces) {\n sz.setNamespaces(opts.namespaces);\n }\n sz.setBase(base);\n switch (contentType) {\n case _types__WEBPACK_IMPORTED_MODULE_1__.RDFXMLContentType:\n documentString = sz.statementsToXML(newSts);\n return executeCallback(null, documentString);\n case _types__WEBPACK_IMPORTED_MODULE_1__.N3ContentType:\n case _types__WEBPACK_IMPORTED_MODULE_1__.N3LegacyContentType:\n documentString = sz.statementsToN3(newSts);\n return executeCallback(null, documentString);\n case _types__WEBPACK_IMPORTED_MODULE_1__.TurtleContentType:\n case _types__WEBPACK_IMPORTED_MODULE_1__.TurtleLegacyContentType:\n // Suppress = for sameAs and => for implies; preserve any user-specified flags (e.g., 'o')\n sz.setFlags('si' + (opts.flags ? ' ' + opts.flags : ''));\n documentString = sz.statementsToN3(newSts);\n return executeCallback(null, documentString);\n case _types__WEBPACK_IMPORTED_MODULE_1__.NTriplesContentType:\n sz.setFlags('deinprstux'); // Suppress nice parts of N3 to make ntriples\n documentString = sz.statementsToNTriples(newSts);\n return executeCallback(null, documentString);\n case _types__WEBPACK_IMPORTED_MODULE_1__.JSONLDContentType:\n // turtle + dr (means no default, no relative prefix); preserve user flags\n sz.setFlags('si dr' + (opts.flags ? ' ' + opts.flags : ''));\n documentString = sz.statementsToJsonld(newSts); // convert via turtle\n return executeCallback(null, documentString);\n case _types__WEBPACK_IMPORTED_MODULE_1__.NQuadsContentType:\n case _types__WEBPACK_IMPORTED_MODULE_1__.NQuadsAltContentType:\n // @@@ just outpout the quads? Does not work for collections\n sz.setFlags('deinprstux q'); // Suppress nice parts of N3 to make ntriples\n documentString = sz.statementsToNTriples(newSts); // q in flag means actually quads\n return executeCallback(null, documentString);\n default:\n throw new Error('Serialize: Content-type ' + contentType + ' not supported for data write.');\n }\n } catch (err) {\n if (callback) {\n // @ts-ignore\n return callback(err, undefined);\n }\n throw err; // Don't hide problems from caller in sync mode\n }\n function executeCallback(err, result) {\n if (callback) {\n callback(err, result);\n return;\n } else {\n return result;\n }\n }\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/serialize.js?\n}");
435
1100
 
436
1101
  /***/ },
437
1102
 
438
- /***/ "./node_modules/rdf-stores/lib/dictionary/ITermDictionary.js"
439
- /*!*******************************************************************!*\
440
- !*** ./node_modules/rdf-stores/lib/dictionary/ITermDictionary.js ***!
441
- \*******************************************************************/
442
- (__unused_webpack_module, exports) {
1103
+ /***/ "./node_modules/rdflib/esm/serializer.js"
1104
+ /*!***********************************************!*\
1105
+ !*** ./node_modules/rdflib/esm/serializer.js ***!
1106
+ \***********************************************/
1107
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
443
1108
 
444
1109
  "use strict";
445
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//# sourceMappingURL=ITermDictionary.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/ITermDictionary.js?\n}");
1110
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ Serializer: () => (/* binding */ Serializer),\n/* harmony export */ \"default\": () => (/* binding */ createSerializer)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _frogcat_ttl2jsonld__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @frogcat/ttl2jsonld */ \"./node_modules/@frogcat/ttl2jsonld/ttl2jsonld.js\");\n/* harmony import */ var _frogcat_ttl2jsonld__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_frogcat_ttl2jsonld__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var solid_namespace__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! solid-namespace */ \"./node_modules/solid-namespace/index.js\");\n/* harmony import */ var solid_namespace__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(solid_namespace__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./factories/canonical-data-factory */ \"./node_modules/rdflib/esm/factories/canonical-data-factory.js\");\n/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils-js */ \"./node_modules/rdflib/esm/uri.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils-js */ \"./node_modules/rdflib/esm/utils-js.js\");\n/* harmony import */ var _xsd__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./xsd */ \"./node_modules/rdflib/esm/xsd.js\");\n\n/* Serialization of RDF Graphs\n**\n** Tim Berners-Lee 2006\n** This is was http://dig.csail.mit.edu/2005/ajar/ajaw/js/rdf/serialize.js\n** This is or was https://github.com/linkeddata/rdflib.js/blob/main/src/serializer.js\n** Licence: MIT\n*/\n\n\n\n\n\n\nfunction createSerializer(store) {\n return new Serializer(store);\n}\n;\nclass Serializer {\n constructor(store) {\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_notQNameChars\", '\\t\\r\\n !\"#$%&\\'()*,+/;<=>?@[\\\\]^`{|}~');\n // issue#228\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_notNameChars\", this._notQNameChars + ':');\n // stringToN3: String escaping for N3\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"validPrefix\", new RegExp(/^[a-zA-Z][a-zA-Z0-9]*$/));\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"forbidden1\", new RegExp(/[\\\\\"\\b\\f\\r\\v\\t\\n\\u0080-\\uffff]/gm));\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"forbidden3\", new RegExp(/[\\\\\"\\b\\f\\r\\v\\u0080-\\uffff]/gm));\n this.flags = '';\n this.base = null;\n this.prefixes = []; // suggested prefixes\n this.namespaces = []; // complementary\n const nsKeys = Object.keys(solid_namespace__WEBPACK_IMPORTED_MODULE_2___default()());\n for (const i in nsKeys) {\n const uri = solid_namespace__WEBPACK_IMPORTED_MODULE_2___default()()[nsKeys[i]]('');\n const prefix = nsKeys[i];\n this.prefixes[uri] = prefix;\n this.namespaces[prefix] = uri;\n }\n this.suggestPrefix('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#'); // XML code assumes this!\n this.suggestPrefix('xml', 'reserved:reservedForFutureUse'); // XML reserves xml: in the spec.\n\n this.namespacesUsed = []; // Count actually used and so needed in @prefixes\n this.keywords = ['a']; // The only one we generate at the moment\n this.prefixchars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n this.incoming = null; // Array not calculated yet\n this.formulas = []; // remembering original formulae from hashes\n this.store = store;\n this.rdfFactory = store.rdfFactory || _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n this.xsd = (0,_xsd__WEBPACK_IMPORTED_MODULE_6__.createXSD)(this.rdfFactory);\n }\n setBase(base) {\n this.base = base;\n return this;\n }\n\n /**\n * Set serializer behavior flags. Letters can be combined with spaces.\n * Examples: 'si', 'deinprstux', 'si dr', 'o'.\n * Notable flags:\n * - 'o': do not abbreviate to a prefixed name when the local part contains a dot\n */\n setFlags(flags) {\n this.flags = flags || '';\n return this;\n }\n toStr(x) {\n var s = x.toNT();\n if (x.termType === 'Graph') {\n this.formulas[s] = x; // remember as reverse does not work\n }\n return s;\n }\n fromStr(s) {\n if (s[0] === '{') {\n var x = this.formulas[s];\n if (!x) console.log('No formula object for ' + s);\n return x;\n }\n return this.store.fromNT(s);\n }\n\n /**\n * Defines a set of [prefix, namespace] pairs to be used by this Serializer instance.\n * Overrides previous prefixes if any\n * @param namespaces\n * @return {Serializer}\n */\n setNamespaces(namespaces) {\n for (var px in namespaces) {\n this.setPrefix(px, namespaces[px]);\n }\n return this;\n }\n\n /**\n * Defines a namespace prefix, overriding any existing prefix for that URI\n * @param prefix\n * @param uri\n */\n setPrefix(prefix, uri) {\n if (prefix.slice(0, 7) === 'default') return; // Try to weed these out\n if (prefix.slice(0, 2) === 'ns') return; // From others inferior algos\n if (!prefix || !uri) return; // empty strings not suitable\n\n // remove any existing prefix targeting this uri\n // for (let existingPrefix in this.namespaces) {\n // if (this.namespaces[existingPrefix] == uri)\n // delete this.namespaces[existingPrefix];\n // }\n\n // remove any existing mapping for this prefix\n for (let existingNs in this.prefixes) {\n if (this.prefixes[existingNs] == prefix) delete this.prefixes[existingNs];\n }\n this.prefixes[uri] = prefix;\n this.namespaces[prefix] = uri;\n }\n\n /* Accumulate Namespaces\n **\n ** These are only hints. If two overlap, only one gets used\n ** There is therefore no guarantee in general.\n */\n suggestPrefix(prefix, uri) {\n if (prefix.slice(0, 7) === 'default') return; // Try to weed these out\n if (prefix.slice(0, 2) === 'ns') return; // From others inferior algos\n if (!prefix || !uri) return; // empty strings not suitable\n if (prefix in this.namespaces || uri in this.prefixes) return; // already used\n this.prefixes[uri] = prefix;\n this.namespaces[prefix] = uri;\n }\n\n // Takes a namespace -> prefix map\n suggestNamespaces(namespaces) {\n for (var px in namespaces) {\n this.suggestPrefix(px, namespaces[px]);\n }\n return this;\n }\n checkIntegrity() {\n var p, ns;\n for (p in this.namespaces) {\n if (this.prefixes[this.namespaces[p]] !== p) {\n throw new Error('Serializer integity error 1: ' + p + ', ' + this.namespaces[p] + ', ' + this.prefixes[this.namespaces[p]] + '!');\n }\n }\n for (ns in this.prefixes) {\n if (this.namespaces[this.prefixes[ns]] !== ns) {\n throw new Error('Serializer integity error 2: ' + ns + ', ' + this.prefixs[ns] + ', ' + this.namespaces[this.prefixes[ns]] + '!');\n }\n }\n }\n\n // Make up an unused prefix for a random namespace\n makeUpPrefix(uri) {\n var p = uri;\n function canUseMethod(pp) {\n if (!this.validPrefix.test(pp)) return false; // bad format\n if (pp === 'ns') return false; // boring\n if (pp in this.namespaces) return false; // already used\n this.prefixes[uri] = pp;\n this.namespaces[pp] = uri;\n return pp;\n }\n var canUse = canUseMethod.bind(this);\n if ('#/'.indexOf(p[p.length - 1]) >= 0) p = p.slice(0, -1);\n var slash = p.lastIndexOf('/');\n if (slash >= 0) p = p.slice(slash + 1);\n var i = 0;\n while (i < p.length) {\n if (this.prefixchars.indexOf(p[i]) >= 0) {\n i++;\n } else {\n break;\n }\n }\n p = p.slice(0, i);\n if (p.length < 6 && canUse(p)) return p; // exact is best\n if (canUse(p.slice(0, 3))) return p.slice(0, 3);\n if (canUse(p.slice(0, 2))) return p.slice(0, 2);\n if (canUse(p.slice(0, 4))) return p.slice(0, 4);\n if (canUse(p.slice(0, 1))) return p.slice(0, 1);\n if (canUse(p.slice(0, 5))) return p.slice(0, 5);\n if (!this.validPrefix.test(p)) {\n p = 'n'; // Otherwise the loop below may never termimnate\n }\n for (var j = 0;; j++) if (canUse(p.slice(0, 3) + j)) return p.slice(0, 3) + j;\n }\n rootSubjects(sts) {\n var incoming = {};\n var subjects = {};\n var allBnodes = {};\n\n /* This scan is to find out which nodes will have to be the roots of trees\n ** in the serialized form. This will be any symbols, and any bnodes\n ** which hve more or less than one incoming arc, and any bnodes which have\n ** one incoming arc but it is an uninterrupted loop of such nodes back to itself.\n ** This should be kept linear time with repect to the number of statements.\n ** Note it does not use any indexing of the store.\n */\n for (var i = 0; i < sts.length; i++) {\n var st = sts[i];\n var checkMentions = function (x) {\n if (!incoming.hasOwnProperty(x)) incoming[x] = [];\n incoming[x].push(st.subject); // List of things which will cause this to be printed\n };\n var st2 = [st.subject, st.predicate, st.object];\n st2.map(function (y) {\n if (y.termType === 'BlankNode') {\n allBnodes[y.toNT()] = true;\n } else if (y.termType === 'Collection') {\n y.elements.forEach(function (z) {\n checkMentions(z); // bnodes in collections important\n });\n }\n });\n checkMentions(sts[i].object);\n var ss = subjects[this.toStr(st.subject)]; // Statements with this as subject\n if (!ss) ss = [];\n ss.push(st);\n subjects[this.toStr(st.subject)] = ss; // Make hash. @@ too slow for formula?\n }\n var roots = [];\n for (var xNT in subjects) {\n if (!subjects.hasOwnProperty(xNT)) continue;\n var y = this.fromStr(xNT);\n if (y.termType !== 'BlankNode' || !incoming[y] || incoming[y].length !== 1) {\n roots.push(y);\n continue;\n }\n }\n this.incoming = incoming; // Keep for serializing @@ Bug for nested formulas\n\n // Now do the scan using existing roots\n var rootsHash = {};\n for (var k = 0; k < roots.length; k++) {\n rootsHash[roots[k].toNT()] = true;\n }\n return {\n 'roots': roots,\n 'subjects': subjects,\n 'rootsHash': rootsHash,\n 'incoming': incoming\n };\n }\n\n // //////////////////////////////////////////////////////\n\n toN3(f) {\n return this.statementsToN3(f.statements);\n }\n // Validate if a string is a valid PN_LOCAL per Turtle 1.1 spec\n // Allows dots inside the local name but not as trailing character\n // Also allows empty local names (for URIs ending in / or #)\n isValidPNLocal(local) {\n // Empty local name is valid (e.g., ex: for http://example.com/)\n if (local.length === 0) return true;\n\n // Cannot end with a dot\n if (local[local.length - 1] === '.') return false;\n\n // Check each character (allow dots mid-string)\n for (var i = 0; i < local.length; i++) {\n var ch = local[i];\n // Dot is allowed unless it's the last character (checked above)\n if (ch === '.') continue;\n // Other characters must not be in the blacklist\n if (this._notNameChars.indexOf(ch) >= 0) {\n return false;\n }\n }\n return true;\n }\n explicitURI(uri) {\n if (this.flags.indexOf('r') < 0 && this.base) {\n uri = _uri__WEBPACK_IMPORTED_MODULE_4__.refTo(this.base, uri);\n } else if (this.flags.indexOf('u') >= 0) {\n // Unicode encoding NTriples style\n uri = backslashUify(uri);\n } else {\n uri = hexify(decodeURI(uri));\n }\n return '<' + uri + '>';\n }\n statementsToNTriples(sts) {\n var sorted = sts.slice();\n sorted.sort();\n var str = '';\n var rdfns = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\n var self = this;\n var kb = this.store;\n var factory = this.rdfFactory;\n var termToNT = function (x) {\n if (x.termType !== 'Collection') {\n return self.atomicTermToN3(x);\n }\n var list = x.elements;\n var rest = kb.sym(rdfns + 'nill');\n for (var i = list.length - 1; i >= 0; i--) {\n var bnode = factory.blankNode();\n str += termToNT(bnode) + ' ' + termToNT(kb.sym(rdfns + 'first')) + ' ' + termToNT(list[i]) + '.\\n';\n str += termToNT(bnode) + ' ' + termToNT(kb.sym(rdfns + 'rest')) + ' ' + termToNT(rest) + '.\\n';\n rest = bnode;\n }\n return self.atomicTermToN3(rest);\n };\n for (var i = 0; i < sorted.length; i++) {\n var st = sorted[i];\n var s = '';\n s += termToNT(st.subject) + ' ';\n s += termToNT(st.predicate) + ' ';\n s += termToNT(st.object) + ' ';\n if (this.flags.indexOf('q') >= 0) {\n // Do quads not nrtiples\n s += termToNT(st.why) + ' ';\n }\n s += '.\\n';\n str += s;\n }\n return str;\n }\n statementsToN3(sts) {\n var indent = 4;\n var width = 80;\n var kb = this.store;\n // A URI Map alows us to put the type statemnts at the top.\n var uriMap = {\n 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type': 'aaa:00'\n };\n var SPO = function (x, y) {\n // Do limited canonicalization of bnodes\n return _utils_js__WEBPACK_IMPORTED_MODULE_5__.heavyCompareSPO(x, y, kb, uriMap);\n };\n sts.sort(SPO);\n if (this.base && !this.defaultNamespace) {\n this.defaultNamespace = this.base + '#';\n }\n var predMap = {};\n if (this.flags.indexOf('s') < 0) {\n predMap['http://www.w3.org/2002/07/owl#sameAs'] = '=';\n }\n if (this.flags.indexOf('t') < 0) {\n predMap['http://www.w3.org/1999/02/22-rdf-syntax-ns#type'] = 'a';\n }\n if (this.flags.indexOf('i') < 0) {\n predMap['http://www.w3.org/2000/10/swap/log#implies'] = '=>';\n }\n // //////////////////////// Arrange the bits of text\n\n var spaces = function (n) {\n var s = '';\n for (var i = 0; i < n; i++) s += ' ';\n return s;\n };\n var treeToLine = function (tree) {\n var str = '';\n for (var i = 0; i < tree.length; i++) {\n var branch = tree[i];\n var s2 = typeof branch === 'string' ? branch : treeToLine(branch);\n // Note the space before the dot in case statement ends with 123 or colon. which is in fact allowed but be conservative.\n if (i !== 0) {\n var ch = str.slice(-1) || ' ';\n if (s2 === ',' || s2 === ';') {\n // no gap\n } else if (s2 === '.' && !'0123456789.:'.includes(ch)) {// no gap except after number and colon\n // no gap\n } else {\n str += ' '; // separate from previous token\n }\n }\n str += s2;\n }\n return str;\n };\n\n // Convert a nested tree of lists and strings to a string\n var treeToString = function (tree, level) {\n var str = '';\n var lastLength = 100000;\n if (level === undefined) level = -1;\n for (var i = 0; i < tree.length; i++) {\n var branch = tree[i];\n if (typeof branch !== 'string') {\n var substr = treeToString(branch, level + 1);\n if (substr.length < 10 * (width - indent * level) && substr.indexOf('\"\"\"') < 0) {\n // Don't mess up multiline strings\n var line = treeToLine(branch);\n if (line.length < width - indent * level) {\n branch = line; // Note! treat as string below\n substr = '';\n }\n }\n if (substr) lastLength = 10000;\n str += substr;\n }\n if (typeof branch === 'string') {\n if (branch.length === 1 && str.slice(-1) === '\\n') {\n if (',.;'.indexOf(branch) >= 0) {\n str = str.slice(0, -1);\n // be conservative and ensure a whitespace between some chars and a final dot, as in treeToLine above\n if (branch == '.' && '0123456789.:'.includes(str.charAt(str.length - 1))) {\n str += ' ';\n lastLength += 1;\n }\n str += branch + '\\n'; // slip punct'n on end\n lastLength += 1;\n continue;\n }\n }\n if (lastLength < indent * level + 4 ||\n // if new line not necessary\n lastLength + branch.length + 1 < width && ';.'.indexOf(str[str.length - 2]) < 0) {\n // or the string fits on last line\n str = str.slice(0, -1) + ' ' + branch + '\\n'; // then continue on this line\n lastLength += branch.length + 1;\n } else {\n let line = spaces(indent * level) + branch;\n str += line + '\\n';\n lastLength = line.length;\n if (level < 0) {\n str += '\\n'; // extra blank line\n lastLength = 100000; // don't touch\n }\n }\n }\n }\n return str;\n };\n\n // //////////////////////////////////////////// Structure for N3\n // Convert a set of statements into a nested tree of lists and strings\n function statementListToTreeMethod(statements) {\n var stats = this.rootSubjects(statements);\n var roots = stats.roots;\n var results = [];\n for (var i = 0; i < roots.length; i++) {\n var root = roots[i];\n results.push(subjectTree(root, stats));\n }\n return results;\n }\n var statementListToTree = statementListToTreeMethod.bind(this);\n\n // The tree for a subject\n function subjectTree(subject, stats) {\n if (subject.termType === 'BlankNode' && !stats.incoming[subject]) {\n return objectTree(subject, stats, true).concat(['.']); // Anonymous bnode subject\n }\n return [termToN3(subject, stats)].concat([propertyTree(subject, stats)]).concat(['.']);\n }\n // The property tree for a single subject or anonymous node\n function propertyTreeMethod(subject, stats) {\n var results = [];\n var lastPred = null;\n var sts = stats.subjects[this.toStr(subject)] || []; // relevant statements\n if (typeof sts === 'undefined') {\n throw new Error('Cant find statements for ' + subject);\n }\n var objects = [];\n for (var i = 0; i < sts.length; i++) {\n var st = sts[i];\n if (st.predicate.uri === lastPred) {\n objects.push(',');\n } else {\n if (lastPred) {\n results = results.concat([objects]).concat([';']);\n objects = [];\n }\n results.push(predMap[st.predicate.uri] ? predMap[st.predicate.uri] : termToN3(st.predicate, stats));\n }\n lastPred = st.predicate.uri;\n objects.push(objectTree(st.object, stats));\n }\n results = results.concat([objects]);\n return results;\n }\n var propertyTree = propertyTreeMethod.bind(this);\n function objectTreeMethod(obj, stats, force) {\n if (obj.termType === 'BlankNode' && (force || stats.rootsHash[obj.toNT()] === undefined)) {\n // if not a root\n if (stats.subjects[this.toStr(obj)]) {\n return ['[', propertyTree(obj, stats), ']'];\n } else {\n return '[]';\n }\n }\n return termToN3(obj, stats);\n }\n var objectTree = objectTreeMethod.bind(this);\n function termToN3Method(expr, stats) {\n //\n var i, res;\n switch (expr.termType) {\n case 'Graph':\n res = ['{'];\n res = res.concat(statementListToTree(expr.statements));\n return res.concat(['}']);\n case 'Collection':\n res = ['('];\n for (i = 0; i < expr.elements.length; i++) {\n res.push([objectTree(expr.elements[i], stats)]);\n }\n res.push(')');\n return res;\n default:\n return this.atomicTermToN3(expr);\n }\n }\n Serializer.prototype.termToN3 = termToN3;\n var termToN3 = termToN3Method.bind(this);\n function prefixDirectivesMethod() {\n var str = '';\n if (this.flags.indexOf('d') < 0 && this.defaultNamespace) {\n str += '@prefix : ' + this.explicitURI(this.defaultNamespace) + '.\\n';\n }\n for (var ns in this.prefixes) {\n if (!this.prefixes.hasOwnProperty(ns)) continue;\n if (!this.namespacesUsed[ns]) continue;\n str += '@prefix ' + this.prefixes[ns] + ': ' + this.explicitURI(ns) + '.\\n';\n }\n return str + '\\n';\n }\n var prefixDirectives = prefixDirectivesMethod.bind(this);\n // Body of statementsToN3:\n var tree = statementListToTree(sts);\n return prefixDirectives() + treeToString(tree);\n }\n // //////////////////////////////////////////// Atomic Terms\n\n // Deal with term level things and nesting with no bnode structure\n atomicTermToN3(expr, stats) {\n switch (expr.termType) {\n case 'BlankNode':\n case 'Variable':\n return expr.toNT();\n case 'Literal':\n var val = expr.value;\n if (typeof val !== 'string') {\n throw new TypeError('Value of RDF literal node must be a string');\n }\n // var val = expr.value.toString() // should be a string already\n if (expr.datatype && this.flags.indexOf('x') < 0) {\n // Supress native numbers\n switch (expr.datatype.uri) {\n case 'http://www.w3.org/2001/XMLSchema#integer':\n return val;\n case 'http://www.w3.org/2001/XMLSchema#decimal':\n // In Turtle, must have dot\n if (val.indexOf('.') < 0) val += '.0';\n return val;\n case 'http://www.w3.org/2001/XMLSchema#double':\n {\n // Must force use of 'e'\n const eNotation = val.toLowerCase().indexOf('e') > 0;\n if (val.indexOf('.') < 0 && !eNotation) val += '.0';\n if (!eNotation) val += 'e0';\n return val;\n }\n case 'http://www.w3.org/2001/XMLSchema#boolean':\n return expr.value === '1' ? 'true' : 'false';\n }\n }\n var str = this.stringToN3(expr.value, this.flags);\n if (expr.language) {\n str += '@' + expr.language;\n } else if (!expr.datatype.equals(this.xsd.string)) {\n str += '^^' + this.atomicTermToN3(expr.datatype, stats);\n }\n return str;\n case 'NamedNode':\n return this.symbolToN3(expr);\n case 'DefaultGraph':\n return '';\n default:\n throw new Error('Internal: atomicTermToN3 cannot handle ' + expr + ' of termType: ' + expr.termType);\n }\n }\n stringToN3(str, flags) {\n if (!flags) flags = 'e';\n var res = '';\n var i, j, k;\n var delim;\n var forbidden;\n if (str.length > 20 &&\n // Long enough to make sense\n str.slice(-1) !== '\"' &&\n // corner case'\n flags.indexOf('n') < 0 && (\n // Force single line\n str.indexOf('\\n') > 0 || str.indexOf('\"') > 0)) {\n delim = '\"\"\"';\n forbidden = this.forbidden3;\n } else {\n delim = '\"';\n forbidden = this.forbidden1;\n }\n for (i = 0; i < str.length;) {\n forbidden.lastIndex = 0;\n var m = forbidden.exec(str.slice(i));\n if (m == null) break;\n j = i + forbidden.lastIndex - 1;\n res += str.slice(i, j);\n var ch = str[j];\n if (ch === '\"' && delim === '\"\"\"' && str.slice(j, j + 3) !== '\"\"\"') {\n res += ch;\n } else {\n k = '\\b\\f\\r\\t\\v\\n\\\\\"'.indexOf(ch); // No escaping of bell (7)?\n if (k >= 0) {\n res += '\\\\' + 'bfrtvn\\\\\"'[k];\n } else {\n if (flags.indexOf('e') >= 0) {\n // Unicode escaping in strings not unix style\n res += '\\\\u' + ('000' + ch.charCodeAt(0).toString(16).toLowerCase()).slice(-4);\n } else {\n // no 'e' flag\n res += ch;\n }\n }\n }\n i = j + 1;\n }\n return delim + res + str.slice(i) + delim;\n }\n // A single symbol, either in <> or namespace notation\n\n symbolToN3(x) {\n // c.f. symbolString() in notation3.py\n var uri = x.uri;\n var j = uri.indexOf('#');\n if (j < 0 && this.flags.indexOf('/') < 0) {\n j = uri.lastIndexOf('/');\n }\n if (j >= 0 && this.flags.indexOf('p') < 0 && (\n // Can split at namespace but only if http[s]: URI or file: or ws[s] (why not others?)\n uri.indexOf('http') === 0 || uri.indexOf('ws') === 0 || uri.indexOf('file') === 0)) {\n var localid = uri.slice(j + 1);\n var namesp = uri.slice(0, j + 1);\n // Don't split if namespace is just the protocol (e.g., https://)\n // A valid namespace should have content after the protocol\n var minNamespaceLength = uri.indexOf('://') + 4; // e.g., \"http://x\" minimum\n // Also don't split if namespace is the base directory (would serialize as relative URI)\n var baseDir = this.base ? this.base.slice(0, Math.max(this.base.lastIndexOf('/'), this.base.lastIndexOf('#')) + 1) : null;\n var namespaceIsBaseDir = baseDir && namesp === baseDir;\n // If flag 'o' is present, forbid dots in local part when abbreviating\n var forbidDotLocal = this.flags.indexOf('o') >= 0 && localid.indexOf('.') >= 0;\n var canSplit = !namespaceIsBaseDir && !forbidDotLocal && namesp.length > minNamespaceLength && this.isValidPNLocal(localid);\n /*\n if (uri.slice(0, j + 1) === this.base + '#') { // base-relative\n if (canSplit) {\n return ':' + uri.slice(j + 1) // assume deafult ns is local\n } else {\n return '<#' + uri.slice(j + 1) + '>'\n }\n }\n */\n if (canSplit) {\n if (this.defaultNamespace && this.defaultNamespace === namesp && this.flags.indexOf('d') < 0) {\n // d -> suppress default\n if (this.flags.indexOf('k') >= 0 && this.keyords.indexOf(localid) < 0) {\n return localid;\n }\n return ':' + localid;\n }\n // this.checkIntegrity() // @@@ Remove when not testing\n var prefix = this.prefixes[namesp];\n if (!prefix) prefix = this.makeUpPrefix(namesp);\n if (prefix) {\n this.namespacesUsed[namesp] = true;\n return prefix + ':' + localid;\n }\n // Fall though if can't do qname\n }\n }\n return this.explicitURI(uri);\n }\n\n // /////////////////////////// Quad store serialization\n\n // @para. write - a function taking a single string to be output\n //\n writeStore(write) {\n var kb = this.store;\n var fetcher = kb.fetcher;\n var session = fetcher && fetcher.appNode;\n\n // The core data\n\n var sources = this.store.index[3];\n for (var s in sources) {\n // -> assume we can use -> as short for log:semantics\n var source = kb.fromNT(s);\n if (session && source.equals(session)) continue;\n write('\\n' + this.atomicTermToN3(source) + ' ' + this.atomicTermToN3(kb.sym('http://www.w3.org/2000/10/swap/log#semantics')) + ' { ' + this.statementsToN3(kb.statementsMatching(undefined, undefined, undefined, source)) + ' }.\\n');\n }\n\n // The metadata from HTTP interactions:\n\n kb.statementsMatching(undefined, kb.sym('http://www.w3.org/2007/ont/link#requestedURI')).map(function (st) {\n write('\\n<' + st.object.value + '> log:metadata {\\n');\n var sts = kb.statementsMatching(undefined, undefined, undefined, st.subject);\n write(this.statementsToN3(this.statementsToN3(sts)));\n write('}.\\n');\n });\n\n // Inferences we have made ourselves not attributable to anyone else\n\n var metaSources = [];\n if (session) metaSources.push(session);\n var metadata = [];\n metaSources.map(function (source) {\n metadata = metadata.concat(kb.statementsMatching(undefined, undefined, undefined, source));\n });\n write(this.statementsToN3(metadata));\n }\n\n // ////////////////////////////////////////////// XML serialization\n\n statementsToXML(sts) {\n var indent = 4;\n var width = 80;\n var namespaceCounts = []; // which have been used\n namespaceCounts['http://www.w3.org/1999/02/22-rdf-syntax-ns#'] = true;\n var liPrefix = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#_'; // prefix for ordered list items\n\n // //////////////////////// Arrange the bits of XML text\n\n var spaces = function (n) {\n var s = '';\n for (var i = 0; i < n; i++) s += ' ';\n return s;\n };\n var XMLtreeToLine = function (tree) {\n var str = '';\n for (var i = 0; i < tree.length; i++) {\n var branch = tree[i];\n var s2 = typeof branch === 'string' ? branch : XMLtreeToLine(branch);\n str += s2;\n }\n return str;\n };\n\n // Convert a nested tree of lists and strings to a string\n var XMLtreeToString = function (tree, level) {\n var str = '';\n var line;\n var lastLength = 100000;\n if (!level) level = 0;\n for (var i = 0; i < tree.length; i++) {\n var branch = tree[i];\n if (typeof branch !== 'string') {\n var substr = XMLtreeToString(branch, level + 1);\n if (substr.length < 10 * (width - indent * level) && substr.indexOf('\"\"\"') < 0) {\n // Don't mess up multiline strings\n line = XMLtreeToLine(branch);\n if (line.length < width - indent * level) {\n branch = ' ' + line; // @@ Hack: treat as string below\n substr = '';\n }\n }\n if (substr) lastLength = 10000;\n str += substr;\n }\n if (typeof branch === 'string') {\n if (lastLength < indent * level + 4) {\n // continue\n str = str.slice(0, -1) + ' ' + branch + '\\n';\n lastLength += branch.length + 1;\n } else {\n line = spaces(indent * level) + branch;\n str += line + '\\n';\n lastLength = line.length;\n }\n } else {// not string\n }\n }\n return str;\n };\n function statementListToXMLTreeMethod(statements) {\n this.suggestPrefix('rdf', 'http://www.w3.org/1999/02/22-rdf-syntax-ns#');\n var stats = this.rootSubjects(statements);\n var roots = stats.roots;\n var results = [];\n for (var i = 0; i < roots.length; i++) {\n var root = roots[i];\n results.push(subjectXMLTree(root, stats));\n }\n return results;\n }\n var statementListToXMLTree = statementListToXMLTreeMethod.bind(this);\n function escapeForXML(str) {\n if (typeof str === 'undefined') return '@@@undefined@@@@';\n return str.replace(/[&<\"]/g, function (m) {\n switch (m[0]) {\n case '&':\n return '&amp;';\n case '<':\n return '&lt;';\n case '\"':\n return '&quot;';\n // '\n }\n });\n }\n function relURIMethod(term) {\n return escapeForXML(this.base ? _uri__WEBPACK_IMPORTED_MODULE_4__.refTo(this.base, term.uri) : term.uri);\n }\n var relURI = relURIMethod.bind(this);\n\n // The tree for a subject\n function subjectXMLTreeMethod(subject, stats) {\n var results = [];\n var type, t, st, pred;\n var sts = stats.subjects[this.toStr(subject)]; // relevant statements\n if (typeof sts === 'undefined') {\n // empty bnode\n return propertyXMLTree(subject, stats);\n }\n\n // Sort only on the predicate, leave the order at object\n // level undisturbed. This leaves multilingual content in\n // the order of entry (for partner literals), which helps\n // readability.\n //\n // For the predicate sort, we attempt to split the uri\n // as a hint to the sequence\n sts.sort(function (a, b) {\n var ap = a.predicate.uri;\n var bp = b.predicate.uri;\n if (ap.substring(0, liPrefix.length) === liPrefix || bp.substring(0, liPrefix.length) === liPrefix) {\n // we're only interested in sorting list items\n return ap.localeCompare(bp);\n }\n var as = ap.substring(liPrefix.length);\n var bs = bp.substring(liPrefix.length);\n var an = parseInt(as, 10);\n var bn = parseInt(bs, 10);\n if (isNaN(an) || isNaN(bn) || an !== as || bn !== bs) {\n // we only care about integers\n return ap.localeCompare(bp);\n }\n return an - bn;\n });\n for (var i = 0; i < sts.length; i++) {\n st = sts[i];\n // look for a type\n if (st.predicate.uri === 'http://www.w3.org/1999/02/22-rdf-syntax-ns#type' && !type && st.object.termType === 'NamedNode') {\n type = st.object;\n continue; // don't include it as a child element\n }\n\n // see whether predicate can be replaced with \"li\"\n pred = st.predicate;\n if (pred.uri.substr(0, liPrefix.length) === liPrefix) {\n var number = pred.uri.substr(liPrefix.length);\n // make sure these are actually numeric list items\n var intNumber = parseInt(number, 10);\n if (number === intNumber.toString()) {\n // was numeric; don't need to worry about ordering since we've already\n // sorted the statements\n pred = this.rdfFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#li');\n }\n }\n t = qname(pred);\n switch (st.object.termType) {\n case 'BlankNode':\n if (stats.incoming[st.object].length === 1) {\n // there should always be something in the incoming array for a bnode\n results = results.concat(['<' + t + ' rdf:parseType=\"Resource\">', subjectXMLTree(st.object, stats), '</' + t + '>']);\n } else {\n results = results.concat(['<' + t + ' rdf:nodeID=\"' + st.object.toNT().slice(2) + '\"/>']);\n }\n break;\n case 'NamedNode':\n results = results.concat(['<' + t + ' rdf:resource=\"' + relURI(st.object) + '\"/>']);\n break;\n case 'Literal':\n results = results.concat(['<' + t + (st.object.language ? ' xml:lang=\"' + st.object.language + '\"' : st.object.datatype.equals(this.xsd.string) ? '' : ' rdf:datatype=\"' + escapeForXML(st.object.datatype.uri) + '\"') + '>' + escapeForXML(st.object.value) + '</' + t + '>']);\n break;\n case 'Collection':\n results = results.concat(['<' + t + ' rdf:parseType=\"Collection\">', collectionXMLTree(st.object, stats), '</' + t + '>']);\n break;\n default:\n throw new Error(\"Can't serialize object of type \" + st.object.termType + ' into XML');\n } // switch\n }\n var tag = type ? qname(type) : 'rdf:Description';\n var attrs = '';\n if (subject.termType === 'BlankNode') {\n if (!stats.incoming[subject] || stats.incoming[subject].length !== 1) {\n // not an anonymous bnode\n attrs = ' rdf:nodeID=\"' + subject.toNT().slice(2) + '\"';\n }\n } else {\n attrs = ' rdf:about=\"' + relURI(subject) + '\"';\n }\n return ['<' + tag + attrs + '>'].concat([results]).concat(['</' + tag + '>']);\n }\n var subjectXMLTree = subjectXMLTreeMethod.bind(this);\n function collectionXMLTree(subject, stats) {\n var res = [];\n for (var i = 0; i < subject.elements.length; i++) {\n res.push(subjectXMLTree(subject.elements[i], stats));\n }\n return res;\n }\n\n // The property tree for a single subject or anonymos node\n function propertyXMLTreeMethod(subject, stats) {\n var results = [];\n var sts = stats.subjects[this.toStr(subject)]; // relevant statements\n if (!sts) return results; // No relevant statements\n sts.sort();\n for (var i = 0; i < sts.length; i++) {\n var st = sts[i];\n switch (st.object.termType) {\n case 'BlankNode':\n if (stats.rootsHash[st.object.toNT()]) {\n // This bnode has been done as a root -- no content here @@ what bout first time\n results = results.concat(['<' + qname(st.predicate) + ' rdf:nodeID=\"' + st.object.toNT().slice(2) + '\">', '</' + qname(st.predicate) + '>']);\n } else {\n results = results.concat(['<' + qname(st.predicate) + ' rdf:parseType=\"Resource\">', propertyXMLTree(st.object, stats), '</' + qname(st.predicate) + '>']);\n }\n break;\n case 'NamedNode':\n results = results.concat(['<' + qname(st.predicate) + ' rdf:resource=\"' + relURI(st.object) + '\"/>']);\n break;\n case 'Literal':\n results = results.concat(['<' + qname(st.predicate) + (st.object.language ? ' xml:lang=\"' + st.object.language + '\"' : st.object.datatype.equals(this.xsd.string) ? '' : ' rdf:datatype=\"' + escapeForXML(st.object.datatype.value) + '\"') + '>' + escapeForXML(st.object.value) + '</' + qname(st.predicate) + '>']);\n break;\n case 'Collection':\n results = results.concat(['<' + qname(st.predicate) + ' rdf:parseType=\"Collection\">', collectionXMLTree(st.object, stats), '</' + qname(st.predicate) + '>']);\n break;\n default:\n throw new Error(\"Can't serialize object of type \" + st.object.termType + ' into XML');\n } // switch\n }\n return results;\n }\n var propertyXMLTree = propertyXMLTreeMethod.bind(this);\n function qnameMethod(term) {\n var uri = term.uri;\n var j = uri.indexOf('#');\n if (j < 0 && this.flags.indexOf('/') < 0) {\n j = uri.lastIndexOf('/');\n }\n if (j < 0) throw new Error('Cannot make qname out of <' + uri + '>');\n for (var k = j + 1; k < uri.length; k++) {\n if (this._notNameChars.indexOf(uri[k]) >= 0) {\n throw new Error('Invalid character \"' + uri[k] + '\" cannot be in XML qname for URI: ' + uri);\n }\n }\n var localid = uri.slice(j + 1);\n var namesp = uri.slice(0, j + 1);\n if (this.defaultNamespace && this.defaultNamespace === namesp && this.flags.indexOf('d') < 0) {\n // d -> suppress default\n return localid;\n }\n var prefix = this.prefixes[namesp];\n if (!prefix) prefix = this.makeUpPrefix(namesp);\n namespaceCounts[namesp] = true;\n return prefix + ':' + localid;\n }\n var qname = qnameMethod.bind(this);\n\n // Body of toXML:\n\n var tree = statementListToXMLTree(sts);\n var str = '<rdf:RDF';\n if (this.defaultNamespace) {\n str += ' xmlns=\"' + escapeForXML(this.defaultNamespace) + '\"';\n }\n for (var ns in namespaceCounts) {\n if (!namespaceCounts.hasOwnProperty(ns)) continue;\n // Rel uris in xml ns is not strictly allowed in the XMLNS spec but needed in practice often\n var ns2 = this.base && this.flags.includes('z') ? _uri__WEBPACK_IMPORTED_MODULE_4__.refTo(this.base, ns) : ns;\n str += '\\n xmlns:' + this.prefixes[ns] + '=\"' + escapeForXML(ns2) + '\"';\n }\n str += '>';\n var tree2 = [str, tree, '</rdf:RDF>']; // @@ namespace declrations\n return XMLtreeToString(tree2, -1);\n } // End @@ body\n\n statementsToJsonld(sts) {\n // ttl2jsonld creates context keys for all ttl prefix\n // context keys must be absolute IRI ttl2jsonld@0.0.8\n /* function findId (itemObj) {\n if (itemObj['@id']) {\n const item = itemObj['@id'].split(':')\n if (keys[item[0]]) itemObj['@id'] = jsonldObj['@context'][item[0]] + item[1]\n }\n const itemValues = Object.values(itemObj)\n for (const i in itemValues) {\n if (typeof itemValues[i] !== 'string') { // @list contains array\n findId(itemValues[i])\n }\n }\n } */\n const turtleDoc = this.statementsToN3(sts);\n const jsonldObj = _frogcat_ttl2jsonld__WEBPACK_IMPORTED_MODULE_1__.parse(turtleDoc);\n return JSON.stringify(jsonldObj, null, 2);\n }\n}\n\n// String escaping utilities\n\nfunction hexify(str) {\n // also used in parser\n return encodeURI(str);\n}\nfunction backslashUify(str) {\n var res = '';\n var k;\n for (var i = 0; i < str.length; i++) {\n k = str.charCodeAt(i);\n if (k > 65535) {\n res += '\\\\U' + ('00000000' + k.toString(16)).slice(-8); // convert to upper?\n } else if (k > 126) {\n res += '\\\\u' + ('0000' + k.toString(16)).slice(-4);\n } else {\n res += str[i];\n }\n }\n return res;\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/serializer.js?\n}");
446
1111
 
447
1112
  /***/ },
448
1113
 
449
- /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberMap.js"
450
- /*!***************************************************************************!*\
451
- !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberMap.js ***!
452
- \***************************************************************************/
453
- (__unused_webpack_module, exports, __webpack_require__) {
1114
+ /***/ "./node_modules/rdflib/esm/sparql-to-query.js"
1115
+ /*!****************************************************!*\
1116
+ !*** ./node_modules/rdflib/esm/sparql-to-query.js ***!
1117
+ \****************************************************/
1118
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
454
1119
 
455
1120
  "use strict";
456
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryNumberMap = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_string_1 = __webpack_require__(/*! rdf-string */ \"./node_modules/rdf-string/index.js\");\n/**\n * A term dictionary that encodes to numbers, and stores the dictionary in memory in a Map.\n */\nclass TermDictionaryNumberMap {\n constructor(dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.lastId = 0;\n this.dictionary = new Map();\n this.reverseDictionary = new Map();\n this.features = { quotedTriples: false };\n this.dataFactory = dataFactory;\n }\n encode(term) {\n const key = (0, rdf_string_1.termToString)(term);\n let encoded = this.dictionary.get(key);\n if (encoded === undefined) {\n encoded = this.lastId++;\n this.dictionary.set(key, encoded);\n this.reverseDictionary.set(encoded, key);\n }\n return encoded;\n }\n encodeOptional(term) {\n const key = (0, rdf_string_1.termToString)(term);\n return this.dictionary.get(key);\n }\n decode(encoding) {\n const string = this.reverseDictionary.get(encoding);\n if (string === undefined) {\n throw new Error(`The value ${encoding} is not present in this dictionary`);\n }\n return (0, rdf_string_1.stringToTerm)(string, this.dataFactory);\n }\n encodings() {\n return this.reverseDictionary.keys();\n }\n findQuotedTriples(quotedTriplePattern) {\n throw new Error('findQuotedTriples is not supported');\n }\n findQuotedTriplesEncoded(quotedTriplePattern) {\n throw new Error('findQuotedTriplesEncoded is not supported');\n }\n}\nexports.TermDictionaryNumberMap = TermDictionaryNumberMap;\n//# sourceMappingURL=TermDictionaryNumberMap.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberMap.js?\n}");
1121
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ SPARQLToQuery)\n/* harmony export */ });\n/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./log */ \"./node_modules/rdflib/esm/log.js\");\n/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./query */ \"./node_modules/rdflib/esm/query.js\");\n// Converting between SPARQL queries and the $rdf query API\n/*\n\nfunction SQuery () {\n this.terms = []\n return this\n}\n\nSTerm.prototype.toString = STerm.val\nSQuery.prototype.add = function (str) {this.terms.push()}*/\n\n\n\n\n/**\n * @SPARQL: SPARQL text that is converted to a query object which is returned.\n * @testMode: testing flag. Prevents loading of sources.\n */\nfunction SPARQLToQuery(SPARQL, testMode, kb) {\n // AJAR_ClearTable()\n var variableHash = [];\n function makeVar(name) {\n if (variableHash[name]) {\n return variableHash[name];\n }\n var newVar = kb.variable(name);\n variableHash[name] = newVar;\n return newVar;\n }\n\n // term type functions\n function isRealText(term) {\n return typeof term === 'string' && term.match(/[^ \\n\\t]/);\n }\n function isVar(term) {\n return typeof term === 'string' && term.match(/^[\\?\\$]/);\n }\n function fixSymbolBrackets(term) {\n if (typeof term === 'string') {\n return term.replace(/^&lt;/, '<').replace(/&gt;$/, '>');\n } else {\n return term;\n }\n }\n function isSymbol(term) {\n return typeof term === 'string' && term.match(/^<[^>]*>$/);\n }\n function isBnode(term) {\n return typeof term === 'string' && (term.match(/^_:/) || term.match(/^$/));\n }\n function isPrefix(term) {\n return typeof term === 'string' && term.match(/:$/);\n }\n function isPrefixedSymbol(term) {\n return typeof term === 'string' && term.match(/^:|^[^_][^:]*:/);\n }\n function getPrefix(term) {\n var a = term.split(':');\n return a[0];\n }\n function getSuffix(term) {\n var a = term.split(':');\n return a[1];\n }\n function removeBrackets(term) {\n if (isSymbol(term)) {\n return term.slice(1, term.length - 1);\n } else {\n return term;\n }\n }\n // takes a string and returns an array of strings and Literals in the place of literals\n function parseLiterals(str) {\n // var sin = (str.indexOf(/[ \\n]\\'/)==-1)?null:str.indexOf(/[ \\n]\\'/), doub = (str.indexOf(/[ \\n]\\\"/)==-1)?null:str.indexOf(/[ \\n]\\\"/)\n var sin = str.indexOf(\"'\") === -1 ? null : str.indexOf(\"'\");\n var doub = str.indexOf('\"') === -1 ? null : str.indexOf('\"');\n // alert(\"S: \"+sin+\" D: \"+doub)\n if (!sin && !doub) {\n var a = new Array(1);\n a[0] = str;\n return a;\n }\n var res = new Array(2);\n var br;\n var ind;\n if (!sin || doub && doub < sin) {\n br = '\"';\n ind = doub;\n } else if (!doub || sin && sin < doub) {\n br = \"'\";\n ind = sin;\n } else {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error('SQARQL QUERY OOPS!');\n return res;\n }\n res[0] = str.slice(0, ind);\n var end = str.slice(ind + 1).indexOf(br);\n if (end === -1) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error('SPARQL parsing error: no matching parentheses in literal ' + str);\n return str;\n }\n // alert(str.slice(end + ind + 2).match(/^\\^\\^/))\n var end2;\n if (str.slice(end + ind + 2).match(/^\\^\\^/)) {\n end2 = str.slice(end + ind + 2).indexOf(' ');\n // alert(end2)\n res[1] = kb.literal(str.slice(ind + 1, ind + 1 + end), kb.sym(removeBrackets(str.slice(ind + 4 + end, ind + 2 + end + end2))));\n // alert(res[1].datatype.uri)\n res = res.concat(parseLiterals(str.slice(end + ind + 3 + end2)));\n } else if (str.slice(end + ind + 2).match(/^@/)) {\n end2 = str.slice(end + ind + 2).indexOf(' ');\n // alert(end2)\n res[1] = kb.literal(str.slice(ind + 1, ind + 1 + end), str.slice(ind + 3 + end, ind + 2 + end + end2), null);\n // alert(res[1].datatype.uri)\n res = res.concat(parseLiterals(str.slice(end + ind + 2 + end2)));\n } else {\n res[1] = kb.literal(str.slice(ind + 1, ind + 1 + end));\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('Literal found: ' + res[1]);\n res = res.concat(parseLiterals(str.slice(end + ind + 2))); // finds any other literals\n }\n return res;\n }\n function spaceDelimit(str) {\n str = str.replace(/\\(/g, ' ( ').replace(/\\)/g, ' ) ').replace(/</g, ' <').replace(/>/g, '> ').replace(/{/g, ' { ').replace(/}/g, ' } ').replace(/[\\t\\n\\r]/g, ' ').replace(/; /g, ' ; ').replace(/\\. /g, ' . ').replace(/, /g, ' , ');\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('New str into spaceDelimit: \\n' + str);\n var res = [];\n var br = str.split(' ');\n for (var x in br) {\n if (isRealText(br[x])) {\n res = res.concat(br[x]);\n }\n }\n return res;\n }\n function replaceKeywords(input) {\n var strarr = input;\n for (var x = 0; x < strarr.length; x++) {\n if (strarr[x] === 'a') {\n strarr[x] = '<http://www.w3.org/1999/02/22-rdf-syntax-ns#type>';\n }\n if (strarr[x] === 'is' && strarr[x + 2] === 'of') {\n strarr.splice(x, 1);\n strarr.splice(x + 1, 1);\n var s = strarr[x - 1];\n strarr[x - 1] = strarr[x + 1];\n strarr[x + 1] = s;\n }\n }\n return strarr;\n }\n function toTerms(input) {\n var res = [];\n for (var x = 0; x < input.length; x++) {\n if (typeof input[x] !== 'string') {\n res[x] = input[x];\n continue;\n }\n input[x] = fixSymbolBrackets(input[x]);\n if (isVar(input[x])) {\n res[x] = makeVar(input[x].slice(1));\n } else if (isBnode(input[x])) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info(input[x] + ' was identified as a bnode.');\n res[x] = kb.bnode();\n } else if (isSymbol(input[x])) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info(input[x] + ' was identified as a symbol.');\n res[x] = kb.sym(removeBrackets(input[x]));\n } else if (isPrefixedSymbol(input[x])) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info(input[x] + ' was identified as a prefixed symbol');\n if (prefixes[getPrefix(input[x])]) {\n res[x] = kb.sym(input[x] = prefixes[getPrefix(input[x])] + getSuffix(input[x]));\n } else {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error('SPARQL error: ' + input[x] + ' with prefix ' + getPrefix(input[x]) + ' does not have a correct prefix entry.');\n res[x] = input[x];\n }\n } else {\n res[x] = input[x];\n }\n }\n return res;\n }\n function tokenize(str) {\n var token1 = parseLiterals(str);\n var token2 = [];\n for (var x in token1) {\n if (typeof token1[x] === 'string') {\n token2 = token2.concat(spaceDelimit(token1[x]));\n } else {\n token2 = token2.concat(token1[x]);\n }\n }\n token2 = replaceKeywords(token2);\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('SPARQL Tokens: ' + token2);\n return token2;\n }\n\n // CASE-INSENSITIVE\n function arrayIndexOf(str, arr) {\n for (var i = 0; i < arr.length; i++) {\n if (typeof arr[i] !== 'string') {\n continue;\n }\n if (arr[i].toLowerCase() === str.toLowerCase()) {\n return i;\n }\n }\n // log.warn(\"No instance of \"+str+\" in array \"+arr)\n return null;\n }\n\n // CASE-INSENSITIVE\n function arrayIndicesOf(str, arr) {\n var ind = [];\n for (var i = 0; i < arr.length; i++) {\n if (typeof arr[i] !== 'string') {\n continue;\n }\n if (arr[i].toLowerCase() === str.toLowerCase()) {\n ind.push(i);\n }\n }\n return ind;\n }\n function setVars(input, query) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('SPARQL vars: ' + input);\n for (var x in input) {\n if (isVar(input[x])) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('Added ' + input[x] + ' to query variables from SPARQL');\n var v = makeVar(input[x].slice(1));\n query.vars.push(v);\n v.label = input[x].slice(1);\n } else {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].warn('Incorrect SPARQL variable in SELECT: ' + input[x]);\n }\n }\n }\n function getPrefixDeclarations(input) {\n var prefInd = arrayIndicesOf('PREFIX', input);\n var res = [];\n for (var i in prefInd) {\n var a = input[prefInd[i] + 1];\n var b = input[prefInd[i] + 2];\n if (!isPrefix(a)) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error('Invalid SPARQL prefix: ' + a);\n } else if (!isSymbol(b)) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error('Invalid SPARQL symbol: ' + b);\n } else {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('Prefix found: ' + a + ' -> ' + b);\n var pref = getPrefix(a);\n var symbol = removeBrackets(b);\n res[pref] = symbol;\n }\n }\n return res;\n }\n function getMatchingBracket(arr, open, close) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('Looking for a close bracket of type ' + close + ' in ' + arr);\n var index = 0;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === open) {\n index++;\n }\n if (arr[i] === close) {\n index--;\n }\n if (index < 0) {\n return i;\n }\n }\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error('Statement had no close parenthesis in SPARQL query');\n return 0;\n }\n function constraintGreaterThan(value) {\n this.describe = function (varstr) {\n return varstr + ' > ' + value.toNT();\n };\n this.test = function (term) {\n if (term.value.match(/[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?/)) {\n return parseFloat(term.value) > parseFloat(value);\n } else {\n return term.toNT() > value.toNT();\n }\n };\n return this;\n }\n function constraintLessThan(value) {\n // this is not the recommended usage. Should only work on literal, numeric, dateTime\n this.describe = function (varstr) {\n return varstr + ' < ' + value.toNT();\n };\n this.test = function (term) {\n // this.describe = function (varstr) { return varstr + \" < \"+value }\n if (term.value.match(/[0-9]+(\\.[0-9]+)?([eE][+-]?[0-9]+)?/)) {\n return parseFloat(term.value) < parseFloat(value);\n } else {\n return term.toNT() < value.toNT();\n }\n };\n return this;\n }\n // This should only work on literals but doesn't.\n function ConstraintEqualTo(value) {\n this.describe = function (varstr) {\n return varstr + ' = ' + value.toNT();\n };\n this.test = function (term) {\n return value.equals(term);\n };\n return this;\n }\n\n // value must be a literal\n function ConstraintRegexp(value) {\n this.describe = function (varstr) {\n return \"REGEXP( '\" + value + \"' , \" + varstr + ' )';\n };\n this.test = function (term) {\n var str = value;\n // str = str.replace(/^//,\"\").replace(//$/,\"\")\n var rg = new RegExp(str);\n if (term.value) {\n return rg.test(term.value);\n } else {\n return false;\n }\n };\n }\n function setConstraint(input, pat) {\n if (input.length === 3 && input[0].termType === 'Variable' && (input[2].termType === 'NamedNode' || input[2].termType === 'Literal')) {\n if (input[1] === '=') {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debug('Constraint added: ' + input);\n pat.constraints[input[0]] = new ConstraintEqualTo(input[2]);\n } else if (input[1] === '>') {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debug('Constraint added: ' + input);\n pat.constraints[input[0]] = new ConstraintEqualTo(input[2]);\n } else if (input[1] === '<') {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debug('Constraint added: ' + input);\n pat.constraints[input[0]] = new ConstraintEqualTo(input[2]);\n } else {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].warn(\"I don't know how to handle the constraint: \" + input);\n }\n } else if (input.length === 6 && typeof input[0] === 'string' && input[0].toLowerCase() === 'regexp' && input[1] === '(' && input[5] === ')' && input[3] === ',' && input[4].termType === 'Variable' && input[2].termType === 'Literal') {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debug('Constraint added: ' + input);\n pat.constraints[input[4]] = new ConstraintRegexp(input[2].value);\n }\n // log.warn(\"I don't know how to handle the constraint: \"+input)\n // alert(\"length: \"+input.length+\" input 0 type: \"+input[0].termType+\" input 1: \"+input[1]+\" input[2] type: \"+input[2].termType)\n }\n function setOptional(terms, pat) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debug('Optional query: ' + terms + ' not yet implemented.');\n var opt = kb.formula();\n setWhere(terms, opt);\n pat.optional.push(opt);\n }\n function setWhere(input, pat) {\n var terms = toTerms(input);\n var end;\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debug('WHERE: ' + terms);\n var opt;\n // var opt = arrayIndicesOf(\"OPTIONAL\",terms)\n while (arrayIndexOf('OPTIONAL', terms)) {\n opt = arrayIndexOf('OPTIONAL', terms);\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debug('OPT: ' + opt + ' ' + terms[opt] + ' in ' + terms);\n if (terms[opt + 1] !== '{') {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].warn('Bad optional opening bracket in word ' + opt);\n }\n end = getMatchingBracket(terms.slice(opt + 2), '{', '}');\n if (end === -1) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error('No matching bracket in word ' + opt);\n } else {\n setOptional(terms.slice(opt + 2, opt + 2 + end), pat);\n // alert(pat.statements[0].toNT())\n opt = arrayIndexOf('OPTIONAL', terms);\n end = getMatchingBracket(terms.slice(opt + 2), '{', '}');\n terms.splice(opt, end + 3);\n }\n }\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debug('WHERE after optionals: ' + terms);\n while (arrayIndexOf('FILTER', terms)) {\n var filt = arrayIndexOf('FILTER', terms);\n if (terms[filt + 1] !== '(') {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].warn('Bad filter opening bracket in word ' + filt);\n }\n end = getMatchingBracket(terms.slice(filt + 2), '(', ')');\n if (end === -1) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error('No matching bracket in word ' + filt);\n } else {\n setConstraint(terms.slice(filt + 2, filt + 2 + end), pat);\n filt = arrayIndexOf('FILTER', terms);\n end = getMatchingBracket(terms.slice(filt + 2), '(', ')');\n terms.splice(filt, end + 3);\n }\n }\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].debug('WHERE after filters and optionals: ' + terms);\n extractStatements(terms, pat);\n }\n function extractStatements(terms, formula) {\n var arrayZero = new Array(1);\n arrayZero[0] = -1; // this is just to add the beginning of the where to the periods index.\n var per = arrayZero.concat(arrayIndicesOf('.', terms));\n var stat = [];\n for (var x = 0; x < per.length - 1; x++) {\n stat[x] = terms.slice(per[x] + 1, per[x + 1]);\n }\n // Now it's in an array of statements\n for (x in stat) {\n // THIS MUST BE CHANGED FOR COMMA, SEMICOLON\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('s+p+o ' + x + ' = ' + stat[x]);\n var subj = stat[x][0];\n stat[x].splice(0, 1);\n var sem = arrayZero.concat(arrayIndicesOf(';', stat[x]));\n sem.push(stat[x].length);\n var stat2 = [];\n for (var y = 0; y < sem.length - 1; y++) {\n stat2[y] = stat[x].slice(sem[y] + 1, sem[y + 1]);\n }\n for (x in stat2) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('p+o ' + x + ' = ' + stat[x]);\n var pred = stat2[x][0];\n stat2[x].splice(0, 1);\n var com = arrayZero.concat(arrayIndicesOf(',', stat2[x]));\n com.push(stat2[x].length);\n var stat3 = [];\n for (y = 0; y < com.length - 1; y++) {\n stat3[y] = stat2[x].slice(com[y] + 1, com[y + 1]);\n }\n for (x in stat3) {\n var obj = stat3[x][0];\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('Subj=' + subj + ' Pred=' + pred + ' Obj=' + obj);\n formula.add(subj, pred, obj);\n }\n }\n }\n }\n\n // ******************************* Body of SPARQLToQuery ***************************//\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].info('SPARQL input: \\n' + SPARQL);\n var q = new _query__WEBPACK_IMPORTED_MODULE_1__.Query();\n var sp = tokenize(SPARQL); // first tokenize everything\n var prefixes = getPrefixDeclarations(sp);\n if (!prefixes.rdf) {\n prefixes.rdf = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#';\n }\n if (!prefixes.rdfs) {\n prefixes.rdfs = 'http://www.w3.org/2000/01/rdf-schema#';\n }\n var selectLoc = arrayIndexOf('SELECT', sp);\n var whereLoc = arrayIndexOf('WHERE', sp);\n if (selectLoc < 0 || whereLoc < 0 || selectLoc > whereLoc) {\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].error('Invalid or nonexistent SELECT and WHERE tags in SPARQL query');\n return false;\n }\n setVars(sp.slice(selectLoc + 1, whereLoc), q);\n setWhere(sp.slice(whereLoc + 2, sp.length - 1), q.pat);\n if (testMode) {\n return q;\n }\n for (var x in q.pat.statements) {\n var st = q.pat.statements[x];\n if (st.subject.termType === 'NamedNode') {\n if (kb.fetcher) {\n kb.fetcher.lookUpThing(st.subject, 'sparql:' + st.subject);\n }\n }\n if (st.object.termType === 'NamedNode') {\n if (kb.fetcher) {\n kb.fetcher.lookUpThing(st.object, 'sparql:' + st.object);\n }\n }\n }\n // alert(q.pat)\n return q;\n // checkVars()\n // *******************************************************************//\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/sparql-to-query.js?\n}");
457
1122
 
458
1123
  /***/ },
459
1124
 
460
- /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecord.js"
461
- /*!******************************************************************************!*\
462
- !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecord.js ***!
463
- \******************************************************************************/
464
- (__unused_webpack_module, exports, __webpack_require__) {
1125
+ /***/ "./node_modules/rdflib/esm/statement.js"
1126
+ /*!**********************************************!*\
1127
+ !*** ./node_modules/rdflib/esm/statement.js ***!
1128
+ \**********************************************/
1129
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
465
1130
 
466
1131
  "use strict";
467
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryNumberRecord = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_string_1 = __webpack_require__(/*! rdf-string */ \"./node_modules/rdf-string/index.js\");\n/**\n * A term dictionary that encodes to numbers, and stores the dictionary in memory in a Record.\n */\nclass TermDictionaryNumberRecord {\n constructor(dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.lastId = 0;\n this.dictionary = {};\n this.reverseDictionary = {};\n this.features = { quotedTriples: false };\n this.dataFactory = dataFactory;\n }\n encode(term) {\n const key = (0, rdf_string_1.termToString)(term);\n let encoded = this.dictionary[key];\n if (encoded === undefined) {\n encoded = this.lastId++;\n this.dictionary[key] = encoded;\n this.reverseDictionary[encoded] = key;\n }\n return encoded;\n }\n encodeOptional(term) {\n const key = (0, rdf_string_1.termToString)(term);\n return this.dictionary[key];\n }\n decode(encoding) {\n const string = this.reverseDictionary[encoding];\n if (string === undefined) {\n throw new Error(`The value ${encoding} is not present in this dictionary`);\n }\n return (0, rdf_string_1.stringToTerm)(string, this.dataFactory);\n }\n *encodings() {\n for (const key of Object.keys(this.reverseDictionary)) {\n yield Number.parseInt(key, 10);\n }\n }\n findQuotedTriples(quotedTriplePattern) {\n throw new Error('findQuotedTriples is not supported');\n }\n findQuotedTriplesEncoded(quotedTriplePattern) {\n throw new Error('findQuotedTriplesEncoded is not supported');\n }\n}\nexports.TermDictionaryNumberRecord = TermDictionaryNumberRecord;\n//# sourceMappingURL=TermDictionaryNumberRecord.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecord.js?\n}");
1132
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Statement)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _node_internal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node-internal */ \"./node_modules/rdflib/esm/node-internal.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n/* harmony import */ var _default_graph__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./default-graph */ \"./node_modules/rdflib/esm/default-graph.js\");\n\n\n\n\nconst defaultGraph = new _default_graph__WEBPACK_IMPORTED_MODULE_3__[\"default\"]();\n\n/** A Statement represents an RDF Triple or Quad. */\nclass Statement {\n /**\n * Construct a new statement\n *\n * @param subject - The subject of the triple. What the fact is about\n * @param predicate - The relationship which is asserted between the subject and object\n * @param object - The thing or data value which is asserted to be related to the subject\n * @param {NamedNode} graph - The document where the triple is or was or will be stored on the web.\n *\n * The graph param is a named node of the document in which the triple when it is stored\n * on the web. It exists because when you have read data from various places in the web,\n * the “graph” tells you _why_ you have the triple. (At the moment, it is just the\n * document, in future it could be an inference step)\n *\n * When you do UpdateManager.update() then the graph’s of all the statements must be the same,\n * and give the document you are patching. In future, we may have a more\n * powerful update() which can update more than one document.\n */\n constructor(subject, predicate, object, graph) {\n /** The subject of the triple. What the Statement is about. */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"subject\", void 0);\n /** The relationship which is asserted between the subject and object */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"predicate\", void 0);\n /** The thing or data value which is asserted to be related to the subject */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"object\", void 0);\n /**\n * The graph param is a named node of the document in which the triple when\n * it is stored on the web.\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"graph\", void 0);\n this.subject = _node_internal__WEBPACK_IMPORTED_MODULE_1__[\"default\"].fromValue(subject);\n this.predicate = _node_internal__WEBPACK_IMPORTED_MODULE_1__[\"default\"].fromValue(predicate);\n this.object = _node_internal__WEBPACK_IMPORTED_MODULE_1__[\"default\"].fromValue(object);\n this.graph = graph == undefined ? defaultGraph : _node_internal__WEBPACK_IMPORTED_MODULE_1__[\"default\"].fromValue(graph); // property currently used by rdflib\n }\n\n /** Alias for graph, favored by Tim */\n get why() {\n return this.graph;\n }\n set why(g) {\n this.graph = g;\n }\n\n /**\n * Checks whether two statements are the same\n * @param other - The other statement\n */\n equals(other) {\n return other.subject.equals(this.subject) && other.predicate.equals(this.predicate) && other.object.equals(this.object) && other.graph.equals(this.graph);\n }\n\n /**\n * Creates a statement with the bindings substituted\n * @param bindings The bindings\n */\n substitute(bindings) {\n const y = new Statement(this.subject.substitute(bindings), this.predicate.substitute(bindings), this.object.substitute(bindings), (0,_default_graph__WEBPACK_IMPORTED_MODULE_3__.isDefaultGraph)(this.graph) ? this.graph : this.graph.substitute(bindings)); // 2016\n // console.log('@@@ statement substitute:' + y)\n return y;\n }\n\n /** Creates a canonical string representation of this statement. */\n toCanonical() {\n let terms = [this.subject.toCanonical(), this.predicate.toCanonical(), this.object.toCanonical()];\n if (this.graph && this.graph.termType !== _types__WEBPACK_IMPORTED_MODULE_2__.DefaultGraphTermType) {\n terms.push(this.graph.toCanonical());\n }\n return terms.join(' ') + ' .';\n }\n\n /** Creates a n-triples string representation of this statement */\n toNT() {\n return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT()].join(' ') + ' .';\n }\n\n /** Creates a n-quads string representation of this statement */\n toNQ() {\n return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT(), (0,_default_graph__WEBPACK_IMPORTED_MODULE_3__.isDefaultGraph)(this.graph) ? '' : this.graph.toNT()].join(' ') + ' .';\n }\n\n /** Creates a string representation of this statement */\n toString() {\n /*\n return [\n this.subject.toString(),\n this.predicate.toString(),\n this.object.toString(),\n ].join(' ') + ' .'\n */\n return this.toNT();\n }\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/statement.js?\n}");
468
1133
 
469
1134
  /***/ },
470
1135
 
471
- /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecordFullTerms.js"
472
- /*!***************************************************************************************!*\
473
- !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecordFullTerms.js ***!
474
- \***************************************************************************************/
475
- (__unused_webpack_module, exports, __webpack_require__) {
1136
+ /***/ "./node_modules/rdflib/esm/store.js"
1137
+ /*!******************************************!*\
1138
+ !*** ./node_modules/rdflib/esm/store.js ***!
1139
+ \******************************************/
1140
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
476
1141
 
477
1142
  "use strict";
478
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryNumberRecordFullTerms = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_string_1 = __webpack_require__(/*! rdf-string */ \"./node_modules/rdf-string/index.js\");\n/**\n * A term dictionary that encodes to numbers, and stores the dictionary in memory in a Record.\n * The reverse dictionary will store full RDF term objects,\n * resulting in slightly better query performance at the cost of slightly higher memory usage.\n */\nclass TermDictionaryNumberRecordFullTerms {\n constructor(dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.lastId = 0;\n this.dictionary = {};\n this.reverseDictionary = {};\n this.features = { quotedTriples: false };\n this.dataFactory = dataFactory;\n }\n encode(term) {\n const key = (0, rdf_string_1.termToString)(term);\n let encoded = this.dictionary[key];\n if (encoded === undefined) {\n encoded = this.lastId++;\n this.dictionary[key] = encoded;\n this.reverseDictionary[encoded] = term;\n }\n return encoded;\n }\n encodeOptional(term) {\n const key = (0, rdf_string_1.termToString)(term);\n return this.dictionary[key];\n }\n decode(encoding) {\n const string = this.reverseDictionary[encoding];\n if (string === undefined) {\n throw new Error(`The value ${encoding} is not present in this dictionary`);\n }\n return string;\n }\n *encodings() {\n for (const key of Object.keys(this.reverseDictionary)) {\n yield Number.parseInt(key, 10);\n }\n }\n findQuotedTriples(quotedTriplePattern) {\n throw new Error('findQuotedTriples is not supported');\n }\n findQuotedTriplesEncoded(quotedTriplePattern) {\n throw new Error('findQuotedTriplesEncoded is not supported');\n }\n}\nexports.TermDictionaryNumberRecordFullTerms = TermDictionaryNumberRecordFullTerms;\n//# sourceMappingURL=TermDictionaryNumberRecordFullTerms.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryNumberRecordFullTerms.js?\n}");
1143
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ IndexedFormula),\n/* harmony export */ defaultGraphURI: () => (/* reexport safe */ _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_2__.defaultGraphURI)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _class_order__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./class-order */ \"./node_modules/rdflib/esm/class-order.js\");\n/* harmony import */ var _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./factories/canonical-data-factory */ \"./node_modules/rdflib/esm/utils/default-graph-uri.js\");\n/* harmony import */ var _formula__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./formula */ \"./node_modules/rdflib/esm/formula.js\");\n/* harmony import */ var _utils__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils */ \"./node_modules/rdflib/esm/utils.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./utils-js */ \"./node_modules/rdflib/esm/utils-js.js\");\n/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/terms */ \"./node_modules/rdflib/esm/utils/terms.js\");\n/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./node */ \"./node_modules/rdflib/esm/node.js\");\n/* harmony import */ var _variable__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./variable */ \"./node_modules/rdflib/esm/variable.js\");\n/* harmony import */ var _query__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./query */ \"./node_modules/rdflib/esm/query.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n/* harmony import */ var _index__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./index */ \"./node_modules/rdflib/esm/index.js\");\n/* harmony import */ var _serialize__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./serialize */ \"./node_modules/rdflib/esm/serialize.js\");\n/* harmony import */ var _blank_node__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./blank-node */ \"./node_modules/rdflib/esm/blank-node.js\");\n/* harmony import */ var _default_graph__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./default-graph */ \"./node_modules/rdflib/esm/default-graph.js\");\n/* harmony import */ var _literal__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./literal */ \"./node_modules/rdflib/esm/literal.js\");\n\n/* Identity management and indexing for RDF\n *\n * This file provides IndexedFormula a formula (set of triples) which\n * indexed by predicate, subject and object.\n *\n * It \"smushes\" (merges into a single node) things which are identical\n * according to owl:sameAs or an owl:InverseFunctionalProperty\n * or an owl:FunctionalProperty\n *\n *\n * 2005-10 Written Tim Berners-Lee\n * 2007 Changed so as not to munge statements from documents when smushing\n * 2019 Converted to typescript\n *\n *\n*/\n\n/** @module store */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nconst owlNamespaceURI = 'http://www.w3.org/2002/07/owl#';\n\n// var link_ns = 'http://www.w3.org/2007/ont/link#'\n\n// Handle Functional Property\nfunction handleFP(formula, subj, pred, obj) {\n var o1 = formula.any(subj, pred, undefined);\n if (!o1) {\n return false; // First time with this value\n }\n // log.warn(\"Equating \"+o1.uri+\" and \"+obj.uri + \" because FP \"+pred.uri); //@@\n formula.equate(o1, obj);\n return true;\n} // handleFP\n\n// Handle Inverse Functional Property\nfunction handleIFP(formula, subj, pred, obj) {\n var s1 = formula.any(undefined, pred, obj);\n if (!s1) {\n return false; // First time with this value\n }\n // log.warn(\"Equating \"+s1.uri+\" and \"+subj.uri + \" because IFP \"+pred.uri); //@@\n formula.equate(s1, subj);\n return true;\n} // handleIFP\n\nfunction handleRDFType(formula, subj, pred, obj, why) {\n //@ts-ignore this method does not seem to exist in this library\n if (formula.typeCallback) {\n formula.typeCallback(formula, obj, why);\n }\n var x = formula.classActions[formula.id(obj)];\n var done = false;\n if (x) {\n for (var i = 0; i < x.length; i++) {\n done = done || x[i](formula, subj, pred, obj, why);\n }\n }\n return done; // statement given is not needed if true\n}\n\n/**\n * Indexed Formula aka Store\n */\nclass IndexedFormula extends _formula__WEBPACK_IMPORTED_MODULE_3__[\"default\"] {\n /**\n * Creates a new formula\n * @param features - What sort of automatic processing to do? Array of string\n * @param features.sameAs - Smush together A and B nodes whenever { A sameAs B }\n * @param opts\n * @param [opts.rdfFactory] - The data factory that should be used by the store\n * @param [opts.rdfArrayRemove] - Function which removes statements from the store\n * @param [opts.dataCallback] - Callback when a statement is added to the store, will not trigger when adding duplicates\n */\n constructor(features, opts = {}) {\n super(undefined, undefined, undefined, undefined, opts);\n // IN future - allow pass array of statements to constructor\n /**\n * An UpdateManager initialised to this store\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"updater\", void 0);\n /**\n * Dictionary of namespace prefixes\n */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"namespaces\", void 0);\n /** Map of iri predicates to functions to call when adding { s type X } */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"classActions\", void 0);\n /** Map of iri predicates to functions to call when getting statement with {s X o} */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"propertyActions\", void 0);\n /** Redirect to lexically smaller equivalent symbol */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"redirections\", void 0);\n /** Reverse mapping to redirection: aliases for this */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"aliases\", void 0);\n /** Redirections we got from HTTP */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"HTTPRedirects\", void 0);\n /** Array of statements with this X as subject */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"subjectIndex\", void 0);\n /** Array of statements with this X as predicate */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"predicateIndex\", void 0);\n /** Array of statements with this X as object */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"objectIndex\", void 0);\n /** Array of statements with X as provenance */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"whyIndex\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"index\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"features\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_universalVariables\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"_existentialVariables\", void 0);\n /** Function to remove quads from the store arrays with */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"rdfArrayRemove\", void 0);\n /** Callbacks which are triggered after a statement has been added to the store */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"dataCallbacks\", []);\n /** Callbacks which are triggered after a statement has been removed from the store */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"dataRemovalCallbacks\", []);\n this.propertyActions = {};\n this.classActions = {};\n this.redirections = [];\n this.aliases = [];\n this.HTTPRedirects = [];\n this.subjectIndex = [];\n this.predicateIndex = [];\n this.objectIndex = [];\n this.whyIndex = [];\n this.index = [this.subjectIndex, this.predicateIndex, this.objectIndex, this.whyIndex];\n this.namespaces = {}; // Dictionary of namespace prefixes\n this.features = features || [// By default, devs do not expect these features.\n // See https://github.com/linkeddata/rdflib.js/issues/458\n // 'sameAs',\n // 'InverseFunctionalProperty',\n // 'FunctionalProperty',\n ];\n this.rdfArrayRemove = opts.rdfArrayRemove || _utils_js__WEBPACK_IMPORTED_MODULE_5__.RDFArrayRemove;\n if (opts.dataCallback) {\n this.dataCallbacks = [opts.dataCallback];\n }\n if (opts.dataRemovalCallback) {\n this.dataRemovalCallbacks = [opts.dataRemovalCallback];\n }\n this.initPropertyActions(this.features);\n }\n\n /**\n * Gets the URI of the default graph\n */\n static get defaultGraphURI() {\n return _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_2__.defaultGraphURI;\n }\n\n /**\n * Gets this graph with the bindings substituted\n * @param bindings The bindings\n */\n substitute(bindings) {\n var statementsCopy = this.statements.map(function (ea) {\n return ea.substitute(bindings);\n });\n var y = new IndexedFormula();\n y.add(statementsCopy);\n return y;\n }\n\n /**\n * Add a callback which will be triggered after a statement has been added to the store.\n * @param cb\n */\n addDataCallback(cb) {\n this.dataCallbacks.push(cb);\n }\n addDataRemovalCallback(cb) {\n this.dataRemovalCallbacks.push(cb);\n }\n\n /**\n * Apply a set of statements to be deleted and to be inserted\n *\n * @param patch - The set of statements to be deleted and to be inserted\n * @param target - The name of the document to patch\n * @param patchCallback - Callback to be called when patching is complete\n */\n applyPatch(patch, target, patchCallback) {\n var targetKB = this;\n var ds;\n var binding = null;\n function doPatch(onDonePatch) {\n if (patch['delete']) {\n ds = patch['delete'];\n // console.log(bindingDebug(binding))\n // console.log('ds before substitute: ' + ds)\n if (binding) ds = ds.substitute(binding);\n // console.log('applyPatch: delete: ' + ds)\n ds = ds.statements;\n var bad = [];\n var ds2 = ds.map(function (st) {\n // Find the actual statements in the store\n var sts = targetKB.statementsMatching(st.subject, st.predicate, st.object, target);\n if (sts.length === 0) {\n // log.info(\"NOT FOUND deletable \" + st)\n bad.push(st);\n return null;\n } else {\n // log.info(\"Found deletable \" + st)\n return sts[0];\n }\n });\n if (bad.length) {\n // console.log('Could not find to delete ' + bad.length + 'statements')\n // console.log('despite ' + targetKB.statementsMatching(bad[0].subject, bad[0].predicate)[0])\n return patchCallback('Could not find to delete: ' + bad.join('\\n or '));\n }\n ds2.map(function (st) {\n targetKB.remove(st);\n });\n }\n if (patch['insert']) {\n // log.info(\"doPatch insert \"+patch['insert'])\n ds = patch['insert'];\n if (binding) ds = ds.substitute(binding);\n ds = ds.statements;\n ds.map(function (st) {\n st.graph = target;\n targetKB.add(st.subject, st.predicate, st.object, st.graph);\n });\n }\n onDonePatch();\n }\n if (patch.where) {\n // log.info(\"Processing WHERE: \" + patch.where + '\\n')\n var query = new _query__WEBPACK_IMPORTED_MODULE_9__.Query('patch');\n query.pat = patch.where;\n query.pat.statements.map(function (st) {\n st.graph = (0,_index__WEBPACK_IMPORTED_MODULE_12__.namedNode)(target.value);\n });\n //@ts-ignore TODO: add sync property to Query when converting Query to typescript\n query.sync = true;\n var bindingsFound = [];\n targetKB.query(query, function onBinding(binding) {\n bindingsFound.push(binding);\n // console.log(' got a binding: ' + bindingDebug(binding))\n }, targetKB.fetcher, function onDone() {\n if (bindingsFound.length === 0) {\n return patchCallback('No match found to be patched:' + patch.where);\n }\n if (bindingsFound.length > 1) {\n return patchCallback('Patch ambiguous. No patch done.');\n }\n binding = bindingsFound[0];\n doPatch(patchCallback);\n });\n } else {\n doPatch(patchCallback);\n }\n }\n\n /**\n * N3 allows for declaring blank nodes, this function enables that support\n *\n * @param x The blank node to be declared, supported in N3\n */\n declareExistential(x) {\n if (!this._existentialVariables) this._existentialVariables = [];\n this._existentialVariables.push(x);\n return x;\n }\n\n /**\n * @param features\n */\n initPropertyActions(features) {\n // If the predicate is #type, use handleRDFType to create a typeCallback on the object\n this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'))] = [handleRDFType];\n\n // Assumption: these terms are not redirected @@fixme\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.ArrayIndexOf)(features, 'sameAs') >= 0) {\n this.propertyActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${owlNamespaceURI}sameAs`))] = [function (formula, subj, pred, obj, why) {\n // log.warn(\"Equating \"+subj.uri+\" sameAs \"+obj.uri); //@@\n formula.equate(subj, obj);\n return true; // true if statement given is NOT needed in the store\n }]; // sameAs -> equate & don't add to index\n }\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.ArrayIndexOf)(features, 'InverseFunctionalProperty') >= 0) {\n this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${owlNamespaceURI}InverseFunctionalProperty`))] = [function (formula, subj, pred, obj, addFn) {\n // yes subj not pred!\n return formula.newPropertyAction(subj, handleIFP);\n }]; // IFP -> handleIFP, do add to index\n }\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.ArrayIndexOf)(features, 'FunctionalProperty') >= 0) {\n this.classActions[this.rdfFactory.id(this.rdfFactory.namedNode(`${owlNamespaceURI}FunctionalProperty`))] = [function (formula, subj, proj, obj, addFn) {\n return formula.newPropertyAction(subj, handleFP);\n }]; // FP => handleFP, do add to index\n }\n }\n\n /** @deprecated Use {add} instead */\n addStatement(st) {\n this.add(st.subject, st.predicate, st.object, st.graph);\n return this.statements.length;\n }\n\n /**\n * Adds a triple (quad) to the store.\n *\n * @param subj - The thing about which the fact a relationship is asserted.\n * Also accepts a statement or an array of Statements.\n * @param pred - The relationship which is asserted\n * @param obj - The object of the relationship, e.g. another thing or a value. If passed a string, this will become a literal.\n * @param why - The document in which the triple (S,P,O) was or will be stored on the web\n * @returns The statement added to the store, or the store\n */\n add(subj, pred, obj, why) {\n var i;\n if (arguments.length === 1) {\n if (subj instanceof Array) {\n for (i = 0; i < subj.length; i++) {\n this.add(subj[i]);\n }\n } else if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_6__.isQuad)(subj)) {\n this.add(subj.subject, subj.predicate, subj.object, subj.graph);\n } else if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_6__.isStore)(subj)) {\n this.add(subj.statements);\n }\n return this;\n }\n var actions;\n var st;\n if (!why) {\n // system generated\n why = this.fetcher ? this.fetcher.appNode : this.rdfFactory.defaultGraph();\n }\n if (typeof subj == 'string') {\n subj = this.rdfFactory.namedNode(subj);\n }\n pred = _node__WEBPACK_IMPORTED_MODULE_7__[\"default\"].fromValue(pred);\n const objNode = _node__WEBPACK_IMPORTED_MODULE_7__[\"default\"].fromValue(obj);\n why = _node__WEBPACK_IMPORTED_MODULE_7__[\"default\"].fromValue(why);\n if (!(0,_utils_terms__WEBPACK_IMPORTED_MODULE_6__.isRDFlibSubject)(subj)) {\n throw new Error('Subject is not a subject type');\n }\n if (!(0,_utils_terms__WEBPACK_IMPORTED_MODULE_6__.isRDFlibPredicate)(pred)) {\n throw new Error(`Predicate ${pred} is not a predicate type`);\n }\n if (!(0,_utils_terms__WEBPACK_IMPORTED_MODULE_6__.isRDFlibObject)(objNode)) {\n throw new Error(`Object ${objNode} is not an object type`);\n }\n if (!(0,_utils_terms__WEBPACK_IMPORTED_MODULE_6__.isGraph)(why)) {\n throw new Error(\"Why is not a graph type\");\n }\n //@ts-ignore This is not used internally\n if (this.predicateCallback) {\n //@ts-ignore This is not used internally\n this.predicateCallback(this, pred, why);\n }\n // Action return true if the statement does not need to be added\n var predHash = this.id(this.canon(pred));\n actions = this.propertyActions[predHash]; // Predicate hash\n var done = false;\n if (actions) {\n // alert('type: '+typeof actions +' @@ actions='+actions)\n for (i = 0; i < actions.length; i++) {\n done = done || actions[i](this, subj, pred, objNode, why);\n }\n }\n if (this.holds(subj, pred, objNode, why)) {\n // Takes time but saves duplicates\n // console.log('rdflib: Ignoring dup! {' + subj + ' ' + pred + ' ' + obj + ' ' + why + '}')\n return null; // @@better to return self in all cases?\n }\n // If we are tracking provenance, every thing should be loaded into the store\n // if (done) return this.rdfFactory.quad(subj, pred, obj, why)\n // Don't put it in the store\n // still return this statement for owl:sameAs input\n var hash = [this.id(this.canon(subj)), predHash, this.id(this.canon(objNode)), this.id(this.canon(why))];\n // @ts-ignore this will fail if you pass a collection and the factory does not allow Collections\n st = this.rdfFactory.quad(subj, pred, objNode, why);\n for (i = 0; i < 4; i++) {\n var ix = this.index[i];\n var h = hash[i];\n if (!ix[h]) {\n ix[h] = [];\n }\n ix[h].push(st); // Set of things with this as subject, etc\n }\n\n // log.debug(\"ADDING {\"+subj+\" \"+pred+\" \"+objNode+\"} \"+why)\n this.statements.push(st);\n for (const callback of this.dataCallbacks) {\n callback(st);\n }\n return st;\n }\n\n /**\n * Returns the symbol with canonical URI as smushed\n * @param term - An RDF node\n */\n canon(term) {\n if (!term) {\n // @@ TODO Should improve this to return proper value - doing this to keep it backward compatible\n return term;\n }\n const y = this.redirections[this.id(term)];\n if (y) {\n return y;\n }\n switch (term.termType) {\n case _types__WEBPACK_IMPORTED_MODULE_10__.BlankNodeTermType:\n return new _blank_node__WEBPACK_IMPORTED_MODULE_14__[\"default\"](term.value);\n case _types__WEBPACK_IMPORTED_MODULE_10__.CollectionTermType:\n return term;\n // non-RDF/JS type, should just need to cast\n case _types__WEBPACK_IMPORTED_MODULE_10__.DefaultGraphTermType:\n return new _default_graph__WEBPACK_IMPORTED_MODULE_15__[\"default\"]();\n case _types__WEBPACK_IMPORTED_MODULE_10__.EmptyTermType:\n // non-RDF/JS type, should just need to cast\n return term;\n case _types__WEBPACK_IMPORTED_MODULE_10__.GraphTermType:\n // non-RDF/JS type, should just need to cast\n return term;\n case _types__WEBPACK_IMPORTED_MODULE_10__.LiteralTermType:\n return new _literal__WEBPACK_IMPORTED_MODULE_16__[\"default\"](term.value, term.language, term.datatype);\n case _types__WEBPACK_IMPORTED_MODULE_10__.NamedNodeTermType:\n return new _named_node__WEBPACK_IMPORTED_MODULE_11__[\"default\"](term.value);\n case _types__WEBPACK_IMPORTED_MODULE_10__.VariableTermType:\n return new _variable__WEBPACK_IMPORTED_MODULE_8__[\"default\"](term.value);\n default:\n throw new Error(`Term Type not recognized for canonization: ${term.termType}`);\n }\n }\n\n /**\n * Checks this formula for consistency\n */\n check() {\n this.checkStatementList(this.statements);\n for (var p = 0; p < 4; p++) {\n var ix = this.index[p];\n for (var key in ix) {\n if (ix.hasOwnProperty(key)) {\n // @ts-ignore should this pass an array or a single statement? checkStateMentsList expects an array.\n this.checkStatementList(ix[key], p);\n }\n }\n }\n }\n\n /**\n * Checks a list of statements for consistency\n * @param sts - The list of statements to check\n * @param from - An index with the array ['subject', 'predicate', 'object', 'why']\n */\n checkStatementList(sts, from) {\n if (from === undefined) {\n from = 0;\n }\n var names = ['subject', 'predicate', 'object', 'why'];\n var origin = ' found in ' + names[from] + ' index.';\n var st;\n for (var j = 0; j < sts.length; j++) {\n st = sts[j];\n var term = [st.subject, st.predicate, st.object, st.graph];\n var arrayContains = function (a, x) {\n for (var i = 0; i < a.length; i++) {\n if (a[i].subject.equals(x.subject) && a[i].predicate.equals(x.predicate) && a[i].object.equals(x.object) && a[i].why.equals(x.graph)) {\n return true;\n }\n }\n };\n for (var p = 0; p < 4; p++) {\n var c = this.canon(term[p]);\n var h = this.id(c);\n if (!this.index[p][h]) {\n // throw new Error('No ' + name[p] + ' index for statement ' + st + '@' + st.why + origin)\n } else {\n if (!arrayContains(this.index[p][h], st)) {\n // throw new Error('Index for ' + name[p] + ' does not have statement ' + st + '@' + st.why + origin)\n }\n }\n }\n if (!arrayContains(this.statements, st)) {\n throw new Error('Statement list does not statement ' + st + '@' + st.graph + origin);\n }\n }\n }\n\n /**\n * Closes this formula (and return it)\n */\n close() {\n return this;\n }\n compareTerms(u1, u2) {\n // Keep compatibility with downstream classOrder changes\n if (Object.prototype.hasOwnProperty.call(u1, \"compareTerm\")) {\n return u1.compareTerm(u2);\n }\n if (_class_order__WEBPACK_IMPORTED_MODULE_1__[\"default\"][u1.termType] < _class_order__WEBPACK_IMPORTED_MODULE_1__[\"default\"][u2.termType]) {\n return -1;\n }\n if (_class_order__WEBPACK_IMPORTED_MODULE_1__[\"default\"][u1.termType] > _class_order__WEBPACK_IMPORTED_MODULE_1__[\"default\"][u2.termType]) {\n return +1;\n }\n if (u1.value < u2.value) {\n return -1;\n }\n if (u1.value > u2.value) {\n return +1;\n }\n return 0;\n }\n\n /**\n * replaces @template with @target and add appropriate triples\n * removes no triples by default and is a one-direction replication\n * @param template node to copy\n * @param target node to copy to\n * @param flags Whether or not to do a two-directional copy and/or delete triples\n */\n copyTo(template, target, flags) {\n if (!flags) flags = [];\n var statList = this.statementsMatching(template);\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.ArrayIndexOf)(flags, 'two-direction') !== -1) {\n statList.concat(this.statementsMatching(undefined, undefined, template));\n }\n for (var i = 0; i < statList.length; i++) {\n var st = statList[i];\n switch (st.object.termType) {\n case 'NamedNode':\n this.add(target, st.predicate, st.object);\n break;\n case 'Literal':\n case 'BlankNode':\n // @ts-ignore Collections can appear here\n case 'Collection':\n // @ts-ignore Possible bug: copy is not available on Collections\n this.add(target, st.predicate, st.object.copy(this));\n }\n if ((0,_utils__WEBPACK_IMPORTED_MODULE_4__.ArrayIndexOf)(flags, 'delete') !== -1) {\n this.remove(st);\n }\n }\n }\n\n /**\n * Simplify graph in store when we realize two identifiers are equivalent\n * We replace the bigger with the smaller.\n * @param u1in The first node\n * @param u2in The second node\n */\n equate(u1in, u2in) {\n // log.warn(\"Equating \"+u1+\" and \"+u2); // @@\n // @@JAMBO Must canonicalize the uris to prevent errors from a=b=c\n // 03-21-2010\n const u1 = this.canon(u1in);\n const u2 = this.canon(u2in);\n var d = this.compareTerms(u1, u2);\n if (!d) {\n return true; // No information in {a = a}\n }\n // var big\n // var small\n if (d < 0) {\n // u1 less than u2\n return this.replaceWith(u2, u1);\n } else {\n return this.replaceWith(u1, u2);\n }\n }\n\n /**\n * Creates a new empty indexed formula\n * Only applicable for IndexedFormula, but TypeScript won't allow a subclass to override a property\n * @param features The list of features\n */\n formula(features) {\n return new IndexedFormula(features);\n }\n\n /**\n * Returns the number of statements contained in this IndexedFormula.\n * (Getter proxy to this.statements).\n * Usage:\n * ```\n * var kb = rdf.graph()\n * kb.length // -> 0\n * ```\n * @returns {Number}\n */\n get length() {\n return this.statements.length;\n }\n\n /**\n * Returns any quads matching the given arguments.\n * Standard RDFJS spec method for Source objects, implemented as an\n * alias to `statementsMatching()`\n * @param subject The subject\n * @param predicate The predicate\n * @param object The object\n * @param graph The graph that contains the statement\n */\n match(subject, predicate, object, graph) {\n return this.statementsMatching(_node__WEBPACK_IMPORTED_MODULE_7__[\"default\"].fromValue(subject), _node__WEBPACK_IMPORTED_MODULE_7__[\"default\"].fromValue(predicate), _node__WEBPACK_IMPORTED_MODULE_7__[\"default\"].fromValue(object), _node__WEBPACK_IMPORTED_MODULE_7__[\"default\"].fromValue(graph));\n }\n\n /**\n * Find out whether a given URI is used as symbol in the formula\n * @param uri The URI to look for\n */\n mentionsURI(uri) {\n var hash = '<' + uri + '>';\n return !!this.subjectIndex[hash] || !!this.objectIndex[hash] || !!this.predicateIndex[hash];\n }\n\n /**\n * Existentials are BNodes - something exists without naming\n * @param uri An URI\n */\n newExistential(uri) {\n if (!uri) return this.bnode();\n var x = this.sym(uri);\n // @ts-ignore x should be blanknode, but is namedNode.\n return this.declareExistential(x);\n }\n\n /**\n * Adds a new property action\n * @param pred the predicate that the function should be triggered on\n * @param action the function that should trigger\n */\n newPropertyAction(pred, action) {\n // log.debug(\"newPropertyAction: \"+pred)\n var hash = this.id(pred);\n if (!this.propertyActions[hash]) {\n this.propertyActions[hash] = [];\n }\n this.propertyActions[hash].push(action);\n // Now apply the function to to statements already in the store\n var toBeFixed = this.statementsMatching(undefined, pred, undefined);\n var done = false;\n for (var i = 0; i < toBeFixed.length; i++) {\n // NOT optimized - sort toBeFixed etc\n done = done || action(this, toBeFixed[i].subject, pred, toBeFixed[i].object);\n }\n return done;\n }\n\n /**\n * Creates a new universal node\n * Universals are Variables\n * @param uri An URI\n */\n newUniversal(uri) {\n var x = this.sym(uri);\n if (!this._universalVariables) this._universalVariables = [];\n this._universalVariables.push(x);\n return x;\n }\n\n // convenience function used by N3 parser\n variable(name) {\n return new _variable__WEBPACK_IMPORTED_MODULE_8__[\"default\"](name);\n }\n\n /**\n * Find an unused id for a file being edited: return a symbol\n * (Note: Slow iff a lot of them -- could be O(log(k)) )\n * @param doc A document named node\n */\n nextSymbol(doc) {\n for (var i = 0;; i++) {\n var uri = doc.value + '#n' + i;\n if (!this.mentionsURI(uri)) return this.sym(uri);\n }\n }\n\n /**\n * Query this store asynchronously, return bindings in callback\n *\n * @param myQuery The query to be run\n * @param callback Function to call when bindings\n * @param Fetcher | null If you want the query to do link following\n * @param onDone OBSOLETE - do not use this // @@ Why not ?? Called when query complete\n */\n query(myQuery, callback, fetcher, onDone) {\n return _query__WEBPACK_IMPORTED_MODULE_9__.indexedFormulaQuery.call(this, myQuery, callback, fetcher, onDone);\n }\n\n /**\n * Query this store synchronously and return bindings\n *\n * @param myQuery The query to be run\n */\n querySync(myQuery) {\n var results = [];\n function saveBinginds(bindings) {\n results.push(bindings);\n }\n function onDone() {\n done = true;\n }\n var done = false;\n // @ts-ignore TODO: Add .sync to Query\n myQuery.sync = true;\n _query__WEBPACK_IMPORTED_MODULE_9__.indexedFormulaQuery.call(this, myQuery, saveBinginds, null, onDone);\n if (!done) {\n throw new Error('Sync query should have called done function');\n }\n return results;\n }\n\n /**\n * Removes one or multiple statement(s) from this formula\n * @param st - A Statement or array of Statements to remove\n */\n remove(st) {\n if (st instanceof Array) {\n for (var i = 0; i < st.length; i++) {\n this.remove(st[i]);\n }\n return this;\n }\n if ((0,_utils_terms__WEBPACK_IMPORTED_MODULE_6__.isStore)(st)) {\n return this.remove(st.statements);\n }\n var sts = this.statementsMatching(st.subject, st.predicate, st.object, st.graph);\n if (!sts.length) {\n throw new Error('Statement to be removed is not on store: ' + st);\n }\n this.removeStatement(sts[0]);\n return this;\n }\n\n /**\n * Removes all statements in a doc, along with the related metadata including request/response/status\n * @param doc - The document / graph\n */\n removeDocument(doc) {\n this.removeMetadata(doc);\n // remove document\n var sts = this.statementsMatching(undefined, undefined, undefined, doc).slice(); // Take a copy as this is the actual index\n for (var i = 0; i < sts.length; i++) {\n this.removeStatement(sts[i]);\n }\n this.removeMatches(doc, null, null);\n return this;\n }\n removeMetadata(doc) {\n const meta = this.sym('chrome://TheCurrentSession'); // or this.rdfFactory.namedNode('chrome://TheCurrentSession')\n const linkNamespaceURI = 'http://www.w3.org/2007/ont/link#';\n // remove status/response/request metadata\n const requests = this.statementsMatching(undefined, this.sym(`${linkNamespaceURI}requestedURI`), this.rdfFactory.literal(doc.value), meta).map(st => st.subject);\n for (var r = 0; r < requests.length; r++) {\n const request = requests[r];\n if (request != undefined) {\n // removeMatches unresolved issue with collection https://github.com/linkeddata/rdflib.js/issues/631\n let sts;\n // status collection\n const status = this.any(request, this.sym(`${linkNamespaceURI}status`), null, meta);\n if (status != undefined) {\n sts = this.statementsMatching(status, this.sym(`${linkNamespaceURI}status`), null, meta).slice();\n for (var i = 0; i < sts.length; i++) {\n this.removeStatement(sts[i]);\n }\n }\n // response items list\n const response = this.any(request, this.sym(`${linkNamespaceURI}response`), null, meta);\n if (response != undefined) {\n sts = this.statementsMatching(response, null, null, meta).slice();\n for (var i = 0; i < sts.length; i++) {\n this.removeStatement(sts[i]);\n }\n }\n // request triples\n sts = this.statementsMatching(request, null, null, meta).slice();\n for (var i = 0; i < sts.length; i++) {\n this.removeStatement(sts[i]);\n }\n }\n }\n this.removeMatches(this.sym(doc.value), null, null, meta); // content-type\n return this;\n }\n\n /**\n * Remove all statements matching args (within limit) *\n * @param subj The subject\n * @param pred The predicate\n * @param obj The object\n * @param why The graph that contains the statement\n * @param limit The number of statements to remove\n */\n removeMany(subj, pred, obj, why, limit) {\n // log.debug(\"entering removeMany w/ subj,pred,obj,why,limit = \" + subj +\", \"+ pred+\", \" + obj+\", \" + why+\", \" + limit)\n var sts = this.statementsMatching(subj, pred, obj, why, false);\n // This is a subtle bug that occurred in updateCenter.js too.\n // The fact is, this.statementsMatching returns this.whyIndex instead of a copy of it\n // but for perfromance consideration, it's better to just do that\n // so make a copy here.\n var statements = [];\n for (var i = 0; i < sts.length; i++) statements.push(sts[i]);\n if (limit) statements = statements.slice(0, limit);\n for (i = 0; i < statements.length; i++) this.remove(statements[i]);\n }\n\n /**\n * Remove all matching statements\n * @param subject The subject\n * @param predicate The predicate\n * @param object The object\n * @param graph The graph that contains the statement\n */\n removeMatches(subject, predicate, object, graph) {\n this.removeMany(subject, predicate, object, graph);\n return this;\n }\n\n /**\n * Remove a particular statement object from the store\n *\n * @param st - a statement which is already in the store and indexed.\n * Make sure you only use this for these.\n * Otherwise, you should use remove() above.\n */\n removeStatement(st) {\n // log.debug(\"entering remove w/ st=\" + st)\n var term = [st.subject, st.predicate, st.object, st.graph];\n for (var p = 0; p < 4; p++) {\n var c = this.canon(term[p]);\n var h = this.id(c);\n if (!this.index[p][h]) {\n // log.warn (\"Statement removal: no index '+p+': \"+st)\n } else {\n this.rdfArrayRemove(this.index[p][h], st);\n }\n }\n this.rdfArrayRemove(this.statements, st);\n for (const callback of this.dataRemovalCallbacks) {\n callback(st);\n }\n return this;\n }\n\n /**\n * Removes statements\n * @param sts The statements to remove\n */\n removeStatements(sts) {\n for (var i = 0; i < sts.length; i++) {\n this.remove(sts[i]);\n }\n return this;\n }\n\n /**\n * Replace big with small, obsoleted with obsoleting.\n */\n replaceWith(big, small) {\n // log.debug(\"Replacing \"+big+\" with \"+small) // this.id(@@\n var oldhash = this.id(big);\n var newhash = this.id(small);\n var moveIndex = function (ix) {\n var oldlist = ix[oldhash];\n if (!oldlist) {\n return; // none to move\n }\n var newlist = ix[newhash];\n if (!newlist) {\n ix[newhash] = oldlist;\n } else {\n ix[newhash] = oldlist.concat(newlist);\n }\n delete ix[oldhash];\n };\n // the canonical one carries all the indexes\n for (var i = 0; i < 4; i++) {\n moveIndex(this.index[i]);\n }\n this.redirections[oldhash] = small;\n if (big.value) {\n // @@JAMBO: must update redirections,aliases from sub-items, too.\n if (!this.aliases[newhash]) {\n this.aliases[newhash] = [];\n }\n this.aliases[newhash].push(big); // Back link\n if (this.aliases[oldhash]) {\n for (i = 0; i < this.aliases[oldhash].length; i++) {\n this.redirections[this.id(this.aliases[oldhash][i])] = small;\n this.aliases[newhash].push(this.aliases[oldhash][i]);\n }\n }\n this.add(small, this.sym('http://www.w3.org/2007/ont/link#uri'), big);\n // If two things are equal, and one is requested, we should request the other.\n if (this.fetcher) {\n this.fetcher.nowKnownAs(big, small);\n }\n }\n moveIndex(this.classActions);\n moveIndex(this.propertyActions);\n // log.debug(\"Equate done. \"+big+\" to be known as \"+small)\n return true; // true means the statement does not need to be put in\n }\n\n /**\n * Return all equivalent URIs by which this is known\n * @param x A named node\n */\n allAliases(x) {\n var a = this.aliases[this.id(this.canon(x))] || [];\n a.push(this.canon(x));\n return a;\n }\n\n /**\n * Compare by canonical URI as smushed\n * @param x A named node\n * @param y Another named node\n */\n sameThings(x, y) {\n if (x.equals(y)) {\n return true;\n }\n var x1 = this.canon(x);\n // alert('x1='+x1)\n if (!x1) return false;\n var y1 = this.canon(y);\n // alert('y1='+y1); //@@\n if (!y1) return false;\n return x1.value === y1.value;\n }\n setPrefixForURI(prefix, nsuri) {\n // TODO: This is a hack for our own issues, which ought to be fixed\n // post-release\n // See http://dig.csail.mit.edu/cgi-bin/roundup.cgi/$rdf/issue227\n if (prefix === 'tab' && this.namespaces['tab']) {\n return;\n } // There are files around with long badly generated prefixes like this\n if (prefix.slice(0, 2) === 'ns' || prefix.slice(0, 7) === 'default') {\n return;\n }\n\n // remove any prefix that currently targets nsuri\n for (let existingPrefix in this.namespaces) {\n if (this.namespaces[existingPrefix] == nsuri) delete this.namespaces[existingPrefix];\n }\n this.namespaces[prefix] = nsuri;\n }\n\n /** Search the Store\n *\n * ALL CONVENIENCE LOOKUP FUNCTIONS RELY ON THIS!\n * @param subj - A node to search for as subject, or if null, a wildcard\n * @param pred - A node to search for as predicate, or if null, a wildcard\n * @param obj - A node to search for as object, or if null, a wildcard\n * @param why - A node to search for as graph, or if null, a wildcard\n * @param justOne - flag - stop when found one rather than get all of them?\n * @returns An array of nodes which match the wildcard position\n */\n statementsMatching(subj, pred, obj, why, justOne) {\n // log.debug(\"Matching {\"+subj+\" \"+pred+\" \"+obj+\"}\")\n var pat = [subj, pred, obj, why];\n var pattern = [];\n var hash = [];\n var wild = []; // wildcards\n var given = []; // Not wild\n var p;\n var list;\n for (p = 0; p < 4; p++) {\n pattern[p] = this.canon(_node__WEBPACK_IMPORTED_MODULE_7__[\"default\"].fromValue(pat[p]));\n if (!pattern[p]) {\n wild.push(p);\n } else {\n given.push(p);\n hash[p] = this.id(pattern[p]);\n }\n }\n if (given.length === 0) {\n return this.statements;\n }\n if (given.length === 1) {\n // Easy too, we have an index for that\n p = given[0];\n list = this.index[p][hash[p]];\n if (list && justOne) {\n if (list.length > 1) {\n list = list.slice(0, 1);\n }\n }\n list = list || [];\n return list;\n }\n // Now given.length is 2, 3 or 4.\n // We hope that the scale-free nature of the data will mean we tend to get\n // a short index in there somewhere!\n var best = 1e10; // really bad\n var iBest;\n var i;\n for (i = 0; i < given.length; i++) {\n p = given[i]; // Which part we are dealing with\n list = this.index[p][hash[p]];\n if (!list) {\n return []; // No occurrences\n }\n if (list.length < best) {\n best = list.length;\n iBest = i; // (not p!)\n }\n }\n // Ok, we have picked the shortest index but now we have to filter it\n var pBest = given[iBest];\n var possibles = this.index[pBest][hash[pBest]];\n var check = given.slice(0, iBest).concat(given.slice(iBest + 1)); // remove iBest\n var results = [];\n var parts = ['subject', 'predicate', 'object', 'why'];\n for (var j = 0; j < possibles.length; j++) {\n var st = possibles[j];\n for (i = 0; i < check.length; i++) {\n // for each position to be checked\n p = check[i];\n if (!this.canon(st[parts[p]]).equals(pattern[p])) {\n st = null;\n break;\n }\n }\n if (st != null) {\n results.push(st);\n if (justOne) break;\n }\n }\n return results;\n }\n\n /**\n * A list of all the URIs by which this thing is known\n * @param term\n */\n uris(term) {\n var cterm = this.canon(term);\n var terms = this.aliases[this.id(cterm)];\n if (!cterm.value) return [];\n var res = [cterm.value];\n if (terms) {\n for (var i = 0; i < terms.length; i++) {\n res.push(terms[i].uri);\n }\n }\n return res;\n }\n serialize(base, contentType, provenance, options) {\n // override Formula.serialize to force the serializer namespace prefixes\n // to those of this IndexedFormula\n\n // if namespaces are explicitly passed in options, let them override the existing namespaces in this formula\n const namespaces = options?.namespaces ? {\n ...this.namespaces,\n ...options.namespaces\n } : {\n ...this.namespaces\n };\n options = {\n ...(options || {}),\n namespaces\n };\n return (0,_serialize__WEBPACK_IMPORTED_MODULE_13__[\"default\"])(provenance, this, base, contentType, undefined, options);\n }\n}\n(0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(IndexedFormula, \"handleRDFType\", void 0);\nIndexedFormula.handleRDFType = handleRDFType;\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/store.js?\n}");
479
1144
 
480
1145
  /***/ },
481
1146
 
482
- /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuoted.js"
483
- /*!************************************************************************!*\
484
- !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuoted.js ***!
485
- \************************************************************************/
486
- (__unused_webpack_module, exports, __webpack_require__) {
1147
+ /***/ "./node_modules/rdflib/esm/types.js"
1148
+ /*!******************************************!*\
1149
+ !*** ./node_modules/rdflib/esm/types.js ***!
1150
+ \******************************************/
1151
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
487
1152
 
488
1153
  "use strict";
489
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryQuoted = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_terms_1 = __webpack_require__(/*! rdf-terms */ \"./node_modules/rdf-terms/index.js\");\n/**\n * A term dictionary for quoted triples.\n *\n * Plain terms and quoted triples are stored in separate dictionaries.\n *\n * Finding quoted triples is done by iterating over all quoted triples, and filtering by the matching ones.\n */\nclass TermDictionaryQuoted {\n constructor(plainTermDictionary, quotedTriplesDictionary, dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.features = { quotedTriples: true };\n this.plainTermDictionary = plainTermDictionary;\n this.quotedTriplesDictionary = quotedTriplesDictionary;\n this.dataFactory = dataFactory;\n }\n encode(term) {\n if (term.termType === 'Quad') {\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return TermDictionaryQuoted.BITMASK | (1 + this.quotedTriplesDictionary.encode(term));\n }\n return this.plainTermDictionary.encode(term);\n }\n encodeOptional(term) {\n if (term.termType === 'Quad') {\n const encoding = this.quotedTriplesDictionary.encodeOptional(term);\n if (encoding === undefined) {\n return encoding;\n }\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return TermDictionaryQuoted.BITMASK | (1 + encoding);\n }\n return this.plainTermDictionary.encodeOptional(term);\n }\n decode(encoding) {\n if (TermDictionaryQuoted.BITMASK & encoding) {\n // Term comes from the quoted triples dictionary\n const encodingBase = (~TermDictionaryQuoted.BITMASK & encoding) - 1;\n return this.quotedTriplesDictionary.decode(encodingBase);\n }\n // Term comes from the plain terms dictionary\n return this.plainTermDictionary.decode(encoding);\n }\n *encodings() {\n for (const encoding of this.plainTermDictionary.encodings()) {\n yield encoding;\n }\n for (const encoding of this.quotedTriplesDictionary.encodings()) {\n yield TermDictionaryQuoted.BITMASK | (1 + encoding);\n }\n }\n *findQuotedTriples(quotedTriplePattern) {\n for (const termEncoded of this.findQuotedTriplesEncoded(quotedTriplePattern)) {\n yield this.decode(termEncoded);\n }\n }\n *findQuotedTriplesEncoded(quotedTriplePattern) {\n for (let encodedQuotedTriple of this.quotedTriplesDictionary.encodings()) {\n encodedQuotedTriple = TermDictionaryQuoted.BITMASK | (1 + encodedQuotedTriple);\n const quotedTriple = this.decode(encodedQuotedTriple);\n if ((0, rdf_terms_1.matchPattern)(quotedTriple, quotedTriplePattern.subject, quotedTriplePattern.predicate, quotedTriplePattern.object, quotedTriplePattern.graph)) {\n yield encodedQuotedTriple;\n }\n }\n }\n}\nexports.TermDictionaryQuoted = TermDictionaryQuoted;\nTermDictionaryQuoted.BITMASK = 1 << 31;\n//# sourceMappingURL=TermDictionaryQuoted.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuoted.js?\n}");
1154
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BlankNodeTermType: () => (/* binding */ BlankNodeTermType),\n/* harmony export */ CollectionTermType: () => (/* binding */ CollectionTermType),\n/* harmony export */ DefaultGraphTermType: () => (/* binding */ DefaultGraphTermType),\n/* harmony export */ EmptyTermType: () => (/* binding */ EmptyTermType),\n/* harmony export */ GraphTermType: () => (/* binding */ GraphTermType),\n/* harmony export */ HTMLContentType: () => (/* binding */ HTMLContentType),\n/* harmony export */ JSONLDContentType: () => (/* binding */ JSONLDContentType),\n/* harmony export */ LiteralTermType: () => (/* binding */ LiteralTermType),\n/* harmony export */ N3ContentType: () => (/* binding */ N3ContentType),\n/* harmony export */ N3LegacyContentType: () => (/* binding */ N3LegacyContentType),\n/* harmony export */ NQuadsAltContentType: () => (/* binding */ NQuadsAltContentType),\n/* harmony export */ NQuadsContentType: () => (/* binding */ NQuadsContentType),\n/* harmony export */ NTriplesContentType: () => (/* binding */ NTriplesContentType),\n/* harmony export */ NamedNodeTermType: () => (/* binding */ NamedNodeTermType),\n/* harmony export */ RDFXMLContentType: () => (/* binding */ RDFXMLContentType),\n/* harmony export */ SPARQLUpdateContentType: () => (/* binding */ SPARQLUpdateContentType),\n/* harmony export */ SPARQLUpdateSingleMatchContentType: () => (/* binding */ SPARQLUpdateSingleMatchContentType),\n/* harmony export */ TurtleContentType: () => (/* binding */ TurtleContentType),\n/* harmony export */ TurtleLegacyContentType: () => (/* binding */ TurtleLegacyContentType),\n/* harmony export */ VariableTermType: () => (/* binding */ VariableTermType),\n/* harmony export */ XHTMLContentType: () => (/* binding */ XHTMLContentType)\n/* harmony export */ });\nconst NamedNodeTermType = \"NamedNode\";\nconst BlankNodeTermType = \"BlankNode\";\nconst LiteralTermType = \"Literal\";\nconst VariableTermType = \"Variable\";\nconst DefaultGraphTermType = \"DefaultGraph\";\n// Non-RDF/JS types:\nconst CollectionTermType = \"Collection\";\nconst EmptyTermType = \"Empty\";\nconst GraphTermType = \"Graph\";\nconst HTMLContentType = \"text/html\";\nconst JSONLDContentType = \"application/ld+json\";\nconst N3ContentType = \"text/n3\";\nconst N3LegacyContentType = \"application/n3\";\nconst NQuadsAltContentType = \"application/nquads\";\nconst NQuadsContentType = \"application/n-quads\";\nconst NTriplesContentType = \"application/n-triples\";\nconst RDFXMLContentType = \"application/rdf+xml\";\nconst SPARQLUpdateContentType = \"application/sparql-update\";\nconst SPARQLUpdateSingleMatchContentType = \"application/sparql-update-single-match\";\nconst TurtleContentType = \"text/turtle\";\nconst TurtleLegacyContentType = \"application/x-turtle\";\nconst XHTMLContentType = \"application/xhtml+xml\";\n\n/**\n * A valid mime type header\n */\n\n/** A type for values that serves as inputs */\n\n/**\n * In this project, there exist two types for the same kind of RDF concept.\n * We have RDF/JS spec types (standardized, generic), and RDFlib types (internal, specific).\n * When deciding which type to use in a function, it is preferable to accept generic inputs,\n * whenever possible, and provide strict outputs.\n * In some ways, the TF types in here are a bit more strict.\n * Variables are missing, and the statement requires specific types of terms (e.g. NamedNode instead of Term).\n */\n\n/** An RDF/JS Subject */\n\n/** An RDF/JS Predicate */\n\n/** An RDF/JS Object */\n\n/** An RDF/JS Graph */\n// | Formula\n\n/** All the types that a .fromValue() method might return */\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/types.js?\n}");
490
1155
 
491
1156
  /***/ },
492
1157
 
493
- /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedIndexed.js"
494
- /*!*******************************************************************************!*\
495
- !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedIndexed.js ***!
496
- \*******************************************************************************/
497
- (__unused_webpack_module, exports, __webpack_require__) {
1158
+ /***/ "./node_modules/rdflib/esm/update-manager.js"
1159
+ /*!***************************************************!*\
1160
+ !*** ./node_modules/rdflib/esm/update-manager.js ***!
1161
+ \***************************************************/
1162
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
498
1163
 
499
1164
  "use strict";
500
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryQuotedIndexed = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst RdfStoreIndexNestedMap_1 = __webpack_require__(/*! ../index/RdfStoreIndexNestedMap */ \"./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMap.js\");\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * A term dictionary for quoted triples.\n *\n * Plain terms are stored in a regular dictionary.\n * Quoted triples are stored separately using an index, which is backed the same dictionary.\n *\n * Finding quoted triples is done through indexed lookups.\n */\nclass TermDictionaryQuotedIndexed {\n constructor(rawTermDictionary, dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.quotedTriplesDictionary = [];\n this.features = { quotedTriples: true };\n this.plainTermDictionary = rawTermDictionary;\n const subIndexOpts = {\n // Not required\n indexCombinations: [],\n // Not required\n indexConstructor: undefined,\n dictionary: this,\n dataFactory,\n };\n this.quotedTriplesReverseDictionaries = [\n new RdfStoreIndexNestedMap_1.RdfStoreIndexNestedMap(subIndexOpts),\n new RdfStoreIndexNestedMap_1.RdfStoreIndexNestedMap(subIndexOpts),\n new RdfStoreIndexNestedMap_1.RdfStoreIndexNestedMap(subIndexOpts),\n ];\n this.dataFactory = dataFactory;\n }\n encode(term) {\n if (term.termType === 'Quad') {\n return this.encodeQuotedTriple(term, false);\n }\n return this.plainTermDictionary.encode(term);\n }\n encodeQuotedTriple(quad, optional) {\n // Only quoted triples are supported\n if (quad.graph.termType !== 'DefaultGraph') {\n throw new Error('Encoding of quoted quads outside of the default graph is not allowed');\n }\n // Check if the quad was already encoded\n const encodedTripleOptional = (0, OrderUtils_1.encodeOptionalTerms)([quad.subject, quad.predicate, quad.object, quad.graph], this);\n const id = encodedTripleOptional && encodedTripleOptional.every(encoded => encoded !== undefined) ?\n this.quotedTriplesReverseDictionaries[0].getEncoded(encodedTripleOptional) :\n undefined;\n // Return the encoding if we found one\n if (id !== undefined || optional) {\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return (id === undefined ? undefined : TermDictionaryQuotedIndexed.BITMASK | id);\n }\n // If the quad was not encoded yet, add a new entry for it in the dictionary.\n const encodedTriple = [\n this.encode(quad.subject),\n this.encode(quad.predicate),\n this.encode(quad.object),\n ];\n const encodingBase = this.quotedTriplesDictionary.length + 1;\n this.quotedTriplesDictionary.push(encodedTriple);\n const encodedGraph = this.encode(this.dataFactory.defaultGraph());\n this.quotedTriplesReverseDictionaries[0].set([\n encodedTriple[0],\n encodedTriple[1],\n encodedTriple[2],\n encodedGraph,\n ], encodingBase);\n this.quotedTriplesReverseDictionaries[1].set([\n encodedTriple[1],\n encodedTriple[2],\n encodedTriple[0],\n encodedGraph,\n ], encodingBase);\n this.quotedTriplesReverseDictionaries[2].set([\n encodedTriple[2],\n encodedTriple[0],\n encodedTriple[1],\n encodedGraph,\n ], encodingBase);\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return TermDictionaryQuotedIndexed.BITMASK | encodingBase;\n }\n encodeOptional(term) {\n if (term.termType === 'Quad') {\n return this.encodeQuotedTriple(term, true);\n }\n return this.plainTermDictionary.encodeOptional(term);\n }\n decode(encoding) {\n if (TermDictionaryQuotedIndexed.BITMASK & encoding) {\n // Term comes from the quoted triples dictionary\n const encodingBase = (~TermDictionaryQuotedIndexed.BITMASK & encoding) - 1;\n if (encodingBase >= this.quotedTriplesDictionary.length) {\n throw new Error(`The value ${encoding} is not present in the quoted triples range of the dictionary`);\n }\n const encodedTerms = this.quotedTriplesDictionary[encodingBase];\n return this.dataFactory.quad(this.decode(encodedTerms[0]), this.decode(encodedTerms[1]), this.decode(encodedTerms[2]));\n }\n // Term comes from the plain terms dictionary\n return this.plainTermDictionary.decode(encoding);\n }\n *encodings() {\n for (const encoding of this.plainTermDictionary.encodings()) {\n yield encoding;\n }\n for (const encoding of this.quotedTriplesDictionary.keys()) {\n yield TermDictionaryQuotedIndexed.BITMASK | (1 + encoding);\n }\n }\n *findQuotedTriples(quotedTriplePattern) {\n for (const termEncoded of this.findQuotedTriplesEncoded(quotedTriplePattern)) {\n yield this.decode(termEncoded);\n }\n }\n *findQuotedTriplesEncoded(quotedTriplePattern) {\n const [patternIn, requireQuotedTripleFiltering] = (0, OrderUtils_1.quadToPattern)(quotedTriplePattern.subject, quotedTriplePattern.predicate, quotedTriplePattern.object, quotedTriplePattern.graph, true);\n // Find all matching terms iteratively\n for (const termS of this.patternToIterable(patternIn[0])) {\n for (const termP of this.patternToIterable(patternIn[1])) {\n for (const termO of this.patternToIterable(patternIn[2])) {\n for (const termG of this.patternToIterable(patternIn[3])) {\n // Find all terms matching the pattern from the reverse indexes\n // We select the reverse index according to the current triple pattern\n if ((termS && termP) || (!termP && !termO)) {\n // SPO\n const pattern = [termS, termP, termO, termG];\n for (const termEncoded of this.quotedTriplesReverseDictionaries[0].findEncoded(pattern, patternIn)) {\n yield TermDictionaryQuotedIndexed.BITMASK |\n this.quotedTriplesReverseDictionaries[0].getEncoded(termEncoded);\n }\n }\n else if (!termS && termP) {\n // POS\n const pattern = [termP, termO, termS, termG];\n for (const termEncoded of this.quotedTriplesReverseDictionaries[1].findEncoded(pattern, patternIn)) {\n yield TermDictionaryQuotedIndexed.BITMASK |\n this.quotedTriplesReverseDictionaries[1].getEncoded(termEncoded);\n }\n }\n else {\n // OSP\n const pattern = [termO, termS, termP, termG];\n for (const termEncoded of this.quotedTriplesReverseDictionaries[2].findEncoded(pattern, patternIn)) {\n yield TermDictionaryQuotedIndexed.BITMASK |\n this.quotedTriplesReverseDictionaries[2].getEncoded(termEncoded);\n }\n }\n }\n }\n }\n }\n }\n /**\n * Helper function to convert a term to an iterator over encoded terms.\n * @param patternTerm A term.\n * @protected\n */\n *patternToIterable(patternTerm) {\n // If the term is another quoted quad, recursively find other quoted triples\n if (patternTerm?.termType === 'Quad') {\n yield* this.findQuotedTriplesEncoded(patternTerm);\n return;\n }\n // Undefined terms indicate a variable\n if (patternTerm === undefined) {\n // eslint-disable-next-line unicorn/no-useless-undefined\n yield undefined;\n return;\n }\n // Defined terms indicate a precise match\n const enc = this.encodeOptional(patternTerm);\n if (enc === undefined) {\n return;\n }\n yield enc;\n }\n}\nexports.TermDictionaryQuotedIndexed = TermDictionaryQuotedIndexed;\nTermDictionaryQuotedIndexed.BITMASK = 1 << 31;\n//# sourceMappingURL=TermDictionaryQuotedIndexed.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedIndexed.js?\n}");
1165
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ UpdateManager)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _store__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./store */ \"./node_modules/rdflib/esm/store.js\");\n/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./uri */ \"./node_modules/rdflib/esm/uri.js\");\n/* harmony import */ var _fetcher__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fetcher */ \"./node_modules/rdflib/esm/fetcher.js\");\n/* harmony import */ var _namespace__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./namespace */ \"./node_modules/rdflib/esm/namespace.js\");\n/* harmony import */ var _serializer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./serializer */ \"./node_modules/rdflib/esm/serializer.js\");\n/* harmony import */ var _utils_terms__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./utils/terms */ \"./node_modules/rdflib/esm/utils/terms.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./utils-js */ \"./node_modules/rdflib/esm/utils-js.js\");\n/* harmony import */ var _utils_termValue__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./utils/termValue */ \"./node_modules/rdflib/esm/utils/termValue.js\");\n\n/* @file Update Manager Class\n**\n** 2007-07-15 original SPARQL Update module by Joe Presbrey <presbrey@mit.edu>\n** 2010-08-08 TimBL folded in Kenny's WEBDAV\n** 2010-12-07 TimBL added local file write code\n*/\n\n\n\n\n\n\n\n\n/**\n* The UpdateManager is a helper object for a store.\n* Just as a Fetcher provides the store with the ability to read and write,\n* the Update Manager provides functionality for making small patches in real time,\n* and also looking out for concurrent updates from other agents\n*/\nclass UpdateManager {\n /**\n * @param store - The quadstore to store data and metadata. Created if not passed.\n */\n constructor(store) {\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"store\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"ifps\", void 0);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"fps\", void 0);\n /** Index of objects for coordinating incoming and outgoing patches */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"patchControl\", void 0);\n /** Object of namespaces */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"ns\", void 0);\n store = store || new _store__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n if (store.updater) {\n throw new Error(\"You can't have two UpdateManagers for the same store\");\n }\n if (!store.fetcher) {\n store.fetcher = new _fetcher__WEBPACK_IMPORTED_MODULE_3__[\"default\"](store);\n }\n this.store = store;\n store.updater = this;\n this.ifps = {};\n this.fps = {};\n this.ns = {};\n this.ns.link = (0,_namespace__WEBPACK_IMPORTED_MODULE_4__[\"default\"])('http://www.w3.org/2007/ont/link#');\n this.ns.http = (0,_namespace__WEBPACK_IMPORTED_MODULE_4__[\"default\"])('http://www.w3.org/2007/ont/http#');\n this.ns.httph = (0,_namespace__WEBPACK_IMPORTED_MODULE_4__[\"default\"])('http://www.w3.org/2007/ont/httph#');\n this.ns.ldp = (0,_namespace__WEBPACK_IMPORTED_MODULE_4__[\"default\"])('http://www.w3.org/ns/ldp#');\n this.ns.rdf = (0,_namespace__WEBPACK_IMPORTED_MODULE_4__[\"default\"])('http://www.w3.org/1999/02/22-rdf-syntax-ns#');\n this.ns.rdfs = (0,_namespace__WEBPACK_IMPORTED_MODULE_4__[\"default\"])('http://www.w3.org/2000/01/rdf-schema#');\n this.ns.rdf = (0,_namespace__WEBPACK_IMPORTED_MODULE_4__[\"default\"])('http://www.w3.org/1999/02/22-rdf-syntax-ns#');\n this.ns.owl = (0,_namespace__WEBPACK_IMPORTED_MODULE_4__[\"default\"])('http://www.w3.org/2002/07/owl#');\n this.patchControl = [];\n }\n patchControlFor(doc) {\n if (!this.patchControl[doc.value]) {\n this.patchControl[doc.value] = [];\n }\n return this.patchControl[doc.value];\n }\n isHttpUri(uri) {\n return uri.slice(0, 4) === 'http';\n }\n\n /** Remove from the store HTTP authorization metadata\n * The editable function below relies on copies we have in the store\n * of the results of previous HTTP transactions. However, when\n * the user logs in, then that data misrepresents what would happen\n * if the user tried again.\n */\n flagAuthorizationMetadata(kb) {\n if (!kb) {\n kb = this.store;\n }\n const meta = kb.fetcher?.appNode;\n const requests = kb.statementsMatching(undefined, this.ns.link('requestedURI'), undefined, meta).map(st => st.subject);\n for (const request of requests) {\n const response = kb.any(request, this.ns.link('response'), null, meta);\n if (response != undefined) {\n // ts\n kb.add(response, this.ns.link('outOfDate'), true, meta); // @@ Boolean is fine - fix types\n }\n }\n }\n\n /**\n * Tests whether a file is editable.\n * If the file has a specific annotation that it is machine written,\n * for safety, it is editable (this doesn't actually check for write access)\n * If the file has wac-allow and accept patch headers, those are respected.\n * and local write access is determined by those headers.\n * This async version not only looks at past HTTP requests, it also makes new ones if necessary.\n *\n * @returns The method string N3PATCH or SPARQL or DAV or\n * LOCALFILE or false if known, undefined if not known.\n */\n async checkEditable(uri, kb) {\n if (!uri) {\n return false; // Eg subject is bnode, no known doc to write to\n }\n if (!kb) {\n kb = this.store;\n }\n const initial = this.editable(uri, kb);\n if (initial !== undefined) {\n return initial;\n }\n await kb.fetcher?.load(uri);\n const final = this.editable(uri, kb);\n // console.log(`Loaded ${uri} just to check editable, result: ${final}.`)\n return final;\n }\n /**\n * Tests whether a file is editable.\n * If the file has a specific annotation that it is machine written,\n * for safety, it is editable (this doesn't actually check for write access)\n * If the file has wac-allow and accept patch headers, those are respected.\n * and local write access is determined by those headers.\n * This synchronous version only looks at past HTTP requests, does not make new ones.\n *\n * @returns The method string SPARQL or DAV or\n * LOCALFILE or false if known, undefined if not known.\n */\n editable(uri, kb) {\n if (!uri) {\n return false; // Eg subject is bnode, no known doc to write to\n }\n if (!kb) {\n kb = this.store;\n }\n uri = (0,_utils_termValue__WEBPACK_IMPORTED_MODULE_8__.termValue)(uri);\n if (!this.isHttpUri(uri)) {\n if (kb.holds(kb.rdfFactory.namedNode(uri), kb.rdfFactory.namedNode('http://www.w3.org/1999/02/22-rdf-syntax-ns#type'), kb.rdfFactory.namedNode('http://www.w3.org/2007/ont/link#MachineEditableDocument'))) {\n return 'LOCALFILE';\n }\n }\n var request;\n var definitive = false;\n const meta = kb.fetcher?.appNode;\n // const kb = s\n\n // @ts-ignore passes a string to kb.each, which expects a term. Should this work?\n var requests = kb.each(undefined, this.ns.link('requestedURI'), (0,_uri__WEBPACK_IMPORTED_MODULE_2__.docpart)(uri), meta);\n var method;\n for (var r = 0; r < requests.length; r++) {\n request = requests[r];\n if (request !== undefined) {\n const response = kb.any(request, this.ns.link('response'), null, meta);\n if (response !== undefined) {\n // ts\n\n const outOfDate = kb.anyJS(response, this.ns.link('outOfDate'), null, meta);\n if (outOfDate) continue;\n var wacAllow = kb.anyValue(response, this.ns.httph('wac-allow'));\n if (wacAllow) {\n for (var bit of wacAllow.split(',')) {\n var lr = bit.split('=');\n if (lr[0].includes('user') && !lr[1].includes('write') && !lr[1].includes('append')) {\n // console.log(' editable? excluded by WAC-Allow: ', wacAllow)\n return false;\n }\n }\n }\n var acceptPatch = kb.each(response, this.ns.httph('accept-patch'));\n if (acceptPatch.length) {\n for (let i = 0; i < acceptPatch.length; i++) {\n method = acceptPatch[i].value.trim();\n // 2025/02 temporarily priorize SPARQL until N3PATCH spec revised on inserts with blankNodes\n if (method.indexOf('application/sparql-update') >= 0) return 'SPARQL';\n if (method.indexOf('application/sparql-update-single-match') >= 0) return 'SPARQL';\n if (method.indexOf('text/n3') >= 0) return 'N3PATCH';\n }\n }\n var authorVia = kb.each(response, this.ns.httph('ms-author-via'));\n if (authorVia.length) {\n for (let i = 0; i < authorVia.length; i++) {\n method = authorVia[i].value.trim();\n if (method.indexOf('SPARQL') >= 0) {\n return 'SPARQL';\n }\n if (method.indexOf('DAV') >= 0) {\n return 'DAV';\n }\n }\n }\n if (!this.isHttpUri(uri)) {\n if (!wacAllow) return false;else return 'LOCALFILE';\n }\n var status = kb.each(response, this.ns.http('status'));\n if (status.length) {\n for (let i = 0; i < status.length; i++) {\n // @ts-ignore since statuses should be TFTerms, this should always be false\n if (status[i] === 200 || status[i] === 404) {\n definitive = true;\n // return false // A definitive answer\n }\n }\n }\n } else {\n // console.log('UpdateManager.editable: No response for ' + uri + '\\n')\n }\n }\n }\n if (requests.length === 0) {\n // console.log('UpdateManager.editable: No request for ' + uri + '\\n')\n } else {\n if (definitive) {\n return false; // We have got a request and it did NOT say editable => not editable\n }\n }\n // console.log('UpdateManager.editable: inconclusive for ' + uri + '\\n')\n return undefined; // We don't know (yet) as we haven't had a response (yet)\n }\n anonymize(obj) {\n let anonymized = obj.toNT().substr(0, 2) === '_:' && this.mentioned(obj) ? '?' + obj.toNT().substr(2) : obj.toNT();\n return anonymized;\n }\n anonymizeNT(stmt) {\n return this.anonymize(stmt.subject) + ' ' + this.anonymize(stmt.predicate) + ' ' + this.anonymize(stmt.object) + ' .';\n }\n nTriples(stmt) {\n return `${stmt.subject.toNT()} ${stmt.predicate.toNT()} ${stmt.object.toNT()} .`;\n }\n\n /**\n * Returns a list of all bnodes occurring in a statement\n * @private\n */\n statementBnodes(st) {\n return [st.subject, st.predicate, st.object].filter(function (x) {\n return (0,_utils_terms__WEBPACK_IMPORTED_MODULE_6__.isBlankNode)(x);\n });\n }\n\n /**\n * Returns a list of all bnodes occurring in a list of statements\n * @private\n */\n statementArrayBnodes(sts) {\n var bnodes = [];\n for (let i = 0; i < sts.length; i++) {\n bnodes = bnodes.concat(this.statementBnodes(sts[i]));\n }\n bnodes.sort(); // in place sort - result may have duplicates\n var bnodes2 = [];\n for (let j = 0; j < bnodes.length; j++) {\n if (j === 0 || !bnodes[j].equals(bnodes[j - 1])) {\n bnodes2.push(bnodes[j]);\n }\n }\n return bnodes2;\n }\n\n /**\n * Makes a cached list of [Inverse-]Functional properties\n * @private\n */\n cacheIfps() {\n this.ifps = {};\n var a = this.store.each(undefined, this.ns.rdf('type'), this.ns.owl('InverseFunctionalProperty'));\n for (let i = 0; i < a.length; i++) {\n this.ifps[a[i].value] = true;\n }\n this.fps = {};\n a = this.store.each(undefined, this.ns.rdf('type'), this.ns.owl('FunctionalProperty'));\n for (let i = 0; i < a.length; i++) {\n this.fps[a[i].value] = true;\n }\n }\n\n /**\n * Returns a context to bind a given node, up to a given depth\n * @private\n */\n bnodeContext2(x, source, depth) {\n // Return a list of statements which indirectly identify a node\n // Depth > 1 if try further indirection.\n // Return array of statements (possibly empty), or null if failure\n var sts = this.store.statementsMatching(undefined, undefined, x, source); // incoming links\n var y;\n var res;\n for (let i = 0; i < sts.length; i++) {\n if (this.fps[sts[i].predicate.value]) {\n y = sts[i].subject;\n if (!y.isBlank) {\n return [sts[i]];\n }\n if (depth) {\n res = this.bnodeContext2(y, source, depth - 1);\n if (res) {\n return res.concat([sts[i]]);\n }\n }\n }\n }\n // outgoing links\n sts = this.store.statementsMatching(x, undefined, undefined, source);\n for (let i = 0; i < sts.length; i++) {\n if (this.ifps[sts[i].predicate.value]) {\n y = sts[i].object;\n if (!y.isBlank) {\n return [sts[i]];\n }\n if (depth) {\n res = this.bnodeContext2(y, source, depth - 1);\n if (res) {\n return res.concat([sts[i]]);\n }\n }\n }\n }\n return null; // Failure\n }\n\n /**\n * Returns the smallest context to bind a given single bnode\n * @private\n */\n bnodeContext1(x, source) {\n // Return a list of statements which indirectly identify a node\n // Breadth-first\n for (var depth = 0; depth < 3; depth++) {\n // Try simple first\n var con = this.bnodeContext2(x, source, depth);\n if (con !== null) return con;\n }\n // If we can't guarantee unique with logic just send all info about node\n return this.store.connectedStatements(x, source); // was:\n // throw new Error('Unable to uniquely identify bnode: ' + x.toNT())\n }\n\n /**\n * @private\n */\n mentioned(x) {\n return this.store.statementsMatching(x, null, null, null).length !== 0 ||\n // Don't pin fresh bnodes\n this.store.statementsMatching(null, x).length !== 0 || this.store.statementsMatching(null, null, x).length !== 0;\n }\n\n /**\n * @private\n */\n bnodeContext(bnodes, doc) {\n var context = [];\n if (bnodes.length) {\n this.cacheIfps();\n for (let i = 0; i < bnodes.length; i++) {\n // Does this occur in old graph?\n var bnode = bnodes[i];\n if (!this.mentioned(bnode)) continue;\n context = context.concat(this.bnodeContext1(bnode, doc));\n }\n }\n return context;\n }\n\n /**\n * Returns the best context for a single statement\n * @private\n */\n statementContext(st) {\n var bnodes = this.statementBnodes(st);\n return this.bnodeContext(bnodes, st.graph);\n }\n\n /**\n * @private\n */\n contextWhere(context) {\n var updater = this;\n return !context || context.length === 0 ? '' : 'WHERE { ' + context.map(function (x) {\n return updater.anonymizeNT(x);\n }).join('\\n') + ' }\\n';\n }\n\n /**\n * @private\n */\n fire(uri, query, callbackFunction, options = {}) {\n return Promise.resolve().then(() => {\n if (!uri) {\n throw new Error('No URI given for remote editing operation: ' + query);\n }\n // console.log('UpdateManager: sending update to <' + uri + '>')\n\n options.noMeta = true;\n options.contentType = options.contentType || 'application/sparql-update';\n options.body = query;\n return this.store.fetcher.webOperation('PATCH', uri, options);\n }).then(response => {\n if (!response.ok) {\n let message = 'UpdateManager: update failed for <' + uri + '> status=' + response.status + ', ' + response.statusText + '\\n for query: ' + query;\n // console.log(message)\n throw new Error(message);\n }\n\n // console.log('UpdateManager: update Ok for <' + uri + '>')\n\n callbackFunction(uri, response.ok, response.responseText, response);\n }).catch(err => {\n callbackFunction(uri, false, err.message, err);\n });\n }\n\n // ARE THESE THREE FUNCTIONS USED? DEPRECATE?\n\n /** return a statemnet updating function\n *\n * This does NOT update the statement.\n * It returns an object which includes\n * function which can be used to change the object of the statement.\n */\n update_statement(statement) {\n if (statement && !statement.graph) {\n return;\n }\n var updater = this;\n var context = this.statementContext(statement);\n return {\n statement: statement ? [statement.subject, statement.predicate, statement.object, statement.graph] : undefined,\n statementNT: statement ? this.anonymizeNT(statement) : undefined,\n where: updater.contextWhere(context),\n set_object: function (obj, callbackFunction) {\n var query = this.where;\n query += 'DELETE DATA { ' + this.statementNT + ' } ;\\n';\n query += 'INSERT DATA { ' +\n // @ts-ignore `this` might refer to the wrong scope. Does this work?\n this.anonymize(this.statement[0]) + ' ' +\n // @ts-ignore\n this.anonymize(this.statement[1]) + ' ' +\n // @ts-ignore\n this.anonymize(obj) + ' ' + ' . }\\n';\n updater.fire(this.statement[3].value, query, callbackFunction);\n }\n };\n }\n insert_statement(st, callbackFunction) {\n var st0 = st instanceof Array ? st[0] : st;\n var query = this.contextWhere(this.statementContext(st0));\n if (st instanceof Array) {\n var stText = '';\n for (let i = 0; i < st.length; i++) stText += st[i] + '\\n';\n query += 'INSERT DATA { ' + stText + ' }\\n';\n } else {\n query += 'INSERT DATA { ' + this.anonymize(st.subject) + ' ' + this.anonymize(st.predicate) + ' ' + this.anonymize(st.object) + ' ' + ' . }\\n';\n }\n this.fire(st0.graph.value, query, callbackFunction);\n }\n delete_statement(st, callbackFunction) {\n var st0 = st instanceof Array ? st[0] : st;\n var query = this.contextWhere(this.statementContext(st0));\n if (st instanceof Array) {\n var stText = '';\n for (let i = 0; i < st.length; i++) stText += st[i] + '\\n';\n query += 'DELETE DATA { ' + stText + ' }\\n';\n } else {\n query += 'DELETE DATA { ' + this.anonymize(st.subject) + ' ' + this.anonymize(st.predicate) + ' ' + this.anonymize(st.object) + ' ' + ' . }\\n';\n }\n this.fire(st0.graph.value, query, callbackFunction);\n }\n\n /// //////////////////////\n\n /**\n * Requests a now or future action to refresh changes coming downstream\n * This is designed to allow the system to re-request the server version,\n * when a websocket has pinged to say there are changes.\n * If the websocket, by contrast, has sent a patch, then this may not be necessary.\n *\n * @param doc\n * @param action\n */\n requestDownstreamAction(doc, action) {\n var control = this.patchControlFor(doc);\n if (!control.pendingUpstream) {\n action(doc);\n } else {\n if (control.downstreamAction) {\n if ('' + control.downstreamAction !== '' + action) {\n // Kludge compare\n throw new Error(\"Can't wait for > 1 different downstream actions\");\n }\n } else {\n control.downstreamAction = action;\n }\n }\n }\n\n /**\n * We want to start counting websocket notifications\n * to distinguish the ones from others from our own.\n */\n clearUpstreamCount(doc) {\n var control = this.patchControlFor(doc);\n control.upstreamCount = 0;\n }\n getUpdatesVia(doc) {\n var linkHeaders = this.store.fetcher.getHeader(doc, 'updates-via');\n if (!linkHeaders || !linkHeaders.length) return null;\n return linkHeaders[0].trim();\n }\n addDownstreamChangeListener(doc, listener) {\n var control = this.patchControlFor(doc);\n if (!control.downstreamChangeListeners) {\n control.downstreamChangeListeners = [];\n }\n control.downstreamChangeListeners.push(listener);\n this.setRefreshHandler(doc, doc => {\n this.reloadAndSync(doc);\n });\n }\n reloadAndSync(doc) {\n var control = this.patchControlFor(doc);\n var updater = this;\n if (control.reloading) {\n // console.log(' Already reloading - note this load may be out of date')\n control.outOfDate = true;\n return; // once only needed @@ Not true, has changed again\n }\n control.reloading = true;\n var retryTimeout = 1000; // ms\n var tryReload = function () {\n // console.log('try reload - timeout = ' + retryTimeout)\n updater.reload(updater.store, doc, function (ok, message, response) {\n if (ok) {\n if (control.downstreamChangeListeners) {\n for (let i = 0; i < control.downstreamChangeListeners.length; i++) {\n // console.log(' Calling downstream listener ' + i)\n control.downstreamChangeListeners[i]();\n }\n }\n control.reloading = false;\n if (control.outOfDate) {\n // console.log(' Extra reload because of extra update.')\n control.outOfDate = false;\n tryReload();\n }\n } else {\n control.reloading = false;\n if (response && response.status === 0) {\n // console.log('Network error refreshing the data. Retrying in ' +\n // retryTimeout / 1000)\n control.reloading = true;\n retryTimeout = retryTimeout * 2;\n setTimeout(tryReload, retryTimeout);\n } else {\n // console.log('Error ' + (response as Response).status + 'refreshing the data:' +\n // message + '. Stopped' + doc)\n }\n }\n });\n };\n tryReload();\n }\n\n /**\n * Sets up websocket to listen on\n *\n * There is coordination between upstream changes and downstream ones\n * so that a reload is not done in the middle of an upstream patch.\n * If you use this API then you get called when a change happens, and you\n * have to reload the file yourself, and then refresh the UI.\n * Alternative is addDownstreamChangeListener(), where you do not\n * have to do the reload yourself. Do mot mix them.\n *\n * kb contains the HTTP metadata from previous operations\n *\n * @param doc\n * @param handler\n *\n * @returns {boolean}\n */\n setRefreshHandler(doc, handler) {\n let wssURI = this.getUpdatesVia(doc); // relative\n // var kb = this.store\n var theHandler = handler;\n var self = this;\n var updater = this;\n var retryTimeout = 1500; // *2 will be 3 Seconds, 6, 12, etc\n var retries = 0;\n if (!wssURI) {\n // console.log('Server does not support live updates through Updates-Via :-(')\n return false;\n }\n wssURI = (0,_uri__WEBPACK_IMPORTED_MODULE_2__.join)(wssURI, doc.value);\n const validWssURI = wssURI.replace(/^http:/, 'ws:').replace(/^https:/, 'wss:');\n // console.log('Web socket URI ' + wssURI)\n\n var openWebsocket = function () {\n // From https://github.com/solid/solid-spec#live-updates\n var socket;\n if (typeof WebSocket !== 'undefined') {\n socket = new WebSocket(validWssURI);\n } else if (typeof window !== 'undefined' && window.WebSocket) {\n socket = window.WebSocket(validWssURI);\n } else {\n // console.log('Live update disabled, as WebSocket not supported by platform :-(')\n return;\n }\n socket.onopen = function () {\n // console.log(' websocket open')\n retryTimeout = 1500; // reset timeout to fast on success\n this.send('sub ' + doc.value);\n if (retries) {\n // console.log('Web socket has been down, better check for any news.')\n updater.requestDownstreamAction(doc, theHandler);\n }\n };\n var control = self.patchControlFor(doc);\n control.upstreamCount = 0;\n socket.onerror = function onerror(err) {\n // console.log('Error on Websocket:', err)\n };\n\n // https://developer.mozilla.org/en-US/docs/Web/API/CloseEvent\n //\n // 1000 CLOSE_NORMAL Normal closure; the connection successfully completed whatever purpose for which it was created.\n // 1001 CLOSE_GOING_AWAY The endpoint is going away, either\n // because of a server failure or because the browser is navigating away from the page that opened the connection.\n // 1002 CLOSE_PROTOCOL_ERROR The endpoint is terminating the connection due to a protocol error.\n // 1003 CLOSE_UNSUPPORTED The connection is being terminated because the endpoint\n // received data of a type it cannot accept (for example, a text-only endpoint received binary data).\n // 1004 Reserved. A meaning might be defined in the future.\n // 1005 CLOSE_NO_STATUS Reserved. Indicates that no status code was provided even though one was expected.\n // 1006 CLOSE_ABNORMAL Reserved. Used to indicate that a connection was closed abnormally (\n //\n //\n socket.onclose = function (event) {\n // console.log('*** Websocket closed with code ' + event.code +\n // \", reason '\" + event.reason + \"' clean = \" + event.wasClean)\n retryTimeout *= 2;\n retries += 1;\n // console.log('Retrying in ' + retryTimeout + 'ms') // (ask user?)\n setTimeout(function () {\n // console.log('Trying websocket again')\n openWebsocket();\n }, retryTimeout);\n };\n socket.onmessage = function (msg) {\n if (msg.data && msg.data.slice(0, 3) === 'pub') {\n if ('upstreamCount' in control) {\n control.upstreamCount -= 1;\n if (control.upstreamCount >= 0) {\n // console.log('just an echo: ' + control.upstreamCount)\n return; // Just an echo\n }\n }\n // console.log('Assume a real downstream change: ' + control.upstreamCount + ' -> 0')\n control.upstreamCount = 0;\n self.requestDownstreamAction(doc, theHandler);\n }\n };\n }; // openWebsocket\n openWebsocket();\n return true;\n }\n\n /**\n * This high-level function updates the local store iff the web is changed successfully.\n * Deletions, insertions may be undefined or single statements or lists or formulae (may contain bnodes which can be indirectly identified by a where clause).\n * The `why` property of each statement must be the give the web document to be updated.\n * The statements to be deleted and inserted may span more than one web document.\n * @param deletions - Statement or statements to be deleted.\n * @param insertions - Statement or statements to be inserted.\n * @returns a promise\n */\n updateMany(deletions, insertions = []) {\n const docs = deletions.concat(insertions).map(st => st.why);\n const thisUpdater = this;\n const uniqueDocs = [];\n docs.forEach(doc => {\n if (!uniqueDocs.find(uniqueDoc => uniqueDoc.equals(doc))) uniqueDocs.push(doc);\n });\n const updates = uniqueDocs.map(doc => thisUpdater.update(deletions.filter(st => st.why.equals(doc)), insertions.filter(st => st.why.equals(doc))));\n if (updates.length > 1) {\n // console.log(`@@ updateMany to ${updates.length}: ${uniqueDocs}`)\n }\n return Promise.all(updates);\n }\n\n /**\n * @private\n * \n * This helper function constructs SPARQL Update query from resolved arguments.\n * \n * @param ds: deletions array.\n * @param is: insertions array.\n * @param bnodes_context: Additional context to uniquely identify any blank nodes.\n */\n constructSparqlUpdateQuery(ds, is, bnodes_context) {\n var whereClause = this.contextWhere(bnodes_context);\n var query = '';\n if (whereClause.length) {\n // Is there a WHERE clause?\n if (ds.length) {\n query += 'DELETE { ';\n for (let i = 0; i < ds.length; i++) {\n query += this.anonymizeNT(ds[i]) + '\\n';\n }\n query += ' }\\n';\n }\n if (is.length) {\n query += 'INSERT { ';\n for (let i = 0; i < is.length; i++) {\n query += this.anonymizeNT(is[i]) + '\\n';\n }\n query += ' }\\n';\n }\n query += whereClause;\n } else {\n // no where clause\n if (ds.length) {\n query += 'DELETE DATA { ';\n for (let i = 0; i < ds.length; i++) {\n query += this.anonymizeNT(ds[i]) + '\\n';\n }\n query += ' } \\n';\n }\n if (is.length) {\n if (ds.length) query += ' ; ';\n query += 'INSERT DATA { ';\n for (let i = 0; i < is.length; i++) {\n query += this.nTriples(is[i]) + '\\n';\n }\n query += ' }\\n';\n }\n }\n return query;\n }\n\n /**\n * @private\n * \n * This helper function constructs n3-patch query from resolved arguments.\n * \n * @param ds: deletions array.\n * @param is: insertions array.\n * @param bnodes_context: Additional context to uniquely identify any blanknodes.\n */\n constructN3PatchQuery(ds, is, bnodes_context) {\n var query = `\n@prefix solid: <http://www.w3.org/ns/solid/terms#>.\n@prefix ex: <http://www.example.org/terms#>.\n\n_:patch\n`;\n // If bnode context is non trivial, express it as ?conditions formula.\n if (bnodes_context && bnodes_context.length > 0) {\n query += `\n solid:where {\n ${bnodes_context.map(x => this.anonymizeNT(x)).join('\\n ')}\n };`;\n }\n if (ds.length > 0) {\n query += `\n solid:deletes {\n ${ds.map(x => this.anonymizeNT(x)).join('\\n ')}\n };`;\n }\n if (is.length > 0) {\n query += `\n solid:inserts {\n ${is.map(x => this.anonymizeNT(x)).join('\\n ')}\n };`;\n }\n query += \" a solid:InsertDeletePatch .\\n\";\n return query;\n }\n\n /**\n * This high-level function updates the local store if the web is changed successfully.\n * Deletions, insertions may be undefined or single statements or lists or formulae (may contain bnodes which can be indirectly identified by a where clause).\n * The `why` property of each statement must be the same and give the web document to be updated.\n * @param deletions - Statement or statements to be deleted.\n * @param insertions - Statement or statements to be inserted.\n * @param callback - called as callbackFunction(uri, success, errorbody)\n * OR returns a promise\n * @param options - Options for the fetch call\n */\n update(deletions, insertions, callback, secondTry, options = {}) {\n if (!callback) {\n var thisUpdater = this;\n return new Promise(function (resolve, reject) {\n // Promise version\n thisUpdater.update(deletions, insertions, function (uri, ok, errorBody) {\n if (!ok) {\n reject(new Error(errorBody));\n } else {\n resolve();\n }\n }, secondTry, options); // callbackFunction\n }); // promise\n } // if\n\n try {\n var kb = this.store;\n var ds = !deletions ? [] : (0,_utils_terms__WEBPACK_IMPORTED_MODULE_6__.isStore)(deletions) ? deletions.statements : deletions instanceof Array ? deletions : [deletions];\n var is = !insertions ? [] : (0,_utils_terms__WEBPACK_IMPORTED_MODULE_6__.isStore)(insertions) ? insertions.statements : insertions instanceof Array ? insertions : [insertions];\n if (!(ds instanceof Array)) {\n throw new Error('Type Error ' + typeof ds + ': ' + ds);\n }\n if (!(is instanceof Array)) {\n throw new Error('Type Error ' + typeof is + ': ' + is);\n }\n if (ds.length === 0 && is.length === 0) {\n return callback(null, true); // success -- nothing needed to be done.\n }\n var doc = ds.length ? ds[0].graph : is[0].graph;\n if (!doc) {\n let message = 'Error patching: statement does not specify which document to patch:' + ds[0] + ', ' + is[0];\n // console.log(message)\n throw new Error(message);\n }\n if (doc.termType !== 'NamedNode') {\n let message = 'Error patching: document not a NamedNode:' + ds[0] + ', ' + is[0];\n // console.log(message)\n throw new Error(message);\n }\n var control = this.patchControlFor(doc);\n var startTime = Date.now();\n var props = ['subject', 'predicate', 'object', 'why'];\n var verbs = ['insert', 'delete'];\n var clauses = {\n 'delete': ds,\n 'insert': is\n };\n verbs.map(function (verb) {\n clauses[verb].map(function (st) {\n if (!doc.equals(st.graph)) {\n throw new Error('update: destination ' + doc + ' inconsistent with delete quad ' + st.graph);\n }\n props.map(function (prop) {\n if (typeof st[prop] === 'undefined') {\n throw new Error('update: undefined ' + prop + ' of statement.');\n }\n });\n });\n });\n var protocol = this.editable(doc.value, kb);\n if (protocol === false) {\n throw new Error('Update: Can\\'t make changes in uneditable ' + doc);\n }\n if (protocol === undefined) {\n // Not enough metadata\n if (secondTry) {\n throw new Error('Update: Loaded ' + doc + \"but still can't figure out what editing protocol it supports.\");\n }\n // console.log(`Update: have not loaded ${doc} before: loading now...`);\n this.store.fetcher.load(doc).then(response => {\n this.update(deletions, insertions, callback, true, options);\n }, err => {\n if (err.response.status === 404) {\n // nonexistent files are fine\n this.update(deletions, insertions, callback, true, options);\n } else {\n throw new Error(`Update: Can't get updatability status ${doc} before patching: ${err}`);\n }\n });\n return;\n } else if (protocol.indexOf('SPARQL') >= 0 || protocol.indexOf('N3PATCH') >= 0) {\n var isSparql = protocol.indexOf('SPARQL') >= 0;\n var bnodes = [];\n // change ReadOnly type to Mutable type\n\n if (ds.length) bnodes = this.statementArrayBnodes(ds);\n if (is.length) bnodes = bnodes.concat(this.statementArrayBnodes(is));\n var context = this.bnodeContext(bnodes, doc);\n var query = isSparql ? this.constructSparqlUpdateQuery(ds, is, context) : this.constructN3PatchQuery(ds, is, context);\n options.contentType = isSparql ? 'application/sparql-update' : 'text/n3';\n\n // Track pending upstream patches until they have finished their callbackFunction\n control.pendingUpstream = control.pendingUpstream ? control.pendingUpstream + 1 : 1;\n if ('upstreamCount' in control) {\n control.upstreamCount += 1; // count changes we originated ourselves\n // console.log('upstream count up to : ' + control.upstreamCount)\n }\n this.fire(doc.value, query, (uri, success, body, response) => {\n response.elapsedTimeMs = Date.now() - startTime;\n /* console.log(' UpdateManager: Return ' +\n (success ? 'success ' : 'FAILURE ') + (response as Response).status +\n ' elapsed ' + (response as any).elapsedTimeMs + 'ms')\n */\n if (success) {\n try {\n kb.remove(ds);\n } catch (e) {\n success = false;\n body = 'Remote Ok BUT error deleting ' + ds.length + ' from store!!! ' + e;\n } // Add in any case -- help recover from weirdness??\n for (let i = 0; i < is.length; i++) {\n kb.add(is[i].subject, is[i].predicate, is[i].object, doc);\n }\n }\n callback(uri, success, body, response);\n control.pendingUpstream -= 1;\n // When upstream patches have been sent, reload state if downstream waiting\n if (control.pendingUpstream === 0 && control.downstreamAction) {\n var downstreamAction = control.downstreamAction;\n delete control.downstreamAction;\n // console.log('delayed downstream action:')\n downstreamAction(doc);\n }\n }, options);\n } else if (protocol.indexOf('DAV') >= 0) {\n this.updateDav(doc, ds, is, callback, options);\n } else {\n if (protocol.indexOf('LOCALFILE') >= 0) {\n try {\n this.updateLocalFile(doc, ds, is, callback, options);\n } catch (e) {\n callback(doc.value, false, 'Exception trying to write back file <' + doc.value + '>\\n'\n // + tabulator.Util.stackString(e))\n );\n }\n } else {\n throw new Error(\"Unhandled edit method: '\" + protocol + \"' for \" + doc);\n }\n }\n } catch (e) {\n callback(undefined, false, 'Exception in update: ' + e + '\\n' + _utils_js__WEBPACK_IMPORTED_MODULE_7__.stackString(e));\n }\n }\n updateDav(doc, ds, is, callbackFunction, options = {}) {\n let kb = this.store;\n // The code below is derived from Kenny's UpdateCenter.js\n var request = kb.any(doc, this.ns.link('request'));\n if (!request) {\n throw new Error('No record of our HTTP GET request for document: ' + doc);\n } // should not happen\n var response = kb.any(request, this.ns.link('response'));\n if (!response) {\n return null; // throw \"No record HTTP GET response for document: \"+doc\n }\n var contentType = kb.the(response, this.ns.httph('content-type')).value;\n\n // prepare contents of revised document\n let newSts = kb.statementsMatching(undefined, undefined, undefined, doc).slice(); // copy!\n for (let i = 0; i < ds.length; i++) {\n _utils_js__WEBPACK_IMPORTED_MODULE_7__.RDFArrayRemove(newSts, ds[i]);\n }\n for (let i = 0; i < is.length; i++) {\n newSts.push(is[i]);\n }\n const documentString = this.serialize(doc.value, newSts, contentType);\n\n // Write the new version back\n var candidateTarget = kb.the(response, this.ns.httph('content-location'));\n var targetURI;\n if (candidateTarget) {\n targetURI = (0,_uri__WEBPACK_IMPORTED_MODULE_2__.join)(candidateTarget.value, targetURI);\n }\n options.contentType = contentType;\n options.noMeta = true;\n options.body = documentString;\n return kb.fetcher.webOperation('PUT', targetURI, options).then(response => {\n if (!response.ok) {\n throw new Error(response.error);\n }\n for (let i = 0; i < ds.length; i++) {\n kb.remove(ds[i]);\n }\n for (let i = 0; i < is.length; i++) {\n kb.add(is[i].subject, is[i].predicate, is[i].object, doc);\n }\n callbackFunction(doc.value, response.ok, response.responseText, response);\n }).catch(err => {\n callbackFunction(doc.value, false, err.message, err);\n });\n }\n\n /**\n * Likely deprecated, since this lib no longer deals with browser extension\n *\n * @param doc\n * @param ds\n * @param is\n * @param callbackFunction\n * @param options\n */\n updateLocalFile(doc, ds, is, callbackFunction, options = {}) {\n const kb = this.store;\n // console.log('Writing back to local file\\n')\n\n // prepare contents of revised document\n let newSts = kb.statementsMatching(undefined, undefined, undefined, doc).slice(); // copy!\n\n for (let i = 0; i < ds.length; i++) {\n _utils_js__WEBPACK_IMPORTED_MODULE_7__.RDFArrayRemove(newSts, ds[i]);\n }\n for (let i = 0; i < is.length; i++) {\n newSts.push(is[i]);\n }\n // serialize to the appropriate format\n var dot = doc.value.lastIndexOf('.');\n if (dot < 1) {\n throw new Error('Rewriting file: No filename extension: ' + doc.value);\n }\n var ext = doc.value.slice(dot + 1);\n let contentType = _fetcher__WEBPACK_IMPORTED_MODULE_3__[\"default\"].CONTENT_TYPE_BY_EXT[ext];\n if (!contentType) {\n throw new Error('File extension .' + ext + ' not supported for data write');\n }\n options.body = this.serialize(doc.value, newSts, contentType);\n options.contentType = contentType;\n kb.fetcher.webOperation('PUT', doc.value, options).then(response => {\n if (!response.ok) return callbackFunction(doc.value, false, response.error);\n for (let i = 0; i < ds.length; i++) {\n kb.remove(ds[i]);\n }\n for (let i = 0; i < is.length; i++) {\n kb.add(is[i].subject, is[i].predicate, is[i].object, doc);\n }\n callbackFunction(doc.value, true, ''); // success!\n });\n }\n\n /**\n * @throws {Error} On unsupported content type\n *\n * @returns {string}\n */\n serialize(uri, data, contentType) {\n const kb = this.store;\n let documentString;\n if (typeof data === 'string') {\n return data;\n }\n\n // serialize to the appropriate format\n var sz = (0,_serializer__WEBPACK_IMPORTED_MODULE_5__[\"default\"])(kb);\n sz.suggestNamespaces(kb.namespaces);\n sz.setBase(uri);\n switch (contentType) {\n case 'text/xml':\n case 'application/rdf+xml':\n documentString = sz.statementsToXML(data);\n break;\n case 'text/n3':\n case 'text/turtle':\n case 'application/x-turtle': // Legacy\n case 'application/n3':\n // Legacy\n documentString = sz.statementsToN3(data);\n break;\n default:\n throw new Error('Content-type ' + contentType + ' not supported for data serialization');\n }\n return documentString;\n }\n\n /**\n * This is suitable for an initial creation of a document.\n */\n put(doc, data, contentType, callback) {\n const kb = this.store;\n let documentString;\n return Promise.resolve().then(() => {\n documentString = this.serialize(doc.value, data, contentType);\n return kb.fetcher.webOperation('PUT', doc.value, {\n contentType,\n body: documentString\n });\n }).then(response => {\n if (!response.ok) {\n return callback(doc.value, response.ok, response.error, response);\n }\n delete kb.fetcher.nonexistent[doc.value];\n delete kb.fetcher.requested[doc.value]; // @@ could this mess with the requested state machine? if a fetch is in progress\n\n if (typeof data !== 'string') {\n data.map(st => {\n kb.addStatement(st);\n });\n }\n callback(doc.value, response.ok, '', response);\n }).catch(err => {\n callback(doc.value, false, err.message);\n });\n }\n\n /**\n * Reloads a document.\n *\n * Fast and cheap, no metadata. Measure times for the document.\n * Load it provisionally.\n * Don't delete the statements before the load, or it will leave a broken\n * document in the meantime.\n *\n * @param kb\n * @param doc {RDFlibNamedNode}\n * @param callbackFunction\n */\n reload(kb, doc, callbackFunction) {\n var startTime = Date.now();\n // force sets no-cache and\n const options = {\n force: true,\n noMeta: true,\n clearPreviousData: true\n };\n kb.fetcher.nowOrWhenFetched(doc.value, options, function (ok, body, response) {\n if (!ok) {\n // console.log(' ERROR reloading data: ' + body)\n callbackFunction(false, 'Error reloading data: ' + body, response);\n //@ts-ignore Where does onErrorWasCalled come from?\n } else if (response.onErrorWasCalled || response.status !== 200) {\n // console.log(' Non-HTTP error reloading data! onErrorWasCalled=' +\n //@ts-ignore Where does onErrorWasCalled come from?\n // response.onErrorWasCalled + ' status: ' + response.status)\n callbackFunction(false, 'Non-HTTP error reloading data: ' + body, response);\n } else {\n var elapsedTimeMs = Date.now() - startTime;\n if (!doc.reloadTimeTotal) doc.reloadTimeTotal = 0;\n if (!doc.reloadTimeCount) doc.reloadTimeCount = 0;\n doc.reloadTimeTotal += elapsedTimeMs;\n doc.reloadTimeCount += 1;\n\n // console.log(' Fetch took ' + elapsedTimeMs + 'ms, av. of ' +\n // doc.reloadTimeCount + ' = ' +\n // (doc.reloadTimeTotal / doc.reloadTimeCount) + 'ms.')\n\n callbackFunction(true);\n }\n });\n }\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/update-manager.js?\n}");
501
1166
 
502
1167
  /***/ },
503
1168
 
504
- /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedReferential.js"
505
- /*!***********************************************************************************!*\
506
- !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedReferential.js ***!
507
- \***********************************************************************************/
508
- (__unused_webpack_module, exports, __webpack_require__) {
1169
+ /***/ "./node_modules/rdflib/esm/updates-via.js"
1170
+ /*!************************************************!*\
1171
+ !*** ./node_modules/rdflib/esm/updates-via.js ***!
1172
+ \************************************************/
1173
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
509
1174
 
510
1175
  "use strict";
511
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionaryQuotedReferential = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_terms_1 = __webpack_require__(/*! rdf-terms */ \"./node_modules/rdf-terms/index.js\");\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * A term dictionary for quoted triples.\n *\n * Plain terms and quoted triples are stored in separate dictionaries,\n * but quoted triples are encoded using encodings from the plain term dictionary.\n *\n * Finding quoted triples is done by iterating over all quoted triples, and filtering by the matching ones.\n */\nclass TermDictionaryQuotedReferential {\n constructor(plainTermDictionary, dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.quotedTriplesDictionary = [];\n this.quotedTriplesReverseDictionary = {};\n this.features = { quotedTriples: true };\n this.plainTermDictionary = plainTermDictionary;\n this.dataFactory = dataFactory;\n }\n encode(term) {\n if (term.termType === 'Quad') {\n return this.encodeQuotedTriple(term, false);\n }\n return this.plainTermDictionary.encode(term);\n }\n encodeQuotedTriple(quad, optional) {\n // Only quoted triples are supported\n if (quad.graph.termType !== 'DefaultGraph') {\n throw new Error('Encoding of quoted quads outside of the default graph is not allowed');\n }\n // Check if the quad was already encoded\n const encodedTripleOptional = (0, OrderUtils_1.encodeOptionalTerms)([quad.subject, quad.predicate, quad.object, undefined], this)?.slice(0, 3);\n const id = encodedTripleOptional && encodedTripleOptional.every(encoded => encoded !== undefined) ?\n this.quotedTriplesReverseDictionary[encodedTripleOptional.join(TermDictionaryQuotedReferential.SEPARATOR)] :\n undefined;\n // Return the encoding if we found one\n if (id !== undefined || optional) {\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return (id === undefined ? undefined : TermDictionaryQuotedReferential.BITMASK | id);\n }\n // If the quad was not encoded yet, add a new entry for it in the dictionary.\n const encodedTriple = [\n this.encode(quad.subject),\n this.encode(quad.predicate),\n this.encode(quad.object),\n ];\n const encodingBase = this.quotedTriplesDictionary.length + 1;\n this.quotedTriplesDictionary.push(encodedTriple);\n this.quotedTriplesReverseDictionary[encodedTriple.join(TermDictionaryQuotedReferential.SEPARATOR)] = encodingBase;\n // Mask MSB to indicate that the encoding should refer to the quoted triples dictionary.\n return TermDictionaryQuotedReferential.BITMASK | encodingBase;\n }\n encodeOptional(term) {\n if (term.termType === 'Quad') {\n return this.encodeQuotedTriple(term, true);\n }\n return this.plainTermDictionary.encodeOptional(term);\n }\n decode(encoding) {\n if (TermDictionaryQuotedReferential.BITMASK & encoding) {\n // Term comes from the quoted triples dictionary\n const encodingBase = (~TermDictionaryQuotedReferential.BITMASK & encoding) - 1;\n if (encodingBase >= this.quotedTriplesDictionary.length) {\n throw new Error(`The value ${encoding} is not present in the quoted triples range of the dictionary`);\n }\n const encodedTerms = this.quotedTriplesDictionary[encodingBase];\n return this.dataFactory.quad(this.decode(encodedTerms[0]), this.decode(encodedTerms[1]), this.decode(encodedTerms[2]));\n }\n // Term comes from the plain terms dictionary\n return this.plainTermDictionary.decode(encoding);\n }\n *encodings() {\n for (const encoding of this.plainTermDictionary.encodings()) {\n yield encoding;\n }\n for (const encoding of this.quotedTriplesDictionary.keys()) {\n yield TermDictionaryQuotedReferential.BITMASK | (1 + encoding);\n }\n }\n *findQuotedTriples(quotedTriplePattern) {\n for (const termEncoded of this.findQuotedTriplesEncoded(quotedTriplePattern)) {\n yield this.decode(termEncoded);\n }\n }\n *findQuotedTriplesEncoded(quotedTriplePattern) {\n for (let encodedQuotedTriple of this.quotedTriplesDictionary.keys()) {\n encodedQuotedTriple = TermDictionaryQuotedReferential.BITMASK | (1 + encodedQuotedTriple);\n const quotedTriple = this.decode(encodedQuotedTriple);\n if ((0, rdf_terms_1.matchPattern)(quotedTriple, quotedTriplePattern.subject, quotedTriplePattern.predicate, quotedTriplePattern.object, quotedTriplePattern.graph)) {\n yield encodedQuotedTriple;\n }\n }\n }\n}\nexports.TermDictionaryQuotedReferential = TermDictionaryQuotedReferential;\nTermDictionaryQuotedReferential.BITMASK = 1 << 31;\nTermDictionaryQuotedReferential.SEPARATOR = '_';\n//# sourceMappingURL=TermDictionaryQuotedReferential.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionaryQuotedReferential.js?\n}");
1176
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ UpdatesSocket: () => (/* binding */ UpdatesSocket),\n/* harmony export */ UpdatesVia: () => (/* binding */ UpdatesVia)\n/* harmony export */ });\n/* harmony import */ var _factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./factories/rdflib-data-factory */ \"./node_modules/rdflib/esm/factories/rdflib-data-factory.js\");\n/*\n * Updates-Via\n */\n\nclass UpdatesSocket {\n constructor(parent, via) {\n this.parent = parent;\n this.via = via;\n this.connected = false;\n this.pending = {};\n this.subscribed = {};\n this.socket = {};\n try {\n this.socket = new WebSocket(via);\n this.socket.onopen = this.onOpen;\n this.socket.onclose = this.onClose;\n this.socket.onmessage = this.onMessage;\n this.socket.onerror = this.onError;\n } catch (error) {\n this.onError(error);\n }\n }\n _decode(q) {\n var elt;\n var i;\n var k;\n var r;\n var ref;\n var ref1;\n var v;\n r = {};\n ref = function () {\n var j, len, ref, results;\n ref = q.split('&');\n results = [];\n for (j = 0, len = ref.length; j < len; j++) {\n elt = ref[j];\n results.push(elt.split('='));\n }\n return results;\n }();\n for (i in ref) {\n elt = ref[i];\n ref1 = [decodeURIComponent(elt[0]), decodeURIComponent(elt[1])];\n k = ref1[0];\n v = ref1[1];\n if (r[k] == null) {\n r[k] = [];\n }\n r[k].push(v);\n }\n return r;\n }\n _send(method, uri, data) {\n var base, message;\n message = [method, uri, data].join(' ');\n return typeof (base = this.socket).send === 'function' ? base.send(message) : void 0;\n }\n _subscribe(uri) {\n this._send('sub', uri, '');\n this.subscribed[uri] = true;\n return this.subscribed[uri];\n }\n onClose(e) {\n var uri;\n this.connected = false;\n for (uri in this.subscribed) {\n this.pending[uri] = true;\n }\n this.subscribed = {};\n return this.subscribed;\n }\n onError(e) {\n throw new Error('onError' + e);\n }\n onMessage(e) {\n var base, message;\n message = e.data.split(' ');\n if (message[0] === 'ping') {\n return typeof (base = this.socket).send === 'function' ? base.send('pong ' + message.slice(1).join(' ')) : void 0;\n } else if (message[0] === 'pub') {\n return this.parent.onUpdate(message[1], this._decode(message[2]));\n }\n }\n onOpen(e) {\n var results, uri;\n this.connected = true;\n results = [];\n for (uri in this.pending) {\n delete this.pending[uri];\n results.push(this._subscribe(uri));\n }\n return results;\n }\n subscribe(uri) {\n if (this.connected) {\n return this._subscribe(uri);\n } else {\n this.pending[uri] = true;\n return this.pending[uri];\n }\n }\n}\nclass UpdatesVia {\n constructor(fetcher) {\n this.fetcher = fetcher;\n this.graph = {};\n this.via = {};\n this.fetcher.addCallback('headers', this.onHeaders);\n }\n onHeaders(d) {\n var etag, uri, via;\n if (d.headers == null) {\n return true;\n }\n if (typeof WebSocket === 'undefined' || WebSocket === null) {\n return true;\n }\n etag = d.headers['etag'];\n via = d.headers['updates-via'];\n uri = d.uri;\n if (etag && via) {\n this.graph[uri] = {\n etag: etag,\n via: via\n };\n this.register(via, uri);\n }\n return true;\n }\n onUpdate(uri, d) {\n return this.fetcher.refresh(_factories_rdflib_data_factory__WEBPACK_IMPORTED_MODULE_0__[\"default\"].namedNode(uri));\n }\n register(via, uri) {\n if (this.via[via] == null) {\n this.via[via] = new UpdatesSocket(this, via);\n }\n return this.via[via].subscribe(uri);\n }\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/updates-via.js?\n}");
512
1177
 
513
1178
  /***/ },
514
1179
 
515
- /***/ "./node_modules/rdf-stores/lib/dictionary/TermDictionarySymbol.js"
516
- /*!************************************************************************!*\
517
- !*** ./node_modules/rdf-stores/lib/dictionary/TermDictionarySymbol.js ***!
518
- \************************************************************************/
519
- (__unused_webpack_module, exports, __webpack_require__) {
1180
+ /***/ "./node_modules/rdflib/esm/uri.js"
1181
+ /*!****************************************!*\
1182
+ !*** ./node_modules/rdflib/esm/uri.js ***!
1183
+ \****************************************/
1184
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
520
1185
 
521
1186
  "use strict";
522
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TermDictionarySymbol = void 0;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst rdf_string_1 = __webpack_require__(/*! rdf-string */ \"./node_modules/rdf-string/index.js\");\n/**\n * A term dictionary that encodes and decodes using symbols.\n */\nclass TermDictionarySymbol {\n constructor(dataFactory = new rdf_data_factory_1.DataFactory()) {\n this.features = { quotedTriples: false };\n this.dataFactory = dataFactory;\n }\n encode(term) {\n return Symbol.for(`rdf::${(0, rdf_string_1.termToString)(term)}`);\n }\n encodeOptional(term) {\n return this.encode(term);\n }\n decode(encoding) {\n const string = Symbol.keyFor(encoding);\n if (string === undefined) {\n throw new Error(`The value ${String(encoding)} is not present in this dictionary`);\n }\n return (0, rdf_string_1.stringToTerm)(string.slice(5), this.dataFactory);\n }\n encodings() {\n throw new Error('encodings is not supported');\n }\n findQuotedTriples(quotedTriplePattern) {\n throw new Error('findQuotedTriples is not supported');\n }\n findQuotedTriplesEncoded(quotedTriplePattern) {\n throw new Error('findQuotedTriplesEncoded is not supported');\n }\n}\nexports.TermDictionarySymbol = TermDictionarySymbol;\n//# sourceMappingURL=TermDictionarySymbol.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/dictionary/TermDictionarySymbol.js?\n}");
1187
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ docpart: () => (/* binding */ docpart),\n/* harmony export */ document: () => (/* binding */ document),\n/* harmony export */ hostpart: () => (/* binding */ hostpart),\n/* harmony export */ join: () => (/* binding */ join),\n/* harmony export */ protocol: () => (/* binding */ protocol),\n/* harmony export */ refTo: () => (/* binding */ refTo)\n/* harmony export */ });\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n/*\n * Implements URI-specific functions\n *\n * See RFC 2386\n *\n * See also:\n * http://www.w3.org/2005/10/ajaw/uri.js\n * http://www.w3.org/2000/10/swap/uripath.py\n *\n */\nvar alert = alert || console.log;\n\n\n/**\n * Gets the document part of an URI\n * @param uri The URI\n */\nfunction docpart(uri) {\n var i;\n i = uri.indexOf('#');\n if (i < 0) {\n return uri;\n } else {\n return uri.slice(0, i);\n }\n}\n\n/**\n * Gets the document part of an URI as a named node\n * @param x - The URI\n */\nfunction document(x) {\n return new _named_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"](docpart(x));\n}\n\n/**\n * Gets the hostname in an URI\n * @param u The URI\n */\nfunction hostpart(u) {\n var m = /[^\\/]*\\/\\/([^\\/]*)\\//.exec(u);\n if (m) {\n return m[1];\n } else {\n return '';\n }\n}\n\n/**\n * Joins an URI with a base\n * @param given - The relative part\n * @param base - The base URI\n */\nfunction join(given, base) {\n var baseColon, baseScheme, baseSingle;\n var colon, lastSlash, path;\n var baseHash = base.indexOf('#');\n if (baseHash > 0) {\n base = base.slice(0, baseHash);\n }\n if (given.length === 0) {\n return base;\n }\n if (given.indexOf('#') === 0) {\n return base + given;\n }\n colon = given.indexOf(':');\n if (colon >= 0) {\n return given;\n }\n baseColon = base.indexOf(':');\n if (base.length === 0) {\n return given;\n }\n if (baseColon < 0) {\n alert('Invalid base: ' + base + ' in join with given: ' + given);\n return given;\n }\n baseScheme = base.slice(0, +baseColon + 1 || 9e9);\n if (given.indexOf('//') === 0) {\n return baseScheme + given;\n }\n if (base.indexOf('//', baseColon) === baseColon + 1) {\n baseSingle = base.indexOf('/', baseColon + 3);\n if (baseSingle < 0) {\n if (base.length - baseColon - 3 > 0) {\n return base + '/' + given;\n } else {\n return baseScheme + given;\n }\n }\n } else {\n baseSingle = base.indexOf('/', baseColon + 1);\n if (baseSingle < 0) {\n if (base.length - baseColon - 1 > 0) {\n return base + '/' + given;\n } else {\n return baseScheme + given;\n }\n }\n }\n if (given.indexOf('/') === 0) {\n return base.slice(0, baseSingle) + given;\n }\n path = base.slice(baseSingle);\n lastSlash = path.lastIndexOf('/');\n if (lastSlash < 0) {\n return baseScheme + given;\n }\n if (lastSlash >= 0 && lastSlash < path.length - 1) {\n path = path.slice(0, +lastSlash + 1 || 9e9);\n }\n path += given;\n while (path.match(/[^\\/]*\\/\\.\\.\\//)) {\n path = path.replace(/[^\\/]*\\/\\.\\.\\//, '');\n }\n path = path.replace(/\\.\\//g, '');\n path = path.replace(/\\/\\.$/, '/');\n return base.slice(0, baseSingle) + path;\n}\n\n/**\n * Gets the protocol part of an URI\n * @param uri The URI\n */\nfunction protocol(uri) {\n const i = uri.indexOf(':');\n if (i < 0) {\n return null;\n } else {\n return uri.slice(0, i);\n }\n}\n\n/**\n * Gets a relative uri\n * @param base The base URI\n * @param uri The absolute URI\n */\nfunction refTo(base, uri) {\n var c, i, k, l, len, len1, n, o, p, q, ref, ref1, s;\n var commonHost = new RegExp('^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$');\n if (!base) {\n return uri;\n }\n if (base === uri) {\n return '';\n }\n for (i = o = 0, len = uri.length; o < len; i = ++o) {\n const c = uri[i];\n if (c !== base[i]) {\n break;\n }\n }\n if (base.slice(0, i).match(commonHost)) {\n k = uri.indexOf('//');\n if (k < 0) {\n k = -2;\n }\n l = uri.indexOf('/', k + 2);\n if (uri[l + 1] !== '/' && base[l + 1] !== '/' && uri.slice(0, l) === base.slice(0, l)) {\n return uri.slice(l);\n }\n }\n if (uri[i] === '#' && base.length === i) {\n return uri.slice(i);\n }\n while (i > 0 && uri[i - 1] !== '/') {\n i--;\n }\n if (i < 3) {\n return uri;\n }\n if (base.indexOf('//', i - 2) > 0 || uri.indexOf('//', i - 2) > 0) {\n return uri;\n }\n if (base.indexOf(':', i) > 0) {\n return uri;\n }\n n = 0;\n ref = base.slice(i);\n for (p = 0, len1 = ref.length; p < len1; p++) {\n c = ref[p];\n if (c === '/') {\n n++;\n }\n }\n if (n === 0 && i < uri.length && uri[i] === '#') {\n return './' + uri.slice(i);\n }\n if (n === 0 && i === uri.length) {\n return './';\n }\n s = '';\n if (n > 0) {\n for (q = 1, ref1 = n; ref1 >= 1 ? q <= ref1 : q >= ref1; ref1 >= 1 ? ++q : --q) {\n s += '../';\n }\n }\n return s + uri.slice(i);\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/uri.js?\n}");
523
1188
 
524
1189
  /***/ },
525
1190
 
526
- /***/ "./node_modules/rdf-stores/lib/index/IRdfStoreIndex.js"
527
- /*!*************************************************************!*\
528
- !*** ./node_modules/rdf-stores/lib/index/IRdfStoreIndex.js ***!
529
- \*************************************************************/
530
- (__unused_webpack_module, exports) {
1191
+ /***/ "./node_modules/rdflib/esm/utils-js.js"
1192
+ /*!*********************************************!*\
1193
+ !*** ./node_modules/rdflib/esm/utils-js.js ***!
1194
+ \*********************************************/
1195
+ (module, __webpack_exports__, __webpack_require__) {
531
1196
 
532
1197
  "use strict";
533
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n//# sourceMappingURL=IRdfStoreIndex.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/IRdfStoreIndex.js?\n}");
1198
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ DOMParserFactory: () => (/* binding */ DOMParserFactory),\n/* harmony export */ RDFArrayRemove: () => (/* binding */ RDFArrayRemove),\n/* harmony export */ callbackify: () => (/* binding */ callbackify),\n/* harmony export */ domToString: () => (/* binding */ domToString),\n/* harmony export */ dtstamp: () => (/* binding */ dtstamp),\n/* harmony export */ dumpNode: () => (/* binding */ dumpNode),\n/* harmony export */ heavyCompare: () => (/* binding */ heavyCompare),\n/* harmony export */ heavyCompareSPO: () => (/* binding */ heavyCompareSPO),\n/* harmony export */ linkRelationProperty: () => (/* binding */ linkRelationProperty),\n/* harmony export */ log: () => (/* reexport safe */ _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"]),\n/* harmony export */ mediaTypeClass: () => (/* binding */ mediaTypeClass),\n/* harmony export */ output: () => (/* binding */ output),\n/* harmony export */ parseXML: () => (/* binding */ parseXML),\n/* harmony export */ stackString: () => (/* binding */ stackString),\n/* harmony export */ string: () => (/* binding */ string),\n/* harmony export */ string_startswith: () => (/* binding */ string_startswith),\n/* harmony export */ uri: () => (/* reexport module object */ _uri__WEBPACK_IMPORTED_MODULE_1__)\n/* harmony export */ });\n/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./log */ \"./node_modules/rdflib/esm/log.js\");\n/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uri */ \"./node_modules/rdflib/esm/uri.js\");\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n/* harmony import */ var _xmldom_xmldom__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @xmldom/xmldom */ \"./node_modules/@xmldom/xmldom/lib/index.js\");\n/* module decorator */ module = __webpack_require__.hmd(module);\n/**\n * Utility functions for $rdf\n * @module util\n */\n\n\n\n\nconst string = {\n template: stringTemplate\n};\n\nfunction mediaTypeClass(mediaType) {\n mediaType = mediaType.split(';')[0].trim(); // remove media type parameters\n return new _named_node__WEBPACK_IMPORTED_MODULE_2__[\"default\"]('http://www.w3.org/ns/iana/media-types/' + mediaType + '#Resource');\n}\nfunction linkRelationProperty(relation) {\n return new _named_node__WEBPACK_IMPORTED_MODULE_2__[\"default\"]('http://www.w3.org/ns/iana/link-relations/relation#' + relation.trim());\n}\n\n/**\n * Adds callback functionality to an object.\n * Callback functions are indexed by a 'hook' string.\n * They return true if they want to be called again.\n * @method callbackify\n * @param obj {Object}\n * @param callbacks {Array<string>}\n */\nfunction callbackify(obj, callbacks) {\n obj.callbacks = {};\n for (var x = callbacks.length - 1; x >= 0; x--) {\n obj.callbacks[callbacks[x]] = [];\n }\n obj.addHook = function (hook) {\n if (!obj.callbacks[hook]) {\n obj.callbacks[hook] = [];\n }\n };\n obj.addCallback = function (hook, func) {\n obj.callbacks[hook].push(func);\n };\n obj.removeCallback = function (hook, funcName) {\n for (var i = 0; i < obj.callbacks[hook].length; i++) {\n if (obj.callbacks[hook][i].name === funcName) {\n obj.callbacks[hook].splice(i, 1);\n return true;\n }\n }\n return false;\n };\n obj.insertCallback = function (hook, func) {\n obj.callbacks[hook].unshift(func);\n };\n obj.fireCallbacks = function fireCallbacks(hook, args) {\n var newCallbacks = [];\n var replaceCallbacks = [];\n var len = obj.callbacks[hook].length;\n var x;\n let callback;\n\n // log.info('!@$ Firing '+hook+' call back with length'+len)\n for (x = len - 1; x >= 0; x--) {\n // log.info('@@ Firing '+hook+' callback '+ obj.callbacks[hook][x])\n callback = obj.callbacks[hook][x];\n if (callback && callback.apply(obj, args)) {\n newCallbacks.push(callback);\n }\n }\n for (x = newCallbacks.length - 1; x >= 0; x--) {\n replaceCallbacks.push(newCallbacks[x]);\n }\n for (x = len; x < obj.callbacks[hook].length; x++) {\n replaceCallbacks.push(obj.callbacks[hook][x]);\n }\n obj.callbacks[hook] = replaceCallbacks;\n };\n}\n\n/**\n * Returns a DOM parser based on current runtime environment.\n */\nfunction DOMParserFactory() {\n if (window.DOMParser) {\n return new _xmldom_xmldom__WEBPACK_IMPORTED_MODULE_3__.DOMParser();\n } else if (window.ActiveXObject) {\n return new ActiveXObject('Microsoft.XMLDOM');\n } else {\n return false;\n }\n}\n\n// From https://github.com/linkeddata/dokieli\nfunction domToString(node, options) {\n options = options || {};\n var selfClosing = [];\n if (options && options.selfClosing) {\n options.selfClosing.split(' ').forEach(function (n) {\n selfClosing[n] = true;\n });\n }\n var skipAttributes = [];\n if (options && options.skipAttributes) {\n options.skipAttributes.split(' ').forEach(function (n) {\n skipAttributes[n] = true;\n });\n }\n return dumpNode(node, options, selfClosing, skipAttributes);\n}\nfunction dumpNode(node, options, selfClosing, skipAttributes) {\n var i;\n var out = '';\n var noEsc = [false];\n if (typeof node.nodeType === 'undefined') return out;\n if (node.nodeType === 1) {\n if (node.hasAttribute('class') && options && options.classWithChildText && node.matches(options.classWithChildText.class)) {\n out += node.querySelector(options.classWithChildText.element).textContent;\n } else if (!(options && options.skipNodeWithClass && node.matches('.' + options.skipNodeWithClass))) {\n var ename = node.nodeName.toLowerCase();\n out += '<' + ename;\n var attrList = [];\n for (i = node.attributes.length - 1; i >= 0; i--) {\n var atn = node.attributes[i];\n if (skipAttributes && skipAttributes.length > 0 && skipAttributes[atn.name]) continue;\n if (/^\\d+$/.test(atn.name)) continue;\n if (atn.name === 'class' && options && options.replaceClassItemWith && atn.value.split(' ').indexOf(options.replaceClassItemWith.source) > -1) {\n var re = new RegExp(options.replaceClassItemWith.source, 'g');\n atn.value = atn.value.replace(re, options.replaceClassItemWith.target).trim();\n }\n if (!(atn.name === 'class' && options && options.skipClassWithValue && options.skipClassWithValue === atn.value)) {\n attrList.push(atn.name + '=\\'' + atn.value.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/'/g, '&quot;') + '\\'');\n }\n }\n if (attrList.length > 0) {\n if (options && options.sortAttributes) {\n attrList.sort(function (a, b) {\n return a.toLowerCase().localeCompare(b.toLowerCase());\n });\n }\n out += ' ' + attrList.join(' ');\n }\n if (selfClosing && selfClosing.ename) {\n out += ' />';\n } else {\n out += '>';\n out += ename === 'html' ? '\\n ' : '';\n noEsc.push(ename === 'style' || ename === 'script');\n for (i = 0; i < node.childNodes.length; i++) out += dumpNode(node.childNodes[i]);\n noEsc.pop();\n out += ename === 'body' ? '</' + ename + '>' + '\\n' : '</' + ename + '>';\n }\n }\n } else if (node.nodeType === 8) {\n // FIXME: If comments are not tabbed in source, a new line is not prepended\n out += '<!--' + node.nodeValue + '-->';\n } else if (node.nodeType === 3 || node.nodeType === 4) {\n // XXX: Remove new lines which were added after DOM ready\n var nl = node.nodeValue.replace(/\\n+$/, '');\n out += noEsc[noEsc.length - 1] ? nl : nl.replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');\n } else {\n console.log('Warning; Cannot handle serialising nodes of type: ' + node.nodeType);\n console.log(node);\n }\n return out;\n}\nfunction dtstamp() {\n var now = new Date();\n var year = now.getYear() + 1900;\n var month = now.getMonth() + 1;\n var day = now.getDate();\n var hour = now.getUTCHours();\n var minute = now.getUTCMinutes();\n var second = now.getSeconds();\n if (month < 10) month = '0' + month;\n if (day < 10) day = '0' + day;\n if (hour < 10) hour = '0' + hour;\n if (minute < 10) minute = '0' + minute;\n if (second < 10) second = '0' + second;\n return year + '-' + month + '-' + day + 'T' + hour + ':' + minute + ':' + second + 'Z';\n}\n\n/**\n * Compares statements (heavy comparison for repeatable canonical ordering)\n */\nfunction heavyCompare(x, y, g, uriMap) {\n var nonBlank = function (x) {\n return x.termType === 'BlankNode' ? null : x;\n };\n var signature = function (x) {\n var lis = g.statementsMatching(x).map(function (st) {\n return '' + nonBlank(st.subject) + ' ' + nonBlank(st.predicate) + ' ' + nonBlank(st.object);\n }).concat(g.statementsMatching(undefined, undefined, x).map(function (st) {\n return '' + nonBlank(st.subject) + ' ' + nonBlank(st.predicate) + ' ' + nonBlank(st.object);\n }));\n lis.sort();\n return lis.join('\\n');\n };\n const comparison = Object.prototype.hasOwnProperty.call(g, \"compareTerms\") ? g.compareTerms(x, y) : x.compareTerm(y);\n if (x.termType === 'BlankNode' && y.termType === 'BlankNode') {\n if (comparison === 0) return 0; // Same\n if (signature(x) > signature(y)) return +1;\n if (signature(x) < signature(y)) return -1;\n return comparison; // Too bad -- this order not canonical.\n // throw \"different bnodes indistinquishable for sorting\"\n } else {\n if (uriMap && x.uri && y.uri) {\n return (uriMap[x.uri] || x.uri).localeCompare(uriMap[y.uri] || y.uri);\n }\n return comparison;\n }\n}\nfunction heavyCompareSPO(x, y, g, uriMap) {\n return heavyCompare(x.subject, y.subject, g, uriMap) || heavyCompare(x.predicate, y.predicate, g, uriMap) || heavyCompare(x.object, y.object, g, uriMap);\n}\n\n/**\n * Defines a simple debugging function\n * @method output\n * @param o {String}\n */\nfunction output(o) {\n var k = document.createElement('div');\n k.textContent = o;\n document.body.appendChild(k);\n}\n\n\n/**\n * Returns a DOM from parsed XML.\n */\nfunction parseXML(str, options) {\n var dparser;\n options = options || {};\n if ( true && module && module.exports) {\n // Node.js\n var dom = new _xmldom_xmldom__WEBPACK_IMPORTED_MODULE_3__.DOMParser().parseFromString(str, options.contentType || 'application/xhtml+xml');\n return dom;\n } else {\n if (typeof window !== 'undefined' && window.DOMParser) {\n dparser = new window.DOMParser(); // seems to actually work\n } else {\n dparser = new _xmldom_xmldom__WEBPACK_IMPORTED_MODULE_3__.DOMParser(); // Doc says this works\n }\n }\n return dparser.parseFromString(str, 'application/xml');\n}\n\n/**\n * Removes all statements equal to x from a\n */\nfunction RDFArrayRemove(a, x) {\n for (var i = 0; i < a.length; i++) {\n // TODO: This used to be the following, which didnt always work..why\n // if(a[i] === x)\n if (a[i].subject.equals(x.subject) && a[i].predicate.equals(x.predicate) && a[i].object.equals(x.object) && a[i].why.equals(x.why)) {\n a.splice(i, 1);\n return;\n }\n }\n throw new Error('RDFArrayRemove: Array did not contain ' + x + ' ' + x.why);\n}\nfunction string_startswith(str, pref) {\n // missing library routines\n return str.slice(0, pref.length) === pref;\n}\n\n/**\n * C++, python style %s -> subs\n */\nfunction stringTemplate(base, subs) {\n var baseA = base.split('%s');\n var result = '';\n for (var i = 0; i < subs.length; i++) {\n subs[i] += '';\n result += baseA[i] + subs[i];\n }\n return result + baseA.slice(subs.length).join();\n}\n\n// Stack dump on errors - to pass errors back\n\nfunction stackString(e) {\n var str = '' + e + '\\n';\n if (!e.stack) {\n return str + 'No stack available.\\n';\n }\n var lines = e.stack.toString().split('\\n');\n var toprint = [];\n for (var i = 0; i < lines.length; i++) {\n var line = lines[i];\n if (line.indexOf('ecmaunit.js') > -1) {\n // remove useless bit of traceback\n break;\n }\n if (line.charAt(0) == '(') {\n line = 'function' + line;\n }\n var chunks = line.split('@');\n toprint.push(chunks);\n }\n // toprint.reverse(); No - I prefer the latest at the top by the error message -tbl\n\n for (var i = 0; i < toprint.length; i++) {\n str += ' ' + toprint[i][1] + '\\n ' + toprint[i][0];\n }\n return str;\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/utils-js.js?\n}");
534
1199
 
535
1200
  /***/ },
536
1201
 
537
- /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMap.js"
538
- /*!*********************************************************************!*\
539
- !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMap.js ***!
540
- \*********************************************************************/
541
- (__unused_webpack_module, exports, __webpack_require__) {
1202
+ /***/ "./node_modules/rdflib/esm/utils.js"
1203
+ /*!******************************************!*\
1204
+ !*** ./node_modules/rdflib/esm/utils.js ***!
1205
+ \******************************************/
1206
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
542
1207
 
543
1208
  "use strict";
544
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedMap = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * An RDF store index that is implemented using nested Maps.\n */\nclass RdfStoreIndexNestedMap {\n constructor(options) {\n this.features = {\n quotedTripleFiltering: false,\n };\n this.dictionary = options.dictionary;\n this.nestedMap = new Map();\n }\n set(terms, value) {\n const map0 = this.nestedMap;\n let map1 = map0.get(terms[0]);\n if (!map1) {\n map1 = new Map();\n map0.set(terms[0], map1);\n }\n let map2 = map1.get(terms[1]);\n if (!map2) {\n map2 = new Map();\n map1.set(terms[1], map2);\n }\n let map3 = map2.get(terms[2]);\n if (!map3) {\n map3 = new Map();\n map2.set(terms[2], map3);\n }\n const contained = map3.has(terms[3]);\n if (!contained) {\n map3.set(terms[3], value);\n }\n return !contained;\n }\n remove(terms) {\n const map0 = this.nestedMap;\n const map1 = map0.get(terms[0]);\n if (!map1) {\n return false;\n }\n const map2 = map1.get(terms[1]);\n if (!map2) {\n return false;\n }\n const map3 = map2.get(terms[2]);\n if (!map3) {\n return false;\n }\n const ret = map3.delete(terms[3]);\n // Clean up intermediate maps\n if (ret && map3.size === 0) {\n map2.delete(terms[2]);\n if (map2.size === 0) {\n map1.delete(terms[1]);\n if (map1.size === 0) {\n map0.delete(terms[0]);\n }\n }\n }\n return ret;\n }\n get(key) {\n const encoded = (0, OrderUtils_1.encodeOptionalTerms)(key, this.dictionary);\n // eslint-disable-next-line unicorn/no-useless-undefined\n if (!encoded || encoded.includes(undefined)) {\n return undefined;\n }\n return this.getEncoded(encoded);\n }\n getEncoded(ids) {\n const map1 = this.nestedMap.get(ids[0]);\n if (!map1) {\n return undefined;\n }\n const map2 = map1.get(ids[1]);\n if (!map2) {\n return undefined;\n }\n const map3 = map2.get(ids[2]);\n if (!map3) {\n return undefined;\n }\n return map3.get(ids[3]);\n }\n *find(terms) {\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n let partialQuad0;\n let partialQuad1;\n let partialQuad2;\n let partialQuad3;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = id0 !== undefined ? (map0.has(id0) ? [id0] : []) : map0.keys();\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n partialQuad0 = term0 || this.dictionary.decode(key1);\n const map1Keys = id1 !== undefined ? (map1.has(id1) ? [id1] : []) : map1.keys();\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n partialQuad1 = term1 || this.dictionary.decode(key2);\n const map2Keys = id2 !== undefined ? (map2.has(id2) ? [id2] : []) : map2.keys();\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n partialQuad2 = term2 || this.dictionary.decode(key3);\n const map3Keys = id3 !== undefined ? (map3.has(id3) ? [id3] : []) : map3.keys();\n for (const key4 of map3Keys) {\n partialQuad3 = term3 || this.dictionary.decode(key4);\n yield [partialQuad0, partialQuad1, partialQuad2, partialQuad3];\n }\n }\n }\n }\n }\n // The code below is nearly identical. We duplicate because abstraction would result in a significant performance hit.\n *findEncoded(ids, terms) {\n const [id0, id1, id2, id3] = ids;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = id0 !== undefined ? (map0.has(id0) ? [id0] : []) : map0.keys();\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n const map1Keys = id1 !== undefined ? (map1.has(id1) ? [id1] : []) : map1.keys();\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n const map2Keys = id2 !== undefined ? (map2.has(id2) ? [id2] : []) : map2.keys();\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n const map3Keys = id3 !== undefined ? (map3.has(id3) ? [id3] : []) : map3.keys();\n for (const key4 of map3Keys) {\n yield [key1, key2, key3, key4];\n }\n }\n }\n }\n }\n count(terms) {\n let count = 0;\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return 0;\n }\n const id0 = ids[0];\n const id1 = ids[1];\n const id2 = ids[2];\n const id3 = ids[3];\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = id0 !== undefined ? (map0.has(id0) ? [id0] : []) : map0.keys();\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n const map1Keys = id1 !== undefined ? (map1.has(id1) ? [id1] : []) : map1.keys();\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n const map2Keys = id2 !== undefined ? (map2.has(id2) ? [id2] : []) : map2.keys();\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n if (id3 !== undefined) {\n if (map3.has(id3)) {\n count++;\n }\n }\n else {\n count += map3.size;\n }\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedMap = RdfStoreIndexNestedMap;\n//# sourceMappingURL=RdfStoreIndexNestedMap.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMap.js?\n}");
1209
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ AJAR_handleNewTerm: () => (/* binding */ AJAR_handleNewTerm),\n/* harmony export */ ArrayIndexOf: () => (/* binding */ ArrayIndexOf),\n/* harmony export */ appliedFactoryMethods: () => (/* binding */ appliedFactoryMethods),\n/* harmony export */ arrayToStatements: () => (/* binding */ arrayToStatements)\n/* harmony export */ });\n/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./log */ \"./node_modules/rdflib/esm/log.js\");\n/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./uri */ \"./node_modules/rdflib/esm/uri.js\");\n/* harmony import */ var _utils_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils-js */ \"./node_modules/rdflib/esm/utils-js.js\");\n\n\n\n/** RDF/JS spec Typeguards */\n\n/**\n * Loads ontologies of the data we load (this is the callback from the kb to\n * the fetcher).\n */\nfunction AJAR_handleNewTerm(kb, p, requestedBy) {\n var sf = null;\n if (typeof kb.fetcher !== 'undefined') {\n sf = kb.fetcher;\n } else {\n return;\n }\n if (p.termType !== 'NamedNode') return;\n var docuri = (0,_uri__WEBPACK_IMPORTED_MODULE_1__.docpart)(p.uri);\n var fixuri;\n if (p.uri.indexOf('#') < 0) {\n // No hash\n // @@ major hack for dbpedia Categories, which spread indefinitely\n if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.string_startswith)(p.uri, 'http://dbpedia.org/resource/Category:')) return;\n\n /*\n if (string_startswith(p.uri, 'http://xmlns.com/foaf/0.1/')) {\n fixuri = \"http://dig.csail.mit.edu/2005/ajar/ajaw/test/foaf\"\n // should give HTTP 303 to ontology -- now is :-)\n } else\n */\n if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.string_startswith)(p.uri, 'http://purl.org/dc/elements/1.1/') || (0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.string_startswith)(p.uri, 'http://purl.org/dc/terms/')) {\n fixuri = 'http://dublincore.org/2005/06/13/dcq';\n // dc fetched multiple times\n } else if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.string_startswith)(p.uri, 'http://xmlns.com/wot/0.1/')) {\n fixuri = 'http://xmlns.com/wot/0.1/index.rdf';\n } else if ((0,_utils_js__WEBPACK_IMPORTED_MODULE_2__.string_startswith)(p.uri, 'http://web.resource.org/cc/')) {\n // log.warn(\"creative commons links to html instead of rdf. doesn't seem to content-negotiate.\")\n fixuri = 'http://web.resource.org/cc/schema.rdf';\n }\n }\n if (fixuri) {\n docuri = fixuri;\n }\n if (sf && sf.getState(docuri) !== 'unrequested') return;\n if (fixuri) {\n // only give warning once: else happens too often\n _log__WEBPACK_IMPORTED_MODULE_0__[\"default\"].warn('Assuming server still broken, faking redirect of <' + p.uri + '> to <' + docuri + '>');\n }\n return sf.fetch(docuri, {\n referringTerm: requestedBy\n });\n}\nconst appliedFactoryMethods = ['blankNode', 'defaultGraph', 'literal', 'namedNode', 'quad', 'variable', 'supports'];\nconst rdf = {\n first: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first',\n rest: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest',\n nil: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'\n};\n\n/**\n * Expands an array of Terms to a set of statements representing the rdf:list.\n * @param rdfFactory - The factory to use\n * @param subject - The iri of the first list item.\n * @param data - The terms to expand into the list.\n * @return The {data} as a set of statements.\n */\nfunction arrayToStatements(rdfFactory, subject, data) {\n const statements = [];\n data.reduce((id, _listObj, i, listData) => {\n statements.push(rdfFactory.quad(id, rdfFactory.namedNode(rdf.first), listData[i]));\n let nextNode;\n if (i < listData.length - 1) {\n nextNode = rdfFactory.blankNode();\n statements.push(rdfFactory.quad(id, rdfFactory.namedNode(rdf.rest), nextNode));\n } else {\n statements.push(rdfFactory.quad(id, rdfFactory.namedNode(rdf.rest), rdfFactory.namedNode(rdf.nil)));\n }\n return nextNode;\n }, subject);\n return statements;\n}\nfunction ArrayIndexOf(arr, item, i = 0) {\n var length = arr.length;\n if (i < 0) i = length + i;\n for (; i < length; i++) {\n if (arr[i] === item) {\n return i;\n }\n }\n return -1;\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/utils.js?\n}");
545
1210
 
546
1211
  /***/ },
547
1212
 
548
- /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapQuoted.js"
549
- /*!***************************************************************************!*\
550
- !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapQuoted.js ***!
551
- \***************************************************************************/
552
- (__unused_webpack_module, exports, __webpack_require__) {
1213
+ /***/ "./node_modules/rdflib/esm/utils/default-graph-uri.js"
1214
+ /*!************************************************************!*\
1215
+ !*** ./node_modules/rdflib/esm/utils/default-graph-uri.js ***!
1216
+ \************************************************************/
1217
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
553
1218
 
554
1219
  "use strict";
555
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedMapQuoted = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\nconst RdfStoreIndexNestedMap_1 = __webpack_require__(/*! ./RdfStoreIndexNestedMap */ \"./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMap.js\");\n/**\n * An RDF store index that is implemented using nested Maps with optimized quoted triple support.\n */\nclass RdfStoreIndexNestedMapQuoted extends RdfStoreIndexNestedMap_1.RdfStoreIndexNestedMap {\n constructor(options) {\n super(options);\n this.features = {\n quotedTripleFiltering: true,\n };\n }\n *getQuotedPatternKeys(map, term) {\n for (const quotedTripleEncoded of this.dictionary.findQuotedTriplesEncoded(term)) {\n if (map.has(quotedTripleEncoded)) {\n yield quotedTripleEncoded;\n }\n }\n }\n *find(terms) {\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let partialQuad0;\n let partialQuad1;\n let partialQuad2;\n let partialQuad3;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (map0.has(id0) ? [id0] : [])) :\n map0.keys());\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n partialQuad0 = !quotedTerm0 && term0 ? term0 : this.dictionary.decode(key1);\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (map1.has(id1) ? [id1] : [])) :\n map1.keys());\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n partialQuad1 = !quotedTerm1 && term1 ? term1 : this.dictionary.decode(key2);\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (map2.has(id2) ? [id2] : [])) :\n map2.keys());\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n partialQuad2 = !quotedTerm2 && term2 ? term2 : this.dictionary.decode(key3);\n const map3Keys = (term3 !== undefined ?\n (quotedTerm3 ? this.getQuotedPatternKeys(map3, term3) : (map3.has(id3) ? [id3] : [])) :\n map3.keys());\n for (const key4 of map3Keys) {\n partialQuad3 = !quotedTerm3 && term3 ? term3 : this.dictionary.decode(key4);\n yield [partialQuad0, partialQuad1, partialQuad2, partialQuad3];\n }\n }\n }\n }\n }\n // The code below is nearly identical. We duplicate because abstraction would result in a significant performance hit.\n *findEncoded(ids, terms) {\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (map0.has(id0) ? [id0] : [])) :\n map0.keys());\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (map1.has(id1) ? [id1] : [])) :\n map1.keys());\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (map2.has(id2) ? [id2] : [])) :\n map2.keys());\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n const map3Keys = (term3 !== undefined ?\n (quotedTerm3 ? this.getQuotedPatternKeys(map3, term3) : (map3.has(id3) ? [id3] : [])) :\n map3.keys());\n for (const key4 of map3Keys) {\n yield [\n Number.parseInt(key1, 10),\n Number.parseInt(key2, 10),\n Number.parseInt(key3, 10),\n Number.parseInt(key4, 10),\n ];\n }\n }\n }\n }\n }\n count(terms) {\n let count = 0;\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return 0;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedMap;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (map0.has(id0) ? [id0] : [])) :\n map0.keys());\n for (const key1 of map0Keys) {\n map1 = map0.get(key1);\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (map1.has(id1) ? [id1] : [])) :\n map1.keys());\n for (const key2 of map1Keys) {\n map2 = map1.get(key2);\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (map2.has(id2) ? [id2] : [])) :\n map2.keys());\n for (const key3 of map2Keys) {\n map3 = map2.get(key3);\n if (term3 !== undefined) {\n if (quotedTerm3) {\n count += [...this.getQuotedPatternKeys(map3, term3)].length;\n }\n else if (map3.has(id3)) {\n count++;\n }\n }\n else {\n count += map3.size;\n }\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedMapQuoted = RdfStoreIndexNestedMapQuoted;\n//# sourceMappingURL=RdfStoreIndexNestedMapQuoted.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapQuoted.js?\n}");
1220
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ defaultGraphNode: () => (/* binding */ defaultGraphNode),\n/* harmony export */ defaultGraphURI: () => (/* binding */ defaultGraphURI)\n/* harmony export */ });\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n// Prevents circular dependencies between data-factory-internal and statement\n\n\nconst defaultGraphURI = 'chrome:theSession';\nconst defaultGraphNode = new _named_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"](defaultGraphURI);\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/utils/default-graph-uri.js?\n}");
556
1221
 
557
1222
  /***/ },
558
1223
 
559
- /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursive.js"
560
- /*!******************************************************************************!*\
561
- !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursive.js ***!
562
- \******************************************************************************/
563
- (__unused_webpack_module, exports, __webpack_require__) {
1224
+ /***/ "./node_modules/rdflib/esm/utils/termValue.js"
1225
+ /*!****************************************************!*\
1226
+ !*** ./node_modules/rdflib/esm/utils/termValue.js ***!
1227
+ \****************************************************/
1228
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
564
1229
 
565
1230
  "use strict";
566
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedMapRecursive = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * An RDF store index that is implemented using nested Maps,\n * and finds quads components via recursive methods calls.\n */\nclass RdfStoreIndexNestedMapRecursive {\n constructor(options) {\n this.features = {\n quotedTripleFiltering: false,\n };\n this.dictionary = options.dictionary;\n this.nestedMap = new Map();\n }\n set(terms, value) {\n let map = this.nestedMap;\n let contained = false;\n for (const [i, term] of terms.entries()) {\n const mapActual = map;\n let nextMap = mapActual.get(term);\n if (!nextMap) {\n nextMap = i === terms.length - 1 ? value : new Map();\n mapActual.set(term, nextMap);\n }\n else if (i === terms.length - 1) {\n contained = true;\n }\n map = nextMap;\n }\n return !contained;\n }\n remove(terms) {\n const map0 = this.nestedMap;\n const map1 = map0.get(terms[0]);\n if (!map1) {\n return false;\n }\n const map2 = map1.get(terms[1]);\n if (!map2) {\n return false;\n }\n const map3 = map2.get(terms[2]);\n if (!map3) {\n return false;\n }\n const ret = map3.delete(terms[3]);\n // Clean up intermediate maps\n if (ret && map3.size === 0) {\n map2.delete(terms[2]);\n if (map2.size === 0) {\n map1.delete(terms[1]);\n if (map1.size === 0) {\n map0.delete(terms[0]);\n }\n }\n }\n return ret;\n }\n get(key) {\n const encoded = (0, OrderUtils_1.encodeOptionalTerms)(key, this.dictionary);\n // eslint-disable-next-line unicorn/no-useless-undefined\n if (!encoded || encoded.includes(undefined)) {\n return undefined;\n }\n return this.getEncoded(encoded);\n }\n getEncoded(ids) {\n const map1 = this.nestedMap.get(ids[0]);\n if (!map1) {\n return undefined;\n }\n const map2 = map1.get(ids[1]);\n if (!map2) {\n return undefined;\n }\n const map3 = map2.get(ids[2]);\n if (!map3) {\n return undefined;\n }\n return map3.get(ids[3]);\n }\n *find(terms) {\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return;\n }\n for (const termsEncoded of this.findEncoded(ids, terms)) {\n yield [\n ids[0] !== undefined ? terms[0] : this.dictionary.decode(termsEncoded[0]),\n ids[1] !== undefined ? terms[1] : this.dictionary.decode(termsEncoded[1]),\n ids[2] !== undefined ? terms[2] : this.dictionary.decode(termsEncoded[2]),\n ids[3] !== undefined ? terms[3] : this.dictionary.decode(termsEncoded[3]),\n ];\n }\n }\n *findEncoded(ids, terms) {\n return yield* this\n .findEncodedInner(0, ids, terms, this.nestedMap, []);\n }\n *findEncodedInner(index, ids, terms, map, partialQuad) {\n if (index === ids.length) {\n yield [...partialQuad];\n }\n else {\n const id = ids[index];\n const currentTerm = terms[index];\n // If current term is undefined, iterate over all terms at this level.\n if (!currentTerm) {\n for (const [key, subMap] of map.entries()) {\n partialQuad[index] = key;\n yield* this\n .findEncodedInner(index + 1, ids, terms, subMap, partialQuad);\n }\n }\n else {\n // If the current term is defined, find one matching map for the current term.\n const encodedTerm = id;\n if (encodedTerm !== undefined) {\n const subMap = map.get(encodedTerm);\n if (subMap) {\n partialQuad[index] = id;\n yield* this\n .findEncodedInner(index + 1, ids, terms, subMap, partialQuad);\n }\n }\n }\n }\n }\n count(terms) {\n return this.countInner(0, terms, this.nestedMap);\n }\n countInner(index, terms, map) {\n const currentTerm = terms[index];\n let count = 0;\n // If current term is undefined, iterate over all terms at this level.\n if (!currentTerm) {\n if (index === terms.length - 1) {\n return map.size;\n }\n for (const subMap of map.values()) {\n count += this.countInner(index + 1, terms, subMap);\n }\n }\n else {\n // If the current term is defined, find one matching map for the current term.\n const encodedTerm = this.dictionary.encodeOptional(currentTerm);\n if (encodedTerm !== undefined) {\n if (index === terms.length - 1) {\n if (map.has(encodedTerm)) {\n return 1;\n }\n return 0;\n }\n const subMap = map.get(encodedTerm);\n if (subMap) {\n count += this.countInner(index + 1, terms, subMap);\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedMapRecursive = RdfStoreIndexNestedMapRecursive;\n//# sourceMappingURL=RdfStoreIndexNestedMapRecursive.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursive.js?\n}");
1231
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ termValue: () => (/* binding */ termValue)\n/* harmony export */ });\n/** Retrieve the value of a term, or self if already a string. */\nfunction termValue(node) {\n if (typeof node === 'string') {\n return node;\n }\n return node.value;\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/utils/termValue.js?\n}");
567
1232
 
568
1233
  /***/ },
569
1234
 
570
- /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursiveQuoted.js"
571
- /*!************************************************************************************!*\
572
- !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursiveQuoted.js ***!
573
- \************************************************************************************/
574
- (__unused_webpack_module, exports, __webpack_require__) {
1235
+ /***/ "./node_modules/rdflib/esm/utils/terms.js"
1236
+ /*!************************************************!*\
1237
+ !*** ./node_modules/rdflib/esm/utils/terms.js ***!
1238
+ \************************************************/
1239
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
575
1240
 
576
1241
  "use strict";
577
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedMapRecursiveQuoted = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\nconst RdfStoreIndexNestedMapRecursive_1 = __webpack_require__(/*! ./RdfStoreIndexNestedMapRecursive */ \"./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursive.js\");\n/**\n * An RDF store index that is implemented using nested Maps,\n * and finds quads components via recursive methods calls\n * with optimized quoted triple support.\n */\nclass RdfStoreIndexNestedMapRecursiveQuoted extends RdfStoreIndexNestedMapRecursive_1.RdfStoreIndexNestedMapRecursive {\n constructor(options) {\n super(options);\n this.features = {\n quotedTripleFiltering: true,\n };\n }\n *findEncoded(ids, terms) {\n return yield* this\n .findEncodedInnerQuoted(0, ids, terms, (0, OrderUtils_1.arePatternsQuoted)(terms), this.nestedMap, []);\n }\n *findEncodedInnerQuoted(index, ids, terms, isQuotedPattern, map, partialQuad) {\n if (index === ids.length) {\n yield [...partialQuad];\n }\n else {\n const id = ids[index];\n const currentTerm = terms[index];\n // If current term is undefined, iterate over all terms at this level.\n if (!currentTerm) {\n for (const [key, subMap] of map.entries()) {\n partialQuad[index] = key;\n yield* this\n .findEncodedInnerQuoted(index + 1, ids, terms, isQuotedPattern, subMap, partialQuad);\n }\n }\n else if (isQuotedPattern[index]) {\n const quotedTriplesEncoded = this\n .dictionary.findQuotedTriplesEncoded(currentTerm);\n // Below, we perform a type of inner (hash) join between quotedTriplesEncoded and map (with hash on map)\n for (const quotedTripleEncoded of quotedTriplesEncoded) {\n const subMap = map.get(quotedTripleEncoded);\n if (subMap) {\n partialQuad[index] = quotedTripleEncoded;\n yield* this.findEncodedInnerQuoted(index + 1, ids, terms, isQuotedPattern, subMap, partialQuad);\n }\n }\n }\n else {\n // If the current term is defined, find one matching map for the current term.\n const encodedTerm = id;\n if (encodedTerm !== undefined) {\n const subMap = map.get(encodedTerm);\n if (subMap) {\n partialQuad[index] = id;\n yield* this.findEncodedInnerQuoted(index + 1, ids, terms, isQuotedPattern, subMap, partialQuad);\n }\n }\n }\n }\n }\n countInner(index, terms, map) {\n const currentTerm = terms[index];\n let count = 0;\n // If current term is undefined, iterate over all terms at this level.\n if (!currentTerm) {\n if (index === terms.length - 1) {\n return map.size;\n }\n for (const subMap of map.values()) {\n count += this.countInner(index + 1, terms, subMap);\n }\n }\n else if (currentTerm.termType === 'Quad' && (0, OrderUtils_1.quadHasVariables)(currentTerm)) {\n const quotedTriplesEncoded = this.dictionary.findQuotedTriplesEncoded(currentTerm);\n // Below, we perform a type of inner (hash) join between quotedTriplesEncoded and map (with hash on map)\n for (const quotedTripleEncoded of quotedTriplesEncoded) {\n if (index === terms.length - 1) {\n if (map.has(quotedTripleEncoded)) {\n count++;\n }\n }\n else {\n const subMap = map.get(quotedTripleEncoded);\n if (subMap) {\n count += this.countInner(index + 1, terms, subMap);\n }\n }\n }\n }\n else {\n // If the current term is defined, find one matching map for the current term.\n const encodedTerm = this.dictionary.encodeOptional(currentTerm);\n if (encodedTerm !== undefined) {\n if (index === terms.length - 1) {\n if (map.has(encodedTerm)) {\n return 1;\n }\n return 0;\n }\n const subMap = map.get(encodedTerm);\n if (subMap) {\n count += this.countInner(index + 1, terms, subMap);\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedMapRecursiveQuoted = RdfStoreIndexNestedMapRecursiveQuoted;\n//# sourceMappingURL=RdfStoreIndexNestedMapRecursiveQuoted.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedMapRecursiveQuoted.js?\n}");
1242
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ isBlankNode: () => (/* binding */ isBlankNode),\n/* harmony export */ isCollection: () => (/* binding */ isCollection),\n/* harmony export */ isGraph: () => (/* binding */ isGraph),\n/* harmony export */ isLiteral: () => (/* binding */ isLiteral),\n/* harmony export */ isNamedNode: () => (/* binding */ isNamedNode),\n/* harmony export */ isPredicate: () => (/* binding */ isPredicate),\n/* harmony export */ isQuad: () => (/* binding */ isQuad),\n/* harmony export */ isRDFObject: () => (/* binding */ isRDFObject),\n/* harmony export */ isRDFlibObject: () => (/* binding */ isRDFlibObject),\n/* harmony export */ isRDFlibPredicate: () => (/* binding */ isRDFlibPredicate),\n/* harmony export */ isRDFlibSubject: () => (/* binding */ isRDFlibSubject),\n/* harmony export */ isStatement: () => (/* binding */ isStatement),\n/* harmony export */ isStore: () => (/* binding */ isStore),\n/* harmony export */ isSubject: () => (/* binding */ isSubject),\n/* harmony export */ isTerm: () => (/* binding */ isTerm),\n/* harmony export */ isVariable: () => (/* binding */ isVariable)\n/* harmony export */ });\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../types */ \"./node_modules/rdflib/esm/types.js\");\n\n/** TypeGuard for RDFLib Statements */\nfunction isStatement(obj) {\n return typeof obj === 'object' && obj !== null && 'subject' in obj;\n}\n\n/** TypeGuard for RDFlib Stores */\nfunction isStore(obj) {\n return typeof obj === 'object' && obj !== null && 'statements' in obj;\n}\n\n/** TypeGuard for RDFLib Collections */\nfunction isCollection(obj) {\n return isTerm(obj) && obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.CollectionTermType;\n}\n\n/** TypeGuard for valid RDFlib Object types, also allows Collections, Graphs */\nfunction isRDFlibObject(obj) {\n return obj && Object.prototype.hasOwnProperty.call(obj, 'termType') && (obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.NamedNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.VariableTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.BlankNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.CollectionTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.LiteralTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.GraphTermType);\n}\n\n/** TypeGuard for valid RDFlib Subject types, same as Object as RDFLib symmetrical.\n*/\nfunction isRDFlibSubject(obj) {\n return obj && Object.prototype.hasOwnProperty.call(obj, 'termType') && (obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.NamedNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.VariableTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.BlankNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.CollectionTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.LiteralTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.GraphTermType);\n}\n\n/** TypeGuard for valid RDF/JS spec Predicate types */\nfunction isRDFlibPredicate(obj) {\n return isTerm(obj) && (obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.NamedNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.BlankNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.VariableTermType);\n}\n\n/** TypeGuard for RDFLib Variables */\nfunction isVariable(obj) {\n return isTerm(obj) && obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.VariableTermType;\n}\n\n/** TypeGuard for RDF/JS spec Terms */\nfunction isTerm(obj) {\n return typeof obj === 'object' && obj !== null && 'termType' in obj;\n}\n\n/** TypeGuard for RDF/JS spec Literals */\nfunction isLiteral(value) {\n return value.termType === _types__WEBPACK_IMPORTED_MODULE_0__.LiteralTermType;\n}\n\n/** TypeGuard for RDF/JS spec Quads */\nfunction isQuad(obj) {\n return typeof obj === \"object\" && obj !== null && 'subject' in obj && 'predicate' in obj && 'object' in obj;\n}\n\n/** TypeGuard for RDF/JS spec NamedNodes */\nfunction isNamedNode(obj) {\n return isTerm(obj) && obj.termType === 'NamedNode';\n}\n\n/** TypeGuard for RDF/JS spec BlankNodes */\nfunction isBlankNode(obj) {\n return isTerm(obj) && 'termType' in obj && obj.termType === 'BlankNode';\n}\n\n/** TypeGuard for valid RDF/JS spec Subject types */\nfunction isSubject(obj) {\n return isTerm(obj) && (obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.NamedNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.VariableTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.BlankNodeTermType);\n}\n\n/** TypeGuard for valid RDF/JS spec Predicate types */\nfunction isPredicate(obj) {\n return isTerm(obj) && (obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.NamedNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.VariableTermType);\n}\n\n/** TypeGuard for valid RDF/JS spec Object types */\nfunction isRDFObject(obj) {\n return isTerm(obj) && (obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.NamedNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.VariableTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.BlankNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.LiteralTermType);\n}\n\n/** TypeGuard for valid RDF/JS Graph types */\nfunction isGraph(obj) {\n return isTerm(obj) && (obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.NamedNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.VariableTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.BlankNodeTermType || obj.termType === _types__WEBPACK_IMPORTED_MODULE_0__.DefaultGraphTermType);\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/utils/terms.js?\n}");
578
1243
 
579
1244
  /***/ },
580
1245
 
581
- /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecord.js"
582
- /*!************************************************************************!*\
583
- !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecord.js ***!
584
- \************************************************************************/
585
- (__unused_webpack_module, exports, __webpack_require__) {
1246
+ /***/ "./node_modules/rdflib/esm/variable.js"
1247
+ /*!*********************************************!*\
1248
+ !*** ./node_modules/rdflib/esm/variable.js ***!
1249
+ \*********************************************/
1250
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
586
1251
 
587
1252
  "use strict";
588
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedRecord = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\n/**\n * An RDF store index that is implemented using nested records.\n */\nclass RdfStoreIndexNestedRecord {\n constructor(options) {\n this.features = {\n quotedTripleFiltering: false,\n };\n this.dictionary = options.dictionary;\n this.nestedRecords = {};\n }\n set(terms, value) {\n const map0 = this.nestedRecords;\n const map1 = map0[terms[0]] || (map0[terms[0]] = {});\n const map2 = map1[terms[1]] || (map1[terms[1]] = {});\n const map3 = map2[terms[2]] || (map2[terms[2]] = {});\n if (map3[terms[3]]) {\n return false;\n }\n map3[terms[3]] = value;\n return true;\n }\n remove(terms) {\n const map0 = this.nestedRecords;\n const map1 = map0[terms[0]];\n if (!map1) {\n return false;\n }\n const map2 = map1[terms[1]];\n if (!map2) {\n return false;\n }\n const map3 = map2[terms[2]];\n if (!map3) {\n return false;\n }\n if (!map3[terms[3]]) {\n return false;\n }\n delete map3[terms[3]];\n // Clean up intermediate maps\n if (Object.keys(map3).length === 0) {\n delete map2[terms[2]];\n if (Object.keys(map2).length === 0) {\n delete map1[terms[1]];\n if (Object.keys(map1).length === 0) {\n delete map0[terms[0]];\n }\n }\n }\n return true;\n }\n get(key) {\n const encoded = (0, OrderUtils_1.encodeOptionalTerms)(key, this.dictionary);\n // eslint-disable-next-line unicorn/no-useless-undefined\n if (!encoded || encoded.includes(undefined)) {\n return undefined;\n }\n return this.getEncoded(encoded);\n }\n getEncoded(ids) {\n return this.nestedRecords[ids[0]]?.[ids[1]]?.[ids[2]]?.[ids[3]];\n }\n *find(terms) {\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n let partialQuad0;\n let partialQuad1;\n let partialQuad2;\n let partialQuad3;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = id0 !== undefined ? (id0 in map0 ? [id0] : []) : Object.keys(map0);\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n partialQuad0 = term0 || this.dictionary.decode(Number.parseInt(key1, 10));\n const map1Keys = id1 !== undefined ? (id1 in map1 ? [id1] : []) : Object.keys(map1);\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n partialQuad1 = term1 || this.dictionary.decode(Number.parseInt(key2, 10));\n const map2Keys = id2 !== undefined ? (id2 in map2 ? [id2] : []) : Object.keys(map2);\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n partialQuad2 = term2 || this.dictionary.decode(Number.parseInt(key3, 10));\n const map3Keys = id3 !== undefined ? (id3 in map3 ? [id3] : []) : Object.keys(map3);\n for (const key4 of map3Keys) {\n partialQuad3 = term3 || this.dictionary.decode(Number.parseInt(key4, 10));\n yield [partialQuad0, partialQuad1, partialQuad2, partialQuad3];\n }\n }\n }\n }\n }\n // The code below is nearly identical. We duplicate because abstraction would result in a significant performance hit.\n *findEncoded(ids, terms) {\n const [id0, id1, id2, id3] = ids;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = id0 !== undefined ? (id0 in map0 ? [id0] : []) : Object.keys(map0);\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n const map1Keys = id1 !== undefined ? (id1 in map1 ? [id1] : []) : Object.keys(map1);\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n const map2Keys = id2 !== undefined ? (id2 in map2 ? [id2] : []) : Object.keys(map2);\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n const map3Keys = id3 !== undefined ? (id3 in map3 ? [id3] : []) : Object.keys(map3);\n for (const key4 of map3Keys) {\n yield [\n Number.parseInt(key1, 10),\n Number.parseInt(key2, 10),\n Number.parseInt(key3, 10),\n Number.parseInt(key4, 10),\n ];\n }\n }\n }\n }\n }\n count(terms) {\n let count = 0;\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return 0;\n }\n const id0 = ids[0];\n const id1 = ids[1];\n const id2 = ids[2];\n const id3 = ids[3];\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = id0 !== undefined ? (id0 in map0 ? [id0] : []) : Object.keys(map0);\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n const map1Keys = id1 !== undefined ? (id1 in map1 ? [id1] : []) : Object.keys(map1);\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n const map2Keys = id2 !== undefined ? (id2 in map2 ? [id2] : []) : Object.keys(map2);\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n if (id3 !== undefined) {\n if (id3 in map3) {\n count++;\n }\n }\n else {\n count += Object.keys(map3).length;\n }\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedRecord = RdfStoreIndexNestedRecord;\n//# sourceMappingURL=RdfStoreIndexNestedRecord.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecord.js?\n}");
1253
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ Variable)\n/* harmony export */ });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/esm/defineProperty.js\");\n/* harmony import */ var _class_order__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./class-order */ \"./node_modules/rdflib/esm/class-order.js\");\n/* harmony import */ var _node_internal__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./node-internal */ \"./node_modules/rdflib/esm/node-internal.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./types */ \"./node_modules/rdflib/esm/types.js\");\n/* harmony import */ var _uri__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./uri */ \"./node_modules/rdflib/esm/uri.js\");\n\n\n\n\n\n/**\n* Variables are placeholders used in patterns to be matched.\n* In cwm they are symbols which are the formula's list of quantified variables.\n* In sparql they are not visibly URIs. Here we compromise, by having\n* a common special base URI for variables. Their names are uris,\n* but the ? notation has an implicit base uri of 'varid:'\n*/\nclass Variable extends _node_internal__WEBPACK_IMPORTED_MODULE_2__[\"default\"] {\n /**\n * Initializes this variable\n * @param name The variable's name\n */\n constructor(name = '') {\n super(name);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"termType\", _types__WEBPACK_IMPORTED_MODULE_3__.VariableTermType);\n /** The base string for a variable's name */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"base\", 'varid:');\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"classOrder\", _class_order__WEBPACK_IMPORTED_MODULE_1__[\"default\"].Variable);\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"isVar\", 1);\n /** The unique identifier of this variable */\n (0,_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(this, \"uri\", void 0);\n this.base = 'varid:';\n this.uri = _uri__WEBPACK_IMPORTED_MODULE_4__.join(name, this.base);\n }\n equals(other) {\n if (!other) {\n return false;\n }\n return this.termType === other.termType && this.value === other.value;\n }\n hashString() {\n return this.toString();\n }\n substitute(bindings) {\n var ref;\n return (ref = bindings[this.toNT()]) != null ? ref : this;\n }\n toString() {\n return Variable.toString(this);\n }\n static toString(variable) {\n if (variable.uri.slice(0, variable.base.length) === variable.base) {\n return `?${variable.uri.slice(variable.base.length)}`;\n }\n return `?${variable.uri}`;\n }\n}\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/variable.js?\n}");
589
1254
 
590
1255
  /***/ },
591
1256
 
592
- /***/ "./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecordQuoted.js"
593
- /*!******************************************************************************!*\
594
- !*** ./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecordQuoted.js ***!
595
- \******************************************************************************/
596
- (__unused_webpack_module, exports, __webpack_require__) {
1257
+ /***/ "./node_modules/rdflib/esm/xsd-internal.js"
1258
+ /*!*************************************************!*\
1259
+ !*** ./node_modules/rdflib/esm/xsd-internal.js ***!
1260
+ \*************************************************/
1261
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
597
1262
 
598
1263
  "use strict";
599
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.RdfStoreIndexNestedRecordQuoted = void 0;\nconst OrderUtils_1 = __webpack_require__(/*! ../OrderUtils */ \"./node_modules/rdf-stores/lib/OrderUtils.js\");\nconst RdfStoreIndexNestedRecord_1 = __webpack_require__(/*! ./RdfStoreIndexNestedRecord */ \"./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecord.js\");\n/**\n * An RDF store index that is implemented using nested records with optimized quoted triple support.\n */\nclass RdfStoreIndexNestedRecordQuoted extends RdfStoreIndexNestedRecord_1.RdfStoreIndexNestedRecord {\n constructor(options) {\n super(options);\n this.features = {\n quotedTripleFiltering: true,\n };\n }\n *getQuotedPatternKeys(map, term) {\n for (const quotedTripleEncoded of this.dictionary.findQuotedTriplesEncoded(term)) {\n if (quotedTripleEncoded in map) {\n yield quotedTripleEncoded;\n }\n }\n }\n *find(terms) {\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let partialQuad0;\n let partialQuad1;\n let partialQuad2;\n let partialQuad3;\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (id0 in map0 ? [id0] : [])) :\n Object.keys(map0));\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n partialQuad0 = !quotedTerm0 && term0 ? term0 : this.dictionary.decode(Number.parseInt(key1, 10));\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (id1 in map1 ? [id1] : [])) :\n Object.keys(map1));\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n partialQuad1 = !quotedTerm1 && term1 ? term1 : this.dictionary.decode(Number.parseInt(key2, 10));\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (id2 in map2 ? [id2] : [])) :\n Object.keys(map2));\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n partialQuad2 = !quotedTerm2 && term2 ? term2 : this.dictionary.decode(Number.parseInt(key3, 10));\n const map3Keys = (term3 !== undefined ?\n (quotedTerm3 ? this.getQuotedPatternKeys(map3, term3) : (id3 in map3 ? [id3] : [])) :\n Object.keys(map3));\n for (const key4 of map3Keys) {\n partialQuad3 = !quotedTerm3 && term3 ? term3 : this.dictionary.decode(Number.parseInt(key4, 10));\n yield [partialQuad0, partialQuad1, partialQuad2, partialQuad3];\n }\n }\n }\n }\n }\n // The code below is nearly identical. We duplicate because abstraction would result in a significant performance hit.\n *findEncoded(ids, terms) {\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (id0 in map0 ? [id0] : [])) :\n Object.keys(map0));\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (id1 in map1 ? [id1] : [])) :\n Object.keys(map1));\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (id2 in map2 ? [id2] : [])) :\n Object.keys(map2));\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n const map3Keys = (term3 !== undefined ?\n (quotedTerm3 ? this.getQuotedPatternKeys(map3, term3) : (id3 in map3 ? [id3] : [])) :\n Object.keys(map3));\n for (const key4 of map3Keys) {\n yield [\n Number.parseInt(key1, 10),\n Number.parseInt(key2, 10),\n Number.parseInt(key3, 10),\n Number.parseInt(key4, 10),\n ];\n }\n }\n }\n }\n }\n count(terms) {\n let count = 0;\n const ids = (0, OrderUtils_1.encodeOptionalTerms)(terms, this.dictionary);\n if (!ids) {\n return 0;\n }\n const [id0, id1, id2, id3] = ids;\n const [term0, term1, term2, term3] = terms;\n const [quotedTerm0, quotedTerm1, quotedTerm2, quotedTerm3] = (0, OrderUtils_1.arePatternsQuoted)(terms);\n let map1;\n let map2;\n let map3;\n const map0 = this.nestedRecords;\n const map0Keys = (term0 !== undefined ?\n (quotedTerm0 ? this.getQuotedPatternKeys(map0, term0) : (id0 in map0 ? [id0] : [])) :\n Object.keys(map0));\n for (const key1 of map0Keys) {\n map1 = map0[key1];\n const map1Keys = (term1 !== undefined ?\n (quotedTerm1 ? this.getQuotedPatternKeys(map1, term1) : (id1 in map1 ? [id1] : [])) :\n Object.keys(map1));\n for (const key2 of map1Keys) {\n map2 = map1[key2];\n const map2Keys = (term2 !== undefined ?\n (quotedTerm2 ? this.getQuotedPatternKeys(map2, term2) : (id2 in map2 ? [id2] : [])) :\n Object.keys(map2));\n for (const key3 of map2Keys) {\n map3 = map2[key3];\n if (term3 !== undefined) {\n if (quotedTerm3) {\n count += [...this.getQuotedPatternKeys(map3, term3)].length;\n }\n else if (id3 in map3) {\n count++;\n }\n }\n else {\n count += Object.keys(map3).length;\n }\n }\n }\n }\n return count;\n }\n}\nexports.RdfStoreIndexNestedRecordQuoted = RdfStoreIndexNestedRecordQuoted;\n//# sourceMappingURL=RdfStoreIndexNestedRecordQuoted.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-stores/lib/index/RdfStoreIndexNestedRecordQuoted.js?\n}");
1264
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _named_node__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./named-node */ \"./node_modules/rdflib/esm/named-node.js\");\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n boolean: new _named_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"]('http://www.w3.org/2001/XMLSchema#boolean'),\n dateTime: new _named_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"]('http://www.w3.org/2001/XMLSchema#dateTime'),\n decimal: new _named_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"]('http://www.w3.org/2001/XMLSchema#decimal'),\n double: new _named_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"]('http://www.w3.org/2001/XMLSchema#double'),\n integer: new _named_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"]('http://www.w3.org/2001/XMLSchema#integer'),\n langString: new _named_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"]('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString'),\n string: new _named_node__WEBPACK_IMPORTED_MODULE_0__[\"default\"]('http://www.w3.org/2001/XMLSchema#string')\n});\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/xsd-internal.js?\n}");
600
1265
 
601
1266
  /***/ },
602
1267
 
603
- /***/ "./node_modules/rdf-string/index.js"
604
- /*!******************************************!*\
605
- !*** ./node_modules/rdf-string/index.js ***!
606
- \******************************************/
607
- (__unused_webpack_module, exports, __webpack_require__) {
1268
+ /***/ "./node_modules/rdflib/esm/xsd.js"
1269
+ /*!****************************************!*\
1270
+ !*** ./node_modules/rdflib/esm/xsd.js ***!
1271
+ \****************************************/
1272
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
608
1273
 
609
1274
  "use strict";
610
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.termToString = exports.stringToTerm = exports.stringQuadToQuad = exports.quadToStringQuad = exports.getLiteralValue = exports.getLiteralType = exports.getLiteralDirection = exports.getLiteralLanguage = void 0;\nconst TermUtil_1 = __webpack_require__(/*! ./lib/TermUtil */ \"./node_modules/rdf-string/lib/TermUtil.js\");\nObject.defineProperty(exports, \"getLiteralLanguage\", ({ enumerable: true, get: function () { return TermUtil_1.getLiteralLanguage; } }));\nObject.defineProperty(exports, \"getLiteralDirection\", ({ enumerable: true, get: function () { return TermUtil_1.getLiteralDirection; } }));\nObject.defineProperty(exports, \"getLiteralType\", ({ enumerable: true, get: function () { return TermUtil_1.getLiteralType; } }));\nObject.defineProperty(exports, \"getLiteralValue\", ({ enumerable: true, get: function () { return TermUtil_1.getLiteralValue; } }));\nObject.defineProperty(exports, \"quadToStringQuad\", ({ enumerable: true, get: function () { return TermUtil_1.quadToStringQuad; } }));\nObject.defineProperty(exports, \"stringQuadToQuad\", ({ enumerable: true, get: function () { return TermUtil_1.stringQuadToQuad; } }));\nObject.defineProperty(exports, \"stringToTerm\", ({ enumerable: true, get: function () { return TermUtil_1.stringToTerm; } }));\nObject.defineProperty(exports, \"termToString\", ({ enumerable: true, get: function () { return TermUtil_1.termToString; } }));\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-string/index.js?\n}");
1275
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ createXSD: () => (/* binding */ createXSD),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\n/* harmony import */ var _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./factories/canonical-data-factory */ \"./node_modules/rdflib/esm/factories/canonical-data-factory.js\");\n\nfunction createXSD(localFactory = _factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_0__[\"default\"]) {\n return {\n boolean: localFactory.namedNode(\"http://www.w3.org/2001/XMLSchema#boolean\"),\n dateTime: localFactory.namedNode(\"http://www.w3.org/2001/XMLSchema#dateTime\"),\n decimal: localFactory.namedNode(\"http://www.w3.org/2001/XMLSchema#decimal\"),\n double: localFactory.namedNode(\"http://www.w3.org/2001/XMLSchema#double\"),\n integer: localFactory.namedNode(\"http://www.w3.org/2001/XMLSchema#integer\"),\n langString: localFactory.namedNode(\"http://www.w3.org/1999/02/22-rdf-syntax-ns#langString\"),\n string: localFactory.namedNode(\"http://www.w3.org/2001/XMLSchema#string\")\n };\n}\nconst defaultXSD = createXSD(_factories_canonical_data_factory__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (defaultXSD);\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/esm/xsd.js?\n}");
611
1276
 
612
1277
  /***/ },
613
1278
 
614
- /***/ "./node_modules/rdf-string/lib/TermUtil.js"
615
- /*!*************************************************!*\
616
- !*** ./node_modules/rdf-string/lib/TermUtil.js ***!
617
- \*************************************************/
618
- (__unused_webpack_module, exports, __webpack_require__) {
1279
+ /***/ "./node_modules/rdflib/node_modules/n3/src/IRIs.js"
1280
+ /*!*********************************************************!*\
1281
+ !*** ./node_modules/rdflib/node_modules/n3/src/IRIs.js ***!
1282
+ \*********************************************************/
1283
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
619
1284
 
620
1285
  "use strict";
621
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.termToString = termToString;\nexports.getLiteralValue = getLiteralValue;\nexports.getLiteralType = getLiteralType;\nexports.getLiteralLanguage = getLiteralLanguage;\nexports.getLiteralDirection = getLiteralDirection;\nexports.stringToTerm = stringToTerm;\nexports.quadToStringQuad = quadToStringQuad;\nexports.stringQuadToQuad = stringQuadToQuad;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst FACTORY = new rdf_data_factory_1.DataFactory();\n/**\n * Utility methods for converting between string-based RDF representations and RDFJS objects.\n *\n * RDF Terms are represented as follows:\n * * Blank nodes: '_:myBlankNode'\n * * Variables: '?myVariable'\n * * Literals: '\"myString\"', '\"myLanguageString\"@en-us', '\"myLanguageString\"@en-us--ltr', '\"3\"^^xsd:number'\n * * URIs: 'http://example.org'\n *\n * Quads/triples are represented as hashes with 'subject', 'predicate', 'object' and 'graph' (optional)\n * as keys, and string-based RDF terms as values.\n */\n/**\n * Convert an RDFJS term to a string-based representation.\n * @param {RDF.Term} term An RDFJS term.\n * @return {string} A string-based term representation.\n */\nfunction termToString(term) {\n // TODO: remove nasty any casts when this TS bug has been fixed: https://github.com/microsoft/TypeScript/issues/26933\n if (!term) {\n return undefined;\n }\n switch (term.termType) {\n case 'NamedNode': return term.value;\n case 'BlankNode': return ('_:' + term.value);\n case 'Literal':\n const literalValue = term;\n return ('\"' + literalValue.value + '\"' +\n (literalValue.datatype &&\n literalValue.datatype.value !== 'http://www.w3.org/2001/XMLSchema#string' &&\n literalValue.datatype.value !== 'http://www.w3.org/1999/02/22-rdf-syntax-ns#langString' &&\n literalValue.datatype.value !== 'http://www.w3.org/1999/02/22-rdf-syntax-ns#dirLangString' ?\n '^^' + literalValue.datatype.value : '') +\n (literalValue.language ? '@' + literalValue.language : '') +\n (literalValue.direction ? '--' + literalValue.direction : ''));\n case 'Quad': return `<<${termToString(term.subject)} ${termToString(term.predicate)} ${termToString(term.object)}${term.graph.termType === 'DefaultGraph' ? '' : ' ' + termToString(term.graph)}>>`;\n case 'Variable': return ('?' + term.value);\n case 'DefaultGraph': return term.value;\n }\n}\n/**\n * Get the string value of a literal.\n * @param {string} literalValue An RDF literal enclosed by '\"'.\n * @return {string} The literal value inside the '\"'.\n */\nfunction getLiteralValue(literalValue) {\n const match = /^\"([^]*)\"/.exec(literalValue);\n if (!match) {\n throw new Error(literalValue + ' is not a literal');\n }\n return match[1];\n}\n/**\n * Get the datatype of the given literal.\n * @param {string} literalValue An RDF literal.\n * @return {string} The datatype of the literal.\n */\nfunction getLiteralType(literalValue) {\n const match = /^\"[^]*\"(?:\\^\\^([^\"]+)|(@)[^@\"]+)?$/.exec(literalValue);\n if (!match) {\n throw new Error(literalValue + ' is not a literal');\n }\n return match[1] || (match[2]\n ? 'http://www.w3.org/1999/02/22-rdf-syntax-ns#langString' : 'http://www.w3.org/2001/XMLSchema#string');\n}\n/**\n * Get the language of the given literal.\n * @param {string} literalValue An RDF literal.\n * @return {string} The language of the literal.\n */\nfunction getLiteralLanguage(literalValue) {\n const match = /^\"[^]*\"(?:@([^@\"]+)|\\^\\^[^\"]+)?$/.exec(literalValue);\n if (!match) {\n throw new Error(literalValue + ' is not a literal');\n }\n if (match[1]) {\n let ret = match[1].toLowerCase();\n // Remove everything after --, since this indicates the base direction, which will be parsed later.\n const doubleDashPos = ret.indexOf('--');\n if (doubleDashPos >= 0) {\n ret = ret.slice(0, doubleDashPos);\n }\n return ret;\n }\n return '';\n}\n/**\n * Get the direction of the given literal.\n * @param {string} literalValue An RDF literal.\n * @return {string} The direction of the literal.\n */\nfunction getLiteralDirection(literalValue) {\n const doubleDashPos = literalValue.indexOf('--', literalValue.lastIndexOf('\"'));\n if (doubleDashPos >= 0) {\n const direction = literalValue.slice(doubleDashPos + 2, literalValue.length);\n if (direction === 'ltr' || direction === 'rtl') {\n return direction;\n }\n throw new Error(literalValue + ' is not a literal with a valid direction');\n }\n return '';\n}\n/**\n * Transform a string-based RDF term to an RDFJS term.\n * @param {string} value A string-based RDF-term.\n * @param {RDF.DataFactory} dataFactory An optional datafactory to create terms with.\n * @return {RDF.Term} An RDF-JS term.\n */\nfunction stringToTerm(value, dataFactory) {\n dataFactory = dataFactory || FACTORY;\n if (!value || !value.length) {\n return dataFactory.defaultGraph();\n }\n switch (value[0]) {\n case '_': return dataFactory.blankNode(value.substr(2));\n case '?':\n if (!dataFactory.variable) {\n throw new Error(`Missing 'variable()' method on the given DataFactory`);\n }\n return dataFactory.variable(value.substr(1));\n case '\"':\n const language = getLiteralLanguage(value);\n const direction = getLiteralDirection(value);\n const type = dataFactory.namedNode(getLiteralType(value));\n return dataFactory.literal(getLiteralValue(value), language ? { language, direction } : type);\n case '<':\n default:\n if (value[0] === '<' && value.length > 4 && value[1] === '<' && value[value.length - 1] === '>' && value[value.length - 2] === '>') {\n // Iterate character-by-character to detect spaces that are *not* wrapped in <<>>\n const terms = value.slice(2, -2).trim();\n let stringTerms = [];\n let ignoreTags = 0;\n let lastIndex = 0;\n let inQuote = false;\n for (let i = 0; i < terms.length; i++) {\n const char = terms[i];\n if (char === '<')\n ignoreTags++;\n if (char === '>') {\n if (ignoreTags === 0) {\n throw new Error('Found closing tag without opening tag in ' + value);\n }\n else {\n ignoreTags--;\n }\n }\n if (char === '\"') {\n let escaped = false;\n let j = i;\n while (j-- > 0 && terms[j] === '\\\\') {\n escaped = !escaped;\n }\n if (!escaped) {\n // We have reached an unescaped quote\n inQuote = !inQuote;\n }\n }\n if (char === ' ' && !inQuote && ignoreTags === 0) {\n stringTerms.push(terms.slice(lastIndex, i));\n while (terms[i + 1] === ' ') {\n i += 1;\n }\n lastIndex = i + 1;\n }\n }\n if (ignoreTags !== 0) {\n throw new Error('Found opening tag without closing tag in ' + value);\n }\n stringTerms.push(terms.slice(lastIndex, terms.length));\n // We require 3 or 4 components\n if (stringTerms.length !== 3 && stringTerms.length !== 4) {\n throw new Error('Nested quad syntax error ' + value);\n }\n stringTerms = stringTerms.map(term => term.startsWith('<') && !term.includes(' ') ? term.slice(1, -1) : term);\n return dataFactory.quad(stringToTerm(stringTerms[0]), stringToTerm(stringTerms[1]), stringToTerm(stringTerms[2]), stringTerms[3] ? stringToTerm(stringTerms[3]) : undefined);\n }\n return dataFactory.namedNode(value);\n }\n}\n/**\n * Convert an RDFJS quad to a string-based quad representation.\n * @param {Quad} q An RDFJS quad.\n * @return {IStringQuad} A hash with string-based quad terms.\n * @template Q The type of quad, defaults to RDF.Quad.\n */\nfunction quadToStringQuad(q) {\n // tslint:disable:object-literal-sort-keys\n return {\n subject: termToString(q.subject),\n predicate: termToString(q.predicate),\n object: termToString(q.object),\n graph: termToString(q.graph),\n };\n // tslint:enable:object-literal-sort-keys\n}\n/**\n * Convert a string-based quad representation to an RDFJS quad.\n * @param {IStringQuad} stringQuad A hash with string-based quad terms.\n * @param {RDF.DataFactory} dataFactory An optional datafactory to create terms with.\n * @return {Q} An RDFJS quad.\n * @template Q The type of quad, defaults to RDF.Quad.\n */\nfunction stringQuadToQuad(stringQuad, dataFactory) {\n dataFactory = dataFactory || FACTORY;\n return dataFactory.quad(stringToTerm(stringQuad.subject, dataFactory), stringToTerm(stringQuad.predicate, dataFactory), stringToTerm(stringQuad.object, dataFactory), stringToTerm(stringQuad.graph, dataFactory));\n}\n//# sourceMappingURL=TermUtil.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-string/lib/TermUtil.js?\n}");
1286
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__)\n/* harmony export */ });\nconst RDF = 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n XSD = 'http://www.w3.org/2001/XMLSchema#',\n SWAP = 'http://www.w3.org/2000/10/swap/';\n\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = ({\n xsd: {\n decimal: `${XSD}decimal`,\n boolean: `${XSD}boolean`,\n double: `${XSD}double`,\n integer: `${XSD}integer`,\n string: `${XSD}string`,\n },\n rdf: {\n type: `${RDF}type`,\n nil: `${RDF}nil`,\n first: `${RDF}first`,\n rest: `${RDF}rest`,\n langString: `${RDF}langString`,\n },\n owl: {\n sameAs: 'http://www.w3.org/2002/07/owl#sameAs',\n },\n r: {\n forSome: `${SWAP}reify#forSome`,\n forAll: `${SWAP}reify#forAll`,\n },\n log: {\n implies: `${SWAP}log#implies`,\n isImpliedBy: `${SWAP}log#isImpliedBy`,\n },\n});\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/node_modules/n3/src/IRIs.js?\n}");
622
1287
 
623
1288
  /***/ },
624
1289
 
625
- /***/ "./node_modules/rdf-terms/index.js"
626
- /*!*****************************************!*\
627
- !*** ./node_modules/rdf-terms/index.js ***!
628
- \*****************************************/
629
- (__unused_webpack_module, exports, __webpack_require__) {
1290
+ /***/ "./node_modules/rdflib/node_modules/n3/src/N3DataFactory.js"
1291
+ /*!******************************************************************!*\
1292
+ !*** ./node_modules/rdflib/node_modules/n3/src/N3DataFactory.js ***!
1293
+ \******************************************************************/
1294
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
630
1295
 
631
1296
  "use strict";
632
- eval("{\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\n__exportStar(__webpack_require__(/*! ./lib/QuadTermUtil */ \"./node_modules/rdf-terms/lib/QuadTermUtil.js\"), exports);\n__exportStar(__webpack_require__(/*! ./lib/TermUtil */ \"./node_modules/rdf-terms/lib/TermUtil.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-terms/index.js?\n}");
1297
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ BlankNode: () => (/* binding */ BlankNode),\n/* harmony export */ DefaultGraph: () => (/* binding */ DefaultGraph),\n/* harmony export */ Literal: () => (/* binding */ Literal),\n/* harmony export */ NamedNode: () => (/* binding */ NamedNode),\n/* harmony export */ Quad: () => (/* binding */ Quad),\n/* harmony export */ Term: () => (/* binding */ Term),\n/* harmony export */ Triple: () => (/* binding */ Quad),\n/* harmony export */ Variable: () => (/* binding */ Variable),\n/* harmony export */ \"default\": () => (__WEBPACK_DEFAULT_EXPORT__),\n/* harmony export */ escapeQuotes: () => (/* binding */ escapeQuotes),\n/* harmony export */ fromQuad: () => (/* binding */ fromQuad),\n/* harmony export */ fromTerm: () => (/* binding */ fromTerm),\n/* harmony export */ termFromId: () => (/* binding */ termFromId),\n/* harmony export */ termToId: () => (/* binding */ termToId),\n/* harmony export */ unescapeQuotes: () => (/* binding */ unescapeQuotes)\n/* harmony export */ });\n/* harmony import */ var _IRIs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./IRIs */ \"./node_modules/rdflib/node_modules/n3/src/IRIs.js\");\n// N3.js implementations of the RDF/JS core data types\n// See http://rdf.js.org/data-model-spec/\n\n\n\nconst { rdf, xsd } = _IRIs__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n\n// eslint-disable-next-line prefer-const\nlet DEFAULTGRAPH;\nlet _blankNodeCounter = 0;\n\nconst escapedLiteral = /^\"(.*\".*)(?=\"[^\"]*$)/;\n\n// ## DataFactory singleton\nconst DataFactory = {\n namedNode,\n blankNode,\n variable,\n literal,\n defaultGraph,\n quad,\n triple: quad,\n fromTerm,\n fromQuad,\n};\n/* harmony default export */ const __WEBPACK_DEFAULT_EXPORT__ = (DataFactory);\n\n// ## Term constructor\nclass Term {\n constructor(id) {\n this.id = id;\n }\n\n // ### The value of this term\n get value() {\n return this.id;\n }\n\n // ### Returns whether this object represents the same term as the other\n equals(other) {\n // If both terms were created by this library,\n // equality can be computed through ids\n if (other instanceof Term)\n return this.id === other.id;\n // Otherwise, compare term type and value\n return !!other && this.termType === other.termType &&\n this.value === other.value;\n }\n\n // ### Implement hashCode for Immutable.js, since we implement `equals`\n // https://immutable-js.com/docs/v4.0.0/ValueObject/#hashCode()\n hashCode() {\n return 0;\n }\n\n // ### Returns a plain object representation of this term\n toJSON() {\n return {\n termType: this.termType,\n value: this.value,\n };\n }\n}\n\n\n// ## NamedNode constructor\nclass NamedNode extends Term {\n // ### The term type of this term\n get termType() {\n return 'NamedNode';\n }\n}\n\n// ## Literal constructor\nclass Literal extends Term {\n // ### The term type of this term\n get termType() {\n return 'Literal';\n }\n\n // ### The text value of this literal\n get value() {\n return this.id.substring(1, this.id.lastIndexOf('\"'));\n }\n\n // ### The language of this literal\n get language() {\n // Find the last quotation mark (e.g., '\"abc\"@en-us')\n const id = this.id;\n let atPos = id.lastIndexOf('\"') + 1;\n // If \"@\" it follows, return the remaining substring; empty otherwise\n return atPos < id.length && id[atPos++] === '@' ? id.substr(atPos).toLowerCase() : '';\n }\n\n // ### The datatype IRI of this literal\n get datatype() {\n return new NamedNode(this.datatypeString);\n }\n\n // ### The datatype string of this literal\n get datatypeString() {\n // Find the last quotation mark (e.g., '\"abc\"^^http://ex.org/types#t')\n const id = this.id, dtPos = id.lastIndexOf('\"') + 1;\n const char = dtPos < id.length ? id[dtPos] : '';\n // If \"^\" it follows, return the remaining substring\n return char === '^' ? id.substr(dtPos + 2) :\n // If \"@\" follows, return rdf:langString; xsd:string otherwise\n (char !== '@' ? xsd.string : rdf.langString);\n }\n\n // ### Returns whether this object represents the same term as the other\n equals(other) {\n // If both literals were created by this library,\n // equality can be computed through ids\n if (other instanceof Literal)\n return this.id === other.id;\n // Otherwise, compare term type, value, language, and datatype\n return !!other && !!other.datatype &&\n this.termType === other.termType &&\n this.value === other.value &&\n this.language === other.language &&\n this.datatype.value === other.datatype.value;\n }\n\n toJSON() {\n return {\n termType: this.termType,\n value: this.value,\n language: this.language,\n datatype: { termType: 'NamedNode', value: this.datatypeString },\n };\n }\n}\n\n// ## BlankNode constructor\nclass BlankNode extends Term {\n constructor(name) {\n super(`_:${name}`);\n }\n\n // ### The term type of this term\n get termType() {\n return 'BlankNode';\n }\n\n // ### The name of this blank node\n get value() {\n return this.id.substr(2);\n }\n}\n\nclass Variable extends Term {\n constructor(name) {\n super(`?${name}`);\n }\n\n // ### The term type of this term\n get termType() {\n return 'Variable';\n }\n\n // ### The name of this variable\n get value() {\n return this.id.substr(1);\n }\n}\n\n// ## DefaultGraph constructor\nclass DefaultGraph extends Term {\n constructor() {\n super('');\n return DEFAULTGRAPH || this;\n }\n\n // ### The term type of this term\n get termType() {\n return 'DefaultGraph';\n }\n\n // ### Returns whether this object represents the same term as the other\n equals(other) {\n // If both terms were created by this library,\n // equality can be computed through strict equality;\n // otherwise, compare term types.\n return (this === other) || (!!other && (this.termType === other.termType));\n }\n}\n\n// ## DefaultGraph singleton\nDEFAULTGRAPH = new DefaultGraph();\n\n// ### Constructs a term from the given internal string ID\n// The third 'nested' parameter of this function is to aid\n// with recursion over nested terms. It should not be used\n// by consumers of this library.\n// See https://github.com/rdfjs/N3.js/pull/311#discussion_r1061042725\nfunction termFromId(id, factory, nested) {\n factory = factory || DataFactory;\n\n // Falsy value or empty string indicate the default graph\n if (!id)\n return factory.defaultGraph();\n\n // Identify the term type based on the first character\n switch (id[0]) {\n case '?':\n return factory.variable(id.substr(1));\n case '_':\n return factory.blankNode(id.substr(2));\n case '\"':\n // Shortcut for internal literals\n if (factory === DataFactory)\n return new Literal(id);\n // Literal without datatype or language\n if (id[id.length - 1] === '\"')\n return factory.literal(id.substr(1, id.length - 2));\n // Literal with datatype or language\n const endPos = id.lastIndexOf('\"', id.length - 1);\n return factory.literal(id.substr(1, endPos - 1),\n id[endPos + 1] === '@' ? id.substr(endPos + 2)\n : factory.namedNode(id.substr(endPos + 3)));\n case '[':\n id = JSON.parse(id);\n break;\n default:\n if (!nested || !Array.isArray(id)) {\n return factory.namedNode(id);\n }\n }\n return factory.quad(\n termFromId(id[0], factory, true),\n termFromId(id[1], factory, true),\n termFromId(id[2], factory, true),\n id[3] && termFromId(id[3], factory, true),\n );\n}\n\n// ### Constructs an internal string ID from the given term or ID string\n// The third 'nested' parameter of this function is to aid\n// with recursion over nested terms. It should not be used\n// by consumers of this library.\n// See https://github.com/rdfjs/N3.js/pull/311#discussion_r1061042725\nfunction termToId(term, nested) {\n if (typeof term === 'string')\n return term;\n if (term instanceof Term && term.termType !== 'Quad')\n return term.id;\n if (!term)\n return DEFAULTGRAPH.id;\n\n // Term instantiated with another library\n switch (term.termType) {\n case 'NamedNode': return term.value;\n case 'BlankNode': return `_:${term.value}`;\n case 'Variable': return `?${term.value}`;\n case 'DefaultGraph': return '';\n case 'Literal': return `\"${term.value}\"${\n term.language ? `@${term.language}` :\n (term.datatype && term.datatype.value !== xsd.string ? `^^${term.datatype.value}` : '')}`;\n case 'Quad':\n const res = [\n termToId(term.subject, true),\n termToId(term.predicate, true),\n termToId(term.object, true),\n ];\n if (term.graph && term.graph.termType !== 'DefaultGraph') {\n res.push(termToId(term.graph, true));\n }\n return nested ? res : JSON.stringify(res);\n default: throw new Error(`Unexpected termType: ${term.termType}`);\n }\n}\n\n\n// ## Quad constructor\nclass Quad extends Term {\n constructor(subject, predicate, object, graph) {\n super('');\n this._subject = subject;\n this._predicate = predicate;\n this._object = object;\n this._graph = graph || DEFAULTGRAPH;\n }\n\n // ### The term type of this term\n get termType() {\n return 'Quad';\n }\n\n get subject() {\n return this._subject;\n }\n\n get predicate() {\n return this._predicate;\n }\n\n get object() {\n return this._object;\n }\n\n get graph() {\n return this._graph;\n }\n\n // ### Returns a plain object representation of this quad\n toJSON() {\n return {\n termType: this.termType,\n subject: this._subject.toJSON(),\n predicate: this._predicate.toJSON(),\n object: this._object.toJSON(),\n graph: this._graph.toJSON(),\n };\n }\n\n // ### Returns whether this object represents the same quad as the other\n equals(other) {\n return !!other && this._subject.equals(other.subject) &&\n this._predicate.equals(other.predicate) &&\n this._object.equals(other.object) &&\n this._graph.equals(other.graph);\n }\n}\n\n\n// ### Escapes the quotes within the given literal\nfunction escapeQuotes(id) {\n return id.replace(escapedLiteral, (_, quoted) => `\"${quoted.replace(/\"/g, '\"\"')}`);\n}\n\n// ### Unescapes the quotes within the given literal\nfunction unescapeQuotes(id) {\n return id.replace(escapedLiteral, (_, quoted) => `\"${quoted.replace(/\"\"/g, '\"')}`);\n}\n\n// ### Creates an IRI\nfunction namedNode(iri) {\n return new NamedNode(iri);\n}\n\n// ### Creates a blank node\nfunction blankNode(name) {\n return new BlankNode(name || `n3-${_blankNodeCounter++}`);\n}\n\n// ### Creates a literal\nfunction literal(value, languageOrDataType) {\n // Create a language-tagged string\n if (typeof languageOrDataType === 'string')\n return new Literal(`\"${value}\"@${languageOrDataType.toLowerCase()}`);\n\n // Automatically determine datatype for booleans and numbers\n let datatype = languageOrDataType ? languageOrDataType.value : '';\n if (datatype === '') {\n // Convert a boolean\n if (typeof value === 'boolean')\n datatype = xsd.boolean;\n // Convert an integer or double\n else if (typeof value === 'number') {\n if (Number.isFinite(value))\n datatype = Number.isInteger(value) ? xsd.integer : xsd.double;\n else {\n datatype = xsd.double;\n if (!Number.isNaN(value))\n value = value > 0 ? 'INF' : '-INF';\n }\n }\n }\n\n // Create a datatyped literal\n return (datatype === '' || datatype === xsd.string) ?\n new Literal(`\"${value}\"`) :\n new Literal(`\"${value}\"^^${datatype}`);\n}\n\n// ### Creates a variable\nfunction variable(name) {\n return new Variable(name);\n}\n\n// ### Returns the default graph\nfunction defaultGraph() {\n return DEFAULTGRAPH;\n}\n\n// ### Creates a quad\nfunction quad(subject, predicate, object, graph) {\n return new Quad(subject, predicate, object, graph);\n}\n\nfunction fromTerm(term) {\n if (term instanceof Term)\n return term;\n\n // Term instantiated with another library\n switch (term.termType) {\n case 'NamedNode': return namedNode(term.value);\n case 'BlankNode': return blankNode(term.value);\n case 'Variable': return variable(term.value);\n case 'DefaultGraph': return DEFAULTGRAPH;\n case 'Literal': return literal(term.value, term.language || term.datatype);\n case 'Quad': return fromQuad(term);\n default: throw new Error(`Unexpected termType: ${term.termType}`);\n }\n}\n\nfunction fromQuad(inQuad) {\n if (inQuad instanceof Quad)\n return inQuad;\n\n if (inQuad.termType !== 'Quad')\n throw new Error(`Unexpected termType: ${inQuad.termType}`);\n\n return quad(fromTerm(inQuad.subject), fromTerm(inQuad.predicate), fromTerm(inQuad.object), fromTerm(inQuad.graph));\n}\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/node_modules/n3/src/N3DataFactory.js?\n}");
633
1298
 
634
1299
  /***/ },
635
1300
 
636
- /***/ "./node_modules/rdf-terms/lib/QuadTermUtil.js"
637
- /*!****************************************************!*\
638
- !*** ./node_modules/rdf-terms/lib/QuadTermUtil.js ***!
639
- \****************************************************/
640
- (__unused_webpack_module, exports, __webpack_require__) {
1301
+ /***/ "./node_modules/rdflib/node_modules/n3/src/N3Lexer.js"
1302
+ /*!************************************************************!*\
1303
+ !*** ./node_modules/rdflib/node_modules/n3/src/N3Lexer.js ***!
1304
+ \************************************************************/
1305
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
641
1306
 
642
1307
  "use strict";
643
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TRIPLE_TERM_NAMES = exports.QUAD_TERM_NAMES = void 0;\nexports.getTerms = getTerms;\nexports.getTermsNested = getTermsNested;\nexports.getNamedTerms = getNamedTerms;\nexports.collectNamedTerms = collectNamedTerms;\nexports.forEachTerms = forEachTerms;\nexports.forEachTermsNested = forEachTermsNested;\nexports.filterTerms = filterTerms;\nexports.filterTermsNested = filterTermsNested;\nexports.filterQuadTermNames = filterQuadTermNames;\nexports.filterQuadTermNamesNested = filterQuadTermNamesNested;\nexports.mapTerms = mapTerms;\nexports.mapTermsNested = mapTermsNested;\nexports.reduceTerms = reduceTerms;\nexports.reduceTermsNested = reduceTermsNested;\nexports.everyTerms = everyTerms;\nexports.everyTermsNested = everyTermsNested;\nexports.someTerms = someTerms;\nexports.someTermsNested = someTermsNested;\nexports.getValueNestedPath = getValueNestedPath;\nexports.matchTerm = matchTerm;\nexports.matchPattern = matchPattern;\nexports.matchPatternComplete = matchPatternComplete;\nexports.matchPatternMappings = matchPatternMappings;\nconst rdf_data_factory_1 = __webpack_require__(/*! rdf-data-factory */ \"./node_modules/rdf-data-factory/index.js\");\nconst DF = new rdf_data_factory_1.DataFactory();\n/**\n * All available quad term names.\n * @type {[string , string , string , string]}\n */\nexports.QUAD_TERM_NAMES = ['subject', 'predicate', 'object', 'graph'];\n/**\n * All available triple term names.\n * @type {[string , string , string]}\n */\nexports.TRIPLE_TERM_NAMES = ['subject', 'predicate', 'object'];\n/**\n * Get all terms in the given quad.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {boolean} ignoreDefaultGraph If true and the quad has the default graph as graph,\n * this term will not be returned in the array.\n * (default: false)\n * @return {Term[]} The available terms in the quad.\n */\nfunction getTerms(quad, ignoreDefaultGraph) {\n if (ignoreDefaultGraph && quad.graph.termType === 'DefaultGraph') {\n return [quad.subject, quad.predicate, quad.object];\n }\n return [quad.subject, quad.predicate, quad.object, quad.graph];\n}\n/**\n * Get all terms in the given quad, including nested quads.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {boolean} ignoreDefaultGraph If true and the quad has the default graph as graph,\n * this term will not be returned in the array.\n * (default: false)\n * @return {Term[]} The available terms in the nested quad, excluding quad terms.\n */\nfunction getTermsNested(quad, ignoreDefaultGraph) {\n const terms = [];\n for (const term of getTerms(quad, ignoreDefaultGraph)) {\n if (term.termType === 'Quad') {\n getTermsNested(term, ignoreDefaultGraph).forEach(subTerm => terms.push(subTerm));\n }\n else {\n terms.push(term);\n }\n }\n return terms;\n}\n/**\n * Convert the given quad to an array of named terms.\n * This is the reverse operation of {@link collectNamedTerms}.\n * @param {BaseQuad} quad An RDFJS quad.\n * @return {INamedTerm[]} An array of named terms.\n */\nfunction getNamedTerms(quad) {\n return [\n { key: 'subject', value: quad.subject },\n { key: 'predicate', value: quad.predicate },\n { key: 'object', value: quad.object },\n { key: 'graph', value: quad.graph },\n ];\n}\n/**\n * Convert an array of named terms to an RDFJS quad.\n * This is the reverse operation of {@link getNamedTerms}.\n * @param {INamedTerm[]} namedTerms An array of named terms.\n * @param {(termName: QuadTermName) => Term} defaultCb An optional callback for when\n * certain terms are not available in the array.\n * @param {RDF.DataFactory} dataFactory A custom data factory to create quads.\n * @return {Q} The resulting RDFJS quad.\n * @template Q The type of quad to output, defaults to RDF.Quad.\n */\nfunction collectNamedTerms(namedTerms, defaultCb, dataFactory) {\n const elements = {};\n namedTerms.forEach((namedTerm) => elements[namedTerm.key] = namedTerm.value);\n if (defaultCb) {\n elements.subject = elements.subject || defaultCb('subject');\n elements.predicate = elements.predicate || defaultCb('predicate');\n elements.object = elements.object || defaultCb('object');\n elements.graph = elements.graph || defaultCb('graph');\n }\n return (dataFactory || DF).quad(elements.subject, elements.predicate, elements.object, elements.graph);\n}\n/**\n * Iterates over each term.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} cb A callback function.\n */\nfunction forEachTerms(quad, cb) {\n cb(quad.subject, 'subject');\n cb(quad.predicate, 'predicate');\n cb(quad.object, 'object');\n cb(quad.graph, 'graph');\n}\n/**\n * Iterates over each leaf term, while recursing into quoted triples.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} cb A callback function.\n * @param QuadTermName[] keys The current key path.\n */\nfunction forEachTermsNested(quad, cb, keys = []) {\n if (quad.subject.termType === 'Quad') {\n forEachTermsNested(quad.subject, cb, [...keys, 'subject']);\n }\n else {\n cb(quad.subject, [...keys, 'subject']);\n }\n if (quad.predicate.termType === 'Quad') {\n forEachTermsNested(quad.predicate, cb, [...keys, 'predicate']);\n }\n else {\n cb(quad.predicate, [...keys, 'predicate']);\n }\n if (quad.object.termType === 'Quad') {\n forEachTermsNested(quad.object, cb, [...keys, 'object']);\n }\n else {\n cb(quad.object, [...keys, 'object']);\n }\n if (quad.graph.termType === 'Quad') {\n forEachTermsNested(quad.graph, cb, [...keys, 'graph']);\n }\n else {\n cb(quad.graph, [...keys, 'graph']);\n }\n}\n/**\n * Get all terms in the given quad that return true on the given filter function.\n * @param {BaseQuad} quad A quad.\n * @param {(value: Term, key: QuadTermName) => boolean} filter A filter callback.\n * @return {Term[]} The list of matching terms.\n */\nfunction filterTerms(quad, filter) {\n const terms = [];\n if (filter(quad.subject, 'subject')) {\n terms.push(quad.subject);\n }\n if (filter(quad.predicate, 'predicate')) {\n terms.push(quad.predicate);\n }\n if (filter(quad.object, 'object')) {\n terms.push(quad.object);\n }\n if (filter(quad.graph, 'graph')) {\n terms.push(quad.graph);\n }\n return terms;\n}\n/**\n * Get all terms in the given quad that return true on the given filter function, while recursing into quoted triples.\n * @param {BaseQuad} quad A quad.\n * @param {(value: Term, key: QuadTermName) => boolean} filter A filter callback.\n * @param QuadTermName[] keys The current key path.\n * @return {Term[]} The list of matching terms.\n */\nfunction filterTermsNested(quad, filter, keys = []) {\n let terms = [];\n if (quad.subject.termType === 'Quad') {\n terms = [...terms, ...filterTermsNested(quad.subject, filter, [...keys, 'subject'])];\n }\n else {\n if (filter(quad.subject, [...keys, 'subject'])) {\n terms.push(quad.subject);\n }\n }\n if (quad.predicate.termType === 'Quad') {\n terms = [...terms, ...filterTermsNested(quad.predicate, filter, [...keys, 'predicate'])];\n }\n else {\n if (filter(quad.predicate, [...keys, 'predicate'])) {\n terms.push(quad.predicate);\n }\n }\n if (quad.object.termType === 'Quad') {\n terms = [...terms, ...filterTermsNested(quad.object, filter, [...keys, 'object'])];\n }\n else {\n if (filter(quad.object, [...keys, 'object'])) {\n terms.push(quad.object);\n }\n }\n if (quad.graph.termType === 'Quad') {\n terms = [...terms, ...filterTermsNested(quad.graph, filter, [...keys, 'graph'])];\n }\n else {\n if (filter(quad.graph, [...keys, 'graph'])) {\n terms.push(quad.graph);\n }\n }\n return terms;\n}\n/**\n * Get all quad term names in the given quad that return true on the given filter function.\n * @param {BaseQuad} quad A quad.\n * @param {(value: Term, key: QuadTermName, all: INamedTerm[]) => boolean} filter A filter callback.\n * @return {QuadTermName[]} The list of matching quad term names.\n */\nfunction filterQuadTermNames(quad, filter) {\n const names = [];\n if (filter(quad.subject, 'subject')) {\n names.push('subject');\n }\n if (filter(quad.predicate, 'predicate')) {\n names.push('predicate');\n }\n if (filter(quad.object, 'object')) {\n names.push('object');\n }\n if (filter(quad.graph, 'graph')) {\n names.push('graph');\n }\n return names;\n}\n/**\n * Get all quad term names in the given quad that return true on the given filter function, while recursing into quoted triples.\n * @param {BaseQuad} quad A quad.\n * @param {(value: Term, key: QuadTermName, all: INamedTerm[]) => boolean} filter A filter callback.\n * @param QuadTermName[] keys The current key path.\n * @return {QuadTermName[]} The list of matching quad term names.\n */\nfunction filterQuadTermNamesNested(quad, filter, keys = []) {\n let names = [];\n const keysS = [...keys, 'subject'];\n if (quad.subject.termType === 'Quad') {\n names = [...names, ...filterQuadTermNamesNested(quad.subject, filter, keysS)];\n }\n else {\n if (filter(quad.subject, keysS)) {\n names.push(keysS);\n }\n }\n const keysP = [...keys, 'predicate'];\n if (quad.predicate.termType === 'Quad') {\n names = [...names, ...filterQuadTermNamesNested(quad.predicate, filter, keysP)];\n }\n else {\n if (filter(quad.predicate, keysP)) {\n names.push(keysP);\n }\n }\n const keysO = [...keys, 'object'];\n if (quad.object.termType === 'Quad') {\n names = [...names, ...filterQuadTermNamesNested(quad.object, filter, keysO)];\n }\n else {\n if (filter(quad.object, keysO)) {\n names.push(keysO);\n }\n }\n const keysG = [...keys, 'graph'];\n if (quad.graph.termType === 'Quad') {\n names = [...names, ...filterQuadTermNamesNested(quad.graph, filter, keysG)];\n }\n else {\n if (filter(quad.graph, keysG)) {\n names.push(keysG);\n }\n }\n return names;\n}\n/**\n * Map all terms of a quad.\n * @param {Quad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName) => Term} mapper A mapper function.\n * @param {RDF.DataFactory} dataFactory A custom data factory to create quads.\n * @return {Quad} A new RDFJS quad.\n * @template Q The type of quad, defaults to RDF.Quad.\n */\nfunction mapTerms(quad, mapper, dataFactory) {\n return (dataFactory || DF).quad(mapper(quad.subject, 'subject'), mapper(quad.predicate, 'predicate'), mapper(quad.object, 'object'), mapper(quad.graph, 'graph'));\n}\n/**\n * Map all terms of a quad, while recursing into quoted triples.\n * @param {Quad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName) => Term} mapper A mapper function.\n * @param {RDF.DataFactory} dataFactory A custom data factory to create quads.\n * @param QuadTermName[] keys The current key path.\n * @return {Quad} A new RDFJS quad.\n * @template Q The type of quad, defaults to RDF.Quad.\n */\nfunction mapTermsNested(quad, mapper, dataFactory, keys = []) {\n return (dataFactory || DF).quad(quad.subject.termType === 'Quad' ?\n mapTermsNested(quad.subject, mapper, dataFactory, [...keys, 'subject']) :\n mapper(quad.subject, [...keys, 'subject']), quad.predicate.termType === 'Quad' ?\n mapTermsNested(quad.predicate, mapper, dataFactory, [...keys, 'predicate']) :\n mapper(quad.predicate, [...keys, 'predicate']), quad.object.termType === 'Quad' ?\n mapTermsNested(quad.object, mapper, dataFactory, [...keys, 'object']) :\n mapper(quad.object, [...keys, 'object']), quad.graph.termType === 'Quad' ?\n mapTermsNested(quad.graph, mapper, dataFactory, [...keys, 'graph']) :\n mapper(quad.graph, [...keys, 'graph']));\n}\n/**\n * Reduce all terms of a quad.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(previousValue: U, currentValue: Term, key: QuadTermName) => U} reducer A reduce function.\n * @param {U} initialValue The initial value.\n * @return {U} The final value.\n */\nfunction reduceTerms(quad, reducer, initialValue) {\n let value = initialValue;\n value = reducer(value, quad.subject, 'subject');\n value = reducer(value, quad.predicate, 'predicate');\n value = reducer(value, quad.object, 'object');\n return reducer(value, quad.graph, 'graph');\n}\n/**\n * Reduce all terms of a quad, while recursing into quoted triples.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(previousValue: U, currentValue: Term, key: QuadTermName) => U} reducer A reduce function.\n * @param {U} initialValue The initial value.\n * @param QuadTermName[] keys The current key path.\n * @return {U} The final value.\n */\nfunction reduceTermsNested(quad, reducer, initialValue, keys = []) {\n let value = initialValue;\n if (quad.subject.termType === 'Quad') {\n value = reduceTermsNested(quad.subject, reducer, value, [...keys, 'subject']);\n }\n else {\n value = reducer(value, quad.subject, [...keys, 'subject']);\n }\n if (quad.predicate.termType === 'Quad') {\n value = reduceTermsNested(quad.predicate, reducer, value, [...keys, 'predicate']);\n }\n else {\n value = reducer(value, quad.predicate, [...keys, 'predicate']);\n }\n if (quad.object.termType === 'Quad') {\n value = reduceTermsNested(quad.object, reducer, value, [...keys, 'object']);\n }\n else {\n value = reducer(value, quad.object, [...keys, 'object']);\n }\n if (quad.graph.termType === 'Quad') {\n value = reduceTermsNested(quad.graph, reducer, value, [...keys, 'graph']);\n }\n else {\n value = reducer(value, quad.graph, [...keys, 'graph']);\n }\n return value;\n}\n/**\n * Determines whether all terms satisfy the specified test.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} checker A checker function.\n * @return {boolean} If all terms satisfy the specified test.\n */\nfunction everyTerms(quad, checker) {\n return checker(quad.subject, 'subject')\n && checker(quad.predicate, 'predicate')\n && checker(quad.object, 'object')\n && checker(quad.graph, 'graph');\n}\n/**\n * Determines whether all terms satisfy the specified test, while recursing into quoted triples.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} checker A checker function.\n * @param QuadTermName[] keys The current key path.\n * @return {boolean} If all terms satisfy the specified test.\n */\nfunction everyTermsNested(quad, checker, keys = []) {\n return (quad.subject.termType === 'Quad' ?\n everyTermsNested(quad.subject, checker, [...keys, 'subject']) :\n checker(quad.subject, [...keys, 'subject']))\n && (quad.predicate.termType === 'Quad' ?\n everyTermsNested(quad.predicate, checker, [...keys, 'predicate']) :\n checker(quad.predicate, [...keys, 'predicate']))\n && (quad.object.termType === 'Quad' ?\n everyTermsNested(quad.object, checker, [...keys, 'object']) :\n checker(quad.object, [...keys, 'object']))\n && (quad.graph.termType === 'Quad' ?\n everyTermsNested(quad.graph, checker, [...keys, 'graph']) :\n checker(quad.graph, [...keys, 'graph']));\n}\n/**\n * Determines whether at least one term satisfies the specified test.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} checker A checker function.\n * @return {boolean} If at least one term satisfies the specified test.\n */\nfunction someTerms(quad, checker) {\n return checker(quad.subject, 'subject')\n || checker(quad.predicate, 'predicate')\n || checker(quad.object, 'object')\n || checker(quad.graph, 'graph');\n}\n/**\n * Determines whether at least one term satisfies the specified test, while recursing into quoted triples.\n * @param {BaseQuad} quad An RDFJS quad.\n * @param {(value: Term, key: QuadTermName} checker A checker function.\n * @param QuadTermName[] keys The current key path.\n * @return {boolean} If at least one term satisfies the specified test.\n */\nfunction someTermsNested(quad, checker, keys = []) {\n return (quad.subject.termType === 'Quad' ?\n someTermsNested(quad.subject, checker, [...keys, 'subject']) :\n checker(quad.subject, [...keys, 'subject']))\n || (quad.predicate.termType === 'Quad' ?\n someTermsNested(quad.predicate, checker, [...keys, 'predicate']) :\n checker(quad.predicate, [...keys, 'predicate']))\n || (quad.object.termType === 'Quad' ?\n someTermsNested(quad.object, checker, [...keys, 'object']) :\n checker(quad.object, [...keys, 'object']))\n || (quad.graph.termType === 'Quad' ?\n someTermsNested(quad.graph, checker, [...keys, 'graph']) :\n checker(quad.graph, [...keys, 'graph']));\n}\n/**\n * Get the nested value inside a quoted triple by the given path of quad keys.\n * @param term A term, that can be a quoted triple.\n * @param keys A path of quad term names.\n */\nfunction getValueNestedPath(term, keys) {\n if (keys.length === 0) {\n return term;\n }\n if (term.termType === 'Quad') {\n return getValueNestedPath(term[keys[0]], keys.slice(1));\n }\n throw new Error(`Tried to get ${keys[0]} from term of type ${term.termType}`);\n}\n/**\n * Check if the given terms match.\n *\n * At least one of the following must be true:\n * * Term B is undefined.\n * * Term B is a variable.\n * * Term A and B are quads, and return true for `matchPatternComplete`.\n * * Quad term and term are equal (`termB.equals(termA)` return true)\n *\n * @param termA A term.\n * @param termB An optional term.\n */\nfunction matchTerm(termA, termB) {\n return !termB\n || termB.termType === 'Variable'\n || (termB.termType === 'Quad' && termA.termType === 'Quad' && matchPatternComplete(termA, termB))\n || termB.equals(termA);\n}\n/**\n * Check if the given quad matches with the given quad terms.\n *\n * Each term must match at least one of the following:\n * * Term is undefined.\n * * Term is a variable.\n * * Quad term and term are both quads, and return true for `matchPatternComplete`.\n * * Quad term and term are equal (`quadTerm.equals(term)` return true)\n *\n * @param {BaseQuad} quad A quad to match with (can not contain variables).\n * @param {Term} subject An optional subject.\n * @param {Term} predicate An optional predicate.\n * @param {Term} object An optional object.\n * @param {Term} graph An optional graph.\n * @return {boolean} If the quad matches with the quad terms.\n */\nfunction matchPattern(quad, subject, predicate, object, graph) {\n return matchTerm(quad.subject, subject)\n && matchTerm(quad.predicate, predicate)\n && matchTerm(quad.object, object)\n && matchTerm(quad.graph, graph);\n}\n/**\n * Check if the first quad matches with all terms from the second quad.\n *\n * Each term must match at least one of the following:\n * * Quad2 term is a variable.\n * * Quad1 term and Quad2 term are equal (`term1.equals(term2)` return true)\n *\n * @param {BaseQuad} quad A quad (can not contain variables).\n * @param {BaseQuad} pattern A quad pattern (can contain variables).\n * @return {boolean} If the quad terms match.\n */\nfunction matchPatternComplete(quad, pattern) {\n return matchPattern(quad, pattern.subject, pattern.predicate, pattern.object, pattern.graph);\n}\nfunction matchPatternMappings(quad, pattern, opt = {}) {\n const map = {};\n function match(_pattern, _quad) {\n return everyTerms(_pattern, (t1, key) => {\n var _a, _b;\n const t2 = _quad[key];\n switch (t1.termType) {\n case 'Variable':\n return (opt.skipVarMapping && t2.termType === 'Variable')\n || ((_b = (_a = map[t1.value]) === null || _a === void 0 ? void 0 : _a.equals(t2)) !== null && _b !== void 0 ? _b : (map[t1.value] = t2, true));\n case 'Quad':\n return t2.termType === 'Quad' && match(t1, t2);\n default:\n return t1.equals(t2);\n }\n });\n }\n return match(pattern, quad) && (opt.returnMappings ? map : true);\n}\n//# sourceMappingURL=QuadTermUtil.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-terms/lib/QuadTermUtil.js?\n}");
1308
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ N3Lexer)\n/* harmony export */ });\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! buffer */ \"./node_modules/buffer/index.js\");\n/* harmony import */ var _IRIs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./IRIs */ \"./node_modules/rdflib/node_modules/n3/src/IRIs.js\");\n// **N3Lexer** tokenizes N3 documents.\n\n\n\nconst { xsd } = _IRIs__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\n\n// Regular expression and replacement string to escape N3 strings\nconst escapeSequence = /\\\\u([a-fA-F0-9]{4})|\\\\U([a-fA-F0-9]{8})|\\\\([^])/g;\nconst escapeReplacements = {\n '\\\\': '\\\\', \"'\": \"'\", '\"': '\"',\n 'n': '\\n', 'r': '\\r', 't': '\\t', 'f': '\\f', 'b': '\\b',\n '_': '_', '~': '~', '.': '.', '-': '-', '!': '!', '$': '$', '&': '&',\n '(': '(', ')': ')', '*': '*', '+': '+', ',': ',', ';': ';', '=': '=',\n '/': '/', '?': '?', '#': '#', '@': '@', '%': '%',\n};\nconst illegalIriChars = /[\\x00-\\x20<>\\\\\"\\{\\}\\|\\^\\`]/;\n\nconst lineModeRegExps = {\n _iri: true,\n _unescapedIri: true,\n _simpleQuotedString: true,\n _langcode: true,\n _blank: true,\n _newline: true,\n _comment: true,\n _whitespace: true,\n _endOfFile: true,\n};\nconst invalidRegExp = /$0^/;\n\n// ## Constructor\nclass N3Lexer {\n constructor(options) {\n // ## Regular expressions\n // It's slightly faster to have these as properties than as in-scope variables\n this._iri = /^<((?:[^ <>{}\\\\]|\\\\[uU])+)>[ \\t]*/; // IRI with escape sequences; needs sanity check after unescaping\n this._unescapedIri = /^<([^\\x00-\\x20<>\\\\\"\\{\\}\\|\\^\\`]*)>[ \\t]*/; // IRI without escape sequences; no unescaping\n this._simpleQuotedString = /^\"([^\"\\\\\\r\\n]*)\"(?=[^\"])/; // string without escape sequences\n this._simpleApostropheString = /^'([^'\\\\\\r\\n]*)'(?=[^'])/;\n this._langcode = /^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\\-])/i;\n 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<])/;\n 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#()\\[\\]\\{\\}\"'<>]))/;\n 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#()\\[\\]\\{\\}\"'<>])/;\n 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#()\\[\\]\\{\\}\"'<>]))/;\n this._number = /^[\\-+]?(?:(\\d+\\.\\d*|\\.?\\d+)[eE][\\-+]?|\\d*(\\.)?)\\d+(?=\\.?[,;:\\s#()\\[\\]\\{\\}\"'<>])/;\n this._boolean = /^(?:true|false)(?=[.,;\\s#()\\[\\]\\{\\}\"'<>])/;\n this._keyword = /^@[a-z]+(?=[\\s#<:])/i;\n this._sparqlKeyword = /^(?:PREFIX|BASE|GRAPH)(?=[\\s#<])/i;\n this._shortPredicates = /^a(?=[\\s#()\\[\\]\\{\\}\"'<>])/;\n this._newline = /^[ \\t]*(?:#[^\\n\\r]*)?(?:\\r\\n|\\n|\\r)[ \\t]*/;\n this._comment = /#([^\\n\\r]*)/;\n this._whitespace = /^[ \\t]+/;\n this._endOfFile = /^(?:#[^\\n\\r]*)?$/;\n options = options || {};\n\n // Whether the log:isImpliedBy predicate is supported\n this._isImpliedBy = options.isImpliedBy;\n\n // In line mode (N-Triples or N-Quads), only simple features may be parsed\n if (this._lineMode = !!options.lineMode) {\n this._n3Mode = false;\n // Don't tokenize special literals\n for (const key in this) {\n if (!(key in lineModeRegExps) && this[key] instanceof RegExp)\n this[key] = invalidRegExp;\n }\n }\n // When not in line mode, enable N3 functionality by default\n else {\n this._n3Mode = options.n3 !== false;\n }\n // Don't output comment tokens by default\n this.comments = !!options.comments;\n // Cache the last tested closing position of long literals\n this._literalClosingPos = 0;\n }\n\n // ## Private methods\n\n // ### `_tokenizeToEnd` tokenizes as for as possible, emitting tokens through the callback\n _tokenizeToEnd(callback, inputFinished) {\n // Continue parsing as far as possible; the loop will return eventually\n let input = this._input;\n let currentLineLength = input.length;\n while (true) {\n // Count and skip whitespace lines\n let whiteSpaceMatch, comment;\n while (whiteSpaceMatch = this._newline.exec(input)) {\n // Try to find a comment\n if (this.comments && (comment = this._comment.exec(whiteSpaceMatch[0])))\n emitToken('comment', comment[1], '', this._line, whiteSpaceMatch[0].length);\n // Advance the input\n input = input.substr(whiteSpaceMatch[0].length, input.length);\n currentLineLength = input.length;\n this._line++;\n }\n // Skip whitespace on current line\n if (!whiteSpaceMatch && (whiteSpaceMatch = this._whitespace.exec(input)))\n input = input.substr(whiteSpaceMatch[0].length, input.length);\n\n // Stop for now if we're at the end\n if (this._endOfFile.test(input)) {\n // If the input is finished, emit EOF\n if (inputFinished) {\n // Try to find a final comment\n if (this.comments && (comment = this._comment.exec(input)))\n emitToken('comment', comment[1], '', this._line, input.length);\n input = null;\n emitToken('eof', '', '', this._line, 0);\n }\n return this._input = input;\n }\n\n // Look for specific token types based on the first character\n const line = this._line, firstChar = input[0];\n let type = '', value = '', prefix = '',\n match = null, matchLength = 0, inconclusive = false;\n switch (firstChar) {\n case '^':\n // We need at least 3 tokens lookahead to distinguish ^^<IRI> and ^^pre:fixed\n if (input.length < 3)\n break;\n // Try to match a type\n else if (input[1] === '^') {\n this._previousMarker = '^^';\n // Move to type IRI or prefixed name\n input = input.substr(2);\n if (input[0] !== '<') {\n inconclusive = true;\n break;\n }\n }\n // If no type, it must be a path expression\n else {\n if (this._n3Mode) {\n matchLength = 1;\n type = '^';\n }\n break;\n }\n // Fall through in case the type is an IRI\n case '<':\n // Try to find a full IRI without escape sequences\n if (match = this._unescapedIri.exec(input))\n type = 'IRI', value = match[1];\n // Try to find a full IRI with escape sequences\n else if (match = this._iri.exec(input)) {\n value = this._unescape(match[1]);\n if (value === null || illegalIriChars.test(value))\n return reportSyntaxError(this);\n type = 'IRI';\n }\n // Try to find a nested triple\n else if (input.length > 1 && input[1] === '<')\n type = '<<', matchLength = 2;\n // Try to find a backwards implication arrow\n else if (this._n3Mode && input.length > 1 && input[1] === '=') {\n matchLength = 2;\n if (this._isImpliedBy) type = 'abbreviation', value = '<';\n else type = 'inverse', value = '>';\n }\n break;\n\n case '>':\n if (input.length > 1 && input[1] === '>')\n type = '>>', matchLength = 2;\n break;\n\n case '_':\n // Try to find a blank node. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a blank node.\n // Therefore, try inserting a space if we're at the end of the input.\n if ((match = this._blank.exec(input)) ||\n inputFinished && (match = this._blank.exec(`${input} `)))\n type = 'blank', prefix = '_', value = match[1];\n break;\n\n case '\"':\n // Try to find a literal without escape sequences\n if (match = this._simpleQuotedString.exec(input))\n value = match[1];\n // Try to find a literal wrapped in three pairs of quotes\n else {\n ({ value, matchLength } = this._parseLiteral(input));\n if (value === null)\n return reportSyntaxError(this);\n }\n if (match !== null || matchLength !== 0) {\n type = 'literal';\n this._literalClosingPos = 0;\n }\n break;\n\n case \"'\":\n if (!this._lineMode) {\n // Try to find a literal without escape sequences\n if (match = this._simpleApostropheString.exec(input))\n value = match[1];\n // Try to find a literal wrapped in three pairs of quotes\n else {\n ({ value, matchLength } = this._parseLiteral(input));\n if (value === null)\n return reportSyntaxError(this);\n }\n if (match !== null || matchLength !== 0) {\n type = 'literal';\n this._literalClosingPos = 0;\n }\n }\n break;\n\n case '?':\n // Try to find a variable\n if (this._n3Mode && (match = this._variable.exec(input)))\n type = 'var', value = match[0];\n break;\n\n case '@':\n // Try to find a language code\n if (this._previousMarker === 'literal' && (match = this._langcode.exec(input)))\n type = 'langcode', value = match[1];\n // Try to find a keyword\n else if (match = this._keyword.exec(input))\n type = match[0];\n break;\n\n case '.':\n // Try to find a dot as punctuation\n if (input.length === 1 ? inputFinished : (input[1] < '0' || input[1] > '9')) {\n type = '.';\n matchLength = 1;\n break;\n }\n // Fall through to numerical case (could be a decimal dot)\n\n case '0':\n case '1':\n case '2':\n case '3':\n case '4':\n case '5':\n case '6':\n case '7':\n case '8':\n case '9':\n case '+':\n case '-':\n // Try to find a number. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a number.\n // Therefore, try inserting a space if we're at the end of the input.\n if (match = this._number.exec(input) ||\n inputFinished && (match = this._number.exec(`${input} `))) {\n type = 'literal', value = match[0];\n prefix = (typeof match[1] === 'string' ? xsd.double :\n (typeof match[2] === 'string' ? xsd.decimal : xsd.integer));\n }\n break;\n\n case 'B':\n case 'b':\n case 'p':\n case 'P':\n case 'G':\n case 'g':\n // Try to find a SPARQL-style keyword\n if (match = this._sparqlKeyword.exec(input))\n type = match[0].toUpperCase();\n else\n inconclusive = true;\n break;\n\n case 'f':\n case 't':\n // Try to match a boolean\n if (match = this._boolean.exec(input))\n type = 'literal', value = match[0], prefix = xsd.boolean;\n else\n inconclusive = true;\n break;\n\n case 'a':\n // Try to find an abbreviated predicate\n if (match = this._shortPredicates.exec(input))\n type = 'abbreviation', value = 'a';\n else\n inconclusive = true;\n break;\n\n case '=':\n // Try to find an implication arrow or equals sign\n if (this._n3Mode && input.length > 1) {\n type = 'abbreviation';\n if (input[1] !== '>')\n matchLength = 1, value = '=';\n else\n matchLength = 2, value = '>';\n }\n break;\n\n case '!':\n if (!this._n3Mode)\n break;\n case ',':\n case ';':\n case '[':\n case ']':\n case '(':\n case ')':\n case '}':\n if (!this._lineMode) {\n matchLength = 1;\n type = firstChar;\n }\n break;\n case '{':\n // We need at least 2 tokens lookahead to distinguish \"{|\" and \"{ \"\n if (!this._lineMode && input.length >= 2) {\n // Try to find a quoted triple annotation start\n if (input[1] === '|')\n type = '{|', matchLength = 2;\n else\n type = firstChar, matchLength = 1;\n }\n break;\n case '|':\n // We need 2 tokens lookahead to parse \"|}\"\n // Try to find a quoted triple annotation end\n if (input.length >= 2 && input[1] === '}')\n type = '|}', matchLength = 2;\n break;\n\n default:\n inconclusive = true;\n }\n\n // Some first characters do not allow an immediate decision, so inspect more\n if (inconclusive) {\n // Try to find a prefix\n if ((this._previousMarker === '@prefix' || this._previousMarker === 'PREFIX') &&\n (match = this._prefix.exec(input)))\n type = 'prefix', value = match[1] || '';\n // Try to find a prefixed name. Since it can contain (but not end with) a dot,\n // we always need a non-dot character before deciding it is a prefixed name.\n // Therefore, try inserting a space if we're at the end of the input.\n else if ((match = this._prefixed.exec(input)) ||\n inputFinished && (match = this._prefixed.exec(`${input} `)))\n type = 'prefixed', prefix = match[1] || '', value = this._unescape(match[2]);\n }\n\n // A type token is special: it can only be emitted after an IRI or prefixed name is read\n if (this._previousMarker === '^^') {\n switch (type) {\n case 'prefixed': type = 'type'; break;\n case 'IRI': type = 'typeIRI'; break;\n default: type = '';\n }\n }\n\n // What if nothing of the above was found?\n if (!type) {\n // We could be in streaming mode, and then we just wait for more input to arrive.\n // Otherwise, a syntax error has occurred in the input.\n // One exception: error on an unaccounted linebreak (= not inside a triple-quoted literal).\n if (inputFinished || (!/^'''|^\"\"\"/.test(input) && /\\n|\\r/.test(input)))\n return reportSyntaxError(this);\n else\n return this._input = input;\n }\n\n // Emit the parsed token\n const length = matchLength || match[0].length;\n const token = emitToken(type, value, prefix, line, length);\n this.previousToken = token;\n this._previousMarker = type;\n\n // Advance to next part to tokenize\n input = input.substr(length, input.length);\n }\n\n // Emits the token through the callback\n function emitToken(type, value, prefix, line, length) {\n const start = input ? currentLineLength - input.length : currentLineLength;\n const end = start + length;\n const token = { type, value, prefix, line, start, end };\n callback(null, token);\n return token;\n }\n // Signals the syntax error through the callback\n function reportSyntaxError(self) { callback(self._syntaxError(/^\\S*/.exec(input)[0])); }\n }\n\n // ### `_unescape` replaces N3 escape codes by their corresponding characters\n _unescape(item) {\n let invalid = false;\n const replaced = item.replace(escapeSequence, (sequence, unicode4, unicode8, escapedChar) => {\n // 4-digit unicode character\n if (typeof unicode4 === 'string')\n return String.fromCharCode(Number.parseInt(unicode4, 16));\n // 8-digit unicode character\n if (typeof unicode8 === 'string') {\n let charCode = Number.parseInt(unicode8, 16);\n return charCode <= 0xFFFF ? String.fromCharCode(Number.parseInt(unicode8, 16)) :\n String.fromCharCode(0xD800 + ((charCode -= 0x10000) >> 10), 0xDC00 + (charCode & 0x3FF));\n }\n // fixed escape sequence\n if (escapedChar in escapeReplacements)\n return escapeReplacements[escapedChar];\n // invalid escape sequence\n invalid = true;\n return '';\n });\n return invalid ? null : replaced;\n }\n\n // ### `_parseLiteral` parses a literal into an unescaped value\n _parseLiteral(input) {\n // Ensure we have enough lookahead to identify triple-quoted strings\n if (input.length >= 3) {\n // Identify the opening quote(s)\n const opening = input.match(/^(?:\"\"\"|\"|'''|'|)/)[0];\n const openingLength = opening.length;\n\n // Find the next candidate closing quotes\n let closingPos = Math.max(this._literalClosingPos, openingLength);\n while ((closingPos = input.indexOf(opening, closingPos)) > 0) {\n // Count backslashes right before the closing quotes\n let backslashCount = 0;\n while (input[closingPos - backslashCount - 1] === '\\\\')\n backslashCount++;\n\n // An even number of backslashes (in particular 0)\n // means these are actual, non-escaped closing quotes\n if (backslashCount % 2 === 0) {\n // Extract and unescape the value\n const raw = input.substring(openingLength, closingPos);\n const lines = raw.split(/\\r\\n|\\r|\\n/).length - 1;\n const matchLength = closingPos + openingLength;\n // Only triple-quoted strings can be multi-line\n if (openingLength === 1 && lines !== 0 ||\n openingLength === 3 && this._lineMode)\n break;\n this._line += lines;\n return { value: this._unescape(raw), matchLength };\n }\n closingPos++;\n }\n this._literalClosingPos = input.length - openingLength + 1;\n }\n return { value: '', matchLength: 0 };\n }\n\n // ### `_syntaxError` creates a syntax error for the given issue\n _syntaxError(issue) {\n this._input = null;\n const err = new Error(`Unexpected \"${issue}\" on line ${this._line}.`);\n err.context = {\n token: undefined,\n line: this._line,\n previousToken: this.previousToken,\n };\n return err;\n }\n\n // ### Strips off any starting UTF BOM mark.\n _readStartingBom(input) {\n return input.startsWith('\\ufeff') ? input.substr(1) : input;\n }\n\n // ## Public methods\n\n // ### `tokenize` starts the transformation of an N3 document into an array of tokens.\n // The input can be a string or a stream.\n tokenize(input, callback) {\n this._line = 1;\n\n // If the input is a string, continuously emit tokens through the callback until the end\n if (typeof input === 'string') {\n this._input = this._readStartingBom(input);\n // If a callback was passed, asynchronously call it\n if (typeof callback === 'function')\n queueMicrotask(() => this._tokenizeToEnd(callback, true));\n // If no callback was passed, tokenize synchronously and return\n else {\n const tokens = [];\n let error;\n this._tokenizeToEnd((e, t) => e ? (error = e) : tokens.push(t), true);\n if (error) throw error;\n return tokens;\n }\n }\n // Otherwise, the input must be a stream\n else {\n this._pendingBuffer = null;\n if (typeof input.setEncoding === 'function')\n input.setEncoding('utf8');\n // Adds the data chunk to the buffer and parses as far as possible\n input.on('data', data => {\n if (this._input !== null && data.length !== 0) {\n // Prepend any previous pending writes\n if (this._pendingBuffer) {\n data = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.concat([this._pendingBuffer, data]);\n this._pendingBuffer = null;\n }\n // Hold if the buffer ends in an incomplete unicode sequence\n if (data[data.length - 1] & 0x80) {\n this._pendingBuffer = data;\n }\n // Otherwise, tokenize as far as possible\n else {\n // Only read a BOM at the start\n if (typeof this._input === 'undefined')\n this._input = this._readStartingBom(typeof data === 'string' ? data : data.toString());\n else\n this._input += data;\n this._tokenizeToEnd(callback, false);\n }\n }\n });\n // Parses until the end\n input.on('end', () => {\n if (typeof this._input === 'string')\n this._tokenizeToEnd(callback, true);\n });\n input.on('error', callback);\n }\n }\n}\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/node_modules/n3/src/N3Lexer.js?\n}");
644
1309
 
645
1310
  /***/ },
646
1311
 
647
- /***/ "./node_modules/rdf-terms/lib/TermUtil.js"
648
- /*!************************************************!*\
649
- !*** ./node_modules/rdf-terms/lib/TermUtil.js ***!
650
- \************************************************/
651
- (__unused_webpack_module, exports, __webpack_require__) {
1312
+ /***/ "./node_modules/rdflib/node_modules/n3/src/N3Parser.js"
1313
+ /*!*************************************************************!*\
1314
+ !*** ./node_modules/rdflib/node_modules/n3/src/N3Parser.js ***!
1315
+ \*************************************************************/
1316
+ (__unused_webpack_module, __webpack_exports__, __webpack_require__) {
652
1317
 
653
1318
  "use strict";
654
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.TERM_TYPES = void 0;\nexports.uniqTerms = uniqTerms;\nexports.getTermsOfType = getTermsOfType;\nexports.getNamedNodes = getNamedNodes;\nexports.getBlankNodes = getBlankNodes;\nexports.getLiterals = getLiterals;\nexports.getVariables = getVariables;\nexports.getDefaultGraphs = getDefaultGraphs;\nexports.getQuads = getQuads;\nconst rdf_string_1 = __webpack_require__(/*! rdf-string */ \"./node_modules/rdf-string/index.js\");\n/**\n * All known term types.\n * @see RDF.Term\n * @type {[string , string , string , string , string, string]}\n */\nexports.TERM_TYPES = ['NamedNode', 'BlankNode', 'Literal', 'Variable', 'DefaultGraph', 'Quad'];\n/*\n * Utility methods for handling RDFJS terms.\n */\n/**\n * Create an array of unique terms from the given array.\n * @param {T[]} terms An array of RDFJS terms.\n * @return {T[]} A new array of unique RDFJS terms.\n */\nfunction uniqTerms(terms) {\n const hash = {};\n return terms.filter(term => {\n const termString = (0, rdf_string_1.termToString)(term);\n return !(termString in hash) && (hash[termString] = true);\n });\n}\n/**\n * Find all terms of the given type in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @param {\"NamedNode\" | \"BlankNode\" | \"Literal\" | \"Variable\" | \"DefaultGraph\" | \"Quad\"} termType A term type.\n * @return {Term[]} A new array with elements from the given array only containing elements of the given type.\n */\nfunction getTermsOfType(terms, termType) {\n return terms.filter((term) => term.termType === termType);\n}\n/**\n * Find all named nodes in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {NamedNode[]} A new array with elements from the given array only containing named nodes.\n */\nfunction getNamedNodes(terms) {\n return getTermsOfType(terms, 'NamedNode');\n}\n/**\n * Find all blank nodes in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {BlankNode[]} A new array with elements from the given array only containing blank nodes.\n */\nfunction getBlankNodes(terms) {\n return getTermsOfType(terms, 'BlankNode');\n}\n/**\n * Find all literals in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {Literal[]} A new array with elements from the given array only containing literals.\n */\nfunction getLiterals(terms) {\n return getTermsOfType(terms, 'Literal');\n}\n/**\n * Find all variables in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {Variable[]} A new array with elements from the given array only containing variables.\n */\nfunction getVariables(terms) {\n return getTermsOfType(terms, 'Variable');\n}\n/**\n * Find all default graphs in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {DefaultGraph[]} A new array with elements from the given array only containing default graphs.\n */\nfunction getDefaultGraphs(terms) {\n return getTermsOfType(terms, 'DefaultGraph');\n}\n/**\n * Find all quads in the given array.\n * @param {Term[]} terms An array of RDFJS terms.\n * @return {BaseQuad[]} A new array with elements from the given array only containing quads.\n */\nfunction getQuads(terms) {\n return getTermsOfType(terms, 'Quad');\n}\n//# sourceMappingURL=TermUtil.js.map\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdf-terms/lib/TermUtil.js?\n}");
1319
+ eval("{__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ N3Parser)\n/* harmony export */ });\n/* harmony import */ var _N3Lexer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./N3Lexer */ \"./node_modules/rdflib/node_modules/n3/src/N3Lexer.js\");\n/* harmony import */ var _N3DataFactory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./N3DataFactory */ \"./node_modules/rdflib/node_modules/n3/src/N3DataFactory.js\");\n/* harmony import */ var _IRIs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IRIs */ \"./node_modules/rdflib/node_modules/n3/src/IRIs.js\");\n// **N3Parser** parses N3 documents.\n\n\n\n\nlet blankNodePrefix = 0;\n\n// ## Constructor\nclass N3Parser {\n constructor(options) {\n this._contextStack = [];\n this._graph = null;\n\n // Set the document IRI\n options = options || {};\n this._setBase(options.baseIRI);\n options.factory && initDataFactory(this, options.factory);\n\n // Set supported features depending on the format\n const format = (typeof options.format === 'string') ?\n options.format.match(/\\w*$/)[0].toLowerCase() : '',\n isTurtle = /turtle/.test(format), isTriG = /trig/.test(format),\n isNTriples = /triple/.test(format), isNQuads = /quad/.test(format),\n isN3 = this._n3Mode = /n3/.test(format),\n isLineMode = isNTriples || isNQuads;\n if (!(this._supportsNamedGraphs = !(isTurtle || isN3)))\n this._readPredicateOrNamedGraph = this._readPredicate;\n // Support triples in other graphs\n this._supportsQuads = !(isTurtle || isTriG || isNTriples || isN3);\n // Whether the log:isImpliedBy predicate is supported\n this._isImpliedBy = options.isImpliedBy;\n // Support nesting of triples\n this._supportsRDFStar = format === '' || /star|\\*$/.test(format);\n // Disable relative IRIs in N-Triples or N-Quads mode\n if (isLineMode)\n this._resolveRelativeIRI = iri => { return null; };\n this._blankNodePrefix = typeof options.blankNodePrefix !== 'string' ? '' :\n options.blankNodePrefix.replace(/^(?!_:)/, '_:');\n this._lexer = options.lexer || new _N3Lexer__WEBPACK_IMPORTED_MODULE_0__[\"default\"]({ lineMode: isLineMode, n3: isN3, isImpliedBy: this._isImpliedBy });\n // Disable explicit quantifiers by default\n this._explicitQuantifiers = !!options.explicitQuantifiers;\n }\n\n // ## Static class methods\n\n // ### `_resetBlankNodePrefix` restarts blank node prefix identification\n static _resetBlankNodePrefix() {\n blankNodePrefix = 0;\n }\n\n // ## Private methods\n\n // ### `_setBase` sets the base IRI to resolve relative IRIs\n _setBase(baseIRI) {\n if (!baseIRI) {\n this._base = '';\n this._basePath = '';\n }\n else {\n // Remove fragment if present\n const fragmentPos = baseIRI.indexOf('#');\n if (fragmentPos >= 0)\n baseIRI = baseIRI.substr(0, fragmentPos);\n // Set base IRI and its components\n this._base = baseIRI;\n this._basePath = baseIRI.indexOf('/') < 0 ? baseIRI :\n baseIRI.replace(/[^\\/?]*(?:\\?.*)?$/, '');\n baseIRI = baseIRI.match(/^(?:([a-z][a-z0-9+.-]*:))?(?:\\/\\/[^\\/]*)?/i);\n this._baseRoot = baseIRI[0];\n this._baseScheme = baseIRI[1];\n }\n }\n\n // ### `_saveContext` stores the current parsing context\n // when entering a new scope (list, blank node, formula)\n _saveContext(type, graph, subject, predicate, object) {\n const n3Mode = this._n3Mode;\n this._contextStack.push({\n type,\n subject, predicate, object, graph,\n inverse: n3Mode ? this._inversePredicate : false,\n blankPrefix: n3Mode ? this._prefixes._ : '',\n quantified: n3Mode ? this._quantified : null,\n });\n // The settings below only apply to N3 streams\n if (n3Mode) {\n // Every new scope resets the predicate direction\n this._inversePredicate = false;\n // In N3, blank nodes are scoped to a formula\n // (using a dot as separator, as a blank node label cannot start with it)\n this._prefixes._ = (this._graph ? `${this._graph.value}.` : '.');\n // Quantifiers are scoped to a formula\n this._quantified = Object.create(this._quantified);\n }\n }\n\n // ### `_restoreContext` restores the parent context\n // when leaving a scope (list, blank node, formula)\n _restoreContext(type, token) {\n // Obtain the previous context\n const context = this._contextStack.pop();\n if (!context || context.type !== type)\n return this._error(`Unexpected ${token.type}`, token);\n\n // Restore the quad of the previous context\n this._subject = context.subject;\n this._predicate = context.predicate;\n this._object = context.object;\n this._graph = context.graph;\n\n // Restore N3 context settings\n if (this._n3Mode) {\n this._inversePredicate = context.inverse;\n this._prefixes._ = context.blankPrefix;\n this._quantified = context.quantified;\n }\n }\n\n // ### `_readInTopContext` reads a token when in the top context\n _readInTopContext(token) {\n switch (token.type) {\n // If an EOF token arrives in the top context, signal that we're done\n case 'eof':\n if (this._graph !== null)\n return this._error('Unclosed graph', token);\n delete this._prefixes._;\n return this._callback(null, null, this._prefixes);\n // It could be a prefix declaration\n case 'PREFIX':\n this._sparqlStyle = true;\n case '@prefix':\n return this._readPrefix;\n // It could be a base declaration\n case 'BASE':\n this._sparqlStyle = true;\n case '@base':\n return this._readBaseIRI;\n // It could be a graph\n case '{':\n if (this._supportsNamedGraphs) {\n this._graph = '';\n this._subject = null;\n return this._readSubject;\n }\n case 'GRAPH':\n if (this._supportsNamedGraphs)\n return this._readNamedGraphLabel;\n // Otherwise, the next token must be a subject\n default:\n return this._readSubject(token);\n }\n }\n\n // ### `_readEntity` reads an IRI, prefixed name, blank node, or variable\n _readEntity(token, quantifier) {\n let value;\n switch (token.type) {\n // Read a relative or absolute IRI\n case 'IRI':\n case 'typeIRI':\n const iri = this._resolveIRI(token.value);\n if (iri === null)\n return this._error('Invalid IRI', token);\n value = this._factory.namedNode(iri);\n break;\n // Read a prefixed name\n case 'type':\n case 'prefixed':\n const prefix = this._prefixes[token.prefix];\n if (prefix === undefined)\n return this._error(`Undefined prefix \"${token.prefix}:\"`, token);\n value = this._factory.namedNode(prefix + token.value);\n break;\n // Read a blank node\n case 'blank':\n value = this._factory.blankNode(this._prefixes[token.prefix] + token.value);\n break;\n // Read a variable\n case 'var':\n value = this._factory.variable(token.value.substr(1));\n break;\n // Everything else is not an entity\n default:\n return this._error(`Expected entity but got ${token.type}`, token);\n }\n // In N3 mode, replace the entity if it is quantified\n if (!quantifier && this._n3Mode && (value.id in this._quantified))\n value = this._quantified[value.id];\n return value;\n }\n\n // ### `_readSubject` reads a quad's subject\n _readSubject(token) {\n this._predicate = null;\n switch (token.type) {\n case '[':\n // Start a new quad with a new blank node as subject\n this._saveContext('blank', this._graph,\n this._subject = this._factory.blankNode(), null, null);\n return this._readBlankNodeHead;\n case '(':\n // Start a new list\n this._saveContext('list', this._graph, this.RDF_NIL, null, null);\n this._subject = null;\n return this._readListItem;\n case '{':\n // Start a new formula\n if (!this._n3Mode)\n return this._error('Unexpected graph', token);\n this._saveContext('formula', this._graph,\n this._graph = this._factory.blankNode(), null, null);\n return this._readSubject;\n case '}':\n // No subject; the graph in which we are reading is closed instead\n return this._readPunctuation(token);\n case '@forSome':\n if (!this._n3Mode)\n return this._error('Unexpected \"@forSome\"', token);\n this._subject = null;\n this._predicate = this.N3_FORSOME;\n this._quantifier = 'blankNode';\n return this._readQuantifierList;\n case '@forAll':\n if (!this._n3Mode)\n return this._error('Unexpected \"@forAll\"', token);\n this._subject = null;\n this._predicate = this.N3_FORALL;\n this._quantifier = 'variable';\n return this._readQuantifierList;\n case 'literal':\n if (!this._n3Mode)\n return this._error('Unexpected literal', token);\n\n if (token.prefix.length === 0) {\n this._literalValue = token.value;\n return this._completeSubjectLiteral;\n }\n else\n this._subject = this._factory.literal(token.value, this._factory.namedNode(token.prefix));\n\n break;\n case '<<':\n if (!this._supportsRDFStar)\n return this._error('Unexpected RDF-star syntax', token);\n this._saveContext('<<', this._graph, null, null, null);\n this._graph = null;\n return this._readSubject;\n default:\n // Read the subject entity\n if ((this._subject = this._readEntity(token)) === undefined)\n return;\n // In N3 mode, the subject might be a path\n if (this._n3Mode)\n return this._getPathReader(this._readPredicateOrNamedGraph);\n }\n\n // The next token must be a predicate,\n // or, if the subject was actually a graph IRI, a named graph\n return this._readPredicateOrNamedGraph;\n }\n\n // ### `_readPredicate` reads a quad's predicate\n _readPredicate(token) {\n const type = token.type;\n switch (type) {\n case 'inverse':\n this._inversePredicate = true;\n case 'abbreviation':\n this._predicate = this.ABBREVIATIONS[token.value];\n break;\n case '.':\n case ']':\n case '}':\n // Expected predicate didn't come, must have been trailing semicolon\n if (this._predicate === null)\n return this._error(`Unexpected ${type}`, token);\n this._subject = null;\n return type === ']' ? this._readBlankNodeTail(token) : this._readPunctuation(token);\n case ';':\n // Additional semicolons can be safely ignored\n return this._predicate !== null ? this._readPredicate :\n this._error('Expected predicate but got ;', token);\n case '[':\n if (this._n3Mode) {\n // Start a new quad with a new blank node as subject\n this._saveContext('blank', this._graph, this._subject,\n this._subject = this._factory.blankNode(), null);\n return this._readBlankNodeHead;\n }\n case 'blank':\n if (!this._n3Mode)\n return this._error('Disallowed blank node as predicate', token);\n default:\n if ((this._predicate = this._readEntity(token)) === undefined)\n return;\n }\n // The next token must be an object\n return this._readObject;\n }\n\n // ### `_readObject` reads a quad's object\n _readObject(token) {\n switch (token.type) {\n case 'literal':\n // Regular literal, can still get a datatype or language\n if (token.prefix.length === 0) {\n this._literalValue = token.value;\n return this._readDataTypeOrLang;\n }\n // Pre-datatyped string literal (prefix stores the datatype)\n else\n this._object = this._factory.literal(token.value, this._factory.namedNode(token.prefix));\n break;\n case '[':\n // Start a new quad with a new blank node as subject\n this._saveContext('blank', this._graph, this._subject, this._predicate,\n this._subject = this._factory.blankNode());\n return this._readBlankNodeHead;\n case '(':\n // Start a new list\n this._saveContext('list', this._graph, this._subject, this._predicate, this.RDF_NIL);\n this._subject = null;\n return this._readListItem;\n case '{':\n // Start a new formula\n if (!this._n3Mode)\n return this._error('Unexpected graph', token);\n this._saveContext('formula', this._graph, this._subject, this._predicate,\n this._graph = this._factory.blankNode());\n return this._readSubject;\n case '<<':\n if (!this._supportsRDFStar)\n return this._error('Unexpected RDF-star syntax', token);\n this._saveContext('<<', this._graph, this._subject, this._predicate, null);\n this._graph = null;\n return this._readSubject;\n default:\n // Read the object entity\n if ((this._object = this._readEntity(token)) === undefined)\n return;\n // In N3 mode, the object might be a path\n if (this._n3Mode)\n return this._getPathReader(this._getContextEndReader());\n }\n return this._getContextEndReader();\n }\n\n // ### `_readPredicateOrNamedGraph` reads a quad's predicate, or a named graph\n _readPredicateOrNamedGraph(token) {\n return token.type === '{' ? this._readGraph(token) : this._readPredicate(token);\n }\n\n // ### `_readGraph` reads a graph\n _readGraph(token) {\n if (token.type !== '{')\n return this._error(`Expected graph but got ${token.type}`, token);\n // The \"subject\" we read is actually the GRAPH's label\n this._graph = this._subject, this._subject = null;\n return this._readSubject;\n }\n\n // ### `_readBlankNodeHead` reads the head of a blank node\n _readBlankNodeHead(token) {\n if (token.type === ']') {\n this._subject = null;\n return this._readBlankNodeTail(token);\n }\n else {\n this._predicate = null;\n return this._readPredicate(token);\n }\n }\n\n // ### `_readBlankNodeTail` reads the end of a blank node\n _readBlankNodeTail(token) {\n if (token.type !== ']')\n return this._readBlankNodePunctuation(token);\n\n // Store blank node quad\n if (this._subject !== null)\n this._emit(this._subject, this._predicate, this._object, this._graph);\n\n // Restore the parent context containing this blank node\n const empty = this._predicate === null;\n this._restoreContext('blank', token);\n // If the blank node was the object, restore previous context and read punctuation\n if (this._object !== null)\n return this._getContextEndReader();\n // If the blank node was the predicate, continue reading the object\n else if (this._predicate !== null)\n return this._readObject;\n // If the blank node was the subject, continue reading the predicate\n else\n // If the blank node was empty, it could be a named graph label\n return empty ? this._readPredicateOrNamedGraph : this._readPredicateAfterBlank;\n }\n\n // ### `_readPredicateAfterBlank` reads a predicate after an anonymous blank node\n _readPredicateAfterBlank(token) {\n switch (token.type) {\n case '.':\n case '}':\n // No predicate is coming if the triple is terminated here\n this._subject = null;\n return this._readPunctuation(token);\n default:\n return this._readPredicate(token);\n }\n }\n\n // ### `_readListItem` reads items from a list\n _readListItem(token) {\n let item = null, // The item of the list\n list = null, // The list itself\n next = this._readListItem; // The next function to execute\n const previousList = this._subject, // The previous list that contains this list\n stack = this._contextStack, // The stack of parent contexts\n parent = stack[stack.length - 1]; // The parent containing the current list\n\n switch (token.type) {\n case '[':\n // Stack the current list quad and start a new quad with a blank node as subject\n this._saveContext('blank', this._graph,\n list = this._factory.blankNode(), this.RDF_FIRST,\n this._subject = item = this._factory.blankNode());\n next = this._readBlankNodeHead;\n break;\n case '(':\n // Stack the current list quad and start a new list\n this._saveContext('list', this._graph,\n list = this._factory.blankNode(), this.RDF_FIRST, this.RDF_NIL);\n this._subject = null;\n break;\n case ')':\n // Closing the list; restore the parent context\n this._restoreContext('list', token);\n // If this list is contained within a parent list, return the membership quad here.\n // This will be `<parent list element> rdf:first <this list>.`.\n if (stack.length !== 0 && stack[stack.length - 1].type === 'list')\n this._emit(this._subject, this._predicate, this._object, this._graph);\n // Was this list the parent's subject?\n if (this._predicate === null) {\n // The next token is the predicate\n next = this._readPredicate;\n // No list tail if this was an empty list\n if (this._subject === this.RDF_NIL)\n return next;\n }\n // The list was in the parent context's object\n else {\n next = this._getContextEndReader();\n // No list tail if this was an empty list\n if (this._object === this.RDF_NIL)\n return next;\n }\n // Close the list by making the head nil\n list = this.RDF_NIL;\n break;\n case 'literal':\n // Regular literal, can still get a datatype or language\n if (token.prefix.length === 0) {\n this._literalValue = token.value;\n next = this._readListItemDataTypeOrLang;\n }\n // Pre-datatyped string literal (prefix stores the datatype)\n else {\n item = this._factory.literal(token.value, this._factory.namedNode(token.prefix));\n next = this._getContextEndReader();\n }\n break;\n case '{':\n // Start a new formula\n if (!this._n3Mode)\n return this._error('Unexpected graph', token);\n this._saveContext('formula', this._graph, this._subject, this._predicate,\n this._graph = this._factory.blankNode());\n return this._readSubject;\n default:\n if ((item = this._readEntity(token)) === undefined)\n return;\n }\n\n // Create a new blank node if no item head was assigned yet\n if (list === null)\n this._subject = list = this._factory.blankNode();\n\n // Is this the first element of the list?\n if (previousList === null) {\n // This list is either the subject or the object of its parent\n if (parent.predicate === null)\n parent.subject = list;\n else\n parent.object = list;\n }\n else {\n // Continue the previous list with the current list\n this._emit(previousList, this.RDF_REST, list, this._graph);\n }\n // If an item was read, add it to the list\n if (item !== null) {\n // In N3 mode, the item might be a path\n if (this._n3Mode && (token.type === 'IRI' || token.type === 'prefixed')) {\n // Create a new context to add the item's path\n this._saveContext('item', this._graph, list, this.RDF_FIRST, item);\n this._subject = item, this._predicate = null;\n // _readPath will restore the context and output the item\n return this._getPathReader(this._readListItem);\n }\n // Output the item\n this._emit(list, this.RDF_FIRST, item, this._graph);\n }\n return next;\n }\n\n // ### `_readDataTypeOrLang` reads an _optional_ datatype or language\n _readDataTypeOrLang(token) {\n return this._completeObjectLiteral(token, false);\n }\n\n\n // ### `_readListItemDataTypeOrLang` reads an _optional_ datatype or language in a list\n _readListItemDataTypeOrLang(token) {\n return this._completeObjectLiteral(token, true);\n }\n\n // ### `_completeLiteral` completes a literal with an optional datatype or language\n _completeLiteral(token) {\n // Create a simple string literal by default\n let literal = this._factory.literal(this._literalValue);\n\n switch (token.type) {\n // Create a datatyped literal\n case 'type':\n case 'typeIRI':\n const datatype = this._readEntity(token);\n if (datatype === undefined) return; // No datatype means an error occurred\n literal = this._factory.literal(this._literalValue, datatype);\n token = null;\n break;\n // Create a language-tagged string\n case 'langcode':\n literal = this._factory.literal(this._literalValue, token.value);\n token = null;\n break;\n }\n\n return { token, literal };\n }\n\n // Completes a literal in subject position\n _completeSubjectLiteral(token) {\n this._subject = this._completeLiteral(token).literal;\n return this._readPredicateOrNamedGraph;\n }\n\n // Completes a literal in object position\n _completeObjectLiteral(token, listItem) {\n const completed = this._completeLiteral(token);\n if (!completed)\n return;\n this._object = completed.literal;\n\n // If this literal was part of a list, write the item\n // (we could also check the context stack, but passing in a flag is faster)\n if (listItem)\n this._emit(this._subject, this.RDF_FIRST, this._object, this._graph);\n // If the token was consumed, continue with the rest of the input\n if (completed.token === null)\n return this._getContextEndReader();\n // Otherwise, consume the token now\n else {\n this._readCallback = this._getContextEndReader();\n return this._readCallback(completed.token);\n }\n }\n\n // ### `_readFormulaTail` reads the end of a formula\n _readFormulaTail(token) {\n if (token.type !== '}')\n return this._readPunctuation(token);\n\n // Store the last quad of the formula\n if (this._subject !== null)\n this._emit(this._subject, this._predicate, this._object, this._graph);\n\n // Restore the parent context containing this formula\n this._restoreContext('formula', token);\n // If the formula was the subject, continue reading the predicate.\n // If the formula was the object, read punctuation.\n return this._object === null ? this._readPredicate : this._getContextEndReader();\n }\n\n // ### `_readPunctuation` reads punctuation between quads or quad parts\n _readPunctuation(token) {\n let next, graph = this._graph;\n const subject = this._subject, inversePredicate = this._inversePredicate;\n switch (token.type) {\n // A closing brace ends a graph\n case '}':\n if (this._graph === null)\n return this._error('Unexpected graph closing', token);\n if (this._n3Mode)\n return this._readFormulaTail(token);\n this._graph = null;\n // A dot just ends the statement, without sharing anything with the next\n case '.':\n this._subject = null;\n next = this._contextStack.length ? this._readSubject : this._readInTopContext;\n if (inversePredicate) this._inversePredicate = false;\n break;\n // Semicolon means the subject is shared; predicate and object are different\n case ';':\n next = this._readPredicate;\n break;\n // Comma means both the subject and predicate are shared; the object is different\n case ',':\n next = this._readObject;\n break;\n // {| means that the current triple is annotated with predicate-object pairs.\n case '{|':\n if (!this._supportsRDFStar)\n return this._error('Unexpected RDF-star syntax', token);\n // Continue using the last triple as quoted triple subject for the predicate-object pairs.\n const predicate = this._predicate, object = this._object;\n this._subject = this._factory.quad(subject, predicate, object, this.DEFAULTGRAPH);\n next = this._readPredicate;\n break;\n // |} means that the current quoted triple in annotation syntax is finalized.\n case '|}':\n if (this._subject.termType !== 'Quad')\n return this._error('Unexpected asserted triple closing', token);\n this._subject = null;\n next = this._readPunctuation;\n break;\n default:\n // An entity means this is a quad (only allowed if not already inside a graph)\n if (this._supportsQuads && this._graph === null && (graph = this._readEntity(token)) !== undefined) {\n next = this._readQuadPunctuation;\n break;\n }\n return this._error(`Expected punctuation to follow \"${this._object.id}\"`, token);\n }\n // A quad has been completed now, so return it\n if (subject !== null) {\n const predicate = this._predicate, object = this._object;\n if (!inversePredicate)\n this._emit(subject, predicate, object, graph);\n else\n this._emit(object, predicate, subject, graph);\n }\n return next;\n }\n\n // ### `_readBlankNodePunctuation` reads punctuation in a blank node\n _readBlankNodePunctuation(token) {\n let next;\n switch (token.type) {\n // Semicolon means the subject is shared; predicate and object are different\n case ';':\n next = this._readPredicate;\n break;\n // Comma means both the subject and predicate are shared; the object is different\n case ',':\n next = this._readObject;\n break;\n default:\n return this._error(`Expected punctuation to follow \"${this._object.id}\"`, token);\n }\n // A quad has been completed now, so return it\n this._emit(this._subject, this._predicate, this._object, this._graph);\n return next;\n }\n\n // ### `_readQuadPunctuation` reads punctuation after a quad\n _readQuadPunctuation(token) {\n if (token.type !== '.')\n return this._error('Expected dot to follow quad', token);\n return this._readInTopContext;\n }\n\n // ### `_readPrefix` reads the prefix of a prefix declaration\n _readPrefix(token) {\n if (token.type !== 'prefix')\n return this._error('Expected prefix to follow @prefix', token);\n this._prefix = token.value;\n return this._readPrefixIRI;\n }\n\n // ### `_readPrefixIRI` reads the IRI of a prefix declaration\n _readPrefixIRI(token) {\n if (token.type !== 'IRI')\n return this._error(`Expected IRI to follow prefix \"${this._prefix}:\"`, token);\n const prefixNode = this._readEntity(token);\n this._prefixes[this._prefix] = prefixNode.value;\n this._prefixCallback(this._prefix, prefixNode);\n return this._readDeclarationPunctuation;\n }\n\n // ### `_readBaseIRI` reads the IRI of a base declaration\n _readBaseIRI(token) {\n const iri = token.type === 'IRI' && this._resolveIRI(token.value);\n if (!iri)\n return this._error('Expected valid IRI to follow base declaration', token);\n this._setBase(iri);\n return this._readDeclarationPunctuation;\n }\n\n // ### `_readNamedGraphLabel` reads the label of a named graph\n _readNamedGraphLabel(token) {\n switch (token.type) {\n case 'IRI':\n case 'blank':\n case 'prefixed':\n return this._readSubject(token), this._readGraph;\n case '[':\n return this._readNamedGraphBlankLabel;\n default:\n return this._error('Invalid graph label', token);\n }\n }\n\n // ### `_readNamedGraphLabel` reads a blank node label of a named graph\n _readNamedGraphBlankLabel(token) {\n if (token.type !== ']')\n return this._error('Invalid graph label', token);\n this._subject = this._factory.blankNode();\n return this._readGraph;\n }\n\n // ### `_readDeclarationPunctuation` reads the punctuation of a declaration\n _readDeclarationPunctuation(token) {\n // SPARQL-style declarations don't have punctuation\n if (this._sparqlStyle) {\n this._sparqlStyle = false;\n return this._readInTopContext(token);\n }\n\n if (token.type !== '.')\n return this._error('Expected declaration to end with a dot', token);\n return this._readInTopContext;\n }\n\n // Reads a list of quantified symbols from a @forSome or @forAll statement\n _readQuantifierList(token) {\n let entity;\n switch (token.type) {\n case 'IRI':\n case 'prefixed':\n if ((entity = this._readEntity(token, true)) !== undefined)\n break;\n default:\n return this._error(`Unexpected ${token.type}`, token);\n }\n // Without explicit quantifiers, map entities to a quantified entity\n if (!this._explicitQuantifiers)\n this._quantified[entity.id] = this._factory[this._quantifier](this._factory.blankNode().value);\n // With explicit quantifiers, output the reified quantifier\n else {\n // If this is the first item, start a new quantifier list\n if (this._subject === null)\n this._emit(this._graph || this.DEFAULTGRAPH, this._predicate,\n this._subject = this._factory.blankNode(), this.QUANTIFIERS_GRAPH);\n // Otherwise, continue the previous list\n else\n this._emit(this._subject, this.RDF_REST,\n this._subject = this._factory.blankNode(), this.QUANTIFIERS_GRAPH);\n // Output the list item\n this._emit(this._subject, this.RDF_FIRST, entity, this.QUANTIFIERS_GRAPH);\n }\n return this._readQuantifierPunctuation;\n }\n\n // Reads punctuation from a @forSome or @forAll statement\n _readQuantifierPunctuation(token) {\n // Read more quantifiers\n if (token.type === ',')\n return this._readQuantifierList;\n // End of the quantifier list\n else {\n // With explicit quantifiers, close the quantifier list\n if (this._explicitQuantifiers) {\n this._emit(this._subject, this.RDF_REST, this.RDF_NIL, this.QUANTIFIERS_GRAPH);\n this._subject = null;\n }\n // Read a dot\n this._readCallback = this._getContextEndReader();\n return this._readCallback(token);\n }\n }\n\n // ### `_getPathReader` reads a potential path and then resumes with the given function\n _getPathReader(afterPath) {\n this._afterPath = afterPath;\n return this._readPath;\n }\n\n // ### `_readPath` reads a potential path\n _readPath(token) {\n switch (token.type) {\n // Forward path\n case '!': return this._readForwardPath;\n // Backward path\n case '^': return this._readBackwardPath;\n // Not a path; resume reading where we left off\n default:\n const stack = this._contextStack, parent = stack.length && stack[stack.length - 1];\n // If we were reading a list item, we still need to output it\n if (parent && parent.type === 'item') {\n // The list item is the remaining subejct after reading the path\n const item = this._subject;\n // Switch back to the context of the list\n this._restoreContext('item', token);\n // Output the list item\n this._emit(this._subject, this.RDF_FIRST, item, this._graph);\n }\n return this._afterPath(token);\n }\n }\n\n // ### `_readForwardPath` reads a '!' path\n _readForwardPath(token) {\n let subject, predicate;\n const object = this._factory.blankNode();\n // The next token is the predicate\n if ((predicate = this._readEntity(token)) === undefined)\n return;\n // If we were reading a subject, replace the subject by the path's object\n if (this._predicate === null)\n subject = this._subject, this._subject = object;\n // If we were reading an object, replace the subject by the path's object\n else\n subject = this._object, this._object = object;\n // Emit the path's current quad and read its next section\n this._emit(subject, predicate, object, this._graph);\n return this._readPath;\n }\n\n // ### `_readBackwardPath` reads a '^' path\n _readBackwardPath(token) {\n const subject = this._factory.blankNode();\n let predicate, object;\n // The next token is the predicate\n if ((predicate = this._readEntity(token)) === undefined)\n return;\n // If we were reading a subject, replace the subject by the path's subject\n if (this._predicate === null)\n object = this._subject, this._subject = subject;\n // If we were reading an object, replace the subject by the path's subject\n else\n object = this._object, this._object = subject;\n // Emit the path's current quad and read its next section\n this._emit(subject, predicate, object, this._graph);\n return this._readPath;\n }\n\n // ### `_readRDFStarTailOrGraph` reads the graph of a nested RDF-star quad or the end of a nested RDF-star triple\n _readRDFStarTailOrGraph(token) {\n if (token.type !== '>>') {\n // An entity means this is a quad (only allowed if not already inside a graph)\n if (this._supportsQuads && this._graph === null && (this._graph = this._readEntity(token)) !== undefined)\n return this._readRDFStarTail;\n return this._error(`Expected >> to follow \"${this._object.id}\"`, token);\n }\n return this._readRDFStarTail(token);\n }\n\n // ### `_readRDFStarTail` reads the end of a nested RDF-star triple\n _readRDFStarTail(token) {\n if (token.type !== '>>')\n return this._error(`Expected >> but got ${token.type}`, token);\n // Read the quad and restore the previous context\n const quad = this._factory.quad(this._subject, this._predicate, this._object,\n this._graph || this.DEFAULTGRAPH);\n this._restoreContext('<<', token);\n // If the triple was the subject, continue by reading the predicate.\n if (this._subject === null) {\n this._subject = quad;\n return this._readPredicate;\n }\n // If the triple was the object, read context end.\n else {\n this._object = quad;\n return this._getContextEndReader();\n }\n }\n\n // ### `_getContextEndReader` gets the next reader function at the end of a context\n _getContextEndReader() {\n const contextStack = this._contextStack;\n if (!contextStack.length)\n return this._readPunctuation;\n\n switch (contextStack[contextStack.length - 1].type) {\n case 'blank':\n return this._readBlankNodeTail;\n case 'list':\n return this._readListItem;\n case 'formula':\n return this._readFormulaTail;\n case '<<':\n return this._readRDFStarTailOrGraph;\n }\n }\n\n // ### `_emit` sends a quad through the callback\n _emit(subject, predicate, object, graph) {\n this._callback(null, this._factory.quad(subject, predicate, object, graph || this.DEFAULTGRAPH));\n }\n\n // ### `_error` emits an error message through the callback\n _error(message, token) {\n const err = new Error(`${message} on line ${token.line}.`);\n err.context = {\n token: token,\n line: token.line,\n previousToken: this._lexer.previousToken,\n };\n this._callback(err);\n this._callback = noop;\n }\n\n // ### `_resolveIRI` resolves an IRI against the base path\n _resolveIRI(iri) {\n return /^[a-z][a-z0-9+.-]*:/i.test(iri) ? iri : this._resolveRelativeIRI(iri);\n }\n\n // ### `_resolveRelativeIRI` resolves an IRI against the base path,\n // assuming that a base path has been set and that the IRI is indeed relative\n _resolveRelativeIRI(iri) {\n // An empty relative IRI indicates the base IRI\n if (!iri.length)\n return this._base;\n // Decide resolving strategy based in the first character\n switch (iri[0]) {\n // Resolve relative fragment IRIs against the base IRI\n case '#': return this._base + iri;\n // Resolve relative query string IRIs by replacing the query string\n case '?': return this._base.replace(/(?:\\?.*)?$/, iri);\n // Resolve root-relative IRIs at the root of the base IRI\n case '/':\n // Resolve scheme-relative IRIs to the scheme\n return (iri[1] === '/' ? this._baseScheme : this._baseRoot) + this._removeDotSegments(iri);\n // Resolve all other IRIs at the base IRI's path\n default:\n // Relative IRIs cannot contain a colon in the first path segment\n return (/^[^/:]*:/.test(iri)) ? null : this._removeDotSegments(this._basePath + iri);\n }\n }\n\n // ### `_removeDotSegments` resolves './' and '../' path segments in an IRI as per RFC3986\n _removeDotSegments(iri) {\n // Don't modify the IRI if it does not contain any dot segments\n if (!/(^|\\/)\\.\\.?($|[/#?])/.test(iri))\n return iri;\n\n // Start with an imaginary slash before the IRI in order to resolve trailing './' and '../'\n const length = iri.length;\n let result = '', i = -1, pathStart = -1, segmentStart = 0, next = '/';\n\n while (i < length) {\n switch (next) {\n // The path starts with the first slash after the authority\n case ':':\n if (pathStart < 0) {\n // Skip two slashes before the authority\n if (iri[++i] === '/' && iri[++i] === '/')\n // Skip to slash after the authority\n while ((pathStart = i + 1) < length && iri[pathStart] !== '/')\n i = pathStart;\n }\n break;\n // Don't modify a query string or fragment\n case '?':\n case '#':\n i = length;\n break;\n // Handle '/.' or '/..' path segments\n case '/':\n if (iri[i + 1] === '.') {\n next = iri[++i + 1];\n switch (next) {\n // Remove a '/.' segment\n case '/':\n result += iri.substring(segmentStart, i - 1);\n segmentStart = i + 1;\n break;\n // Remove a trailing '/.' segment\n case undefined:\n case '?':\n case '#':\n return result + iri.substring(segmentStart, i) + iri.substr(i + 1);\n // Remove a '/..' segment\n case '.':\n next = iri[++i + 1];\n if (next === undefined || next === '/' || next === '?' || next === '#') {\n result += iri.substring(segmentStart, i - 2);\n // Try to remove the parent path from result\n if ((segmentStart = result.lastIndexOf('/')) >= pathStart)\n result = result.substr(0, segmentStart);\n // Remove a trailing '/..' segment\n if (next !== '/')\n return `${result}/${iri.substr(i + 1)}`;\n segmentStart = i + 1;\n }\n }\n }\n }\n next = iri[++i];\n }\n return result + iri.substring(segmentStart);\n }\n\n // ## Public methods\n\n // ### `parse` parses the N3 input and emits each parsed quad through the onQuad callback.\n parse(input, quadCallback, prefixCallback) {\n // The second parameter accepts an object { onQuad: ..., onPrefix: ..., onComment: ...}\n // As a second and third parameter it still accepts a separate quadCallback and prefixCallback for backward compatibility as well\n let onQuad, onPrefix, onComment;\n if (quadCallback && (quadCallback.onQuad || quadCallback.onPrefix || quadCallback.onComment)) {\n onQuad = quadCallback.onQuad;\n onPrefix = quadCallback.onPrefix;\n onComment = quadCallback.onComment;\n }\n else {\n onQuad = quadCallback;\n onPrefix = prefixCallback;\n }\n // The read callback is the next function to be executed when a token arrives.\n // We start reading in the top context.\n this._readCallback = this._readInTopContext;\n this._sparqlStyle = false;\n this._prefixes = Object.create(null);\n this._prefixes._ = this._blankNodePrefix ? this._blankNodePrefix.substr(2)\n : `b${blankNodePrefix++}_`;\n this._prefixCallback = onPrefix || noop;\n this._inversePredicate = false;\n this._quantified = Object.create(null);\n\n // Parse synchronously if no quad callback is given\n if (!onQuad) {\n const quads = [];\n let error;\n this._callback = (e, t) => { e ? (error = e) : t && quads.push(t); };\n this._lexer.tokenize(input).every(token => {\n return this._readCallback = this._readCallback(token);\n });\n if (error) throw error;\n return quads;\n }\n\n let processNextToken = (error, token) => {\n if (error !== null)\n this._callback(error), this._callback = noop;\n else if (this._readCallback)\n this._readCallback = this._readCallback(token);\n };\n\n // Enable checking for comments on every token when a commentCallback has been set\n if (onComment) {\n // Enable the lexer to return comments as tokens first (disabled by default)\n this._lexer.comments = true;\n // Patch the processNextToken function\n processNextToken = (error, token) => {\n if (error !== null)\n this._callback(error), this._callback = noop;\n else if (this._readCallback) {\n if (token.type === 'comment')\n onComment(token.value);\n else\n this._readCallback = this._readCallback(token);\n }\n };\n }\n\n // Parse asynchronously otherwise, executing the read callback when a token arrives\n this._callback = onQuad;\n this._lexer.tokenize(input, processNextToken);\n }\n}\n\n// The empty function\nfunction noop() {}\n\n// Initializes the parser with the given data factory\nfunction initDataFactory(parser, factory) {\n parser._factory = factory;\n\n parser.DEFAULTGRAPH = factory.defaultGraph();\n\n // Set common named nodes\n parser.RDF_FIRST = factory.namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_2__[\"default\"].rdf.first);\n parser.RDF_REST = factory.namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_2__[\"default\"].rdf.rest);\n parser.RDF_NIL = factory.namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_2__[\"default\"].rdf.nil);\n parser.N3_FORALL = factory.namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_2__[\"default\"].r.forAll);\n parser.N3_FORSOME = factory.namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_2__[\"default\"].r.forSome);\n parser.ABBREVIATIONS = {\n 'a': factory.namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_2__[\"default\"].rdf.type),\n '=': factory.namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_2__[\"default\"].owl.sameAs),\n '>': factory.namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_2__[\"default\"].log.implies),\n '<': factory.namedNode(_IRIs__WEBPACK_IMPORTED_MODULE_2__[\"default\"].log.isImpliedBy),\n };\n parser.QUANTIFIERS_GRAPH = factory.namedNode('urn:n3:quantifiers');\n}\ninitDataFactory(N3Parser.prototype, _N3DataFactory__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/rdflib/node_modules/n3/src/N3Parser.js?\n}");
655
1320
 
656
1321
  /***/ },
657
1322
 
@@ -993,6 +1658,16 @@ eval("{/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/ope
993
1658
 
994
1659
  /***/ },
995
1660
 
1661
+ /***/ "./node_modules/solid-namespace/index.js"
1662
+ /*!***********************************************!*\
1663
+ !*** ./node_modules/solid-namespace/index.js ***!
1664
+ \***********************************************/
1665
+ (module) {
1666
+
1667
+ eval("{/**\n * Provides a way to access commonly used namespaces\n *\n * Usage:\n *\n * ```\n * const $rdf = require('rdflib'); //or any other RDF/JS-compatible library\n * const ns = require('solid-namespace')($rdf);\n * const store = $rdf.graph();\n *\n * let me = ...;\n * let name = store.any(me, ns.vcard(‘fn’)) || store.any(me, ns.foaf(‘name’));\n * ```\n * @module vocab\n */\nconst aliases = {\n acl: 'http://www.w3.org/ns/auth/acl#',\n arg: 'http://www.w3.org/ns/pim/arg#',\n as: 'https://www.w3.org/ns/activitystreams#',\n bookmark: 'http://www.w3.org/2002/01/bookmark#',\n cal: 'http://www.w3.org/2002/12/cal/ical#',\n cco: 'http://www.ontologyrepository.com/CommonCoreOntologies/',\n cert: 'http://www.w3.org/ns/auth/cert#',\n contact: 'http://www.w3.org/2000/10/swap/pim/contact#',\n dc: 'http://purl.org/dc/elements/1.1/',\n dct: 'http://purl.org/dc/terms/',\n doap: 'http://usefulinc.com/ns/doap#',\n foaf: 'http://xmlns.com/foaf/0.1/',\n geo: 'http://www.w3.org/2003/01/geo/wgs84_pos#',\n gpx: 'http://www.w3.org/ns/pim/gpx#',\n gr: 'http://purl.org/goodrelations/v1#',\n http: 'http://www.w3.org/2007/ont/http#',\n httph: 'http://www.w3.org/2007/ont/httph#',\n icalTZ: 'http://www.w3.org/2002/12/cal/icaltzd#', // Beware: not cal:\n ldp: 'http://www.w3.org/ns/ldp#',\n link: 'http://www.w3.org/2007/ont/link#',\n log: 'http://www.w3.org/2000/10/swap/log#',\n meeting: 'http://www.w3.org/ns/pim/meeting#',\n mo: 'http://purl.org/ontology/mo/',\n org: 'http://www.w3.org/ns/org#',\n owl: 'http://www.w3.org/2002/07/owl#',\n pad: 'http://www.w3.org/ns/pim/pad#',\n patch: 'http://www.w3.org/ns/pim/patch#',\n prov: 'http://www.w3.org/ns/prov#',\n pto: 'http://www.productontology.org/id/',\n qu: 'http://www.w3.org/2000/10/swap/pim/qif#',\n trip: 'http://www.w3.org/ns/pim/trip#',\n rdf: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#',\n rdfs: 'http://www.w3.org/2000/01/rdf-schema#',\n rss: 'http://purl.org/rss/1.0/',\n sched: 'http://www.w3.org/ns/pim/schedule#',\n schema: 'http://schema.org/', // @@ beware confusion with documents no 303\n sioc: 'http://rdfs.org/sioc/ns#',\n skos: 'http://www.w3.org/2004/02/skos/core#',\n solid: 'http://www.w3.org/ns/solid/terms#',\n space: 'http://www.w3.org/ns/pim/space#',\n stat: 'http://www.w3.org/ns/posix/stat#',\n tab: 'http://www.w3.org/2007/ont/link#',\n tabont: 'http://www.w3.org/2007/ont/link#',\n ui: 'http://www.w3.org/ns/ui#',\n vann: 'http://purl.org/vocab/vann/',\n vcard: 'http://www.w3.org/2006/vcard/ns#',\n wf: 'http://www.w3.org/2005/01/wf/flow#',\n xsd: 'http://www.w3.org/2001/XMLSchema#',\n}\n\n/**\n * @param [rdflib] {RDF} Optional RDF Library (such as rdflib.js or rdf-ext) to inject\n */\nfunction vocab (rdf = { namedNode: u => u }) {\n const namespaces = {}\n for (const alias in aliases) {\n const expansion = aliases[alias]\n namespaces[alias] = function (localName = '') {\n return rdf.namedNode(expansion + localName)\n }\n };\n\n return namespaces\n};\n\nmodule.exports = vocab\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./node_modules/solid-namespace/index.js?\n}");
1668
+
1669
+ /***/ },
1670
+
996
1671
  /***/ "./node_modules/string_decoder/lib/string_decoder.js"
997
1672
  /*!***********************************************************!*\
998
1673
  !*** ./node_modules/string_decoder/lib/string_decoder.js ***!
@@ -1407,7 +2082,7 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexp
1407
2082
  (__unused_webpack_module, exports, __webpack_require__) {
1408
2083
 
1409
2084
  "use strict";
1410
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Store = exports.TripleNotFoundError = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.mjs\");\nconst n3 = tslib_1.__importStar(__webpack_require__(/*! n3 */ \"./node_modules/n3/src/index.js\"));\nconst src = tslib_1.__importStar(__webpack_require__(/*! ../ontologies/src */ \"./src/ontologies/src.ts\"));\nconst rdf_stores_1 = __webpack_require__(/*! rdf-stores */ \"./node_modules/rdf-stores/index.js\");\nconst ontologies_1 = __webpack_require__(/*! ../ontologies */ \"./src/ontologies/index.ts\");\nconst ontologies_2 = __webpack_require__(/*! ../ontologies */ \"./src/ontologies/index.ts\");\nconst rdfxml_streaming_parser_1 = __webpack_require__(/*! rdfxml-streaming-parser */ \"./node_modules/rdfxml-streaming-parser/index.js\");\nconst { namedNode, blankNode, quad } = n3.DataFactory;\n/**\n * Indicates an error when a triple is not found in the store.\n */\nclass TripleNotFoundError extends Error {\n /**\n * Create a new instance of the error.\n * @param message The error message.\n */\n constructor(subject, predicate, object) {\n super(`No triple was found matching the pattern: ${subject} ${predicate} ${object}`);\n this.name = \"TripleNotFoundError\";\n }\n}\nexports.TripleNotFoundError = TripleNotFoundError;\n/*\n * A store for RDF triples with support for reasoning.\n */\nclass Store {\n /**\n * Get the number of triples in all graphs of the store.\n */\n get size() {\n return this._ds.size;\n }\n /**\n * Create a new RDF triple store.\n * @param reasoner The reasoner to be used for inference.\n */\n constructor(reasoner) {\n /**\n * The adapted RDF.js triple store implementation.\n *\n * Note: Please do not use this directly, but rather use the `_ds` property to access the dataset.\n */\n this._store = rdf_stores_1.RdfStore.createDefault();\n /**\n * The RDF dataset containing the triples in the store, which should primarily be used\n * for any operations so that the store can be swapped out with a different implementation.\n */\n this._ds = this._store.asDataset();\n this.reasoner = reasoner;\n }\n [Symbol.iterator]() {\n return this._ds[Symbol.iterator]();\n }\n /**\n * Loads a set of W3C Standard ontologies into the store (RDF, RDFA, RDFS, OWL, SKOS, SHACL, XSD).\n */\n async loadFrameworkOntologies() {\n await this.loadFromTurtleStream(src.rdf, ontologies_2._RDF);\n await this.loadFromTurtleStream(src.rdfa, ontologies_2._RDFA);\n await this.loadFromTurtleStream(src.rdfs, ontologies_2._RDFS);\n await this.loadFromTurtleStream(src.owl, ontologies_2._OWL);\n await this.loadFromTurtleStream(src.sh, ontologies_2._SH);\n await this.loadFromTurtleStream(src.skos, ontologies_2._SKOS);\n await this.loadFromTurtleStream(src.xsd, ontologies_2._XSD);\n }\n /**\n * Add a quad to the store. Existing quads with the same subject, predicate, object, and graph will be ignored.\n * @param quad The quad to be added.\n * @returns The store instance.\n */\n add(quad) {\n this._ds.add(quad);\n return this;\n }\n /**\n * Delete a quad from the store.\n * @param quad The quad to be deleted.\n * @returns The store instance.\n */\n delete(quad) {\n this._ds.delete(quad);\n return this;\n }\n /**\n * Indicates if the store contains a specific quad.\n * @param quad The quad to be checked.\n * @returns `true` if the quad is found in the store, `false` otherwise.\n */\n has(quad) {\n return this._ds.has(quad);\n }\n /**\n * Get the URIs of the graphs in the triple store.\n * @returns An array of graph URIs in no particular order.\n */\n getGraphs() {\n const result = new Set();\n for (const q of this._ds.match(null, null, null, null)) {\n result.add(q.graph.value);\n }\n return Array.from(result);\n }\n /**\n * Load a set of triples into the store.\n * @param quads An array of quads to be loaded into the store.\n * @param graphUri The target graph URI.\n * @param executeInference Indicates if inference should be executed after loading the triples.\n * @param clearGraph Indicates if the graph should be cleared before loading.\n * @param onQuad A callback function that will be called for each parsed triple.\n */\n _loadQuads(quads, graphUri, executeInference = true, clearGraph = true, onQuad) {\n const graph = namedNode(graphUri.replace('\\\\', '\\/'));\n // Only clear the graph once if there had been no errors.\n if (clearGraph) {\n // Note: Using the match method to clear the graph results in an error because the graph is being modified.\n this.deleteGraphs([graphUri]);\n if (this.reasoner) {\n const inferenceGraph = namedNode(this.reasoner.targetUriGenerator.getGraphUri(graphUri));\n this.deleteGraphs([inferenceGraph.value]);\n }\n }\n for (let q of quads) {\n this._ds.add(quad(q.subject, q.predicate, q.object, graph));\n if (onQuad) {\n onQuad(q);\n }\n }\n if (this.reasoner && executeInference) {\n this.reasoner.expand(this._ds, graphUri);\n }\n }\n /**\n * Create an RDF store from N3, Turtle or N-Triples data.\n * @param input Input data or stream in to be parsed.\n * @param graphUri URI of the graph to in which the triples will be created.\n * @param executeInference Indicates if inference should be executed after loading the triples.\n * @param clearGraph Indicates if the graph should be cleared before loading.\n * @param onQuad Callback function that will be called for each parsed triple.\n * @returns A promise that resolves to an RDF store.\n */\n async loadFromTurtleStream(input, graphUri, executeInference = true, clearGraph = true, onQuad) {\n return new Promise((resolve, reject) => {\n let quads = [];\n new n3.Parser({}).parse(input, (error, quad, done) => {\n if (error) {\n reject(error);\n }\n else if (quad) {\n quads.push(quad);\n }\n else if (done) {\n this._loadQuads(quads, graphUri, executeInference, clearGraph, onQuad);\n resolve(this);\n }\n });\n });\n }\n /**\n * Create an RDF store from RDF/XML data.\n * @param input Input data or stream format to be parsed.\n * @param graphUri URI of the graph to in which the triples will be created.\n * @param executeInference Indicates if inference should be executed after loading the triples.\n * @param clearGraph Indicates if the graph should be cleared before loading.\n * @param onQuad Callback function that will be called for each parsed triple.\n * @returns A promise that resolves to an RDF store.\n */\n async loadFromXmlStream(input, graphUri, executeInference = true, clearGraph = true, onQuad) {\n return new Promise((resolve, reject) => {\n let quads = [];\n const parser = new rdfxml_streaming_parser_1.RdfXmlParser();\n if (typeof input === 'string') {\n parser.on('error', (error) => reject(error));\n parser.on('data', (quad) => quads.push(quad));\n parser.on('end', () => {\n this._loadQuads(quads, graphUri, executeInference, clearGraph, onQuad);\n resolve(this);\n });\n parser.write(input);\n parser.end();\n }\n else {\n parser.import(input)\n .on('error', (error) => reject(error))\n .on('data', (quad) => quads.push(quad))\n .on('end', () => {\n this._loadQuads(quads, graphUri, executeInference, clearGraph, onQuad);\n resolve(this);\n });\n }\n });\n }\n /**\n * Write the triples in the store into a string in Turtle format.\n * @param graphUri A graph URI.\n * @returns A string serialization of the triples in the graph in Turtle format.\n */\n async serializeGraph(graphUri, prefixes, format) {\n return new Promise((resolve, reject) => {\n const writer = new n3.Writer({\n format: format || 'Turtle',\n prefixes: prefixes\n });\n for (let q of this._ds.match(null, null, null, namedNode(graphUri))) {\n writer.addQuad(q.subject, q.predicate, q.object);\n }\n writer.end((error, result) => {\n if (error) {\n reject(error);\n }\n else {\n resolve(result);\n }\n });\n });\n }\n /**\n * Indicates if the store contains triples in a given graph.\n * @param graphUri A graph URI.\n * @returns `true` if the store contains triples in the graph URI, `false` otherwise.\n */\n hasGraph(graphUri) {\n const uri = typeof graphUri === 'string' ? namedNode(graphUri) : graphUri;\n for (const _ of this._ds.match(null, null, null, uri)) {\n return true;\n }\n return false;\n }\n /**\n * Apply inference to the given graph and store the triples in the associated inference graph.\n * @param graphUri A graph URI.\n */\n executeInference(graphUri) {\n if (this.reasoner) {\n this.reasoner.expand(this._ds, graphUri);\n }\n }\n /**\n * Delete named graphs from the store.\n * @param graphUris URIs of the graphs to be deleted.\n */\n deleteGraphs(graphUris) {\n for (let graphUri of graphUris) {\n const g = namedNode(graphUri);\n for (let q of this._ds.match(null, null, null, g)) {\n this._ds.delete(q);\n }\n }\n }\n /**\n * Get the URIs of ordered list members in the store.\n * @param graphUris Optional graph URI or array of graph URIs to query.\n * @param listUri URI of the list to get the items from.\n * @returns An array of URIs of the items in the list.\n */\n getListItems(graphUris, listUri) {\n // To do: Fix #10\n const list = listUri.includes(':') ? namedNode(listUri) : blankNode(listUri);\n return this._getListItems(graphUris, list).map(t => t.value);\n }\n _getListItems(graphUris, subject) {\n const first = Array.from(this.matchAll(graphUris, subject, ontologies_1.rdf.first, null));\n if (!first.length) {\n return [];\n }\n const rest = Array.from(this.matchAll(graphUris, subject, ontologies_1.rdf.rest, null));\n const firstItem = first[0].object;\n const restList = rest[0]?.object;\n if (restList.value === ontologies_1.RDF.nil) {\n return [firstItem];\n }\n else {\n const restItems = this._getListItems(graphUris, restList);\n return [firstItem, ...restItems];\n }\n }\n /**\n * Returns the exact cardinality of the quads matching the pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n countQuads(subject, predicate, object, graph) {\n return this._store.countQuads(subject, predicate, object, graph);\n }\n /**\n * Returns a stream of quads matching the given pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n * @returns A stream of matching quads.\n */\n match(subject, predicate, object, graph) {\n return this._store.match(subject, predicate, object, graph);\n }\n /**\n * Query the store for triples matching the given pattern supporting multiple graphs.\n * @param graphUris Optional graph URI or array of graph URIs to query.\n * @param subject A subject URI or null to match any subject.\n * @param predicate A predicate URI or null to match any predicate.\n * @param object An object URI or null to match any object.\n */\n *matchAll(graphUris, subject, predicate, object, includeInferred) {\n if (includeInferred && !this.reasoner) {\n throw new Error('Reasoner is not available to include inferred triples.');\n }\n const s = subject;\n const p = predicate;\n const o = object;\n if (graphUris !== undefined) {\n const graphs = Array.isArray(graphUris) ? graphUris : [graphUris];\n for (let graph of graphs.map(g => namedNode(g))) {\n for (let q of this._ds.match(s, p, o, graph)) {\n yield q;\n }\n if (includeInferred !== false && this.reasoner) {\n let inferenceGraph = namedNode(this.reasoner.targetUriGenerator.getGraphUri(graph.value));\n for (let q of this._ds.match(s, p, o, inferenceGraph)) {\n yield q;\n }\n }\n }\n }\n else {\n yield* this._ds.match(s, p, o);\n }\n }\n /**\n * Indicate if there are triples matching the given pattern in the store.\n * @param graphUris Optional graph URI or array of graph URIs to query.\n * @param subject A subject URI or null to match any subject.\n * @param predicate A predicate URI or null to match any predicate.\n * @param object An object URI or null to match any object.\n * @returns `true` if there are triples matching the pattern, `false` otherwise.\n */\n any(graphUris, subject, predicate, object, includeInferred) {\n return this.matchAll(graphUris, subject, predicate, object, includeInferred).next().done === false;\n }\n /**\n * Get the first triple matching the given pattern in the store.\n * @param graphUris Optional graph URI or array of graph URIs to query.\n * @param subject A subject URI or null to match any subject.\n * @param predicate A predicate URI or null to match any predicate.\n * @param object An object URI or null to match any object.\n * @returns The first triple that matches the pattern.\n * @throws {TripleNotFoundError} If no triple is found matching the pattern.\n */\n first(graphUris, subject, predicate, object, includeInferred) {\n const result = this.matchAll(graphUris, subject, predicate, object, includeInferred).next().value;\n if (!result) {\n throw new TripleNotFoundError(subject, predicate, object);\n }\n return result;\n }\n}\nexports.Store = Store;\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./src/rdf/store.ts?\n}");
2085
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.Store = exports.TripleNotFoundError = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.mjs\");\nconst n3 = tslib_1.__importStar(__webpack_require__(/*! n3 */ \"./node_modules/n3/src/index.js\"));\nconst src = tslib_1.__importStar(__webpack_require__(/*! ../ontologies/src */ \"./src/ontologies/src.ts\"));\nconst rdf_stores_1 = __webpack_require__(/*! rdf-stores */ \"./node_modules/rdf-stores/index.js\");\nconst ontologies_1 = __webpack_require__(/*! ../ontologies */ \"./src/ontologies/index.ts\");\nconst ontologies_2 = __webpack_require__(/*! ../ontologies */ \"./src/ontologies/index.ts\");\nconst rdfxml_streaming_parser_1 = __webpack_require__(/*! rdfxml-streaming-parser */ \"./node_modules/rdfxml-streaming-parser/index.js\");\nconst rdflib_1 = __webpack_require__(/*! rdflib */ \"./node_modules/rdflib/esm/index.js\");\nconst utils_1 = __webpack_require__(/*! ./utils */ \"./src/rdf/utils.ts\");\nconst { namedNode, blankNode, quad } = n3.DataFactory;\n/**\n * Indicates an error when a triple is not found in the store.\n */\nclass TripleNotFoundError extends Error {\n /**\n * Create a new instance of the error.\n * @param message The error message.\n */\n constructor(subject, predicate, object) {\n super(`No triple was found matching the pattern: ${subject} ${predicate} ${object}`);\n this.name = \"TripleNotFoundError\";\n }\n}\nexports.TripleNotFoundError = TripleNotFoundError;\n/*\n * A store for RDF triples with support for reasoning.\n */\nclass Store {\n /**\n * Get the number of triples in all graphs of the store.\n */\n get size() {\n return this._ds.size;\n }\n /**\n * Create a new RDF triple store.\n * @param reasoner The reasoner to be used for inference.\n */\n constructor(reasoner) {\n /**\n * The adapted RDF.js triple store implementation.\n *\n * Note: Please do not use this directly, but rather use the `_ds` property to access the dataset.\n */\n this._store = rdf_stores_1.RdfStore.createDefault();\n /**\n * The RDF dataset containing the triples in the store, which should primarily be used\n * for any operations so that the store can be swapped out with a different implementation.\n */\n this._ds = this._store.asDataset();\n this.reasoner = reasoner;\n }\n [Symbol.iterator]() {\n return this._ds[Symbol.iterator]();\n }\n /**\n * Loads a set of W3C Standard ontologies into the store (RDF, RDFA, RDFS, OWL, SKOS, SHACL, XSD).\n */\n async loadFrameworkOntologies() {\n await this.loadFromTurtleStream(src.rdf, ontologies_2._RDF);\n await this.loadFromTurtleStream(src.rdfa, ontologies_2._RDFA);\n await this.loadFromTurtleStream(src.rdfs, ontologies_2._RDFS);\n await this.loadFromTurtleStream(src.owl, ontologies_2._OWL);\n await this.loadFromTurtleStream(src.sh, ontologies_2._SH);\n await this.loadFromTurtleStream(src.skos, ontologies_2._SKOS);\n await this.loadFromTurtleStream(src.xsd, ontologies_2._XSD);\n }\n /**\n * Add a quad to the store. Existing quads with the same subject, predicate, object, and graph will be ignored.\n * @param quad The quad to be added.\n * @returns The store instance.\n */\n add(quad) {\n this._ds.add(quad);\n return this;\n }\n /**\n * Delete a quad from the store.\n * @param quad The quad to be deleted.\n * @returns The store instance.\n */\n delete(quad) {\n this._ds.delete(quad);\n return this;\n }\n /**\n * Indicates if the store contains a specific quad.\n * @param quad The quad to be checked.\n * @returns `true` if the quad is found in the store, `false` otherwise.\n */\n has(quad) {\n return this._ds.has(quad);\n }\n /**\n * Get the URIs of the graphs in the triple store.\n * @returns An array of graph URIs in no particular order.\n */\n getGraphs() {\n const result = new Set();\n for (const q of this._ds.match(null, null, null, null)) {\n result.add(q.graph.value);\n }\n return Array.from(result);\n }\n /**\n * Load a set of triples into the store.\n * @param quads An array of quads to be loaded into the store.\n * @param graphUri The target graph URI.\n * @param executeInference Indicates if inference should be executed after loading the triples.\n * @param clearGraph Indicates if the graph should be cleared before loading.\n * @param onQuad A callback function that will be called for each parsed triple.\n */\n _loadQuads(quads, graphUri, executeInference = true, clearGraph = true, onQuad) {\n const graph = namedNode(graphUri.replace('\\\\', '\\/'));\n // Only clear the graph once if there had been no errors.\n if (clearGraph) {\n // Note: Using the match method to clear the graph results in an error because the graph is being modified.\n this.deleteGraphs([graphUri]);\n if (this.reasoner) {\n const inferenceGraph = namedNode(this.reasoner.targetUriGenerator.getGraphUri(graphUri));\n this.deleteGraphs([inferenceGraph.value]);\n }\n }\n for (let q of quads) {\n this._ds.add(quad(q.subject, q.predicate, q.object, graph));\n if (onQuad) {\n onQuad(q);\n }\n }\n if (this.reasoner && executeInference) {\n this.reasoner.expand(this._ds, graphUri);\n }\n }\n /**\n * Create an RDF store from N3, Turtle or N-Triples data.\n * @param input Input data or stream in to be parsed.\n * @param graphUri URI of the graph to in which the triples will be created.\n * @param executeInference Indicates if inference should be executed after loading the triples.\n * @param clearGraph Indicates if the graph should be cleared before loading.\n * @param onQuad Callback function that will be called for each parsed triple.\n * @returns A promise that resolves to an RDF store.\n */\n async loadFromTurtleStream(input, graphUri, executeInference = true, clearGraph = true, onQuad) {\n return new Promise((resolve, reject) => {\n let quads = [];\n new n3.Parser({}).parse(input, (error, quad, done) => {\n if (error) {\n reject(error);\n }\n else if (quad) {\n quads.push(quad);\n }\n else if (done) {\n this._loadQuads(quads, graphUri, executeInference, clearGraph, onQuad);\n resolve(this);\n }\n });\n });\n }\n /**\n * Create an RDF store from RDF/XML data.\n * @param input Input data or stream format to be parsed.\n * @param graphUri URI of the graph to in which the triples will be created.\n * @param executeInference Indicates if inference should be executed after loading the triples.\n * @param clearGraph Indicates if the graph should be cleared before loading.\n * @param onQuad Callback function that will be called for each parsed triple.\n * @returns A promise that resolves to an RDF store.\n */\n async loadFromXmlStream(input, graphUri, executeInference = true, clearGraph = true, onQuad) {\n return new Promise((resolve, reject) => {\n let quads = [];\n const parser = new rdfxml_streaming_parser_1.RdfXmlParser();\n if (typeof input === 'string') {\n parser.on('error', (error) => reject(error));\n parser.on('data', (quad) => quads.push(quad));\n parser.on('end', () => {\n this._loadQuads(quads, graphUri, executeInference, clearGraph, onQuad);\n resolve(this);\n });\n parser.write(input);\n parser.end();\n }\n else {\n parser.import(input)\n .on('error', (error) => reject(error))\n .on('data', (quad) => quads.push(quad))\n .on('end', () => {\n this._loadQuads(quads, graphUri, executeInference, clearGraph, onQuad);\n resolve(this);\n });\n }\n });\n }\n /**\n * Write the triples in the store into a string in Turtle format.\n * @param sourceGraphUri A graph URI.\n * @param targetFormat Optional mime type of the serialization format (e.g., 'text/turtle').\n * @param targetGraphUri Optional target graph URI. If not provided, the source graph URI will be used for serialization formats that support quads.\n * @param prefixes Optional prefixes to be used in the serialization.\n * @returns A string serialization of the triples in the graph in the specified format.\n */\n async serializeGraph(sourceGraphUri, targetFormat = 'text/turtle', targetGraphUri, prefixes) {\n return new Promise((resolve, reject) => {\n const sourceGraph = namedNode(sourceGraphUri);\n const targetGraph = targetGraphUri ? namedNode(targetGraphUri) : undefined;\n const store = (0, rdflib_1.graph)();\n // Unfortunately the termType values of RDFJS terms are not directly compatible with rdflib.\n // For serialization, rdflib expectes a compareTerm function to sort blank nodes which does not\n // exist in the RDFJS interface or n3.Terms.\n const g = targetGraph ? (0, utils_1.toRdflibTerm)(targetGraph) : undefined;\n for (const q of this._ds.match(null, null, null, sourceGraph)) {\n const s = (0, utils_1.toRdflibTerm)(q.subject);\n const p = (0, utils_1.toRdflibTerm)(q.predicate);\n const o = (0, utils_1.toRdflibTerm)(q.object);\n store.add(s, p, o, g);\n }\n const callback = (error, result) => {\n if (error) {\n reject(error);\n }\n else {\n resolve(result ?? '');\n }\n };\n (0, rdflib_1.serialize)(null, store, null, targetFormat, callback, prefixes);\n });\n }\n /**\n * Indicates if the store contains triples in a given graph.\n * @param graphUri A graph URI.\n * @returns `true` if the store contains triples in the graph URI, `false` otherwise.\n */\n hasGraph(graphUri) {\n const uri = typeof graphUri === 'string' ? namedNode(graphUri) : graphUri;\n for (const _ of this._ds.match(null, null, null, uri)) {\n return true;\n }\n return false;\n }\n /**\n * Apply inference to the given graph and store the triples in the associated inference graph.\n * @param graphUri A graph URI.\n */\n executeInference(graphUri) {\n if (this.reasoner) {\n this.reasoner.expand(this._ds, graphUri);\n }\n }\n /**\n * Delete named graphs from the store.\n * @param graphUris URIs of the graphs to be deleted.\n */\n deleteGraphs(graphUris) {\n for (let graphUri of graphUris) {\n const g = namedNode(graphUri);\n for (let q of this._ds.match(null, null, null, g)) {\n this._ds.delete(q);\n }\n }\n }\n /**\n * Get the URIs of ordered list members in the store.\n * @param graphUris Optional graph URI or array of graph URIs to query.\n * @param listUri URI of the list to get the items from.\n * @returns An array of URIs of the items in the list.\n */\n getListItems(graphUris, listUri) {\n // To do: Fix #10\n const list = listUri.includes(':') ? namedNode(listUri) : blankNode(listUri);\n return this._getListItems(graphUris, list).map(t => t.value);\n }\n _getListItems(graphUris, subject) {\n const first = Array.from(this.matchAll(graphUris, subject, ontologies_1.rdf.first, null));\n if (!first.length) {\n return [];\n }\n const rest = Array.from(this.matchAll(graphUris, subject, ontologies_1.rdf.rest, null));\n const firstItem = first[0].object;\n const restList = rest[0]?.object;\n if (restList.value === ontologies_1.RDF.nil) {\n return [firstItem];\n }\n else {\n const restItems = this._getListItems(graphUris, restList);\n return [firstItem, ...restItems];\n }\n }\n /**\n * Returns the exact cardinality of the quads matching the pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n */\n countQuads(subject, predicate, object, graph) {\n return this._store.countQuads(subject, predicate, object, graph);\n }\n /**\n * Returns a stream of quads matching the given pattern.\n * @param subject The optional subject.\n * @param predicate The optional predicate.\n * @param object The optional object.\n * @param graph The optional graph.\n * @returns A stream of matching quads.\n */\n match(subject, predicate, object, graph) {\n return this._store.match(subject, predicate, object, graph);\n }\n /**\n * Query the store for triples matching the given pattern supporting multiple graphs.\n * @param graphUris Optional graph URI or array of graph URIs to query.\n * @param subject A subject URI or null to match any subject.\n * @param predicate A predicate URI or null to match any predicate.\n * @param object An object URI or null to match any object.\n */\n *matchAll(graphUris, subject, predicate, object, includeInferred) {\n if (includeInferred && !this.reasoner) {\n throw new Error('Reasoner is not available to include inferred triples.');\n }\n const s = subject;\n const p = predicate;\n const o = object;\n if (graphUris !== undefined) {\n const graphs = Array.isArray(graphUris) ? graphUris : [graphUris];\n for (let graph of graphs.map(g => namedNode(g))) {\n for (let q of this._ds.match(s, p, o, graph)) {\n yield q;\n }\n if (includeInferred !== false && this.reasoner) {\n let inferenceGraph = namedNode(this.reasoner.targetUriGenerator.getGraphUri(graph.value));\n for (let q of this._ds.match(s, p, o, inferenceGraph)) {\n yield q;\n }\n }\n }\n }\n else {\n yield* this._ds.match(s, p, o);\n }\n }\n /**\n * Indicate if there are triples matching the given pattern in the store.\n * @param graphUris Optional graph URI or array of graph URIs to query.\n * @param subject A subject URI or null to match any subject.\n * @param predicate A predicate URI or null to match any predicate.\n * @param object An object URI or null to match any object.\n * @returns `true` if there are triples matching the pattern, `false` otherwise.\n */\n any(graphUris, subject, predicate, object, includeInferred) {\n return this.matchAll(graphUris, subject, predicate, object, includeInferred).next().done === false;\n }\n /**\n * Get the first triple matching the given pattern in the store.\n * @param graphUris Optional graph URI or array of graph URIs to query.\n * @param subject A subject URI or null to match any subject.\n * @param predicate A predicate URI or null to match any predicate.\n * @param object An object URI or null to match any object.\n * @returns The first triple that matches the pattern.\n * @throws {TripleNotFoundError} If no triple is found matching the pattern.\n */\n first(graphUris, subject, predicate, object, includeInferred) {\n const result = this.matchAll(graphUris, subject, predicate, object, includeInferred).next().value;\n if (!result) {\n throw new TripleNotFoundError(subject, predicate, object);\n }\n return result;\n }\n}\nexports.Store = Store;\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./src/rdf/store.ts?\n}");
1411
2086
 
1412
2087
  /***/ },
1413
2088
 
@@ -1422,6 +2097,17 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexp
1422
2097
 
1423
2098
  /***/ },
1424
2099
 
2100
+ /***/ "./src/rdf/utils.ts"
2101
+ /*!**************************!*\
2102
+ !*** ./src/rdf/utils.ts ***!
2103
+ \**************************/
2104
+ (__unused_webpack_module, exports, __webpack_require__) {
2105
+
2106
+ "use strict";
2107
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.toRdflibTerm = exports.toRdfjsTerm = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.mjs\");\nconst rdflib = tslib_1.__importStar(__webpack_require__(/*! rdflib */ \"./node_modules/rdflib/esm/index.js\"));\nconst n3 = tslib_1.__importStar(__webpack_require__(/*! n3 */ \"./node_modules/n3/src/index.js\"));\n/**\n * Converts an rdflib term to an RDFJS term.\n * @param term The rdflib term to convert.\n * @returns The corresponding RDFJS term.\n */\nconst toRdfjsTerm = (term) => {\n switch (term.termType) {\n case 'NamedNode':\n return n3.DataFactory.namedNode(term.value);\n case 'BlankNode':\n return n3.DataFactory.blankNode(term.value);\n case 'Literal': {\n const literal = term;\n if (literal.language) {\n return n3.DataFactory.literal(term.value, literal.language);\n }\n else if (literal.datatype) {\n return n3.DataFactory.literal(term.value, n3.DataFactory.namedNode(literal.datatype.value));\n }\n else {\n return n3.DataFactory.literal(term.value);\n }\n }\n default: {\n throw new Error(`Unsupported RDF termType: ${term.termType}`);\n }\n }\n};\nexports.toRdfjsTerm = toRdfjsTerm;\n/**\n * Converts an RDFJS term to an rdflib term adding compareTerm methods required by rdflib serializers.\n * @param term The RDFJS term to convert.\n * @returns The corresponding rdflib term.\n */\nconst toRdflibTerm = (term) => {\n switch (term.termType) {\n case 'NamedNode':\n return rdflib.namedNode(term.value);\n case 'BlankNode':\n return rdflib.blankNode(term.value);\n case 'Literal': {\n const literal = term;\n if (literal.language) {\n return rdflib.lit(term.value, literal.language);\n }\n else if (literal.datatype) {\n return rdflib.lit(term.value, undefined, rdflib.namedNode(literal.datatype.value));\n }\n else {\n return rdflib.lit(term.value);\n }\n }\n default: {\n throw new Error(`Unsupported RDF termType: ${term.termType}`);\n }\n }\n};\nexports.toRdflibTerm = toRdflibTerm;\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./src/rdf/utils.ts?\n}");
2108
+
2109
+ /***/ },
2110
+
1425
2111
  /***/ "./src/rdf/vocabulary-repository.ts"
1426
2112
  /*!******************************************!*\
1427
2113
  !*** ./src/rdf/vocabulary-repository.ts ***!
@@ -1429,7 +2115,7 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexp
1429
2115
  (__unused_webpack_module, exports, __webpack_require__) {
1430
2116
 
1431
2117
  "use strict";
1432
- eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.VocabularyRepository = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.mjs\");\nconst n3 = tslib_1.__importStar(__webpack_require__(/*! n3 */ \"./node_modules/n3/src/index.js\"));\nconst ontologies_1 = __webpack_require__(/*! ../ontologies */ \"./src/ontologies/index.ts\");\nconst uri_1 = __webpack_require__(/*! ./uri */ \"./src/rdf/uri.ts\");\nconst shape_repository_1 = __webpack_require__(/*! ./shape-repository */ \"./src/rdf/shape-repository.ts\");\nconst { namedNode } = n3.DataFactory;\n/**\n * A repository for retrieving ontologies and ontology concepts from graphs.\n */\nclass VocabularyRepository extends shape_repository_1.ShapeRepository {\n /**\n * Get all concept schemes in the repository.\n * @param graphUris URIs of the graphs to search.\n * @returns An iterator of all concept schemes in the repository.\n */\n *getConceptSchemes(graphUris) {\n const yielded = new Set();\n for (const q of this.store.matchAll(graphUris, null, ontologies_1.rdf.type, ontologies_1.skos.ConceptScheme)) {\n const s = q.subject;\n if (s.termType != \"NamedNode\") {\n continue;\n }\n if (!yielded.has(s.value)) {\n yielded.add(s.value);\n yield s.value;\n }\n }\n }\n /**\n * Indicates whether the repository contains any concept schemes.\n * @param graphUris URIs of the graphs to search.\n * @returns `true` if the repository contains any concept schemes, `false` otherwise.\n */\n hasConceptSchemes(graphUris) {\n for (const _ of this.getConceptSchemes(graphUris)) {\n return true;\n }\n return false;\n }\n /**\n * Get all ontologies in the repository.\n * @param graphUris URIs of the graphs to search.\n * @returns An iterator of all ontologies in the repository.\n */\n *getOntologies(graphUris) {\n const yielded = new Set();\n for (const q of this.store.matchAll(graphUris, null, ontologies_1.rdf.type, ontologies_1.owl.Ontology)) {\n const s = q.subject;\n if (s.termType != \"NamedNode\") {\n continue;\n }\n if (!yielded.has(s.value)) {\n yielded.add(s.value);\n yield s.value;\n }\n }\n }\n /**\n * Indicates whether the repository contains any ontology headers.\n * @param graphUris URIs of the graphs to search.\n * @returns `true` if the repository contains any ontology headers, `false` otherwise.\n */\n hasOntologies(graphUris) {\n for (const _ of this.getOntologies(graphUris)) {\n return true;\n }\n return false;\n }\n /**\n * Get the version (owl:versionInfo) of an ontology. If the version is a date, it is returned as a string in the format \"YYYY-MM-DD\".\n * @param graphUris URIs of the graphs to search.\n * @param ontologyUri URI of the ontology.\n * @returns The version of the ontology, or undefined if it is not found.\n */\n getOntologyVersionInfo(graphUris, ontologyUri) {\n const s = namedNode(ontologyUri);\n for (const q of this.store.matchAll(graphUris, s, ontologies_1.owl.versionInfo, null)) {\n // If the version is a date, return it in the format \"YYYY-MM-DD\".\n const match = q.object.value.match(/(\\d{4}[\\/-]\\d{2}[\\/-]\\d{2})/);\n if (match && match.length > 1) {\n return new Date(match[1]).toISOString().substring(0, 10);\n }\n else {\n return q.object.value;\n }\n }\n }\n /**\n * Get the sources of definitions for a given graph. These are ontology definitions\n * or the objects of `rdfs:isDefinedBy` triples. If the rdfs:isDefinedBy object can be\n * matched with an ontology definition, the ontology URI is returned.\n * @param graphUris URIs of the graphs to search.\n * @returns An iterator of sources of definitions for the given graph.\n */\n *getDefinitionSources(graphUris, includeOntologies = false) {\n const yielded = new Set();\n // Load all ontologies in the graph in a normalized form.\n const ontologies = {};\n // Store the normalized versions of the ontology URI so that we can detect \n // equality even if different namespace seperators ('#' and '/') are used.\n for (let o of this.getOntologies(graphUris)) {\n const uri = uri_1.Uri.getNormalizedUri(o);\n ontologies[uri] = o;\n }\n for (const q of this.store.matchAll(graphUris, null, ontologies_1.rdfs.isDefinedBy, null)) {\n const s = q.subject;\n const o = q.object;\n if (s.termType != \"NamedNode\" || o.termType != \"NamedNode\") {\n continue;\n }\n // Do not include ontologies in the list of sources. However, if there are other\n // terms defined by the object it will be included by subsequent iterations.\n const s_ = uri_1.Uri.getNormalizedUri(s.value);\n const o_ = uri_1.Uri.getNormalizedUri(o.value);\n let isOntology = s_ in ontologies;\n if (!isOntology || includeOntologies) {\n let sourceValue;\n if (o_ in ontologies) {\n sourceValue = ontologies[o_];\n }\n else {\n sourceValue = o.value;\n }\n if (!yielded.has(sourceValue)) {\n yielded.add(sourceValue);\n yield sourceValue;\n }\n }\n }\n }\n}\nexports.VocabularyRepository = VocabularyRepository;\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./src/rdf/vocabulary-repository.ts?\n}");
2118
+ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexports.VocabularyRepository = void 0;\nconst tslib_1 = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.mjs\");\nconst n3 = tslib_1.__importStar(__webpack_require__(/*! n3 */ \"./node_modules/n3/src/index.js\"));\nconst ontologies_1 = __webpack_require__(/*! ../ontologies */ \"./src/ontologies/index.ts\");\nconst uri_1 = __webpack_require__(/*! ./uri */ \"./src/rdf/uri.ts\");\nconst shape_repository_1 = __webpack_require__(/*! ./shape-repository */ \"./src/rdf/shape-repository.ts\");\nconst { namedNode } = n3.DataFactory;\n/**\n * A repository for retrieving ontologies and ontology concepts from graphs.\n */\nclass VocabularyRepository extends shape_repository_1.ShapeRepository {\n /**\n * Get all concept schemes in the repository.\n * @param graphUris URIs of the graphs to search.\n * @returns An iterator of all concept schemes in the repository.\n */\n *getConceptSchemes(graphUris) {\n const yielded = new Set();\n for (const q of this.store.matchAll(graphUris, null, ontologies_1.rdf.type, ontologies_1.skos.ConceptScheme)) {\n const s = q.subject;\n if (s.termType != \"NamedNode\") {\n continue;\n }\n if (!yielded.has(s.value)) {\n yielded.add(s.value);\n yield s.value;\n }\n }\n }\n /**\n * Indicates whether the repository contains any concept schemes.\n * @param graphUris URIs of the graphs to search.\n * @returns `true` if the repository contains any concept schemes, `false` otherwise.\n */\n hasConceptSchemes(graphUris) {\n for (const _ of this.getConceptSchemes(graphUris)) {\n return true;\n }\n return false;\n }\n /**\n * Get all ontologies in the repository.\n * @param graphUris URIs of the graphs to search.\n * @returns An iterator of all ontologies in the repository.\n */\n *getOntologies(graphUris) {\n const yielded = new Set();\n for (const q of this.store.matchAll(graphUris, null, ontologies_1.rdf.type, ontologies_1.owl.Ontology)) {\n const s = q.subject;\n if (s.termType != \"NamedNode\") {\n continue;\n }\n if (!yielded.has(s.value)) {\n yielded.add(s.value);\n yield s.value;\n }\n }\n }\n /**\n * Indicates whether the repository contains any ontology headers.\n * @param graphUris URIs of the graphs to search.\n * @returns `true` if the repository contains any ontology headers, `false` otherwise.\n */\n hasOntologies(graphUris) {\n for (const _ of this.getOntologies(graphUris)) {\n return true;\n }\n return false;\n }\n /**\n * Get the version (owl:versionInfo) of an ontology. If the version is a date, it is returned as a string in the format \"YYYY-MM-DD\".\n * @param graphUris URIs of the graphs to search.\n * @param ontologyUri URI of the ontology.\n * @returns The version of the ontology, or undefined if it is not found.\n */\n getOntologyVersionInfo(graphUris, ontologyUri) {\n const s = namedNode(ontologyUri);\n for (const q of this.store.matchAll(graphUris, s, ontologies_1.owl.versionInfo, null)) {\n // If the version is a date, return it in the format \"YYYY-MM-DD\".\n const match = q.object.value.match(/(\\d{4}[\\/-]\\d{2}[\\/-]\\d{2})/);\n if (match && match.length > 1) {\n // Don't rely on Date parsing or timezone conversions; keep it purely lexical.\n // The source is already YYYY-MM-DD or YYYY/MM/DD, normalize to YYYY-MM-DD.\n return match[1].replace(/\\//g, '-');\n }\n else {\n return q.object.value;\n }\n }\n }\n /**\n * Get the sources of definitions for a given graph. These are ontology definitions\n * or the objects of `rdfs:isDefinedBy` triples. If the rdfs:isDefinedBy object can be\n * matched with an ontology definition, the ontology URI is returned.\n * @param graphUris URIs of the graphs to search.\n * @returns An iterator of sources of definitions for the given graph.\n */\n *getDefinitionSources(graphUris, includeOntologies = false) {\n const yielded = new Set();\n // Load all ontologies in the graph in a normalized form.\n const ontologies = {};\n // Store the normalized versions of the ontology URI so that we can detect \n // equality even if different namespace seperators ('#' and '/') are used.\n for (let o of this.getOntologies(graphUris)) {\n const uri = uri_1.Uri.getNormalizedUri(o);\n ontologies[uri] = o;\n }\n for (const q of this.store.matchAll(graphUris, null, ontologies_1.rdfs.isDefinedBy, null)) {\n const s = q.subject;\n const o = q.object;\n if (s.termType != \"NamedNode\" || o.termType != \"NamedNode\") {\n continue;\n }\n // Do not include ontologies in the list of sources. However, if there are other\n // terms defined by the object it will be included by subsequent iterations.\n const s_ = uri_1.Uri.getNormalizedUri(s.value);\n const o_ = uri_1.Uri.getNormalizedUri(o.value);\n let isOntology = s_ in ontologies;\n if (!isOntology || includeOntologies) {\n let sourceValue;\n if (o_ in ontologies) {\n sourceValue = ontologies[o_];\n }\n else {\n sourceValue = o.value;\n }\n if (!yielded.has(sourceValue)) {\n yielded.add(sourceValue);\n yield sourceValue;\n }\n }\n }\n }\n}\nexports.VocabularyRepository = VocabularyRepository;\n\n\n//# sourceURL=webpack://@faubulous/mentor-rdf/./src/rdf/vocabulary-repository.ts?\n}");
1433
2119
 
1434
2120
  /***/ }
1435
2121
 
@@ -1453,18 +2139,24 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexp
1453
2139
  /******/ }
1454
2140
  /******/ // Create a new module (and put it into the cache)
1455
2141
  /******/ var module = __webpack_module_cache__[moduleId] = {
1456
- /******/ // no module.id needed
1457
- /******/ // no module.loaded needed
2142
+ /******/ id: moduleId,
2143
+ /******/ loaded: false,
1458
2144
  /******/ exports: {}
1459
2145
  /******/ };
1460
2146
  /******/
1461
2147
  /******/ // Execute the module function
1462
2148
  /******/ __webpack_modules__[moduleId].call(module.exports, module, module.exports, __webpack_require__);
1463
2149
  /******/
2150
+ /******/ // Flag the module as loaded
2151
+ /******/ module.loaded = true;
2152
+ /******/
1464
2153
  /******/ // Return the exports of the module
1465
2154
  /******/ return module.exports;
1466
2155
  /******/ }
1467
2156
  /******/
2157
+ /******/ // expose the modules object (__webpack_modules__)
2158
+ /******/ __webpack_require__.m = __webpack_modules__;
2159
+ /******/
1468
2160
  /************************************************************************/
1469
2161
  /******/ /* webpack/runtime/compat get default export */
1470
2162
  /******/ (() => {
@@ -1478,6 +2170,36 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexp
1478
2170
  /******/ };
1479
2171
  /******/ })();
1480
2172
  /******/
2173
+ /******/ /* webpack/runtime/create fake namespace object */
2174
+ /******/ (() => {
2175
+ /******/ var getProto = Object.getPrototypeOf ? (obj) => (Object.getPrototypeOf(obj)) : (obj) => (obj.__proto__);
2176
+ /******/ var leafPrototypes;
2177
+ /******/ // create a fake namespace object
2178
+ /******/ // mode & 1: value is a module id, require it
2179
+ /******/ // mode & 2: merge all properties of value into the ns
2180
+ /******/ // mode & 4: return value when already ns object
2181
+ /******/ // mode & 16: return value when it's Promise-like
2182
+ /******/ // mode & 8|1: behave like require
2183
+ /******/ __webpack_require__.t = function(value, mode) {
2184
+ /******/ if(mode & 1) value = this(value);
2185
+ /******/ if(mode & 8) return value;
2186
+ /******/ if(typeof value === 'object' && value) {
2187
+ /******/ if((mode & 4) && value.__esModule) return value;
2188
+ /******/ if((mode & 16) && typeof value.then === 'function') return value;
2189
+ /******/ }
2190
+ /******/ var ns = Object.create(null);
2191
+ /******/ __webpack_require__.r(ns);
2192
+ /******/ var def = {};
2193
+ /******/ leafPrototypes = leafPrototypes || [null, getProto({}), getProto([]), getProto(getProto)];
2194
+ /******/ for(var current = mode & 2 && value; (typeof current == 'object' || typeof current == 'function') && !~leafPrototypes.indexOf(current); current = getProto(current)) {
2195
+ /******/ Object.getOwnPropertyNames(current).forEach((key) => (def[key] = () => (value[key])));
2196
+ /******/ }
2197
+ /******/ def['default'] = () => (value);
2198
+ /******/ __webpack_require__.d(ns, def);
2199
+ /******/ return ns;
2200
+ /******/ };
2201
+ /******/ })();
2202
+ /******/
1481
2203
  /******/ /* webpack/runtime/define property getters */
1482
2204
  /******/ (() => {
1483
2205
  /******/ // define getter functions for harmony exports
@@ -1490,6 +2212,28 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexp
1490
2212
  /******/ };
1491
2213
  /******/ })();
1492
2214
  /******/
2215
+ /******/ /* webpack/runtime/ensure chunk */
2216
+ /******/ (() => {
2217
+ /******/ __webpack_require__.f = {};
2218
+ /******/ // This file contains only the entry chunk.
2219
+ /******/ // The chunk loading function for additional chunks
2220
+ /******/ __webpack_require__.e = (chunkId) => {
2221
+ /******/ return Promise.all(Object.keys(__webpack_require__.f).reduce((promises, key) => {
2222
+ /******/ __webpack_require__.f[key](chunkId, promises);
2223
+ /******/ return promises;
2224
+ /******/ }, []));
2225
+ /******/ };
2226
+ /******/ })();
2227
+ /******/
2228
+ /******/ /* webpack/runtime/get javascript chunk filename */
2229
+ /******/ (() => {
2230
+ /******/ // This function allow to reference async chunks
2231
+ /******/ __webpack_require__.u = (chunkId) => {
2232
+ /******/ // return url for filenames based on template
2233
+ /******/ return "" + chunkId + ".index.js";
2234
+ /******/ };
2235
+ /******/ })();
2236
+ /******/
1493
2237
  /******/ /* webpack/runtime/global */
1494
2238
  /******/ (() => {
1495
2239
  /******/ __webpack_require__.g = (function() {
@@ -1502,11 +2246,71 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexp
1502
2246
  /******/ })();
1503
2247
  /******/ })();
1504
2248
  /******/
2249
+ /******/ /* webpack/runtime/harmony module decorator */
2250
+ /******/ (() => {
2251
+ /******/ __webpack_require__.hmd = (module) => {
2252
+ /******/ module = Object.create(module);
2253
+ /******/ if (!module.children) module.children = [];
2254
+ /******/ Object.defineProperty(module, 'exports', {
2255
+ /******/ enumerable: true,
2256
+ /******/ set: () => {
2257
+ /******/ throw new Error('ES Modules may not assign module.exports or exports.*, Use ESM export syntax, instead: ' + module.id);
2258
+ /******/ }
2259
+ /******/ });
2260
+ /******/ return module;
2261
+ /******/ };
2262
+ /******/ })();
2263
+ /******/
1505
2264
  /******/ /* webpack/runtime/hasOwnProperty shorthand */
1506
2265
  /******/ (() => {
1507
2266
  /******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
1508
2267
  /******/ })();
1509
2268
  /******/
2269
+ /******/ /* webpack/runtime/load script */
2270
+ /******/ (() => {
2271
+ /******/ var inProgress = {};
2272
+ /******/ var dataWebpackPrefix = "@faubulous/mentor-rdf:";
2273
+ /******/ // loadScript function to load a script via script tag
2274
+ /******/ __webpack_require__.l = (url, done, key, chunkId) => {
2275
+ /******/ if(inProgress[url]) { inProgress[url].push(done); return; }
2276
+ /******/ var script, needAttach;
2277
+ /******/ if(key !== undefined) {
2278
+ /******/ var scripts = document.getElementsByTagName("script");
2279
+ /******/ for(var i = 0; i < scripts.length; i++) {
2280
+ /******/ var s = scripts[i];
2281
+ /******/ if(s.getAttribute("src") == url || s.getAttribute("data-webpack") == dataWebpackPrefix + key) { script = s; break; }
2282
+ /******/ }
2283
+ /******/ }
2284
+ /******/ if(!script) {
2285
+ /******/ needAttach = true;
2286
+ /******/ script = document.createElement('script');
2287
+ /******/
2288
+ /******/ script.charset = 'utf-8';
2289
+ /******/ if (__webpack_require__.nc) {
2290
+ /******/ script.setAttribute("nonce", __webpack_require__.nc);
2291
+ /******/ }
2292
+ /******/ script.setAttribute("data-webpack", dataWebpackPrefix + key);
2293
+ /******/
2294
+ /******/ script.src = url;
2295
+ /******/ }
2296
+ /******/ inProgress[url] = [done];
2297
+ /******/ var onScriptComplete = (prev, event) => {
2298
+ /******/ // avoid mem leaks in IE.
2299
+ /******/ script.onerror = script.onload = null;
2300
+ /******/ clearTimeout(timeout);
2301
+ /******/ var doneFns = inProgress[url];
2302
+ /******/ delete inProgress[url];
2303
+ /******/ script.parentNode && script.parentNode.removeChild(script);
2304
+ /******/ doneFns && doneFns.forEach((fn) => (fn(event)));
2305
+ /******/ if(prev) return prev(event);
2306
+ /******/ }
2307
+ /******/ var timeout = setTimeout(onScriptComplete.bind(null, undefined, { type: 'timeout', target: script }), 120000);
2308
+ /******/ script.onerror = onScriptComplete.bind(null, script.onerror);
2309
+ /******/ script.onload = onScriptComplete.bind(null, script.onload);
2310
+ /******/ needAttach && document.head.appendChild(script);
2311
+ /******/ };
2312
+ /******/ })();
2313
+ /******/
1510
2314
  /******/ /* webpack/runtime/make namespace object */
1511
2315
  /******/ (() => {
1512
2316
  /******/ // define __esModule on exports
@@ -1518,6 +2322,119 @@ eval("{\nObject.defineProperty(exports, \"__esModule\", ({ value: true }));\nexp
1518
2322
  /******/ };
1519
2323
  /******/ })();
1520
2324
  /******/
2325
+ /******/ /* webpack/runtime/publicPath */
2326
+ /******/ (() => {
2327
+ /******/ var scriptUrl;
2328
+ /******/ if (__webpack_require__.g.importScripts) scriptUrl = __webpack_require__.g.location + "";
2329
+ /******/ var document = __webpack_require__.g.document;
2330
+ /******/ if (!scriptUrl && document) {
2331
+ /******/ if (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT')
2332
+ /******/ scriptUrl = document.currentScript.src;
2333
+ /******/ if (!scriptUrl) {
2334
+ /******/ var scripts = document.getElementsByTagName("script");
2335
+ /******/ if(scripts.length) {
2336
+ /******/ var i = scripts.length - 1;
2337
+ /******/ while (i > -1 && (!scriptUrl || !/^http(s?):/.test(scriptUrl))) scriptUrl = scripts[i--].src;
2338
+ /******/ }
2339
+ /******/ }
2340
+ /******/ }
2341
+ /******/ // When supporting browsers where an automatic publicPath is not supported you must specify an output.publicPath manually via configuration
2342
+ /******/ // or pass an empty string ("") and set the __webpack_public_path__ variable from your code to use your own logic.
2343
+ /******/ if (!scriptUrl) throw new Error("Automatic publicPath is not supported in this browser");
2344
+ /******/ scriptUrl = scriptUrl.replace(/^blob:/, "").replace(/#.*$/, "").replace(/\?.*$/, "").replace(/\/[^\/]+$/, "/");
2345
+ /******/ __webpack_require__.p = scriptUrl;
2346
+ /******/ })();
2347
+ /******/
2348
+ /******/ /* webpack/runtime/jsonp chunk loading */
2349
+ /******/ (() => {
2350
+ /******/ // no baseURI
2351
+ /******/
2352
+ /******/ // object to store loaded and loading chunks
2353
+ /******/ // undefined = chunk not loaded, null = chunk preloaded/prefetched
2354
+ /******/ // [resolve, reject, Promise] = chunk loading, 0 = chunk loaded
2355
+ /******/ var installedChunks = {
2356
+ /******/ "main": 0
2357
+ /******/ };
2358
+ /******/
2359
+ /******/ __webpack_require__.f.j = (chunkId, promises) => {
2360
+ /******/ // JSONP chunk loading for javascript
2361
+ /******/ var installedChunkData = __webpack_require__.o(installedChunks, chunkId) ? installedChunks[chunkId] : undefined;
2362
+ /******/ if(installedChunkData !== 0) { // 0 means "already installed".
2363
+ /******/
2364
+ /******/ // a Promise means "currently loading".
2365
+ /******/ if(installedChunkData) {
2366
+ /******/ promises.push(installedChunkData[2]);
2367
+ /******/ } else {
2368
+ /******/ if(true) { // all chunks have JS
2369
+ /******/ // setup Promise in chunk cache
2370
+ /******/ var promise = new Promise((resolve, reject) => (installedChunkData = installedChunks[chunkId] = [resolve, reject]));
2371
+ /******/ promises.push(installedChunkData[2] = promise);
2372
+ /******/
2373
+ /******/ // start chunk loading
2374
+ /******/ var url = __webpack_require__.p + __webpack_require__.u(chunkId);
2375
+ /******/ // create error before stack unwound to get useful stacktrace later
2376
+ /******/ var error = new Error();
2377
+ /******/ var loadingEnded = (event) => {
2378
+ /******/ if(__webpack_require__.o(installedChunks, chunkId)) {
2379
+ /******/ installedChunkData = installedChunks[chunkId];
2380
+ /******/ if(installedChunkData !== 0) installedChunks[chunkId] = undefined;
2381
+ /******/ if(installedChunkData) {
2382
+ /******/ var errorType = event && (event.type === 'load' ? 'missing' : event.type);
2383
+ /******/ var realSrc = event && event.target && event.target.src;
2384
+ /******/ error.message = 'Loading chunk ' + chunkId + ' failed.\n(' + errorType + ': ' + realSrc + ')';
2385
+ /******/ error.name = 'ChunkLoadError';
2386
+ /******/ error.type = errorType;
2387
+ /******/ error.request = realSrc;
2388
+ /******/ installedChunkData[1](error);
2389
+ /******/ }
2390
+ /******/ }
2391
+ /******/ };
2392
+ /******/ __webpack_require__.l(url, loadingEnded, "chunk-" + chunkId, chunkId);
2393
+ /******/ }
2394
+ /******/ }
2395
+ /******/ }
2396
+ /******/ };
2397
+ /******/
2398
+ /******/ // no prefetching
2399
+ /******/
2400
+ /******/ // no preloaded
2401
+ /******/
2402
+ /******/ // no HMR
2403
+ /******/
2404
+ /******/ // no HMR manifest
2405
+ /******/
2406
+ /******/ // no on chunks loaded
2407
+ /******/
2408
+ /******/ // install a JSONP callback for chunk loading
2409
+ /******/ var webpackJsonpCallback = (parentChunkLoadingFunction, data) => {
2410
+ /******/ var [chunkIds, moreModules, runtime] = data;
2411
+ /******/ // add "moreModules" to the modules object,
2412
+ /******/ // then flag all "chunkIds" as loaded and fire callback
2413
+ /******/ var moduleId, chunkId, i = 0;
2414
+ /******/ if(chunkIds.some((id) => (installedChunks[id] !== 0))) {
2415
+ /******/ for(moduleId in moreModules) {
2416
+ /******/ if(__webpack_require__.o(moreModules, moduleId)) {
2417
+ /******/ __webpack_require__.m[moduleId] = moreModules[moduleId];
2418
+ /******/ }
2419
+ /******/ }
2420
+ /******/ if(runtime) var result = runtime(__webpack_require__);
2421
+ /******/ }
2422
+ /******/ if(parentChunkLoadingFunction) parentChunkLoadingFunction(data);
2423
+ /******/ for(;i < chunkIds.length; i++) {
2424
+ /******/ chunkId = chunkIds[i];
2425
+ /******/ if(__webpack_require__.o(installedChunks, chunkId) && installedChunks[chunkId]) {
2426
+ /******/ installedChunks[chunkId][0]();
2427
+ /******/ }
2428
+ /******/ installedChunks[chunkId] = 0;
2429
+ /******/ }
2430
+ /******/
2431
+ /******/ }
2432
+ /******/
2433
+ /******/ var chunkLoadingGlobal = self["webpackChunk_faubulous_mentor_rdf"] = self["webpackChunk_faubulous_mentor_rdf"] || [];
2434
+ /******/ chunkLoadingGlobal.forEach(webpackJsonpCallback.bind(null, 0));
2435
+ /******/ chunkLoadingGlobal.push = webpackJsonpCallback.bind(null, chunkLoadingGlobal.push.bind(chunkLoadingGlobal));
2436
+ /******/ })();
2437
+ /******/
1521
2438
  /************************************************************************/
1522
2439
  /******/
1523
2440
  /******/ // startup