All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.vivoweb.linkeddatafragments.servlet.ldf-client-worker.js Maven / Gradle / Ivy

The newest version!
!function(t){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=t();else if("function"==typeof define&&define.amd)define([],t);else{var e;e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,e.ldf=t()}}(function(){var t;return function t(e,r,n){function i(a,o){if(!r[a]){if(!e[a]){var u="function"==typeof require&&require;if(!o&&u)return u(a,!0);if(s)return s(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[a]={exports:{}};e[a][0].call(l.exports,function(t){var r=e[a][1][t];return i(r?r:t)},l,l.exports,t,e,r,n)}return r[a].exports}for(var s="function"==typeof require&&require,a=0;a=0;s--)if(a[s]!=o[s])return!1;for(s=a.length-1;s>=0;s--)if(i=a[s],!u(t[i],e[i]))return!1;return!0}function f(t,e){return!(!t||!e)&&("[object RegExp]"==Object.prototype.toString.call(e)?e.test(t):t instanceof e||e.call({},t)===!0)}function h(t,e,r,n){var i;p.isString(r)&&(n=r,r=null);try{e()}catch(t){i=t}if(n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),t&&!i&&a(i,r,"Missing expected exception"+n),!t&&f(i,r)&&a(i,r,"Got unwanted exception"+n),t&&i&&r&&!f(i,r)||!t&&i)throw i}
// Copyright (c) 2009 Thomas Robinson <280north.com>
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the 'Software'), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
    var p=t("util/"),d=Array.prototype.slice,_=Object.prototype.hasOwnProperty,g=e.exports=o;g.AssertionError=function(t){this.name="AssertionError",this.actual=t.actual,this.expected=t.expected,this.operator=t.operator,t.message?(this.message=t.message,this.generatedMessage=!1):(this.message=s(this),this.generatedMessage=!0);var e=t.stackStartFunction||a;if(Error.captureStackTrace)Error.captureStackTrace(this,e);else{var r=new Error;if(r.stack){var n=r.stack,i=e.name,o=n.indexOf("\n"+i);if(o>=0){var u=n.indexOf("\n",o+1);n=n.substring(u+1)}this.stack=n}}},p.inherits(g.AssertionError,Error),g.fail=a,g.ok=o,g.equal=function(t,e,r){t!=e&&a(t,e,r,"==",g.equal)},g.notEqual=function(t,e,r){t==e&&a(t,e,r,"!=",g.notEqual)},g.deepEqual=function(t,e,r){u(t,e)||a(t,e,r,"deepEqual",g.deepEqual)},g.notDeepEqual=function(t,e,r){u(t,e)&&a(t,e,r,"notDeepEqual",g.notDeepEqual)},g.strictEqual=function(t,e,r){t!==e&&a(t,e,r,"===",g.strictEqual)},g.notStrictEqual=function(t,e,r){t===e&&a(t,e,r,"!==",g.notStrictEqual)},g.throws=function(t,e,r){h.apply(this,[!0].concat(d.call(arguments)))},g.doesNotThrow=function(t,e){h.apply(this,[!1].concat(d.call(arguments)))},g.ifError=function(t){if(t)throw t};var y=Object.keys||function(t){var e=[];for(var r in t)_.call(t,r)&&e.push(r);return e}},{"util/":62}],2:[function(t,e,r){(function(r){function n(){return this instanceof n?(D.call(this),this.on("newListener",o),this._state=P,void(this._readable=!1)):new n}function i(t,e){t.emit(e)}function s(t){t._end()}function a(t){N(s,t)}function o(t){"data"===t&&(this.removeListener("newListener",o),this._addSingleListener("readable",u),this.readable&&N(c,u,this))}function u(){for(var t;this._hasListeners("data")&&null!==(t=this.read());)this.emit("data",t);this._hasListeners("data")||(this.removeListener("readable",u),this._addSingleListener("newListener",o))}function c(t,e){t.call(e)}function l(t,e,r){t.getProperty(r,function(t){e.setProperty(r,t)})}function f(){return this instanceof f?(n.call(this),void this._changeState($,!0)):new f}function h(t){return this instanceof h?(n.call(this),this._item=t,void(null===t?this.close():this.readable=!0)):new h(t)}function p(t){return this instanceof p?(n.call(this),t&&t.length>0?(this._buffer=Array.prototype.slice.call(t),void(this.readable=!0)):this.close()):new p(t)}function d(t){if(!(this instanceof d))return new d(t);n.call(this),t=t||{};var e,r=t.step,i=t.end,s=t.start;this._step=r=isFinite(r)?~~r:1,e=r>=0?1/0:-(1/0),this._last=i=isFinite(i)?~~i:i===-e?i:e,this._next=s="number"!=typeof s?0:isFinite(s)?~~s:s,!isFinite(s)||(r>=0?s>i:s=0&&i.splice(e,1)},t.ended||(i=[],t.on("readable",e),t.on("end",r),t.on("error",n))}function O(t){return"function"==typeof t}var D=t("events").EventEmitter,N=function(){if("undefined"==typeof r||r.browser){var e=t("immediate"),n=0;return function(t,r,i,s){1e4===n++?setTimeout(t,n=0,r,i,s):e(t,r,i,s)}}return setImmediate}(),L=n.STATES=["INIT","OPEN","CLOSING","CLOSED","ENDED"],R=0,P=1,U=2,B=3,$=4;L.forEach(function(t,e){n[t]=e}),function t(e){e.prototype=Object.create(this.prototype,{constructor:{value:e,configurable:!0,writable:!0}}),e.subclass=t}.call(D,n),n.prototype._changeState=function(t,e){var r=t>this._state;return r&&(this._state=t,t===$&&(e?N(i,this,"end"):this.emit("end"))),r},n.prototype.read=function(){return null},n.prototype.each=function(t,e){this.on("data",e?t.bind(e):t)},n.prototype._hasListeners=function(t){return this._events&&t in this._events},n.prototype._addSingleListener=function(t,e){var r=this._events&&this._events[t];r&&!(O(r)?r!==e:r.indexOf(e)<0)||this.on(t,e)},n.prototype.close=function(){this._changeState(B)&&a(this)},n.prototype._end=function(){this._changeState($)&&(this._readable=!1,this.removeAllListeners("readable"),this.removeAllListeners("data"),this.removeAllListeners("end"))},Object.defineProperty(n.prototype,"readable",{get:function(){return this._readable},set:function(t){t=!!t&&!this.ended,this._readable!==t&&(this._readable=t,t&&N(i,this,"readable"))},enumerable:!0}),Object.defineProperty(n.prototype,"closed",{get:function(){return this._state>=U},enumerable:!0}),Object.defineProperty(n.prototype,"ended",{get:function(){return this._state===$},enumerable:!0}),n.prototype.getProperty=function(t,e){var r,n=this._properties;return e?void(n&&t in n?N(e,n[t]):((r=this._propertyCallbacks)||(this._propertyCallbacks=r=Object.create(null)),t in r?r[t].push(e):r[t]=[e])):n&&n[t]},n.prototype.setProperty=function(t,e){var r=this._properties||(this._properties=Object.create(null));r[t]=e;var n,i=this._propertyCallbacks;if(n=i&&i[t]){delete i[t],1===n.length?N(n[0],e):N(function(){for(var t=0;t=0?n>r:n0&&(this._pushedCount=0,this._reading=!0,this._read(t,function(){if(!t)throw new Error("done callback called multiple times");t=0,e._reading=!1,e.closed?e._completeClose():e._pushedCount&&(e.readable=!0,e._buffer.length0&&null!==(r=i.read());)this._push(r),o&&(n.item=null);else a&&a.ended&&this.close();e()},C.prototype._createTransformer=h,C.prototype._closeWhenDone=function(){this._transformerQueue.length||this.close()},b.subclass(S),Object.defineProperty(S.prototype,"source",{set:function(t){var e=t&&t._destination;this._validateSource(t,!e||e instanceof j),this._source=t,e||(e=t._destination=new j(t)),e.endsAt(0)?this.close():(e.register(this),null!==e.readAt(0)&&(this.readable=!0));var r=this._propertyCallbacks;for(var n in r)for(var i=r[n],s=0;s0&&this._events[t].length>r&&(this._events[t].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[t].length),"function"==typeof console.trace&&console.trace())),this},n.prototype.on=n.prototype.addListener,n.prototype.once=function(t,e){function r(){this.removeListener(t,r),n||(n=!0,e.apply(this,arguments))}if(!i(e))throw TypeError("listener must be a function");var n=!1;return r.listener=e,this.on(t,r),this},n.prototype.removeListener=function(t,e){var r,n,s,o;if(!i(e))throw TypeError("listener must be a function");if(!this._events||!this._events[t])return this;if(r=this._events[t],s=r.length,n=-1,r===e||i(r.listener)&&r.listener===e)delete this._events[t],this._events.removeListener&&this.emit("removeListener",t,e);else if(a(r)){for(o=s;o-- >0;)if(r[o]===e||r[o].listener&&r[o].listener===e){n=o;break}if(n<0)return this;1===r.length?(r.length=0,delete this._events[t]):r.splice(n,1),this._events.removeListener&&this.emit("removeListener",t,e)}return this},n.prototype.removeAllListeners=function(t){var e,r;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[t]&&delete this._events[t],this;if(0===arguments.length){for(e in this._events)"removeListener"!==e&&this.removeAllListeners(e);return this.removeAllListeners("removeListener"),this._events={},this}if(r=this._events[t],i(r))this.removeListener(t,r);else if(r)for(;r.length;)this.removeListener(t,r[r.length-1]);return delete this._events[t],this},n.prototype.listeners=function(t){var e;return e=this._events&&this._events[t]?i(this._events[t])?[this._events[t]]:this._events[t].slice():[]},n.prototype.listenerCount=function(t){if(this._events){var e=this._events[t];if(i(e))return 1;if(e)return e.length}return 0},n.listenerCount=function(t,e){return t.listenerCount(e)}},{}],5:[function(t,e,r){"use strict";function n(){o&&u&&(o=!1,u.length?h=u.concat(h):f=-1,h.length&&i())}function i(){if(!o){p=!1,o=!0;for(var t=h.length,e=setTimeout(n);t;){for(u=h,h=[];u&&++f1)for(var r=1;r>>32-e}function a(t){for(var e,r="",n=7;n>=0;n--)e=t>>>4*n&15,r+=e.toString(16);return r}/*! @license MIT ©2015-2016 Ruben Verborgh, Ghent University - imec */
    /* Browser replacement for a subset of crypto. */
    r.createHash=function(){var t;return{update:function(e){t?t+=e:t=e},digest:function(){return n(t)}}};/*! @license MIT ©2002-2014 Chris Veness */
    /* SHA-1 implementation */
    var o=[1518500249,1859775393,2400959708,3395469782],u=Math.pow(2,35)},{}],13:[function(t,e,r){function n(t){return this instanceof n?(i.call(this),this._extractors=s.isArray(t)?{"":t}:t,void(s.any(this._extractors,"length")||(this._extractors=null))):new n(t)}/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
    /* A CompositeExtractor combines metadata from different extractors. */
    var i=t("./MetadataExtractor"),s=t("lodash");i.inherits(n),n.prototype._extract=function(t,e,r){s.each(this._extractors||r(null,{})&&null,function(n,i){function a(t,e){t||(o=o?s.defaults(o,e):e),0===--u&&(i&&(e=o,o={},o[i]=e),r(null,o||{}))}var o,u=n.length;s.each(n,function(r){r.extract(t,e,a)})})},e.exports=n},{"./MetadataExtractor":16,lodash:35}],14:[function(t,e,r){function n(){return this instanceof n?void i.call(this):new n}/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
    /* A ControlsExtractor extracts hypermedia controls from a triple stream. */
    var i=t("./MetadataExtractor"),s=t("uritemplate"),a=t("../util/RdfUtil"),o=t("assert"),u=["first","next","previous","last"],c={getFragmentUrl:function(t){throw new Error("The fragment "+this.fragment+" does not contain Triple Pattern Fragment hypermedia controls.")}};u.forEach(function(t){Object.defineProperty(c,t,{get:function(){throw new Error("The fragment "+this.fragment+" does not contain controls for "+t+".")}})}),i.inherits(n),n.prototype._extract=function(t,e,r){var n=Object.create(null);e.on("data",function(t){if(0===t.predicate.indexOf(a.HYDRA)){var e=t.predicate.substr(a.HYDRA.length),r=n[e]||(n[e]={}),i=r[t.subject]||(r[t.subject]=[]);i.push(t.object)}}),e.on("end",function(){var e=Object.create(c);e.fragment=t.fragmentUrl,u.forEach(function(t){var r=n[t]||n[t+"Page"],i=r&&r[e.fragment];i&&i.length>0&&Object.defineProperty(e,t,{value:i[0],enumerable:!0})});var i=n.search;if(i){o(1===Object.keys(i).length,"Expected 1 hydra:search");var l=i[Object.keys(i)[0]][0],f=(n.template||{})[l]||[];o(1===f.length,"Expected 1 hydra:template for "+l);var h=a.getLiteralValue(f[0]),p=s.parse(h),d=(n.mapping||{})[l]||[];o(3===d.length,"Expected 3 hydra:mappings for "+l),d=d.reduce(function(t,e){var r=((n.variable||{})[e]||[])[0],i=((n.property||{})[e]||[])[0];return o(r,"Expected a hydra:variable for "+e),o(i,"Expected a hydra:property for "+e),t[i]=a.getLiteralValue(r),t},{}),e.getFragmentUrl=function(t){var e={};return e[d[a.RDF_SUBJECT]]=t.subject,e[d[a.RDF_PREDICATE]]=t.predicate,e[d[a.RDF_OBJECT]]=t.object,p.expand(e)}}r(null,e)})},e.exports=n},{"../util/RdfUtil":31,"./MetadataExtractor":16,assert:1,uritemplate:57}],15:[function(t,e,r){function n(t){return this instanceof n?(s.call(this),void(this._countPredicates=i(t&&t.countPredicates)||o)):new n(t)}function i(t){return t&&t.reduce(function(t,e){return t[e]=!0,t},Object.create(null))}/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
    /* A CountExtractor extracts count metadata from a triple stream. */
    var s=t("./MetadataExtractor"),a=t("../util/RdfUtil"),o=i([a.VOID_TRIPLES,a.HYDRA_TOTALITEMS]);s.inherits(n),n.prototype._extract=function(t,e,r){function n(e){if(e.predicate in s&&a.decodedURIEquals(e.subject,t.fragmentUrl)){var r=e.object.match(/\d+/);r&&i({totalTriples:parseInt(r[0],10)})}}function i(t){e.removeListener("end",i),e.removeListener("data",n),r(null,t||{})}var s=this._countPredicates;e.on("end",i),e.on("data",n)},e.exports=n},{"../util/RdfUtil":31,"./MetadataExtractor":16}],16:[function(t,e,r){function n(){if(!(this instanceof n))return new n}/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
    /* MetadataExtractor is a base class for objects that extract metadata from a triple stream. */
    var i=t("util");n.inherits=function(t){i.inherits(t,this),t.inherits=this.inherits},n.prototype.extract=function(t,e,r){if(r)return e?void this._extract(t||{},e,r):r(null,{})},n.prototype._extract=function(t,e,r){throw new Error("Not implemented")},e.exports=n},{util:62}],17:[function(t,e,r){function n(t,e){return this instanceof n?(i.call(this,t,e),void(this._uniques=Object.create(null))):new n(t,e)}/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
    /* A DistinctIterator emits the unique items from a source. */
    var i=t("asynciterator").SimpleTransformIterator,s=t("crypto");i.subclass(n),n.prototype._filter=function(t){var e=this._uniques,r=this._hash(t);r in e||(e[r]=!0,this._push(t))},n.prototype._hash=function(t){var e=s.createHash("sha1");return e.update(JSON.stringify(t)),e.digest("base64")},e.exports=n},{asynciterator:2,crypto:12}],18:[function(t,e,r){function n(t,e,r){if(!(this instanceof n))return new n(t,e,r);"function"!=typeof e&&(r=e,e=null),s.call(this,t,r);var a=r&&r.window;this._windowLength=isFinite(a)&&a>0?~~a:1/0,this._sort=e||i,this._sorted=[]}function i(t,e){return te?1:0}/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
    /* A SortIterator emits the items of a source in a sorted way. */
    var s=t("asynciterator").TransformIterator;s.subclass(n),n.prototype._read=function(t,e){var r,n=this._sorted,i=this._source,s=n.length;if(i){for(;s!==this._windowLength&&null!==(r=i.read());){for(var a,o,u=0,c=s-1;u<=c;)o=this._sort(r,n[a=u+c>>1]),o<0?u=a+1:o>0?c=a-1:(u=a,c=-1);n.splice(u,0,r),s++}s===this._windowLength&&this._push(n.pop())}e()},n.prototype._flush=function(t){for(var e=this._sorted,r=e.length;r--;)this._push(e.pop());t()},e.exports=n},{asynciterator:2}],19:[function(t,e,r){function n(t,e,r){"function"!=typeof t.read&&(r=e,e=t,t=null),r=r||{},t=t||f.single({});try{"string"==typeof e&&(e=new l(r.prefixes).parse(e));var n,i=x[e.queryType];if(!i)throw new Error("No iterator available for query type: "+e.queryType);n=new i(null,e,r);for(var s=new u(t,n.patterns||e.where,r),a=e.order&&e.order.length-1;a>=0;a--){var o=new y(e.order[a].expression),c=!e.order[a].descending;s=new _(s,function(t,e){var r="",n="";try{r=o(t)}catch(t){}try{n=o(e)}catch(t){}return rn?c?1:-1:0},r)}return n.source=s,e.distinct&&(n=new g(n,r)),("offset"in e||"limit"in e)&&(n=n.transform({offset:e.offset,limit:e.limit})),n.queryType=e.queryType,n}catch(t){throw t=/Parse error/.test(t.message)?new w(e,t):new E(e,t)}}function i(t,e,r){h.call(this,t,r),this.setProperty("variables",e.variables)}function s(t,e,r){h.call(this,t,r),this._template=e.template.filter(function(t){return b.hasVariables(t)||this._push(t)},this),this._blankNodeId=0}function a(t,e,r){for(var n=e.variables,i=e.template=[],a=0,o=n.length;a=r.length&&(this._sourceIndex=0)}null!==n&&this._push(n),r.length||this.close(),e()},e.exports=n},{asynciterator:2}],21:[function(t,e,r){function n(t,e){if(!(this instanceof n))return new n(t,e);e=h.defaults(e||{},{contentType:p});var r=this._cache=new u({max:100});if(this._httpClient=e.httpClient||new s(e),this._metadataExtractor=e.metadataExtractor||new c({metadata:[new l],controls:[new f]}),t){if("string"==typeof t){var a=this._startFragmentUrl=t;t=new i(this),t.loadFromUrl(a)}this._startFragment=t,t.setMaxListeners(100),t.once("error",function(e){r.reset(),t.error=e}),t.getProperty("controls",function(){t.error=null,t.removeAllListeners("error")})}}function i(t,e){return this instanceof i?(a.call(this),this._fragmentsClient=t,void(this._pattern=e)):new i(t)}/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
    /* A FragmentsClient fetches Triple Pattern Fragments through HTTP. */
    /* eslint max-nested-callbacks: [2, 3] */
    var s=t("../util/HttpClient"),a=t("asynciterator").BufferedIterator,o=t("../util/RdfUtil"),u=t("lru-cache"),c=t("../extractors/CompositeExtractor"),l=t("../extractors/CountExtractor"),f=t("../extractors/ControlsExtractor"),h=t("lodash"),p="application/trig;q=1.0,application/n-quads;q=0.7,text/turtle;q=0.6,application/n-triples;q=0.3,text/n3;q=0.2",d=[t("./TrigFragmentIterator"),t("./TurtleFragmentIterator")];n.prototype.getFragmentByPattern=function(t){function e(){s.emit("error",a.error),s.close()}var r=this._cache,n=JSON.stringify(t);if(r.has(n))return r.get(n).clone();var s=new i(this,t),a=this._startFragment;if(null!==a.error){if(a.error)return setImmediate(e),s;a.once("error",e)}return a.getProperty("controls",function(e){var r=o.isVariableOrBlank(t.subject)?null:t.subject,n=o.isVariableOrBlank(t.predicate)?null:t.predicate,i=o.isVariableOrBlank(t.object)?null:t.object;return o.isLiteral(r)||o.isLiteral(n)?s.empty():(t={subject:r,predicate:n,object:i},void s.loadFromUrl(e.getFragmentUrl(t)))}),r.set(n,s),s.clone()},n.prototype.abortAll=function(){this._httpClient.abortAll()},a.subclass(i),i.prototype._read=function(t,e){for(var r;t-- >0&&this._page&&(r=this._page.read());)this._push(r);e()},i.prototype.loadFromUrl=function(t){var e,r=this,n=this._fragmentsClient,i={"user-agent":"Triple Pattern Fragments Client"};n._startFragmentUrl&&(i.referer=n._startFragmentUrl),e=n._httpClient.get(t,i),e.on("error",function(t){r.emit("error",t)}),e.getProperty("statusCode",function(i){return 200!==i?(e.emit("error",new Error("Could not retrieve "+t+" ("+i+")")),r.close()):void e.getProperty("contentType",function(i){function s(){var t;try{t=u&&u.next}catch(t){}t?r.loadFromUrl(t):r.close()}var a=h.find(d,function(t){return t.supportsContentType(i)});if(!a)return r.emit("error",new Error("No parser for "+i+" at "+t));var o=r._page=new a(e,t);o.on("readable",function(){r.readable=!0});var u={};n._metadataExtractor.extract({fragmentUrl:t},o.metadataStream,function(t,e){for(var n in e)r.getProperty(n)||r.setProperty(n,e[n]);u=e.controls||u}),o.on("end",function(){setImmediate(s)}),o.on("error",function(t){r.emit("error",t)}),r.readable=!0})})},i.prototype.empty=function(){return this.getProperty("metadata")||this.setProperty("metadata",{totalTriples:0}),this.close(),this},i.prototype.toString=function(){return"["+this.constructor.name+" {"+o.toQuickString(this._pattern)+")}"},e.exports=n},{"../extractors/CompositeExtractor":13,"../extractors/ControlsExtractor":14,"../extractors/CountExtractor":15,"../util/HttpClient":29,"../util/RdfUtil":31,"./TrigFragmentIterator":23,"./TurtleFragmentIterator":25,asynciterator:2,lodash:35,"lru-cache":36}],22:[function(t,e,r){function n(t,e,r){return e&&e.length?1===e.length?new l(t,e[0],r):this instanceof n?(a.call(this,t,r),this._pattern=e,this._options=r||(r={}),void(this._client=r.fragmentsClient)):new n(t,e,r):new s(t,r)}/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
    /* A ReorderingGraphPatternIterator builds bindings by reading matches for a basic graph pattern. */
    var i=t("asynciterator"),s=i.TransformIterator,a=i.MultiTransformIterator,o=t("../util/RdfUtil"),u=t("lodash"),c=t("../util/ExecutionLogger")("ReorderingGraphPatternIterator"),l=t("./TriplePatternIterator");a.subclass(n),n.prototype._createTransformer=function(t){function e(e){var r=i.single(t),s=new l(r,e,f);for(p&&0!==p.length&&(s=new n(s,p,f));p=h.pop();)s=new n(s,p,f);return s}var r,a=o.applyBindings(t,this._pattern),f=this._options,h=u.sortBy(o.findConnectedPatterns(a),function(t){var e=u.union.apply(u,t.map(o.getVariables)).length;return-(a.length*e+t.length)}),p=h.pop(),d=p.length;if(1===d)return e(p.pop());r=new s;var _=0,g=1/0;return p.forEach(function(t,n){var i=this._client.getFragmentByPattern(t);i.getProperty("metadata",function(t){return i.close(),t.totalTriples?(t.totalTriples0&&(i=s.read());)this._push(i),t--;if(!t)break}e()},i.prototype.empty=function(){this.getProperty("metadata")||this.setProperty("metadata",{totalTriples:0}),this.close()},i.prototype.toString=function(){return this.toString()+"{"+c.map(this._fragments,function(t){return t.toString()}).join(", ")+"}"},e.exports=n},{"../../util/RdfUtil":31,"../FragmentsClient":21,asynciterator:2,lodash:35}],27:[function(t,e,r){/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
    function n(t,e){function r(r){this.name=t,Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=r,e&&e.apply(this,arguments)}return r.prototype=new Error,r.prototype.name=t,r.prototype.constructor=r,r}e.exports=n},{}],28:[function(t,e,r){function n(t){return this instanceof n?void i.call(this,t):new n(t)}/*! @license MIT ©2013-2016 Miel Vander Sande, Ghent University - imec */
    var i=t("./Logger"),s=t("util"),a=t("asynciterator"),o=0,u=0;a.prototype._uniqueId=function(){return this.__uniqueid||(this.__uniqueid=++o),this.__uniqueid},s.inherits(n,i),n.prototype.logBinding=function(t,e,r,n){i.enabled("debug")&&this.debug(++u,t._uniqueId(),e,r,n)},n.prototype.logFragment=function(t,e,r){if(i.enabled("debug")){var n=this;e.getProperty("metadata",function(e){n.logBinding(t,r,t._pattern,e&&e.totalTriples)})}},e.exports=n},{"./Logger":30,asynciterator:2,util:62}],29:[function(t,e,r){function n(e){return this instanceof n?(e=e||{},this._request=e.request||t("./Request"),this._defaultHeaders=a.pick({accept:e.contentType||"*/*","accept-encoding":"gzip,deflate","accept-datetime":e.datetime&&e.datetime.toUTCString()},a.identity),this._logger=e.logger||s("HttpClient"),this._maxActiveRequestCount=e.concurrentRequests||10,this._requestId=0,this._queued=[],this._active={},void(this._activeCount=0)):new n(e)}/*! @license MIT ©2014-2016 Ruben Verborgh, Ghent University - imec */
    var i=t("asynciterator").TransformIterator,s=t("../util/Logger.js"),a=t("lodash"),o=t("parse-link-header");n.prototype.get=function(t,e,r){return this.request(t,"GET",e,r)},n.prototype.request=function(t,e,r,n){var s=a.assign({id:this._requestId++,startTime:new Date,url:t,method:e||"GET",headers:a.assign({},this._defaultHeaders,r),timeout:5e3,followRedirect:!0,response:new i({maxBufferSize:1/0})},n);return this._queued.push(s),this._startNextRequest(),s.response},n.prototype._startNextRequest=function(t){t&&delete this._active[t.id]&&this._activeCount--,this._activeCount=0)for(;++e":function(t,e){return t>e},">=":function(t,e){return t>=e},"!":function(t){return!t},"&&":function(t,e){return t&&e},"||":function(t,e){return t||e},lang:function(t){return'"'+l.getLiteralLanguage(t).toLowerCase()+'"'},langmatches:function(t,e){return t=t.toLowerCase(),e=e.toLowerCase(),t===e||"*"===(e=b(e))||t.substr(1,e.length+1)===e+"-"},contains:function(t,e){return e=b(e),t=b(t),t.indexOf(e)>=0},regex:function(t,e){return v(t)&&(t=b(t)),new RegExp(b(e)).test(t)},str:function(t){return v(t)?t:'"'+t+'"'},"http://www.w3.org/2001/XMLSchema#integer":function(t){return'"'+Math.floor(t)+'"^^http://www.w3.org/2001/XMLSchema#integer'},"http://www.w3.org/2001/XMLSchema#double":function(t){return t=t.toFixed(),t.indexOf(".")<0&&(t+=".0"),'"'+t+'"^^http://www.w3.org/2001/XMLSchema#double'},bound:function(t){if("?"!==t[0])throw new Error("BOUND expects a variable but got: "+t);return t in this?g:y}},["+","-","*","/","<","<=",">",">=",p,d].forEach(function(t){a[t].type="numeric"}),["!","&&","||"].forEach(function(t){a[t].type="boolean"}),["+","-","*","/"].forEach(function(t){a[t].resultType="numeric"}),["!","&&","||","=","!=","<","<=",">",">=","langmatches","contains","regex"].forEach(function(t){a[t].resultType="boolean"}),a.bound.acceptsExpressions=!0,o=f("UnsupportedExpressionError",function(t){this.message="Unsupported expression type: "+t+"."}),u=f("UnsupportedExpressionError",function(t){this.message="Unsupported operator: "+t+"."}),c=f("InvalidArgumentsNumberError",function(t,e,r){this.message="Invalid number of arguments for "+t+": "+e+" (expected: "+r+")."}),e.exports=n,e.exports.UnsupportedExpressionError=o,e.exports.UnsupportedOperatorError=u,e.exports.InvalidArgumentsNumberError=c},{"./CustomError":27,n3:37}],33:[function(t,e,r){function n(t){i.call(this,t),this._empty=!0,this._variables=t.getProperty("variables")||[]}/*! @license MIT ©2014-2016 Miel Vander Sande, Ghent University - imec */
    /* Serializing the output of a SparqlIterator */
    var i=t("asynciterator").TransformIterator;i.subclass(n),n.prototype._begin=function(t){this._writeHead(this._variables.map(function(t){return t.substring(1)})),t()},n.prototype._writeHead=function(t){},n.prototype._transform=function(t,e){"boolean"==typeof t?this._writeBoolean(t):this._writeBindings(t),this._empty=!1,e()},n.prototype._writeBindings=function(t){throw new Error("The _writeBindings method has not been implemented.")},n.prototype._writeBoolean=function(t){throw new Error("The _writeBoolean method has not been implemented.")},n.writers={},n.register=function(t,e){n.writers[t]=e},n.instantiate=function(e,r){var i=n.writers[e];if(!i)throw new Error("No writer available for media type "+e+".");return"string"==typeof i&&(i=n.writers[e]=t(i)),new i(r)},e.exports=n},{asynciterator:2}],34:[function(t,e,r){/*! @license MIT ©2013-2016 Ruben Verborgh, Ghent University - imec */
    /* Main ldf-client module exports. */
    var n=t;t=function(e){return function(){return t(e)}};var r=e.exports={SparqlIterator:t("./lib/sparql/SparqlIterator.js"),FragmentsClient:t("./lib/triple-pattern-fragments/federated/FederatedFragmentsClient"),Logger:t("./lib/util/Logger"),HttpClient:t("./lib/util/HttpClient"),SparqlResultWriter:function(){var e=t("./lib/writers/SparqlResultWriter");return e.register("application/json","./JSONResultWriter"),e.register("application/sparql-results+json","./SparqlJSONResultWriter"),e.register("application/sparql-results+xml","./SparqlXMLResultWriter"),e.register("debug","./StatsResultWriter"),e.register("simple","./SimpleResultWriter"),e.register("table","./TableResultWriter"),e}};Object.keys(r).forEach(function(t){var e=r[t];Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){return delete r[t],r[t]=e()}})}),t=n},{"./lib/sparql/SparqlIterator.js":19,"./lib/triple-pattern-fragments/federated/FederatedFragmentsClient":26,"./lib/util/HttpClient":29,"./lib/util/Logger":30,"./lib/writers/SparqlResultWriter":33}],35:[function(e,r,n){(function(e){(function(){function i(t,e,r){for(var n=(r||0)-1,i=t?t.length:0;++n-1?0:-1:t?0:-1}function a(t){var e=this.cache,r=typeof t;if("boolean"==r||null==t)e[t]=!0;else{"number"!=r&&"string"!=r&&(r="object");var n="number"==r?t:x+t,i=e[r]||(e[r]={});"object"==r?(i[n]||(i[n]=[])).push(t):i[n]=!0}}function o(t){return t.charCodeAt(0)}function u(t,e){for(var r=t.criteria,n=e.criteria,i=-1,s=r.length;++io||"undefined"==typeof a)return 1;if(a=w&&n===i,u=[];if(o){var l=c(e);l?(n=s,e=l):o=!1}for(;++r-1});return i.pop(),s.pop(),v&&(p(i),p(s)),a}function et(t,e,r,n,i){(Yr(e)?Xt:un)(e,function(e,s){var a,o,u=e,c=t[s];if(e&&((o=Yr(e))||cn(e))){for(var l=n.length;l--;)if(a=n[l]==e){c=i[l];break}if(!a){var f;r&&(u=r(c,e),(f="undefined"!=typeof u)&&(c=u)),f||(c=o?Yr(c)?c:[]:cn(c)?c:{}),n.push(e),i.push(c),f||et(c,e,r,n,i)}}else r&&(u=r(c,e),"undefined"==typeof u&&(u=e)),"undefined"!=typeof u&&(c=u);t[s]=c})}function rt(t,e){return t+Ar(Qr()*(e-t+1))}function it(t,e,r){var n=-1,a=ut(),o=t?t.length:0,u=[],l=!e&&o>=w&&a===i,h=r||l?f():u;if(l){var _=c(h);a=s,h=_}for(;++n3&&"function"==typeof e[r-2])var n=b(e[--r-1],e[r--],2);else r>2&&"function"==typeof e[r-1]&&(n=e[--r]);for(var i=_(arguments,1,r),s=-1,a=f(),o=f();++s-1:"number"==typeof s?a=(Lt(t)?t.indexOf(e,r):i(t,e,r))>-1:un(t,function(t){if(++n>=r)return!(a=t===e)}),a}function Ht(t,r,n){var i=!0;r=e.createCallback(r,n,3);var s=-1,a=t?t.length:0;if("number"==typeof a)for(;++ss&&(s=c)}else r=null==r&&Lt(t)?o:e.createCallback(r,n,3),Xt(t,function(t,e,n){var a=r(t,e,n);a>i&&(i=a,s=t)});return s}function ee(t,r,n){var i=1/0,s=i;if("function"!=typeof r&&n&&n[r]===t&&(r=null),null==r&&Yr(t))for(var a=-1,u=t.length;++a=w&&c(e?t[e]:u)))}var h=t[0],_=-1,g=h?h.length:0,y=[];t:for(;++_>>1;n(t[o])1?arguments:arguments[0],e=-1,r=t?te(pn(t,"length")):0,n=pr(r<0?0:r);++e2?at(t,17,_(arguments,2),null,e):at(t,1,null,null,e)}function Le(t){for(var e=arguments.length>1?K(arguments,!0,!1,1):mt(t),r=-1,n=e.length;++r2?at(e,19,_(arguments,2),null,t):at(e,3,null,null,t)}function Pe(){for(var t=arguments,e=t.length;e--;)if(!St(t[e]))throw new wr;return function(){for(var e=arguments,r=t.length;r--;)e=[t[r].apply(this,e)];return e[0]}}function Ue(t,e){return e="number"==typeof e?e:+e||t.length,at(t,4,null,null,null,e)}function Be(t,e,r){var n,i,s,a,o,u,c,l=0,f=!1,h=!0;if(!St(t))throw new wr;if(e=zr(0,e)||0,r===!0){var p=!0;h=!1}else At(r)&&(p=r.leading,f="maxWait"in r&&(zr(e,r.maxWait)||0),h="trailing"in r?r.trailing:h);var d=function(){var r=e-(_n()-a);if(r<=0){i&&Sr(i);var f=c;i=u=c=y,f&&(l=_n(),s=t.apply(o,n),u||i||(n=o=null))}else u=Lr(d,r)},_=function(){u&&Sr(u),i=u=c=y,(h||f!==e)&&(l=_n(),s=t.apply(o,n),u||i||(n=o=null))};return function(){if(n=arguments,a=_n(),o=this,c=h&&(u||!p),f===!1)var r=p&&!u;else{i||p||(l=a);var g=f-(a-l),y=g<=0;y?(i&&(i=Sr(i)),l=a,s=t.apply(o,n)):i||(i=Lr(_,g))}return y&&u?u=Sr(u):u||e===f||(u=Lr(d,e)),r&&(y=!0,s=t.apply(o,n)),!y||u||i||(n=o=null),s}}function $e(t){if(!St(t))throw new wr;var e=_(arguments,1);return Lr(function(){t.apply(y,e)},1)}function qe(t,e){if(!St(t))throw new wr;var r=_(arguments,2);return Lr(function(){t.apply(y,r)},e)}function Me(t,e){if(!St(t))throw new wr;var r=function(){var n=r.cache,i=e?e.apply(this,arguments):x+arguments[0];return Dr.call(n,i)?n[i]:n[i]=t.apply(this,arguments)};return r.cache={},r}function Ge(t){var e,r;if(!St(t))throw new wr;return function(){return e?r:(e=!0,r=t.apply(this,arguments),t=null,r)}}function ze(t){return at(t,16,_(arguments,1))}function Ve(t){return at(t,32,null,_(arguments,1))}function He(t,e,r){var n=!0,i=!0;if(!St(t))throw new wr;return r===!1?n=!1:At(r)&&(n="leading"in r?r.leading:n,i="trailing"in r?r.trailing:i),W.leading=n,W.maxWait=e,W.trailing=i,Be(t,e,W)}function Qe(t,e){return at(e,16,[t])}function We(t){return function(){return t}}function Ze(t,e,r){var n=typeof t;if(null==t||"function"==n)return b(t,e,r);if("object"!=n)return er(t);var i=Kr(t),s=i[0],a=t[s];return 1!=i.length||a!==a||At(a)?function(e){for(var r=i.length,n=!1;r--&&(n=tt(e[i[r]],t[i[r]],null,!0)););return n}:function(t){var e=t[s];return a===e&&(0!==a||1/a==1/e)}}function Xe(t){return null==t?"":xr(t).replace(nn,ot)}function Ye(t){return t}function Je(t,n,i){var s=!0,a=n&&mt(n);n&&(i||a.length)||(null==i&&(i=n),o=r,n=t,t=e,a=mt(n)),i===!1?s=!1:At(i)&&"chain"in i&&(s=i.chain);var o=t,u=St(o);Xt(a,function(e){var r=t[e]=n[e];u&&(o.prototype[e]=function(){var e=this.__chain__,n=this.__wrapped__,i=[n];Nr.apply(i,arguments);var a=r.apply(t,i);if(s||e){if(n===a&&At(a))return this;a=new o(a),a.__chain__=e}return a})})}function Ke(){return t._=Tr,this}function tr(){}function er(t){return function(e){return e[t]}}function rr(t,e,r){var n=null==t,i=null==e;if(null==r&&("boolean"==typeof t&&i?(r=t,t=1):i||"boolean"!=typeof e||(r=e,i=!0)),n&&i&&(e=1),t=+t||0,i?(e=t,t=0):e=+e||0,r||t%1||e%1){var s=Qr();return Vr(t+s*(e-t+parseFloat("1e-"+((s+"").length-1))),e)}return rt(t,e)}function nr(t,e){if(t){var r=t[e];return St(r)?t[e]():r}}function ir(t,r,n){var i=e.templateSettings;t=xr(t||""),n=an({},n,i);var s,a=an({},n.imports,i.imports),o=Kr(a),u=Gt(a),c=0,f=n.interpolate||D,h="__p += '",p=mr((n.escape||D).source+"|"+f.source+"|"+(f===j?C:D).source+"|"+(n.evaluate||D).source+"|$","g");t.replace(p,function(e,r,n,i,a,o){return n||(n=i),h+=t.slice(c,o).replace(L,l),r&&(h+="' +\n__e("+r+") +\n'"),a&&(s=!0,h+="';\n"+a+";\n__p += '"),n&&(h+="' +\n((__t = ("+n+")) == null ? '' : __t) +\n'"),c=o+e.length,e}),h+="';\n";var d=n.variable,_=d;_||(d="obj",h="with ("+d+") {\n"+h+"\n}\n"),h=(s?h.replace(T,""):h).replace(k,"$1").replace(I,"$1;"),h="function("+d+") {\n"+(_?"":d+" || ("+d+" = {});\n")+"var __t, __p = '', __e = _.escape"+(s?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+h+"return __p\n}";var g="\n/*\n//# sourceURL="+(n.sourceURL||"/lodash/template/source["+P++ +"]")+"\n*/";try{var v=gr(o,"return "+h+g).apply(y,u)}catch(t){throw t.source=h,t}return r?v(r):(v.source=h,v)}function sr(t,e,r){t=(t=+t)>-1?t:0;var n=-1,i=pr(t);for(e=b(e,r,1);++n/g,evaluate:/<%([\s\S]+?)%>/g,interpolate:j,variable:"",imports:{_:e}},Br||(v=function(){function e(){}return function(r){if(At(r)){e.prototype=r;var n=new e;e.prototype=null}return n||t.Object()}}());var Xr=Ur?function(t,e){Z.value=e,Ur(t,"__bindData__",Z),Z.value=null}:tr,Yr=$r||function(t){return t&&"object"==typeof t&&"number"==typeof t.length&&kr.call(t)==B||!1},Jr=function(t){var e,r=t,n=[];if(!r)return n;if(!X[typeof t])return n;for(e in r)Dr.call(r,e)&&n.push(e);return n},Kr=Gr?function(t){return At(t)?Gr(t):[]}:Jr,tn={"&":"&","<":"<",">":">",'"':""","'":"'"},en=wt(tn),rn=mr("("+Kr(en).join("|")+")","g"),nn=mr("["+Kr(tn).join("")+"]","g"),sn=function(t,e,r){var n,i=t,s=i;if(!i)return s;var a=arguments,o=0,u="number"==typeof r?2:a.length;if(u>3&&"function"==typeof a[u-2])var c=b(a[--u-1],a[u--],2);else u>2&&"function"==typeof a[u-1]&&(c=a[--u]);for(;++o/g,O=RegExp("^["+F+"]*0+(?=.$)"),D=/($^)/,N=/\bthis\b/,L=/['\n\r\t\u2028\u2029\\]/g,R=["Array","Boolean","Date","Function","Math","Number","Object","RegExp","String","_","attachEvent","clearTimeout","isFinite","isNaN","parseInt","setTimeout"],P=0,U="[object Arguments]",B="[object Array]",$="[object Boolean]",q="[object Date]",M="[object Function]",G="[object Number]",z="[object Object]",V="[object RegExp]",H="[object String]",Q={};Q[M]=!1,Q[U]=Q[B]=Q[$]=Q[q]=Q[G]=Q[z]=Q[V]=Q[H]=!0;var W={leading:!1,maxWait:0,trailing:!1},Z={configurable:!1,enumerable:!1,value:null,writable:!1},X={boolean:!1,function:!0,object:!0,number:!1,string:!1,undefined:!1},Y={"\\":"\\","'":"'","\n":"n","\r":"r","\t":"t","\u2028":"u2028","\u2029":"u2029"},J=self,K=X[typeof n]&&n&&!n.nodeType&&n,tt=X[typeof r]&&r&&!r.nodeType&&r,et=tt&&tt.exports===K&&K,rt=X[typeof e]&&e;!rt||rt.global!==rt&&rt.window!==rt||(J=rt);var nt=g();"function"==typeof t&&"object"==typeof t.amd&&t.amd?(J._=nt,t(function(){return nt})):K&&tt?et?(tt.exports=nt)._=nt:K._=nt:J._=nt}).call(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],36:[function(t,e,r){function n(t,e,r){var n;return g[e]?n=g[e]:(n=h(e),g[e]=n),2===arguments.length?t[n]:(t[n]=r,r)}function i(){return 1}function s(t){if(!(this instanceof s))return new s(t);"number"==typeof t&&(t={max:t}),t||(t={});var e=n(this,"max",t.max);(!e||"number"!=typeof e||e<=0)&&n(this,"max",1/0);var r=t.length||i;"function"!=typeof r&&(r=i),n(this,"lengthCalculator",r),n(this,"allowStale",t.stale||!1),n(this,"maxAge",t.maxAge||0),n(this,"dispose",t.dispose),this.reset()}function a(t,e,r,i){var s=r.value;u(t,s)&&(l(t,r),n(t,"allowStale")||(s=void 0)),s&&e.call(i,s.value,s.key,t)}function o(t,e,r){var i=n(t,"cache").get(e);if(i){var s=i.value;u(t,s)?(l(t,i),n(t,"allowStale")||(s=void 0)):r&&n(t,"lruList").unshiftNode(i),s&&(s=s.value)}return s}function u(t,e){if(!e||!e.maxAge&&!n(t,"maxAge"))return!1;var r=!1,i=Date.now()-e.now;return r=e.maxAge?i>e.maxAge:n(t,"maxAge")&&i>n(t,"maxAge")}function c(t){if(n(t,"length")>n(t,"max"))for(var e=n(t,"lruList").tail;n(t,"length")>n(t,"max")&&null!==e;){var r=e.prev;l(t,e),e=r}}function l(t,e){if(e){var r=e.value;n(t,"dispose")&&n(t,"dispose").call(this,r.key,r.value),n(t,"length",n(t,"length")-r.length),n(t,"cache").delete(r.key),n(t,"lruList").removeNode(e)}}function f(t,e,r,n,i){this.key=t,this.value=e,this.length=r,this.now=n,this.maxAge=i||0}e.exports=s;var h,p=t("pseudomap"),d=t("util"),_=t("yallist"),g={},y="function"==typeof Symbol;h=y?function(t){return Symbol.for(t)}:function(t){return"_"+t},Object.defineProperty(s.prototype,"max",{set:function(t){(!t||"number"!=typeof t||t<=0)&&(t=1/0),n(this,"max",t),c(this)},get:function(){return n(this,"max")},enumerable:!0}),Object.defineProperty(s.prototype,"allowStale",{set:function(t){n(this,"allowStale",!!t)},get:function(){return n(this,"allowStale")},enumerable:!0}),Object.defineProperty(s.prototype,"maxAge",{set:function(t){(!t||"number"!=typeof t||t<0)&&(t=0),n(this,"maxAge",t),c(this)},get:function(){return n(this,"maxAge")},enumerable:!0}),Object.defineProperty(s.prototype,"lengthCalculator",{set:function(t){"function"!=typeof t&&(t=i),t!==n(this,"lengthCalculator")&&(n(this,"lengthCalculator",t),n(this,"length",0),n(this,"lruList").forEach(function(t){t.length=n(this,"lengthCalculator").call(this,t.value,t.key),n(this,"length",n(this,"length")+t.length)},this)),c(this)},get:function(){return n(this,"lengthCalculator")},enumerable:!0
}),Object.defineProperty(s.prototype,"length",{get:function(){return n(this,"length")},enumerable:!0}),Object.defineProperty(s.prototype,"itemCount",{get:function(){return n(this,"lruList").length},enumerable:!0}),s.prototype.rforEach=function(t,e){e=e||this;for(var r=n(this,"lruList").tail;null!==r;){var i=r.prev;a(this,t,r,e),r=i}},s.prototype.forEach=function(t,e){e=e||this;for(var r=n(this,"lruList").head;null!==r;){var i=r.next;a(this,t,r,e),r=i}},s.prototype.keys=function(){return n(this,"lruList").toArray().map(function(t){return t.key},this)},s.prototype.values=function(){return n(this,"lruList").toArray().map(function(t){return t.value},this)},s.prototype.reset=function(){n(this,"dispose")&&n(this,"lruList")&&n(this,"lruList").length&&n(this,"lruList").forEach(function(t){n(this,"dispose").call(this,t.key,t.value)},this),n(this,"cache",new p),n(this,"lruList",new _),n(this,"length",0)},s.prototype.dump=function(){return n(this,"lruList").map(function(t){if(!u(this,t))return{k:t.key,v:t.value,e:t.now+(t.maxAge||0)}},this).toArray().filter(function(t){return t})},s.prototype.dumpLru=function(){return n(this,"lruList")},s.prototype.inspect=function(t,e){var r="LRUCache {",s=!1,a=n(this,"allowStale");a&&(r+="\n  allowStale: true",s=!0);var o=n(this,"max");o&&o!==1/0&&(s&&(r+=","),r+="\n  max: "+d.inspect(o,e),s=!0);var c=n(this,"maxAge");c&&(s&&(r+=","),r+="\n  maxAge: "+d.inspect(c,e),s=!0);var l=n(this,"lengthCalculator");l&&l!==i&&(s&&(r+=","),r+="\n  length: "+d.inspect(n(this,"length"),e),s=!0);var f=!1;return n(this,"lruList").forEach(function(t){f?r+=",\n  ":(s&&(r+=",\n"),f=!0,r+="\n  ");var n=d.inspect(t.key).split("\n").join("\n  "),a={value:t.value};t.maxAge!==c&&(a.maxAge=t.maxAge),l!==i&&(a.length=t.length),u(this,t)&&(a.stale=!0),a=d.inspect(a,e).split("\n").join("\n  "),r+=n+" => "+a}),(f||s)&&(r+="\n"),r+="}"},s.prototype.set=function(t,e,r){r=r||n(this,"maxAge");var i=r?Date.now():0,s=n(this,"lengthCalculator").call(this,e,t);if(n(this,"cache").has(t)){if(s>n(this,"max"))return l(this,n(this,"cache").get(t)),!1;var a=n(this,"cache").get(t),o=a.value;return n(this,"dispose")&&n(this,"dispose").call(this,t,o.value),o.now=i,o.maxAge=r,o.value=e,n(this,"length",n(this,"length")+(s-o.length)),o.length=s,this.get(t),c(this),!0}var u=new f(t,e,s,i,r);return u.length>n(this,"max")?(n(this,"dispose")&&n(this,"dispose").call(this,t,e),!1):(n(this,"length",n(this,"length")+u.length),n(this,"lruList").unshift(u),n(this,"cache").set(t,n(this,"lruList").head),c(this),!0)},s.prototype.has=function(t){if(!n(this,"cache").has(t))return!1;var e=n(this,"cache").get(t).value;return!u(this,e)},s.prototype.get=function(t){return o(this,t,!0)},s.prototype.peek=function(t){return o(this,t,!1)},s.prototype.pop=function(){var t=n(this,"lruList").tail;return t?(l(this,t),t.value):null},s.prototype.del=function(t){l(this,n(this,"cache").get(t))},s.prototype.load=function(t){this.reset();for(var e=Date.now(),r=t.length-1;r>=0;r--){var n=t[r],i=n.e||0;if(0===i)this.set(n.k,n.v);else{var s=i-e;s>0&&this.set(n.k,n.v,s)}}},s.prototype.prune=function(){var t=this;n(this,"cache").forEach(function(e,r){o(t,r,!1)})}},{pseudomap:47,util:62,yallist:64}],37:[function(t,e,r){var n=t;t=function(){};var r=e.exports={Lexer:t("./lib/N3Lexer"),Parser:t("./lib/N3Parser"),Writer:t("./lib/N3Writer"),Store:t("./lib/N3Store"),StreamParser:t("./lib/N3StreamParser"),StreamWriter:t("./lib/N3StreamWriter"),Util:t("./lib/N3Util")};Object.keys(r).forEach(function(t){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){return delete r[t],r[t]=n("./lib/N3"+t)}})})},{"./lib/N3Lexer":38,"./lib/N3Parser":39,"./lib/N3Store":40,"./lib/N3StreamParser":41,"./lib/N3StreamWriter":42,"./lib/N3Util":43,"./lib/N3Writer":44}],38:[function(t,e,r){function n(t){if(!(this instanceof n))return new n(t);if(t=t||{},t.lineMode){this._tripleQuotedString=this._number=this._boolean=/$0^/;var e=this;this._tokenize=this.tokenize,this.tokenize=function(t,r){this._tokenize(t,function(t,n){!t&&/^(?:IRI|prefixed|literal|langcode|type|\.|eof)$/.test(n.type)?r&&r(t,n):r&&r(t||e._syntaxError(n.type,r=null))})}}this._n3Mode=t.n3!==!1,this._comments=!!t.comments}var i=String.fromCharCode,s="function"==typeof setImmediate?setImmediate:function(t){setTimeout(t,0)},a=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\[uU]|\\(.)/g,o={"\\":"\\","'":"'",'"':'"',n:"\n",r:"\r",t:"\t",f:"\f",b:"\b",_:"_","~":"~",".":".","-":"-","!":"!",$:"$","&":"&","(":"(",")":")","*":"*","+":"+",",":",",";":";","=":"=","/":"/","?":"?","#":"#","@":"@","%":"%"},u=/[\x00-\x20<>\\"\{\}\|\^\`]/;n.prototype={_iri:/^<((?:[^ <>{}\\]|\\[uU])+)>/,_unescapedIri:/^<([^\x00-\x20<>\\"\{\}\|\^\`]*)>/,_unescapedString:/^"[^"\\]+"(?=[^"\\])/,_singleQuotedString:/^"[^"\\]*(?:\\.[^"\\]*)*"(?=[^"\\])|^'[^'\\]*(?:\\.[^'\\]*)*'(?=[^'\\])/,_tripleQuotedString:/^""("[^"\\]*(?:(?:\\.|"(?!""))[^"\\]*)*")""|^''('[^'\\]*(?:(?:\\.|'(?!''))[^'\\]*)*')''/,_langcode:/^@([a-z]+(?:-[a-z0-9]+)*)(?=[^a-z0-9\-])/i,_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<])/,_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}|\\[!#-\/;=?\-@_~]))?)?)(?=\.?[,;!\^\s#()\[\]\{\}"'<])/,_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#()\[\]\{\}"'<])/,_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])*)(?=\.?[,;:\s#()\[\]\{\}"'<])/,_number:/^[\-+]?(?:\d+\.?\d*([eE](?:[\-\+])?\d+)|\d*\.?\d+)(?=[.,;:\s#()\[\]\{\}"'<])/,_boolean:/^(?:true|false)(?=[.,;\s#()\[\]\{\}"'<])/,_keyword:/^@[a-z]+(?=[\s#<:])/i,_sparqlKeyword:/^(?:PREFIX|BASE|GRAPH)(?=[\s#<:])/i,_shortPredicates:/^a(?=\s+|<)/,_newline:/^[ \t]*(?:#[^\n\r]*)?(?:\r\n|\n|\r)[ \t]*/,_comment:/#([^\n\r]*)/,_whitespace:/^[ \t]+/,_endOfFile:/^(?:#[^\n\r]*)?$/,_tokenizeToEnd:function(t,e){function r(e){t(e._syntaxError(/^\S*/.exec(n)[0]))}for(var n=this._input,i=this._comments;;){for(var s,a;s=this._newline.exec(n);)i&&(a=this._comment.exec(s[0]))&&t(null,{line:this._line,type:"comment",value:a[1],prefix:""}),n=n.substr(s[0].length,n.length),this._line++;if((s=this._whitespace.exec(n))&&(n=n.substr(s[0].length,n.length)),this._endOfFile.test(n))return e&&(i&&(a=this._comment.exec(n))&&t(null,{line:this._line,type:"comment",value:a[1],prefix:""}),t(n=null,{line:this._line,type:"eof",value:"",prefix:""})),this._input=n;var o,c=this._line,l="",f="",h="",p=n[0],d=null,_=0,g=!1;switch(p){case"^":if(n.length<3)break;if("^"!==n[1]){this._n3Mode&&(_=1,l="^");break}if(this._prevTokenType="^^",n=n.substr(2),"<"!==n[0]){g=!0;break}case"<":if(d=this._unescapedIri.exec(n))l="IRI",f=d[1];else if(d=this._iri.exec(n)){if(o=this._unescape(d[1]),null===o||u.test(o))return r(this);l="IRI",f=o}else this._n3Mode&&n.length>1&&"="===n[1]&&(l="inverse",_=2,f="http://www.w3.org/2000/10/swap/log#implies");break;case"_":((d=this._blank.exec(n))||e&&(d=this._blank.exec(n+" ")))&&(l="blank",h="_",f=d[1]);break;case'"':case"'":if(d=this._unescapedString.exec(n))l="literal",f=d[0];else if(d=this._singleQuotedString.exec(n)){if(o=this._unescape(d[0]),null===o)return r(this);l="literal",f=o.replace(/^'|'$/g,'"')}else if(d=this._tripleQuotedString.exec(n)){if(o=d[1]||d[2],this._line+=o.split(/\r\n|\r|\n/).length-1,o=this._unescape(o),null===o)return r(this);l="literal",f=o.replace(/^'|'$/g,'"')}break;case"?":this._n3Mode&&(d=this._variable.exec(n))&&(l="var",f=d[0]);break;case"@":"literal"===this._prevTokenType&&(d=this._langcode.exec(n))?(l="langcode",f=d[1]):(d=this._keyword.exec(n))&&(l=d[0]);break;case".":if(1===n.length?e:n[1]<"0"||n[1]>"9"){l=".",_=1;break}case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":case"8":case"9":case"+":case"-":(d=this._number.exec(n))&&(l="literal",f='"'+d[0]+'"^^http://www.w3.org/2001/XMLSchema#'+(d[1]?"double":/^[+\-]?\d+$/.test(d[0])?"integer":"decimal"));break;case"B":case"b":case"p":case"P":case"G":case"g":(d=this._sparqlKeyword.exec(n))?l=d[0].toUpperCase():g=!0;break;case"f":case"t":(d=this._boolean.exec(n))?(l="literal",f='"'+d[0]+'"^^http://www.w3.org/2001/XMLSchema#boolean'):g=!0;break;case"a":(d=this._shortPredicates.exec(n))?(l="abbreviation",f="http://www.w3.org/1999/02/22-rdf-syntax-ns#type"):g=!0;break;case"=":this._n3Mode&&n.length>1&&(l="abbreviation",">"!==n[1]?(_=1,f="http://www.w3.org/2002/07/owl#sameAs"):(_=2,f="http://www.w3.org/2000/10/swap/log#implies"));break;case"!":if(!this._n3Mode)break;case",":case";":case"[":case"]":case"(":case")":case"{":case"}":_=1,l=p;break;default:g=!0}if(g&&("@prefix"!==this._prevTokenType&&"PREFIX"!==this._prevTokenType||!(d=this._prefix.exec(n))?((d=this._prefixed.exec(n))||e&&(d=this._prefixed.exec(n+" ")))&&(l="prefixed",h=d[1]||"",f=this._unescape(d[2])):(l="prefix",f=d[1]||"")),"^^"===this._prevTokenType)switch(l){case"prefixed":l="type";break;case"IRI":l="typeIRI";break;default:l=""}if(!l)return e||!/^'''|^"""/.test(n)&&/\n|\r/.test(n)?r(this):this._input=n;t(null,{line:c,type:l,value:f,prefix:h}),this._prevTokenType=l,n=n.substr(_||d[0].length,n.length)}},_unescape:function(t){try{return t.replace(a,function(t,e,r,n){var s;if(e){if(s=parseInt(e,16),isNaN(s))throw new Error;return i(s)}if(r){if(s=parseInt(r,16),isNaN(s))throw new Error;return s<=65535?i(s):i(55296+(s-=65536)/1024,56320+(1023&s))}var a=o[n];if(!a)throw new Error;return a})}catch(t){return null}},_syntaxError:function(t){return this._input=null,new Error('Unexpected "'+t+'" on line '+this._line+".")},tokenize:function(t,e){var r=this;if(this._line=1,"string"==typeof t){if(this._input=t,"function"!=typeof e){var n,i=[];if(this._tokenizeToEnd(function(t,e){t?n=t:i.push(e)},!0),n)throw n;return i}s(function(){r._tokenizeToEnd(e,!0)})}else this._input="","function"==typeof t.setEncoding&&t.setEncoding("utf8"),t.on("data",function(t){null!==r._input&&(r._input+=t,r._tokenizeToEnd(e,!1))}),t.on("end",function(){null!==r._input&&r._tokenizeToEnd(e,!0)})}},e.exports=n},{}],39:[function(t,e,r){function n(t){if(!(this instanceof n))return new n(t);this._contextStack=[],this._graph=null,t=t||{},this._setBase(t.documentIRI);var e="string"==typeof t.format?t.format.match(/\w*$/)[0].toLowerCase():"",r="turtle"===e,a="trig"===e,o=/triple/.test(e),u=/quad/.test(e),c=this._n3Mode=/n3/.test(e),l=o||u;(this._supportsNamedGraphs=!(r||c))||(this._readPredicateOrNamedGraph=this._readPredicate),this._supportsQuads=!(r||a||o||c),l&&(this._base="",this._resolveIRI=function(t){return this._error("Disallowed relative IRI",t),this._callback=i,this._subject=null}),this._blankNodePrefix="string"!=typeof t.blankNodePrefix?"":"_:"+t.blankNodePrefix.replace(/^_:/,""),this._lexer=t.lexer||new s({lineMode:l,n3:c}),this._explicitQuantifiers=!!t.explicitQuantifiers}function i(){}var s=t("./N3Lexer"),a="http://www.w3.org/1999/02/22-rdf-syntax-ns#",o=a+"nil",u=a+"first",c=a+"rest",l="urn:n3:quantifiers",f=/^[a-z][a-z0-9+.-]*:/i,h=/^(?:([a-z][a-z0-9+.-]*:))?(?:\/\/[^\/]*)?/i,p=/(?:^|\/)\.\.?(?:$|[\/#?])/,d=0,_=0;n._resetBlankNodeIds=function(){d=_=0},n.prototype={_setBase:function(t){if(t){var e=t.indexOf("#");e>=0&&(t=t.substr(0,e)),this._base=t,this._basePath=t.indexOf("/")<0?t:t.replace(/[^\/?]*(?:\?.*)?$/,""),t=t.match(h),this._baseRoot=t[0],this._baseScheme=t[1]}else this._base=null},_saveContext:function(t,e,r,n,i){var s=this._n3Mode;this._contextStack.push({subject:r,predicate:n,object:i,graph:e,type:t,inverse:!!s&&this._inversePredicate,blankPrefix:s?this._prefixes._:"",quantified:s?this._quantified:null}),s&&(this._inversePredicate=!1,this._prefixes._=this._graph+".",this._quantified=Object.create(this._quantified))},_restoreContext:function(){var t=this._contextStack.pop(),e=this._n3Mode;this._subject=t.subject,this._predicate=t.predicate,this._object=t.object,this._graph=t.graph,e&&(this._inversePredicate=t.inverse,this._prefixes._=t.blankPrefix,this._quantified=t.quantified)},_readInTopContext:function(t){switch(t.type){case"eof":return null!==this._graph?this._error("Unclosed graph",t):(delete this._prefixes._,this._callback(null,null,this._prefixes));case"PREFIX":this._sparqlStyle=!0;case"@prefix":return this._readPrefix;case"BASE":this._sparqlStyle=!0;case"@base":return this._readBaseIRI;case"{":if(this._supportsNamedGraphs)return this._graph="",this._subject=null,this._readSubject;case"GRAPH":if(this._supportsNamedGraphs)return this._readNamedGraphLabel;default:return this._readSubject(t)}},_readEntity:function(t,e){var r;switch(t.type){case"IRI":case"typeIRI":r=null===this._base||f.test(t.value)?t.value:this._resolveIRI(t);break;case"type":case"blank":case"prefixed":var n=this._prefixes[t.prefix];if(void 0===n)return this._error('Undefined prefix "'+t.prefix+':"',t);r=n+t.value;break;case"var":return t.value;default:return this._error("Expected entity but got "+t.type,t)}return!e&&this._n3Mode&&r in this._quantified&&(r=this._quantified[r]),r},_readSubject:function(t){switch(this._predicate=null,t.type){case"[":return this._saveContext("blank",this._graph,this._subject="_:b"+_++,null,null),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,o,null,null),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._graph="_:b"+_++,null,null),this._readSubject):this._error("Unexpected graph",t);case"}":return this._readPunctuation(t);case"@forSome":return this._subject=null,this._predicate="http://www.w3.org/2000/10/swap/reify#forSome",this._quantifiedPrefix="_:b",this._readQuantifierList;case"@forAll":return this._subject=null,this._predicate="http://www.w3.org/2000/10/swap/reify#forAll",this._quantifiedPrefix="?b-",this._readQuantifierList;default:if(!(this._subject=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._readPredicateOrNamedGraph)}return this._readPredicateOrNamedGraph},_readPredicate:function(t){var e=t.type;switch(e){case"inverse":this._inversePredicate=!0;case"abbreviation":this._predicate=t.value;break;case".":case"]":case"}":return null===this._predicate?this._error("Unexpected "+e,t):(this._subject=null,"]"===e?this._readBlankNodeTail(t):this._readPunctuation(t));case";":return this._readPredicate;case"blank":if(!this._n3Mode)return this._error("Disallowed blank node as predicate",t);default:if(!(this._predicate=this._readEntity(t)))return}return this._readObject},_readObject:function(t){switch(t.type){case"literal":return this._object=t.value,this._readDataTypeOrLang;case"[":return this._saveContext("blank",this._graph,this._subject,this._predicate,this._subject="_:b"+_++),this._readBlankNodeHead;case"(":return this._saveContext("list",this._graph,this._subject,this._predicate,o),this._subject=null,this._readListItem;case"{":return this._n3Mode?(this._saveContext("formula",this._graph,this._subject,this._predicate,this._graph="_:b"+_++),this._readSubject):this._error("Unexpected graph",t);default:if(!(this._object=this._readEntity(t)))return;if(this._n3Mode)return this._getPathReader(this._getTripleEndReader())}return this._getTripleEndReader()},_readPredicateOrNamedGraph:function(t){return"{"===t.type?this._readGraph(t):this._readPredicate(t)},_readGraph:function(t){return"{"!==t.type?this._error("Expected graph but got "+t.type,t):(this._graph=this._subject,this._subject=null,this._readSubject)},_readBlankNodeHead:function(t){return"]"===t.type?(this._subject=null,this._readBlankNodeTail(t)):(this._predicate=null,this._readPredicate(t))},_readBlankNodeTail:function(t){if("]"!==t.type)return this._readBlankNodePunctuation(t);null!==this._subject&&this._triple(this._subject,this._predicate,this._object,this._graph);var e=null===this._predicate;return this._restoreContext(),null===this._object?e?this._readPredicateOrNamedGraph:this._readPredicate:this._getTripleEndReader()},_readDataTypeOrLang:function(t){var e;switch(t.type){case"type":case"typeIRI":e="^^"+this._readEntity(t);break;case"langcode":e="@"+t.value.toLowerCase();break;default:return this._readCallback=this._getTripleEndReader(),this._readCallback(t)}return this._object+=e,this._getTripleEndReader()},_readListItem:function(t){var e=null,r=null,n=this._subject,i=this._contextStack,s=i[i.length-1],a=this._readListItem;switch(t.type){case"[":this._saveContext("blank",this._graph,r="_:b"+_++,u,this._subject=e="_:b"+_++),a=this._readBlankNodeHead;break;case"(":this._saveContext("list",this._graph,r="_:b"+_++,u,o),this._subject=null;break;case")":if(this._restoreContext(),0!==i.length&&"list"===i[i.length-1].type&&this._triple(this._subject,this._predicate,this._object,this._graph),null===this._predicate){if(a=this._readPredicate,this._subject===o)return a}else if(a=this._getTripleEndReader(),this._object===o)return a;r=o;break;case"literal":e=t.value,a=this._readDataTypeOrLang;break;default:if(!(e=this._readEntity(t)))return}if(null===r&&(this._subject=r="_:b"+_++),null===n?null===s.predicate?s.subject=r:s.object=r:this._triple(n,c,r,this._graph),null!==e){if(this._n3Mode&&("IRI"===t.type||"prefixed"===t.type))return this._saveContext("item",this._graph,r,u,e),this._subject=e,this._predicate=null,this._getPathReader(this._readListItem);this._triple(r,u,e,this._graph)}return a},_readFormulaTail:function(t){return"}"!==t.type?this._readPunctuation(t):(null!==this._subject&&this._triple(this._subject,this._predicate,this._object,this._graph),this._restoreContext(),null===this._object?this._readPredicate:this._getTripleEndReader())},_readPunctuation:function(t){var e,r=this._subject,n=this._graph,i=this._inversePredicate;switch(t.type){case"}":if(null===this._graph)return this._error("Unexpected graph closing",t);if(this._n3Mode)return this._readFormulaTail(t);this._graph=null;case".":this._subject=null,e=this._contextStack.length?this._readSubject:this._readInTopContext,i&&(this._inversePredicate=!1);break;case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:if(this._supportsQuads&&null===this._graph&&(n=this._readEntity(t))){e=this._readQuadPunctuation;break}return this._error('Expected punctuation to follow "'+this._object+'"',t)}if(null!==r){var s=this._predicate,a=this._object;i?this._triple(a,s,r,n):this._triple(r,s,a,n)}return e},_readBlankNodePunctuation:function(t){var e;switch(t.type){case";":e=this._readPredicate;break;case",":e=this._readObject;break;default:return this._error('Expected punctuation to follow "'+this._object+'"',t)}return this._triple(this._subject,this._predicate,this._object,this._graph),e},_readQuadPunctuation:function(t){return"."!==t.type?this._error("Expected dot to follow quad",t):this._readInTopContext},_readPrefix:function(t){return"prefix"!==t.type?this._error("Expected prefix to follow @prefix",t):(this._prefix=t.value,this._readPrefixIRI)},_readPrefixIRI:function(t){if("IRI"!==t.type)return this._error('Expected IRI to follow prefix "'+this._prefix+':"',t);var e=this._readEntity(t);return this._prefixes[this._prefix]=e,this._prefixCallback(this._prefix,e),this._readDeclarationPunctuation},_readBaseIRI:function(t){return"IRI"!==t.type?this._error("Expected IRI to follow base declaration",t):(this._setBase(null===this._base||f.test(t.value)?t.value:this._resolveIRI(t)),this._readDeclarationPunctuation)},_readNamedGraphLabel:function(t){switch(t.type){case"IRI":case"blank":case"prefixed":return this._readSubject(t),this._readGraph;case"[":return this._readNamedGraphBlankLabel;default:return this._error("Invalid graph label",t)}},_readNamedGraphBlankLabel:function(t){return"]"!==t.type?this._error("Invalid graph label",t):(this._subject="_:b"+_++,this._readGraph)},_readDeclarationPunctuation:function(t){return this._sparqlStyle?(this._sparqlStyle=!1,this._readInTopContext(t)):"."!==t.type?this._error("Expected declaration to end with a dot",t):this._readInTopContext},_readQuantifierList:function(t){var e;switch(t.type){case"IRI":case"prefixed":if(e=this._readEntity(t,!0))break;default:return this._error("Unexpected "+t.type,t)}return this._explicitQuantifiers?(null===this._subject?this._triple(this._graph||"",this._predicate,this._subject="_:b"+_++,l):this._triple(this._subject,c,this._subject="_:b"+_++,l),this._triple(this._subject,u,e,l)):this._quantified[e]=this._quantifiedPrefix+_++,this._readQuantifierPunctuation},_readQuantifierPunctuation:function(t){return","===t.type?this._readQuantifierList:(this._explicitQuantifiers&&(this._triple(this._subject,c,o,l),this._subject=null),this._readCallback=this._getTripleEndReader(),this._readCallback(t))},_getPathReader:function(t){return this._afterPath=t,this._readPath},_readPath:function(t){switch(t.type){case"!":return this._readForwardPath;case"^":return this._readBackwardPath;default:var e=this._contextStack,r=e.length&&e[e.length-1];if(r&&"item"===r.type){var n=this._subject;this._restoreContext(),this._triple(this._subject,u,n,this._graph)}return this._afterPath(t)}},_readForwardPath:function(t){var e,r,n="_:b"+_++;if(r=this._readEntity(t))return null===this._predicate?(e=this._subject,this._subject=n):(e=this._object,this._object=n),this._triple(e,r,n,this._graph),this._readPath},_readBackwardPath:function(t){var e,r,n="_:b"+_++;if(e=this._readEntity(t))return null===this._predicate?(r=this._subject,this._subject=n):(r=this._object,this._object=n),this._triple(n,e,r,this._graph),this._readPath},_getTripleEndReader:function(){var t=this._contextStack;if(!t.length)return this._readPunctuation;switch(t[t.length-1].type){case"blank":return this._readBlankNodeTail;case"list":return this._readListItem;case"formula":return this._readFormulaTail}},_triple:function(t,e,r,n){this._callback(null,{subject:t,predicate:e,object:r,graph:n||""})},_error:function(t,e){this._callback(new Error(t+" on line "+e.line+"."))},_resolveIRI:function(t){var e=t.value;switch(e[0]){case void 0:return this._base;case"#":return this._base+e;case"?":return this._base.replace(/(?:\?.*)?$/,e);case"/":return("/"===e[1]?this._baseScheme:this._baseRoot)+this._removeDotSegments(e);default:return this._removeDotSegments(this._basePath+e)}},_removeDotSegments:function(t){if(!p.test(t))return t;for(var e="",r=t.length,n=-1,i=-1,s=0,a="/";n=i&&(e=e.substr(0,s)),"/"!==a)return e+"/"+t.substr(n+1);s=n+1}}}a=t[++n]}return e+t.substring(s)},parse:function(t,e,r){var n=this;if(this._readCallback=this._readInTopContext,this._sparqlStyle=!1,this._prefixes=Object.create(null),this._prefixes._=this._blankNodePrefix||"_:b"+d++ +"_",this._inversePredicate=!1,this._quantified=Object.create(null),!e&&!r){var s,a=[];if(this._callback=function(t,e){t?s=t:e&&a.push(e)},this._lexer.tokenize(t).every(function(t){return n._readCallback=n._readCallback(t)}),s)throw s;return a}this._callback=e||i,this._prefixCallback=r||i,this._lexer.tokenize(t,function(t,e){null!==t?(n._callback(t),n._callback=i):n._readCallback&&(n._readCallback=n._readCallback(e))})}},e.exports=n},{"./N3Lexer":38}],40:[function(t,e,r){function n(t,e){return this instanceof n?(this._size=0,this._graphs=Object.create(null),this._id=0,this._ids=Object.create(null),this._ids["><"]=0,this._entities=Object.create(null),this._blankNodeIndex=0,e||!t||t[0]||(e=t,t=null),e=e||{},this._prefixes=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes),void(t&&this.addTriples(t))):new n(t,e)}var i=t("./N3Util").expandPrefixedName,s="urn:n3:defaultGraph";n.prototype={get size(){var t=this._size;if(null!==t)return t;var e,r,n=this._graphs;for(var i in n)for(var s in e=n[i].subjects)for(var a in r=e[s])t+=Object.keys(r[a]).length;return this._size=t},get defaultGraph(){return s},_addToIndex:function(t,e,r,n){var i=t[e]||(t[e]={}),s=i[r]||(i[r]={}),a=n in s;return a||(s[n]=null),!a},_removeFromIndex:function(t,e,r,n){var i,s=t[e],a=s[r];delete a[n];for(i in a)return;delete s[r];for(i in s)return;delete t[e]},_findInIndex:function(t,e,r,n,i,s,a,o){var u,c,l,f=[],h=!e+!r+!n,p=h>1?Object.keys(this._ids):this._entities;e&&((u=t,t={})[e]=u[e]);for(var d in t){var _=p[d];if(c=t[d]){r&&((u=c,c={})[r]=u[r]);for(var g in c){var y=p[g];if(l=c[g])for(var v=(n?n in l?[n]:[]:Object.keys(l)),b=v.length-1;b>=0;b--){var m={subject:"",predicate:"",object:"",graph:o};m[i]=_,m[s]=y,m[a]=p[v[b]],f.push(m)}}}}return f},_countInIndex:function(t,e,r,n){var i,s,a,o=0;e&&((i=t,t={})[e]=i[e]);for(var u in t)if(s=t[u]){r&&((i=s,s={})[r]=i[r]);for(var c in s)(a=s[c])&&(n?n in a&&o++:o+=Object.keys(a).length)}return o},addTriple:function(t,e,r,n){e||(n=t.graph,r=t.object,e=t.predicate,t=t.subject),n=n||s;var i=this._graphs[n];i||(i=this._graphs[n]={subjects:{},predicates:{},objects:{}},Object.freeze(i));var a=this._ids,o=this._entities;t=a[t]||(a[o[++this._id]=t]=this._id),e=a[e]||(a[o[++this._id]=e]=this._id),r=a[r]||(a[o[++this._id]=r]=this._id);var u=this._addToIndex(i.subjects,t,e,r);return this._addToIndex(i.predicates,e,r,t),this._addToIndex(i.objects,r,t,e),this._size=null,u},addTriples:function(t){for(var e=t.length-1;e>=0;e--)this.addTriple(t[e])},addPrefix:function(t,e){this._prefixes[t]=e},addPrefixes:function(t){for(var e in t)this.addPrefix(e,t[e])},removeTriple:function(t,e,r,n){e||(n=t.graph,r=t.object,e=t.predicate,t=t.subject),n=n||s;var i,a=this._ids,o=this._graphs;if(!(t=a[t]))return!1;if(!(e=a[e]))return!1;if(!(r=a[r]))return!1;if(!(i=o[n]))return!1;var u,c;if(!(u=i.subjects[t]))return!1;if(!(c=u[e]))return!1;if(!(r in c))return!1;this._removeFromIndex(i.subjects,t,e,r),this._removeFromIndex(i.predicates,e,r,t),this._removeFromIndex(i.objects,r,t,e),null!==this._size&&this._size--;for(t in i.subjects)return!0;return delete o[n],!0},removeTriples:function(t){for(var e=t.length-1;e>=0;e--)this.removeTriple(t[e])},find:function(t,e,r,n){var s=this._prefixes;return this.findByIRI(i(t,s),i(e,s),i(r,s),i(n,s))},findByIRI:function(t,e,r,n){var i,a,o,u,c=[],l={},f=this._ids;n?l[n]=this._graphs[n]:l=this._graphs;for(var h in l)if(i=l[h]){if(t&&!(a=f[t]))return c;if(e&&!(o=f[e]))return c;if(r&&!(u=f[r]))return c;h===s&&(h=""),a?u?c.push(this._findInIndex(i.objects,u,a,o,"object","subject","predicate",h)):c.push(this._findInIndex(i.subjects,a,o,null,"subject","predicate","object",h)):o?c.push(this._findInIndex(i.predicates,o,u,null,"predicate","object","subject",h)):u?c.push(this._findInIndex(i.objects,u,null,null,"object","subject","predicate",h)):c.push(this._findInIndex(i.subjects,null,null,null,"subject","predicate","object",h))}return 1===c.length?c[0]:c.concat.apply([],c)},count:function(t,e,r,n){var s=this._prefixes;return this.countByIRI(i(t,s),i(e,s),i(r,s),i(n,s))},countByIRI:function(t,e,r,n){n=n||s;var i=this._graphs[n],a=this._ids;return i?t&&!(t=a[t])?0:e&&!(e=a[e])?0:r&&!(r=a[r])?0:t?r?this._countInIndex(i.objects,r,t,e):this._countInIndex(i.subjects,t,e,r):e?this._countInIndex(i.predicates,e,r,t):this._countInIndex(i.objects,r,t,e):0},createBlankNode:function(t){var e,r;if(t)for(e=t="_:"+t,r=1;this._ids[e];)e=t+r++;else do e="_:b"+this._blankNodeIndex++;while(this._ids[e]);return this._ids[e]=++this._id,this._entities[this._id]=e,e}},e.exports=n},{"./N3Util":43}],41:[function(t,e,r){function n(t){if(!(this instanceof n))return new n(t);i.call(this,{decodeStrings:!0}),this._readableState.objectMode=!0;var e,r,s=this,o=new a(t);o.parse({on:function(t,n){"data"===t?e=n:r=n}},function(t,e){t&&s.emit("error",t)||e&&s.push(e)},function(t,e){s.emit("prefix",t,e)}),this._transform=function(t,r,n){e(t),n()},this._flush=function(t){r(),t()}}var i=t("stream").Transform,s=t("util"),a=t("./N3Parser.js");s.inherits(n,i),e.exports=n},{"./N3Parser.js":39,stream:void 0,util:62}],42:[function(t,e,r){function n(t){if(!(this instanceof n))return new n(t);i.call(this,{encoding:"utf8"}),this._writableState.objectMode=!0;var e=this,r=new a({write:function(t,r,n){e.push(t),n&&n()},end:function(t){e.push(null),t&&t()}},t);this._transform=function(t,e,n){r.addTriple(t,n)},this._flush=function(t){r.end(t)}}var i=t("stream").Transform,s=t("util"),a=t("./N3Writer.js");s.inherits(n,i),e.exports=n},{"./N3Writer.js":44,stream:void 0,util:62}],43:[function(t,e,r){function n(t,e){for(var r in f)e?t.prototype[r]=i(f[r]):t[r]=f[r];return t}function i(t){return function(e){return t(this,e)}}var s="http://www.w3.org/2001/XMLSchema#",a=s+"string",o=s+"integer",u=s+"decimal",c=s+"boolean",l="http://www.w3.org/1999/02/22-rdf-syntax-ns#langString",f={isIRI:function(t){if(!t)return t;var e=t[0];return'"'!==e&&"_"!==e},isLiteral:function(t){return t&&'"'===t[0]},isBlank:function(t){return t&&"_:"===t.substr(0,2)},getLiteralValue:function(t){var e=/^"([^]*)"/.exec(t);if(!e)throw new Error(t+" is not a literal");return e[1]},getLiteralType:function(t){var e=/^"[^]*"(?:\^\^([^"]+)|(@)[^@"]+)?$/.exec(t);if(!e)throw new Error(t+" is not a literal");return e[1]||(e[2]?l:a)},getLiteralLanguage:function(t){var e=/^"[^]*"(?:@([^@"]+)|\^\^[^"]+)?$/.exec(t);if(!e)throw new Error(t+" is not a literal");return e[1]?e[1].toLowerCase():""},isPrefixedName:function(t){return t&&/^[^:\/"']*:[^:\/"']+$/.test(t)},expandPrefixedName:function(t,e){var r,n,i,s=/(?:^|"\^\^)([^:\/#"'\^_]*):[^\/]*$/.exec(t);return s&&(r=s[1],n=e[r],i=s.index),void 0===n?t:0===i?n+t.substr(r.length+1):t.substr(0,i+3)+n+t.substr(i+r.length+4)},createIRI:function(t){return t&&'"'===t[0]?f.getLiteralValue(t):t},createLiteral:function(t,e){if(!e)switch(typeof t){case"boolean":e=c;break;case"number":if(isFinite(t)){e=t%1===0?o:u;break}default:return'"'+t+'"'}return'"'+t+(/^[a-z]+(-[a-z0-9]+)*$/i.test(e)?'"@'+e.toLowerCase():'"^^'+e)},prefix:function(t){return f.prefixes({"":t})("")},prefixes:function(t){function e(t,e){if(e||!(t in r)){var n=Object.create(null);e=e||"",r[t]=function(t){return n[t]||(n[t]=e+t)}}return r[t]}var r=Object.create(null);for(var n in t)e(n,t[n]);return e}};e.exports=n(n)},{}],44:[function(t,e,r){function n(t,e){if(!(this instanceof n))return new n(t,e);if(t&&"function"!=typeof t.write&&(e=t,t=null),e=e||{},t)this._outputStream=t,this._endStream=void 0===e.end||!!e.end;else{
    var r="";this._outputStream={write:function(t,e,n){r+=t,n&&n()},end:function(t){t&&t(null,r)}},this._endStream=!0}this._subject=null,/triple|quad/i.test(e.format)?this._writeTriple=this._writeTripleLine:(this._graph="",this._prefixIRIs=Object.create(null),e.prefixes&&this.addPrefixes(e.prefixes))}function i(t){var e=l[t];return void 0===e&&(1===t.length?(e=t.charCodeAt(0).toString(16),e="\\u0000".substr(0,6-e.length)+e):(e=(1024*(t.charCodeAt(0)-55296)+t.charCodeAt(1)+9216).toString(16),e="\\U00000000".substr(0,10-e.length)+e)),e}var s=/^"([^]*)"(?:\^\^(.+)|@([\-a-z]+))?$/i,a="http://www.w3.org/1999/02/22-rdf-syntax-ns#",o=a+"type",u=/["\\\t\n\r\b\f\u0000-\u0019\ud800-\udbff]/,c=/["\\\t\n\r\b\f\u0000-\u0019]|[\ud800-\udbff][\udc00-\udfff]/g,l={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"};n.prototype={_write:function(t,e){this._outputStream.write(t,"utf8",e)},_writeTriple:function(t,e,r,n,i){try{this._graph!==n&&(this._write((null===this._subject?"":this._graph?"\n}\n":".\n")+(n?this._encodeIriOrBlankNode(n)+" {\n":"")),this._subject=null,this._graph="["!==n[0]?n:"]"),this._subject===t?this._predicate===e?this._write(", "+this._encodeObject(r),i):this._write(";\n    "+this._encodePredicate(this._predicate=e)+" "+this._encodeObject(r),i):this._write((null===this._subject?"":".\n")+this._encodeSubject(this._subject=t)+" "+this._encodePredicate(this._predicate=e)+" "+this._encodeObject(r),i)}catch(t){i&&i(t)}},_writeTripleLine:function(t,e,r,n,i){delete this._prefixMatch;try{this._write(this._encodeIriOrBlankNode(t)+" "+this._encodeIriOrBlankNode(e)+" "+this._encodeObject(r)+(n?" "+this._encodeIriOrBlankNode(n)+".\n":".\n"),i)}catch(t){i&&i(t)}},_encodeIriOrBlankNode:function(t){var e=t[0];if("["===e||"("===e||"_"===e&&":"===t[1])return t;u.test(t)&&(t=t.replace(c,i));var r=this._prefixRegex.exec(t);return r?r[1]?this._prefixIRIs[r[1]]+r[2]:t:"<"+t+">"},_encodeLiteral:function(t,e,r){return u.test(t)&&(t=t.replace(c,i)),r?'"'+t+'"@'+r:e?'"'+t+'"^^'+this._encodeIriOrBlankNode(e):'"'+t+'"'},_encodeSubject:function(t){if('"'===t[0])throw new Error("A literal as subject is not allowed: "+t);return"["===t[0]&&(this._subject="]"),this._encodeIriOrBlankNode(t)},_encodePredicate:function(t){if('"'===t[0])throw new Error("A literal as predicate is not allowed: "+t);return t===o?"a":this._encodeIriOrBlankNode(t)},_encodeObject:function(t){if('"'!==t[0])return this._encodeIriOrBlankNode(t);var e=s.exec(t);if(!e)throw new Error("Invalid literal: "+t);return this._encodeLiteral(e[1],e[2],e[3])},_blockedWrite:function(){throw new Error("Cannot write because the writer has been closed.")},addTriple:function(t,e,r,n,i){void 0===r?this._writeTriple(t.subject,t.predicate,t.object,t.graph||"",e):"string"!=typeof n?this._writeTriple(t,e,r,"",n):this._writeTriple(t,e,r,n,i)},addTriples:function(t){for(var e=0;e.\n"))}if(n){var a="",o="";for(var u in r)a+=a?"|"+u:u,o+=(o?"|":"")+r[u];a=a.replace(/[\]\/\(\)\*\+\?\.\\\$]/g,"\\$&"),this._prefixRegex=new RegExp("^(?:"+o+")[^/]*$|^("+a+")([a-zA-Z][\\-_a-zA-Z0-9]*)$")}this._write(n?"\n":"",e)},blank:function(t,e){var r,n,i=t;switch(void 0===t?i=[]:"string"==typeof t?i=[{predicate:t,object:e}]:"length"in t||(i=[t]),n=i.length){case 0:return"[]";case 1:if(r=i[0],"["!==r.object[0])return"[ "+this._encodePredicate(r.predicate)+" "+this._encodeObject(r.object)+" ]";default:for(var s="[",a=0;a]/g,""),n=u.parse(r),i=o.parse(n.query),a=e.reduce(s,{});return a=c(i,a),a.url=r,a}catch(t){return null}}var o=t("querystring"),u=t("url"),c=t("xtend");e.exports=function(t){return t?t.split(/,\s*1)for(var r=1;r1&&(n=r[0]+"@",t=r[1]),t=t.replace(D,".");var i=t.split("."),s=a(i,e).join(".");return n+s}function u(t){for(var e,r,n=[],i=0,s=t.length;i=55296&&e<=56319&&i65535&&(t-=65536,e+=P(t>>>10&1023|55296),t=56320|1023&t),e+=P(t)}).join("")}function l(t){return t-48<10?t-22:t-65<26?t-65:t-97<26?t-97:E}function f(t,e){return t+22+75*(t<26)-((0!=e)<<5)}function h(t,e,r){var n=0;for(t=r?R(t/I):t>>1,t+=R(t/e);t>L*T>>1;n+=E)t=R(t/L);return R(n+(L+1)*t/(t+k))}function p(t){var e,r,n,i,a,o,u,f,p,d,_=[],g=t.length,y=0,v=S,b=C;for(r=t.lastIndexOf(A),r<0&&(r=0),n=0;n=128&&s("not-basic"),_.push(t.charCodeAt(n));for(i=r>0?r+1:0;i=g&&s("invalid-input"),f=l(t.charCodeAt(i++)),(f>=E||f>R((w-y)/o))&&s("overflow"),y+=f*o,p=u<=b?F:u>=b+T?T:u-b,!(fR(w/d)&&s("overflow"),o*=d;e=_.length+1,b=h(y-a,e,0==a),R(y/e)>w-v&&s("overflow"),v+=R(y/e),y%=e,_.splice(y++,0,v)}return c(_)}function d(t){var e,r,n,i,a,o,c,l,p,d,_,g,y,v,b,m=[];for(t=u(t),g=t.length,e=S,r=0,a=C,o=0;o=e&&_R((w-r)/y)&&s("overflow"),r+=(c-e)*y,e=c,o=0;ow&&s("overflow"),_==e){for(l=r,p=E;d=p<=a?F:p>=a+T?T:p-a,!(l= 0x80 (not a basic code point)","invalid-input":"Invalid input"},L=E-F,R=Math.floor,P=String.fromCharCode;if(m={version:"1.4.1",ucs2:{decode:u,encode:c},decode:p,encode:d,toASCII:g,toUnicode:_},"function"==typeof t&&"object"==typeof t.amd&&t.amd)t("punycode",function(){return m});else if(y&&v)if(r.exports==y)v.exports=m;else for(x in m)m.hasOwnProperty(x)&&(y[x]=m[x]);else i.punycode=m}(this)}).call(this,"undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],50:[function(t,e,r){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
    "use strict";function n(t,e){return Object.prototype.hasOwnProperty.call(t,e)}e.exports=function(t,e,r,s){e=e||"&",r=r||"=";var a={};if("string"!=typeof t||0===t.length)return a;var o=/\+/g;t=t.split(e);var u=1e3;s&&"number"==typeof s.maxKeys&&(u=s.maxKeys);var c=t.length;u>0&&c>u&&(c=u);for(var l=0;l=0?(f=_.substr(0,g),h=_.substr(g+1)):(f=_,h=""),p=decodeURIComponent(f),d=decodeURIComponent(h),n(a,p)?i(a[p])?a[p].push(d):a[p]=[a[p],d]:a[p]=d}return a};var i=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)}},{}],51:[function(t,e,r){
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
    "use strict";function n(t,e){if(t.map)return t.map(e);for(var r=[],n=0;n\n");for(var r in t.prefixes)e+="PREFIX "+r+": <"+t.prefixes[r]+">\n";return t.queryType&&(e+=t.queryType.toUpperCase()+" "),t.reduced&&(e+="REDUCED "),t.distinct&&(e+="DISTINCT "),t.variables?e+=c(t.variables,function(t){return u(t)?a(t):"("+s(t.expression)+" AS "+t.variable+")"})+" ":t.template&&(e+=h.group(t.template,!0)+"\n"),t.from&&(e+=c(t.from.default||[],function(t){return"FROM "+a(t)+"\n"},"")+c(t.from.named||[],function(t){return"FROM NAMED "+a(t)+"\n"},"")),t.where&&(e+="WHERE "+h.group(t.where,!0)+"\n"),t.updates&&(e+=c(t.updates,o,";\n")),t.group&&(e+="GROUP BY "+c(t.group,function(t){return u(t.expression)?t.expression:"("+s(t.expression)+")"})+"\n"),t.having&&(e+="HAVING ("+c(t.having,s)+")\n"),t.order&&(e+="ORDER BY "+c(t.order,function(t){var e=s(t.expression);return t.descending?"DESC("+e+")":e})+"\n"),t.offset&&(e+="OFFSET "+t.offset+"\n"),t.limit&&(e+="LIMIT "+t.limit+"\n"),t.values&&(e+=h.values(t)),e.trim()}function i(t){var e=t.type||t instanceof Array&&"array"||(t.subject&&t.predicate&&t.object?"triple":"");if(!(e in h))throw new Error("Unknown entry type: "+e);return h[e](t)}function s(t){if(u(t))return a(t);switch(t.type.toLowerCase()){case"aggregate":return t.aggregation.toUpperCase()+"("+(t.distinct?"DISTINCT ":"")+s(t.expression)+(t.separator?"; SEPARATOR = "+a('"'+t.separator+'"'):"")+")";case"functioncall":return a(t.function)+"("+c(t.args,s,", ")+")";case"operation":var e=t.operator.toUpperCase(),r=t.args||[];switch(t.operator.toLowerCase()){case"<":case">":case">=":case"<=":case"&&":case"||":case"=":case"!=":case"+":case"-":case"*":case"/":return(u(r[0])?a(r[0]):"("+s(r[0])+")")+" "+e+" "+(u(r[1])?a(r[1]):"("+s(r[1])+")");case"!":return"!"+s(r[0]);case"notin":e="NOT IN";case"in":return s(r[0])+" "+e+"("+(u(r[1])?r[1]:c(r[1],s,", "))+")";case"notexists":e="NOT EXISTS";case"exists":return e+" "+h.group(r[0],!0);default:return e+"("+c(r,s,", ")+")"}default:throw new Error("Unknown expression type: "+t.type)}}function a(t){if(u(t))switch(t[0]){case"?":case"$":case"*":case"_":return t;case'"':var e=t.match(/^"([^]*)"(?:(@.+)|\^\^(.+))?$/)||{},r=e[1]||"",n=e[2]||"",i=e[3];if(t='"'+r.replace(p,d)+'"'+n,i){if(i===f&&/^\d+$/.test(r))return r+" ";t+="^^<"+i+">"}return t;default:return"<"+t+">"}else{var s=t.items.map(a),o=t.pathType;switch(o){case"^":case"!":return o+s[0];case"*":case"+":case"?":return s[0]+o;default:return"("+s.join(o)+")"}}}function o(t){switch(t.type||t.updateType){case"load":return"LOAD"+(t.source?" "+a(t.source):"")+(t.destination?" INTO GRAPH "+a(t.destination):"");case"insert":return"INSERT DATA "+h.group(t.insert,!0);case"delete":return"DELETE DATA "+h.group(t.delete,!0);case"deletewhere":return"DELETE WHERE "+h.group(t.delete,!0);case"insertdelete":return(t.graph?"WITH "+a(t.graph)+"\n":"")+(t.delete.length?"DELETE "+h.group(t.delete,!0)+"\n":"")+(t.insert.length?"INSERT "+h.group(t.insert,!0)+"\n":"")+"WHERE "+h.group(t.where,!0);case"add":case"copy":case"move":return t.type.toUpperCase()+(t.source.default?" DEFAULT ":" ")+"TO "+a(t.destination.name);default:throw new Error("Unknown update query type: "+t.type)}}function u(t){return"string"==typeof t}function c(t,e,r){return t.map(e).join(u(r)?r:" ")}function l(t){return t.replace(/^/gm,"  ")}var f="http://www.w3.org/2001/XMLSchema#integer";e.exports=function(){return{stringify:n}};var h={triple:function(t){return a(t.subject)+" "+a(t.predicate)+" "+a(t.object)+"."},array:function(t){return c(t,i,"\n")},bgp:function(t){return c(t.triples,h.triple,"\n")},graph:function(t){return"GRAPH "+a(t.name)+" "+h.group(t)},group:function(t,e){return t=e!==!0?h.array(t.patterns||t.triples):i("group"!==t.type?t:t.patterns),t.indexOf("\n")===-1?"{ "+t+" }":"{\n"+l(t)+"\n}"},query:function(t){return"{\n"+l(n(t))+"\n}"},filter:function(t){return"FILTER("+s(t.expression)+")"},bind:function(t){return"BIND("+s(t.expression)+" AS "+t.variable+")"},optional:function(t){return"OPTIONAL "+h.group(t)},union:function(t){return c(t.patterns,function(t){return h.group(t,!0)},"\nUNION\n")},minus:function(t){return"MINUS "+h.group(t)},values:function(t){var e=Object.keys(t.values.reduce(function(t,e){for(var r in e)t[r]=!0;return t},{}));return"VALUES ("+e.join(" ")+") {\n"+c(t.values,function(t){return"  ("+c(e,function(e){return void 0!==t[e]?a(t[e]):"UNDEF"})+")"},"\n")+"\n}"},service:function(t){return"SERVICE "+(t.silent?"SILENT ":"")+a(t.name)+" "+h.group(t)}},p=/["\\\t\n\r\b\f]/g,d=function(t){return _[t]},_={"\\":"\\\\",'"':'\\"',"\t":"\\t","\n":"\\n","\r":"\\r","\b":"\\b","\f":"\\f"}},{}],55:[function(t,e,r){(function(n){var i=function(){function t(t){return t.toLowerCase()}function e(t,e){return t.push(e),t}function r(t,e){return t.push.apply(t,e),t}function n(t){t||(t={});for(var e,r=1,n=arguments.length;r>10),56320+(1023&i))}var s=Ur[n];if(!s)throw new Error;return s})}catch(t){return""}return'"'+t+'"'}function v(t){var e,n=g(),i=n,s=[],a=[];t.forEach(function(t){s.push(t.entity),r(a,t.triples)});for(var o=0,u=0,c=s.length,e=Array(2*c);o":308,"<=":309,">=":310,NOT:311,CONCAT:312,COALESCE:313,SUBSTR:314,REGEX:315,REPLACE:316,$accept:0,$end:1},terminals_:{2:"error",6:"EOF",11:"BASE",12:"IRIREF",14:"PREFIX",15:"PNAME_NS",23:"SELECT",27:"VAR",28:"(",30:"AS",31:")",33:"CONSTRUCT",37:"WHERE",38:"{",40:"}",42:"DESCRIBE",47:"ASK",50:"FROM",60:"GROUP",61:"BY",67:"HAVING",70:"ORDER",73:"ASC",75:"DESC",78:"LIMIT",79:"INTEGER",80:"OFFSET",82:"VALUES",89:"UNDEF",95:"LOAD",104:"TO",105:"CREATE",107:"GRAPH",108:"INSERTDATA",110:"DELETEDATA",111:"DELETEWHERE",120:"DELETE",121:"INSERT",123:"USING",126:"WITH",128:"INTO",129:"DEFAULT",155:"OPTIONAL",156:"MINUS",158:"SERVICE",161:"FILTER",162:"BIND",163:"NIL",181:"a",192:";",203:"!",208:"^",210:"[",211:"]",213:"BLANK_NODE_LABEL",214:"ANON",218:"||",222:"&&",226:"IN",241:"-",243:"FUNC_ARITY0",244:"FUNC_ARITY1",245:"FUNC_ARITY2",246:",",247:"IF",249:"BOUND",250:"BNODE",252:"EXISTS",253:"COUNT",256:"FUNC_AGGREGATE",258:"GROUP_CONCAT",262:"SEPARATOR",263:"=",265:"LANGTAG",266:"^^",267:"DECIMAL",268:"DOUBLE",269:"true",270:"false",271:"STRING_LITERAL1",272:"STRING_LITERAL2",273:"STRING_LITERAL_LONG1",274:"STRING_LITERAL_LONG2",275:"INTEGER_POSITIVE",276:"DECIMAL_POSITIVE",277:"DOUBLE_POSITIVE",278:"INTEGER_NEGATIVE",279:"DECIMAL_NEGATIVE",280:"DOUBLE_NEGATIVE",281:"PNAME_LN",284:"DISTINCT",285:"REDUCED",287:"*",290:"NAMED",291:"SILENT",292:"CLEAR",293:"DROP",294:"ADD",295:"MOVE",296:"COPY",297:"ALL",298:".",299:"UNION",301:"|",302:"/",304:"?",305:"+",306:"!=",307:"<",308:">",309:"<=",310:">=",311:"NOT",312:"CONCAT",313:"COALESCE",314:"SUBSTR",315:"REGEX",316:"REPLACE"},productions_:[0,[3,3],[7,2],[10,2],[13,3],[16,4],[21,4],[17,3],[26,1],[26,5],[32,5],[32,7],[41,5],[46,4],[49,3],[19,2],[20,4],[59,3],[63,1],[63,1],[63,3],[63,5],[63,1],[66,2],[69,3],[72,2],[72,2],[72,1],[72,1],[77,2],[77,2],[77,4],[77,4],[81,2],[83,4],[83,6],[87,1],[87,1],[87,1],[90,3],[92,2],[94,4],[94,3],[94,5],[94,4],[94,2],[94,2],[94,2],[94,6],[94,6],[117,2],[113,2],[122,3],[125,2],[127,3],[103,1],[103,2],[100,2],[100,1],[109,4],[134,7],[139,3],[54,3],[54,3],[143,2],[146,3],[150,3],[147,2],[147,2],[147,2],[147,3],[147,4],[147,2],[147,6],[147,1],[76,1],[76,1],[76,1],[65,2],[65,6],[166,1],[166,4],[34,3],[169,3],[141,2],[141,2],[175,1],[173,2],[178,2],[179,1],[179,1],[179,1],[180,2],[152,2],[152,2],[184,4],[191,1],[191,3],[194,2],[196,2],[199,2],[198,2],[200,1],[200,1],[200,2],[200,3],[204,1],[204,1],[204,4],[205,1],[205,1],[205,2],[205,2],[174,3],[174,3],[185,3],[185,3],[183,1],[183,1],[189,1],[189,1],[172,1],[172,1],[172,1],[172,1],[172,1],[172,1],[29,2],[217,2],[215,2],[221,2],[219,1],[219,3],[219,4],[223,2],[229,2],[229,2],[229,2],[227,2],[237,2],[235,2],[235,2],[235,2],[240,1],[240,1],[240,1],[240,1],[240,1],[240,1],[74,3],[64,1],[64,2],[64,4],[64,6],[64,8],[64,2],[64,4],[64,2],[64,4],[64,3],[242,5],[242,5],[242,6],[261,4],[88,1],[88,2],[88,3],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[88,1],[264,1],[264,1],[264,1],[264,1],[231,1],[231,1],[231,1],[233,1],[233,1],[233,1],[52,1],[52,1],[52,1],[282,1],[282,1],[4,0],[4,2],[5,1],[5,1],[8,1],[8,1],[8,1],[8,1],[9,0],[9,1],[18,0],[18,2],[22,0],[22,1],[283,1],[283,1],[24,0],[24,1],[286,1],[286,2],[25,1],[25,1],[35,0],[35,2],[36,0],[36,2],[39,0],[39,1],[288,1],[288,1],[289,1],[289,2],[43,1],[43,1],[44,0],[44,2],[45,0],[45,1],[48,0],[48,2],[51,0],[51,1],[53,0],[53,1],[55,0],[55,1],[56,0],[56,1],[57,0],[57,1],[58,0],[58,1],[62,1],[62,2],[68,1],[68,2],[71,1],[71,2],[84,0],[84,2],[85,0],[85,2],[86,0],[86,2],[91,0],[91,2],[93,0],[93,3],[96,0],[96,1],[97,0],[97,1],[98,1],[98,1],[99,0],[99,1],[101,1],[101,1],[101,1],[102,0],[102,1],[106,0],[106,1],[112,0],[112,1],[114,0],[114,1],[115,0],[115,2],[116,0],[116,1],[118,0],[118,1],[119,0],[119,2],[124,0],[124,1],[130,0],[130,1],[131,1],[131,1],[131,1],[132,0],[132,1],[133,0],[133,2],[135,1],[135,1],[136,0],[136,1],[137,0],[137,1],[138,0],[138,1],[140,0],[140,3],[142,0],[142,1],[144,0],[144,1],[145,0],[145,2],[148,0],[148,1],[149,0],[149,1],[151,0],[151,3],[153,0],[153,1],[154,0],[154,3],[157,1],[157,1],[159,0],[159,1],[160,1],[160,1],[164,0],[164,1],[165,0],[165,3],[167,0],[167,3],[168,0],[168,1],[170,0],[170,3],[171,0],[171,1],[176,0],[176,1],[300,1],[300,2],[177,0],[177,3],[182,0],[182,3],[186,0],[186,1],[187,1],[187,1],[188,0],[188,3],[190,0],[190,2],[193,1],[193,1],[195,0],[195,3],[197,0],[197,3],[303,1],[303,1],[303,1],[201,0],[201,1],[202,0],[202,1],[206,0],[206,3],[207,0],[207,1],[209,1],[209,2],[212,1],[212,2],[216,0],[216,2],[220,0],[220,2],[224,1],[224,1],[224,1],[224,1],[224,1],[224,1],[225,0],[225,1],[228,0],[228,2],[230,1],[230,1],[232,0],[232,2],[234,0],[234,2],[236,0],[236,2],[238,1],[238,1],[239,0],[239,1],[248,1],[248,1],[248,1],[248,1],[248,1],[251,0],[251,1],[254,0],[254,1],[255,1],[255,1],[257,0],[257,1],[259,0],[259,1],[260,0],[260,1]],performAction:function(w,E,F,T,k,I,C){var S=I.length-1;switch(k){case 1:return x.base&&(I[S-1].base=x.base),x.base=Dr=Nr=Lr="",I[S-1].prefixes=x.prefixes,x.prefixes=null,I[S-1];case 2:this.$=n(I[S-1],I[S],{type:"query"});break;case 3:x.base=s(I[S]),Dr=Nr=Lr="";break;case 4:x.prefixes||(x.prefixes={}),I[S-1]=I[S-1].substr(0,I[S-1].length-1),I[S]=s(I[S]),x.prefixes[I[S-1]]=I[S];break;case 5:this.$=n(I[S-3],f(I[S-2]),I[S-1],I[S]);break;case 6:this.$=n({type:"query"},I[S-3],I[S-2],I[S-1],I[S]);break;case 7:this.$=n({queryType:"SELECT",variables:"*"===I[S]?["*"]:I[S]},I[S-1]&&(I[S-2]=t(I[S-1]),I[S-1]={},I[S-1][I[S-2]]=!0,I[S-1]));break;case 8:case 89:case 121:case 148:this.$=a(I[S]);break;case 9:case 21:this.$=u(I[S-3],{variable:a(I[S-1])});break;case 10:this.$=n({queryType:"CONSTRUCT",template:I[S-3]},f(I[S-2]),I[S-1],I[S]);break;case 11:this.$=n({queryType:"CONSTRUCT",template:I[S-2]=I[S-2]?I[S-2].triples:[]},f(I[S-5]),{where:[{type:"bgp",triples:r([],I[S-2])}]},I[S]);break;case 12:this.$=n({queryType:"DESCRIBE",variables:"*"===I[S-3]?["*"]:I[S-3].map(a)},f(I[S-2]),I[S-1],I[S]);break;case 13:this.$=n({queryType:"ASK"},f(I[S-2]),I[S-1],I[S]);break;case 14:case 52:this.$={iri:I[S],named:!!I[S-1]};break;case 15:this.$={where:I[S].patterns};break;case 16:this.$=n(I[S-3],I[S-2],I[S-1],I[S]);break;case 17:this.$={group:I[S]};break;case 18:case 19:case 25:case 27:this.$=u(I[S]);break;case 20:this.$=u(I[S-1]);break;case 22:case 28:this.$=u(a(I[S]));break;case 23:this.$={having:I[S]};break;case 24:this.$={order:I[S]};break;case 26:this.$=u(I[S],{descending:!0});break;case 29:this.$={limit:h(I[S])};break;case 30:this.$={offset:h(I[S])};break;case 31:this.$={limit:h(I[S-2]),offset:h(I[S])};break;case 32:this.$={limit:h(I[S]),offset:h(I[S-2])};break;case 33:this.$={type:"values",values:I[S]};break;case 34:I[S-3]=a(I[S-3]),this.$=I[S-1].map(function(t){var e={};return e[I[S-3]]=t,e});break;case 35:var A=I[S-4].length;I[S-4]=I[S-4].map(a),this.$=I[S-1].map(function(t){if(t.length!==A)throw Error("Inconsistent VALUES length");for(var e={},r=0;r1){for(var O,D,N=[],L=0;D=I[S-1][L];L++)switch(D.type){case"bgp":D.triples.length&&(O?r(O.triples,D.triples):e(N,O=D));break;default:(!D.patterns||D.patterns.length>0)&&(e(N,D),O=null)}I[S-1]=N}this.$={type:"group",patterns:I[S-1]};break;case 64:this.$=I[S-1]?i([I[S-1]],I[S]):i(I[S]);break;case 65:this.$=I[S]?[I[S-2],I[S]]:I[S-2];break;case 67:this.$=I[S-1].length?{type:"union",patterns:i(I[S-1].map(p),[p(I[S])])}:p(I[S]);break;case 68:this.$=n(I[S],{type:"optional"});break;case 69:this.$=n(I[S],{type:"minus"});break;case 70:this.$=n(I[S],{type:"graph",name:a(I[S-1])});break;case 71:this.$=n(I[S],{type:"service",name:a(I[S-1]),silent:!!I[S-2]});break;case 72:this.$={type:"filter",expression:I[S]};break;case 73:this.$={type:"bind",variable:a(I[S-1]),expression:I[S-3]};break;case 78:this.$={type:"functionCall",function:I[S-1],args:[]};break;case 79:this.$={type:"functionCall",function:I[S-5],args:e(I[S-2],I[S-1]),distinct:!!I[S-3]};break;case 80:case 96:case 107:case 189:case 199:case 211:case 213:case 223:case 227:case 247:case 249:case 251:case 253:case 255:case 276:case 282:case 293:case 303:case 309:case 315:case 319:case 329:case 331:case 335:case 343:case 345:case 351:case 353:case 357:case 359:case 368:case 376:case 378:case 388:case 392:case 394:case 396:this.$=[];break;case 81:this.$=e(I[S-2],I[S-1]);break;case 83:this.$=i(I[S-2],[I[S-1]]);break;case 84:case 93:this.$=I[S].map(function(t){return n(_(I[S-1]),t)});break;case 85:this.$=r(I[S].map(function(t){return n(_(I[S-1].entity),t)}),I[S-1].triples);break;case 87:this.$=i(I[S-1],[I[S]]);break;case 88:this.$=m(I[S-1],I[S]);break;case 91:case 103:case 110:this.$=wr;break;case 92:this.$=e(I[S-1],I[S]);break;case 94:this.$=I[S]?r(I[S].map(function(t){return n(_(I[S-1].entity),t)}),I[S-1].triples):I[S-1].triples;
    break;case 95:this.$=m(a(I[S-3]),e(I[S-2],I[S-1]),I[S]);break;case 97:this.$=m(a(I[S-1]),I[S]);break;case 98:this.$=I[S-1].length?c("|",e(I[S-1],I[S])):I[S];break;case 99:this.$=I[S-1].length?c("/",e(I[S-1],I[S])):I[S];break;case 100:this.$=I[S]?c(I[S],[I[S-1]]):I[S-1];break;case 101:this.$=I[S-1]?c(I[S-1],[I[S]]):I[S];break;case 104:case 111:this.$=c(I[S-1],[I[S]]);break;case 108:this.$=c("|",e(I[S-2],I[S-1]));break;case 112:this.$=c(I[S-1],[wr]);break;case 113:case 115:this.$=v(I[S-1]);break;case 114:case 116:this.$=b(I[S-1]);break;case 117:this.$={entity:I[S],triples:[]};break;case 119:this.$={entity:I[S],triples:[]};break;case 125:this.$=g();break;case 126:this.$=Tr;break;case 127:case 129:case 134:case 138:this.$=l(I[S-1],I[S]);break;case 128:this.$=["||",I[S]];break;case 130:this.$=["&&",I[S]];break;case 132:this.$=o(I[S-1],[I[S-2],I[S]]);break;case 133:this.$=o(I[S-2]?"notin":"in",[I[S-3],I[S]]);break;case 135:case 139:this.$=[I[S-1],I[S]];break;case 136:this.$=["+",l(I[S-1],I[S])];break;case 137:this.$=["-",l(I[S-1].replace("-",""),I[S])];break;case 141:this.$=o(I[S-1],[I[S]]);break;case 142:this.$=o("UMINUS",[I[S]]);break;case 151:this.$=o(t(I[S-1]));break;case 152:this.$=o(t(I[S-3]),[I[S-1]]);break;case 153:this.$=o(t(I[S-5]),[I[S-3],I[S-1]]);break;case 154:this.$=o(t(I[S-7]),[I[S-5],I[S-3],I[S-1]]);break;case 155:this.$=o(t(I[S-1]),I[S]);break;case 156:this.$=o("bound",[a(I[S-1])]);break;case 157:this.$=o(I[S-1],[]);break;case 158:this.$=o(I[S-3],[I[S-1]]);break;case 159:this.$=o(I[S-2]?"notexists":"exists",[p(I[S])]);break;case 160:case 161:this.$=u(I[S-1],{type:"aggregate",aggregation:t(I[S-4]),distinct:!!I[S-2]});break;case 162:this.$=u(I[S-2],{type:"aggregate",aggregation:t(I[S-5]),distinct:!!I[S-3],separator:I[S-1]||" "});break;case 163:this.$=I[S].substr(1,I[S].length-2);break;case 165:this.$=I[S-1]+t(I[S]);break;case 166:this.$=I[S-2]+"^^"+I[S];break;case 167:case 181:this.$=d(I[S],Ir);break;case 168:case 182:this.$=d(I[S],Cr);break;case 169:case 183:this.$=d(t(I[S]),Sr);break;case 172:this.$=jr;break;case 173:this.$=Or;break;case 174:case 175:this.$=y(I[S],1);break;case 176:case 177:this.$=y(I[S],3);break;case 178:this.$=d(I[S].substr(1),Ir);break;case 179:this.$=d(I[S].substr(1),Cr);break;case 180:this.$=d(I[S].substr(1).toLowerCase(),Sr);break;case 184:this.$=s(I[S]);break;case 185:var R=I[S].indexOf(":"),P=I[S].substr(0,R),U=x.prefixes[P];if(!U)throw new Error("Unknown prefix: "+P);this.$=s(U+I[S].substr(R+1));break;case 186:if(I[S]=I[S].substr(0,I[S].length-1),!(I[S]in x.prefixes))throw new Error("Unknown prefix: "+I[S]);this.$=s(x.prefixes[I[S]]);break;case 190:case 200:case 208:case 212:case 214:case 220:case 224:case 228:case 242:case 244:case 246:case 248:case 250:case 252:case 254:case 277:case 283:case 294:case 310:case 342:case 354:case 373:case 375:case 377:case 379:case 389:case 393:case 395:case 397:I[S-1].push(I[S]);break;case 207:case 219:case 241:case 243:case 245:case 341:case 372:case 374:this.$=[I[S]];break;case 256:case 304:case 316:case 320:case 330:case 332:case 336:case 344:case 346:case 352:case 358:case 360:case 369:I[S-2].push(I[S-1])}},table:[w(E,[2,189],{3:1,4:2}),{1:[3]},w(F,[2,255],{5:3,282:4,7:5,92:6,10:7,13:8,8:9,93:10,16:13,32:14,41:15,46:16,17:17,11:[1,11],14:[1,12],23:T,33:[1,18],42:[1,19],47:[1,20]}),{6:[1,22]},w(E,[2,190]),{6:[2,191]},{6:[2,192]},w(E,[2,187]),w(E,[2,188]),{6:[2,197],9:23,81:24,82:k},{94:26,95:[1,27],98:28,101:29,105:[1,30],108:[1,31],110:[1,32],111:[1,33],112:34,116:35,120:[2,278],121:[2,272],125:41,126:[1,42],292:[1,36],293:[1,37],294:[1,38],295:[1,39],296:[1,40]},{12:[1,43]},{15:[1,44]},w(I,[2,193]),w(I,[2,194]),w(I,[2,195]),w(I,[2,196]),w(C,[2,199],{18:45}),w(S,[2,213],{34:46,36:47,38:[1,48]}),{12:A,15:j,27:O,43:49,52:54,281:D,287:[1,51],288:52,289:50},w(C,[2,227],{48:58}),w(N,[2,205],{24:59,283:60,284:[1,61],285:[1,62]}),{1:[2,1]},{6:[2,2]},{6:[2,198]},{27:[1,64],28:[1,65],83:63},{6:[2,40],192:[1,66]},w(L,[2,257],{96:67,291:[1,68]}),w(R,[2,263],{99:69,291:[1,70]}),w(P,[2,268],{102:71,291:[1,72]}),{106:73,107:[2,270],291:[1,74]},{38:U,109:75},{38:U,109:77},{38:U,109:78},{113:79,121:B},{117:81,120:$},w(q,[2,261]),w(q,[2,262]),w(M,[2,265]),w(M,[2,266]),w(M,[2,267]),{120:[2,279],121:[2,273]},{12:A,15:j,52:83,281:D},w(E,[2,3]),{12:[1,84]},{19:85,37:G,38:z,49:86,50:V,53:87},w(C,[2,211],{35:90}),{37:[1,91],49:92,50:V},w(H,[2,335],{168:93,169:94,170:95,40:[2,333]}),w(Q,[2,223],{44:96}),w(Q,[2,221],{52:54,288:97,12:A,15:j,27:O,281:D}),w(Q,[2,222]),w(W,[2,219]),w(W,[2,217]),w(W,[2,218]),w(Z,[2,184]),w(Z,[2,185]),w(Z,[2,186]),{19:98,37:G,38:z,49:99,50:V,53:87},{25:100,26:103,27:X,28:Y,286:101,287:[1,102]},w(N,[2,206]),w(N,[2,203]),w(N,[2,204]),w(J,[2,33]),{38:[1,106]},w(K,[2,249],{85:107}),w(F,[2,256]),{12:A,15:j,52:108,281:D},w(L,[2,258]),{100:109,107:[1,110],129:[1,112],131:111,290:[1,113],297:[1,114]},w(R,[2,264]),w(L,tt,{103:115,130:117,107:et,129:rt}),w(P,[2,269]),{107:[1,119]},{107:[2,271]},w(nt,[2,45]),w(H,it,{132:120,139:121,140:122,40:st,107:st}),w(nt,[2,46]),w(nt,[2,47]),w(at,[2,274],{114:123,117:124,120:$}),{38:U,109:125},w(at,[2,280],{118:126,113:127,121:B}),{38:U,109:128},w([120,121],[2,53]),w(E,[2,4]),w(ot,ut,{20:129,55:130,59:131,60:ct}),w(C,[2,200]),{38:lt,54:133},w(L,[2,229],{51:135,290:[1,136]}),{38:[2,232]},{19:137,37:G,38:z,49:138,50:V,53:87},{38:[1,139]},w(S,[2,214]),{40:[1,140]},{40:[2,334]},{12:A,15:j,27:ft,28:ht,52:145,79:pt,88:146,141:141,163:dt,172:142,174:143,210:_t,213:gt,214:yt,231:156,233:157,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D},w(Ot,[2,225],{53:87,45:170,49:171,19:172,37:G,38:z,50:V}),w(W,[2,220]),w(ot,ut,{55:130,59:131,20:173,60:ct}),w(C,[2,228]),w(C,[2,7]),w(C,[2,209],{26:174,27:X,28:Y}),w(C,[2,210]),w(Dt,[2,207]),w(Dt,[2,8]),w(Nt,Lt,{29:175,215:176,219:177,223:178,227:179,235:180,239:181,203:Rt,241:Pt,305:Ut}),w(Bt,[2,247],{84:185}),{27:[1,187],31:[1,186]},w(nt,[2,259],{97:188,127:189,128:[1,190]}),w(nt,[2,42]),{12:A,15:j,52:191,281:D},w(nt,[2,58]),w(nt,[2,288]),w(nt,[2,289]),w(nt,[2,290]),{104:[1,192]},w($t,[2,55]),{12:A,15:j,52:193,281:D},w(L,[2,287]),{12:A,15:j,52:194,281:D},w(qt,[2,293],{133:195}),w(qt,[2,292]),{12:A,15:j,27:ft,28:ht,52:145,79:pt,88:146,141:196,163:dt,172:142,174:143,210:_t,213:gt,214:yt,231:156,233:157,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D},w(at,[2,276],{115:197}),w(at,[2,275]),w([37,120,123],[2,51]),w(at,[2,282],{119:198}),w(at,[2,281]),w([37,121,123],[2,50]),w(I,[2,5]),w(Mt,[2,235],{56:199,66:200,67:[1,201]}),w(ot,[2,234]),{61:[1,202]},w([6,40,60,67,70,78,80,82],[2,15]),w(H,Gt,{21:203,143:204,17:205,144:206,150:207,151:208,23:T,38:zt,40:zt,82:zt,107:zt,155:zt,156:zt,158:zt,161:zt,162:zt}),{12:A,15:j,52:209,281:D},w(L,[2,230]),w(ot,ut,{55:130,59:131,20:210,60:ct}),w(C,[2,212]),w(H,it,{140:122,39:211,139:212,40:[2,215]}),w(C,[2,82]),{40:[2,337],171:213,298:[1,214]},w(Vt,Ht,{173:215,177:216}),w(Vt,Ht,{177:216,175:217,176:218,173:219,40:Qt,107:Qt,298:Qt}),w(Wt,[2,121]),w(Wt,[2,122]),w(Wt,[2,123]),w(Wt,[2,124]),w(Wt,[2,125]),w(Wt,[2,126]),{12:A,15:j,27:ft,28:ht,52:145,79:pt,88:146,163:dt,172:222,174:223,183:221,209:220,210:_t,213:gt,214:yt,231:156,233:157,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D},w(Vt,Ht,{177:216,173:224}),w(Zt,[2,164],{265:[1,225],266:[1,226]}),w(Zt,[2,167]),w(Zt,[2,168]),w(Zt,[2,169]),w(Zt,[2,170]),w(Zt,[2,171]),w(Zt,[2,172]),w(Zt,[2,173]),w(Xt,[2,174]),w(Xt,[2,175]),w(Xt,[2,176]),w(Xt,[2,177]),w(Zt,[2,178]),w(Zt,[2,179]),w(Zt,[2,180]),w(Zt,[2,181]),w(Zt,[2,182]),w(Zt,[2,183]),w(ot,ut,{55:130,59:131,20:227,60:ct}),w(Q,[2,224]),w(Ot,[2,226]),w(I,[2,13]),w(Dt,[2,208]),{30:[1,228]},w(Yt,[2,376],{216:229}),w(Jt,[2,378],{220:230}),w(Jt,[2,131],{224:231,225:232,226:[2,386],263:[1,233],306:[1,234],307:[1,235],308:[1,236],309:[1,237],310:[1,238],311:[1,239]}),w(Kt,[2,388],{228:240}),w(te,[2,396],{236:241}),{12:A,15:j,27:ee,28:re,52:245,64:244,65:246,74:243,79:pt,88:247,231:156,233:157,240:242,242:250,243:ne,244:ie,245:se,247:ae,248:255,249:oe,250:ue,251:258,252:ce,253:le,256:fe,258:he,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D,311:pe,312:de,313:_e,314:ge,315:ye,316:ve},{12:A,15:j,27:ee,28:re,52:245,64:244,65:246,74:243,79:pt,88:247,231:156,233:157,240:268,242:250,243:ne,244:ie,245:se,247:ae,248:255,249:oe,250:ue,251:258,252:ce,253:le,256:fe,258:he,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D,311:pe,312:de,313:_e,314:ge,315:ye,316:ve},{12:A,15:j,27:ee,28:re,52:245,64:244,65:246,74:243,79:pt,88:247,231:156,233:157,240:269,242:250,243:ne,244:ie,245:se,247:ae,248:255,249:oe,250:ue,251:258,252:ce,253:le,256:fe,258:he,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D,311:pe,312:de,313:_e,314:ge,315:ye,316:ve},w(Nt,[2,401]),{12:A,15:j,40:[1,270],52:272,79:pt,87:271,88:273,89:be,231:156,233:157,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D},{38:[1,275]},w(K,[2,250]),w(nt,[2,41]),w(nt,[2,260]),{107:[1,276]},w(nt,[2,57]),w(L,tt,{130:117,103:277,107:et,129:rt}),w($t,[2,56]),w(nt,[2,44]),{40:[1,278],107:[1,280],134:279},w(qt,[2,305],{142:281,298:[1,282]}),{37:[1,283],122:284,123:me},{37:[1,286],122:287,123:me},w(xe,[2,237],{57:288,69:289,70:[1,290]}),w(Mt,[2,236]),{12:A,15:j,28:re,52:296,64:294,65:295,68:291,74:293,76:292,242:250,243:ne,244:ie,245:se,247:ae,248:255,249:oe,250:ue,251:258,252:ce,253:le,256:fe,258:he,281:D,311:pe,312:de,313:_e,314:ge,315:ye,316:ve},{12:A,15:j,27:we,28:Ee,52:296,62:297,63:298,64:299,65:300,242:250,243:ne,244:ie,245:se,247:ae,248:255,249:oe,250:ue,251:258,252:ce,253:le,256:fe,258:he,281:D,311:pe,312:de,313:_e,314:ge,315:ye,316:ve},{40:[1,303]},{40:[1,304]},{19:305,37:G,38:z,53:87},w(Fe,[2,309],{145:306}),w(Fe,[2,308]),{12:A,15:j,27:ft,28:Te,52:145,79:pt,88:146,152:307,163:dt,172:308,185:309,210:ke,213:gt,214:yt,231:156,233:157,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D},w(Q,[2,14]),w(I,[2,10]),{40:[1,312]},{40:[2,216]},{40:[2,83]},w(H,[2,336],{40:[2,338]}),w(Ie,[2,84]),{12:A,15:j,27:[1,315],52:316,178:313,179:314,181:[1,317],281:D},w(Ie,[2,85]),w(Ie,[2,86]),w(Ie,[2,340]),{12:A,15:j,27:ft,28:ht,31:[1,318],52:145,79:pt,88:146,163:dt,172:222,174:223,183:319,210:_t,213:gt,214:yt,231:156,233:157,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D},w(Ce,[2,372]),w(Se,[2,117]),w(Se,[2,118]),{211:[1,320]},w(Zt,[2,165]),{12:A,15:j,52:321,281:D},w(I,[2,12]),{27:[1,322]},w([30,31,192,246],[2,127],{217:323,218:[1,324]}),w(Yt,[2,129],{221:325,222:[1,326]}),w(Nt,Lt,{227:179,235:180,239:181,223:327,203:Rt,241:Pt,305:Ut}),{226:[1,328]},w(Ae,[2,380]),w(Ae,[2,381]),w(Ae,[2,382]),w(Ae,[2,383]),w(Ae,[2,384]),w(Ae,[2,385]),{226:[2,387]},w([30,31,192,218,222,226,246,263,306,307,308,309,310,311],[2,134],{229:329,230:330,231:331,233:332,241:[1,334],275:kt,276:It,277:Ct,278:St,279:At,280:jt,305:[1,333]}),w(Kt,[2,138],{237:335,238:336,287:je,302:Oe}),w(te,[2,140]),w(te,[2,143]),w(te,[2,144]),w(te,[2,145],{28:De,163:Ne}),w(te,[2,146]),w(te,[2,147]),w(te,[2,148]),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:341,203:Rt,241:Pt,305:Ut}),w(Le,[2,150]),{163:[1,342]},{28:[1,343]},{28:[1,344]},{28:[1,345]},{28:Re,163:Pe,166:346},{28:[1,349]},{28:[1,351],163:[1,350]},{252:[1,352]},{28:[1,353]},{28:[1,354]},{28:[1,355]},w(Ue,[2,402]),w(Ue,[2,403]),w(Ue,[2,404]),w(Ue,[2,405]),w(Ue,[2,406]),{252:[2,408]},w(te,[2,141]),w(te,[2,142]),w(J,[2,34]),w(Bt,[2,248]),w(Be,[2,36]),w(Be,[2,37]),w(Be,[2,38]),w($e,[2,251],{86:356}),{12:A,15:j,52:357,281:D},w(nt,[2,43]),w([6,37,120,121,123,192],[2,59]),w(qt,[2,294]),{12:A,15:j,27:[1,359],52:360,135:358,281:D},w(qt,[2,61]),w(H,[2,304],{40:qe,107:qe}),{38:lt,54:361},w(at,[2,277]),w(L,[2,284],{124:362,290:[1,363]}),{38:lt,54:364},w(at,[2,283]),w(Me,[2,239],{58:365,77:366,78:[1,367],80:[1,368]}),w(xe,[2,238]),{61:[1,369]},w(Mt,[2,23],{242:250,248:255,251:258,74:293,64:294,65:295,52:296,76:370,12:A,15:j,28:re,243:ne,244:ie,245:se,247:ae,249:oe,250:ue,252:ce,253:le,256:fe,258:he,281:D,311:pe,312:de,313:_e,314:ge,315:ye,316:ve}),w(Ge,[2,243]),w(ze,[2,75]),w(ze,[2,76]),w(ze,[2,77]),{28:De,163:Ne},w(ot,[2,17],{242:250,248:255,251:258,52:296,64:299,65:300,63:371,12:A,15:j,27:we,28:Ee,243:ne,244:ie,245:se,247:ae,249:oe,250:ue,252:ce,253:le,256:fe,258:he,281:D,311:pe,312:de,313:_e,314:ge,315:ye,316:ve}),w(Ve,[2,241]),w(Ve,[2,18]),w(Ve,[2,19]),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:372,203:Rt,241:Pt,305:Ut}),w(Ve,[2,22]),w(He,[2,62]),w(He,[2,63]),w(ot,ut,{55:130,59:131,20:373,60:ct}),{38:[2,319],40:[2,64],81:383,82:k,107:[1,379],146:374,147:375,154:376,155:[1,377],156:[1,378],158:[1,380],161:[1,381],162:[1,382]},w(Fe,[2,317],{153:384,298:[1,385]}),w(Qe,We,{184:386,187:387,194:388,195:390,27:Ze}),w(Xe,[2,347],{187:387,194:388,195:390,186:391,184:392,12:We,15:We,28:We,181:We,203:We,208:We,281:We,27:Ze}),{12:A,15:j,27:ft,28:Te,52:145,79:pt,88:146,163:dt,172:395,185:396,189:394,210:ke,212:393,213:gt,214:yt,231:156,233:157,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D},w(Qe,We,{187:387,194:388,195:390,184:397,27:Ze}),w(ot,ut,{55:130,59:131,20:398,60:ct}),w([40,107,211,298],[2,87],{300:399,192:[1,400]}),w(H,Ye,{180:401,182:402}),w(H,[2,89]),w(H,[2,90]),w(H,[2,91]),w(Je,[2,113]),w(Ce,[2,373]),w(Je,[2,114]),w(Zt,[2,166]),{31:[1,403]},w(Yt,[2,377]),w(Nt,Lt,{219:177,223:178,227:179,235:180,239:181,215:404,203:Rt,241:Pt,305:Ut}),w(Jt,[2,379]),w(Nt,Lt,{223:178,227:179,235:180,239:181,219:405,203:Rt,241:Pt,305:Ut}),w(Jt,[2,132]),{28:Re,163:Pe,166:406},w(Kt,[2,389]),w(Nt,Lt,{235:180,239:181,227:407,203:Rt,241:Pt,305:Ut}),w(te,[2,392],{232:408}),w(te,[2,394],{234:409}),w(Ae,[2,390]),w(Ae,[2,391]),w(te,[2,397]),w(Nt,Lt,{239:181,235:410,203:Rt,241:Pt,305:Ut}),w(Ae,[2,398]),w(Ae,[2,399]),w(Le,[2,78]),w(Ae,[2,327],{164:411,284:[1,412]}),{31:[1,413]},w(Le,[2,151]),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:414,203:Rt,241:Pt,305:Ut}),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:415,203:Rt,241:Pt,305:Ut}),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:416,203:Rt,241:Pt,305:Ut}),w(Le,[2,155]),w(Le,[2,80]),w(Ae,[2,331],{167:417}),{27:[1,418]},w(Le,[2,157]),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:419,203:Rt,241:Pt,305:Ut}),{38:lt,54:420},w(Ke,[2,409],{254:421,284:[1,422]}),w(Ae,[2,413],{257:423,284:[1,424]}),w(Ae,[2,415],{259:425,284:[1,426]}),{28:[1,429],40:[1,427],90:428},w(nt,[2,54]),{38:[1,430]},{38:[2,295]},{38:[2,296]},w(nt,[2,48]),{12:A,15:j,52:431,281:D},w(L,[2,285]),w(nt,[2,49]),w(Me,[2,16]),w(Me,[2,240]),{79:[1,432]},{79:[1,433]},{12:A,15:j,27:tr,28:re,52:296,64:294,65:295,71:434,72:435,73:er,74:293,75:rr,76:438,242:250,243:ne,244:ie,245:se,247:ae,248:255,249:oe,250:ue,251:258,252:ce,253:le,256:fe,258:he,281:D,311:pe,312:de,313:_e,314:ge,315:ye,316:ve},w(Ge,[2,244]),w(Ve,[2,242]),{30:[1,441],31:[1,440]},{22:442,40:[2,201],81:443,82:k},w(Fe,[2,310]),w(nr,[2,311],{148:444,298:[1,445]}),{38:lt,54:446},{38:lt,54:447},{38:lt,54:448},{12:A,15:j,27:[1,450],52:451,157:449,281:D},w(ir,[2,323],{159:452,291:[1,453]}),{12:A,15:j,28:re,52:296,64:294,65:295,74:293,76:454,242:250,243:ne,244:ie,245:se,247:ae,248:255,249:oe,250:ue,251:258,252:ce,253:le,256:fe,258:he,281:D,311:pe,312:de,313:_e,314:ge,315:ye,316:ve},{28:[1,455]},w(sr,[2,74]),w(Fe,[2,66]),w(H,[2,316],{38:ar,40:ar,82:ar,107:ar,155:ar,156:ar,158:ar,161:ar,162:ar}),w(Xe,[2,93]),w(H,[2,351],{188:456}),w(H,[2,349]),w(H,[2,350]),w(Qe,[2,359],{196:457,197:458}),w(Xe,[2,94]),w(Xe,[2,348]),{12:A,15:j,27:ft,28:Te,31:[1,459],52:145,79:pt,88:146,163:dt,172:395,185:396,189:460,210:ke,213:gt,214:yt,231:156,233:157,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D},w(Ce,[2,374]),w(Se,[2,119]),w(Se,[2,120]),{211:[1,461]},w(I,[2,11]),w(Vt,[2,344],{192:[1,462]}),w(or,[2,341]),w([40,107,192,211,298],[2,88]),{12:A,15:j,27:ft,28:ht,52:145,79:pt,88:146,163:dt,172:222,174:223,183:463,210:_t,213:gt,214:yt,231:156,233:157,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D},w(Dt,[2,9]),w(Yt,[2,128]),w(Jt,[2,130]),w(Jt,[2,133]),w(Kt,[2,135]),w(Kt,[2,136],{238:336,237:464,287:je,302:Oe}),w(Kt,[2,137],{238:336,237:465,287:je,302:Oe}),w(te,[2,139]),w(Ae,[2,329],{165:466}),w(Ae,[2,328]),w([6,12,15,27,28,30,31,38,40,70,73,75,78,79,80,82,107,155,156,158,161,162,163,192,210,213,214,218,222,226,241,243,244,245,246,247,249,250,252,253,256,258,263,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,287,298,302,305,306,307,308,309,310,311,312,313,314,315,316],[2,149]),{31:[1,467]},{246:[1,468]},{246:[1,469]},w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:470,203:Rt,241:Pt,305:Ut}),{31:[1,471]},{31:[1,472]},w(Le,[2,159]),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,255:473,29:475,203:Rt,241:Pt,287:[1,474],305:Ut}),w(Ke,[2,410]),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:476,203:Rt,241:Pt,305:Ut}),w(Ae,[2,414]),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:477,203:Rt,241:Pt,305:Ut}),w(Ae,[2,416]),w(J,[2,35]),w($e,[2,252]),w(ur,[2,253],{91:478}),w(H,it,{140:122,136:479,139:480,40:[2,297]}),w(at,[2,52]),w(Me,[2,29],{80:[1,481]}),w(Me,[2,30],{78:[1,482]}),w(xe,[2,24],{242:250,248:255,251:258,74:293,64:294,65:295,52:296,76:438,72:483,12:A,15:j,27:tr,28:re,73:er,75:rr,243:ne,244:ie,245:se,247:ae,249:oe,250:ue,252:ce,253:le,256:fe,258:he,281:D,311:pe,312:de,313:_e,314:ge,315:ye,316:ve}),w(cr,[2,245]),{28:re,74:484},{28:re,74:485},w(cr,[2,27]),w(cr,[2,28]),w(Ve,[2,20]),{27:[1,486]},{40:[2,6]},{40:[2,202]},w(H,Gt,{151:208,149:487,150:488,38:lr,40:lr,82:lr,107:lr,155:lr,156:lr,158:lr,161:lr,162:lr}),w(nr,[2,312]),w(sr,[2,67],{299:[1,489]}),w(sr,[2,68]),w(sr,[2,69]),{38:lt,54:490},{38:[2,321]},{38:[2,322]},{12:A,15:j,27:[1,492],52:493,160:491,281:D},w(ir,[2,324]),w(sr,[2,72]),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:494,203:Rt,241:Pt,305:Ut}),{12:A,15:j,27:ft,28:Te,52:145,79:pt,88:146,163:dt,172:395,185:396,189:495,210:ke,213:gt,214:yt,231:156,233:157,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D},w(Ce,[2,98],{301:[1,496]}),w(fr,[2,366],{198:497,202:498,208:[1,499]}),w(Wt,[2,115]),w(Ce,[2,375]),w(Wt,[2,116]),w(or,[2,342]),w(hr,[2,92],{246:[1,500]}),w(te,[2,393]),w(te,[2,395]),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:501,203:Rt,241:Pt,305:Ut}),w(Le,[2,152]),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:502,203:Rt,241:Pt,305:Ut}),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:503,203:Rt,241:Pt,305:Ut}),{31:[1,504],246:[1,505]},w(Le,[2,156]),w(Le,[2,158]),{31:[1,506]},{31:[2,411]},{31:[2,412]},{31:[1,507]},{31:[2,417],192:[1,510],260:508,261:509},{12:A,15:j,31:[1,511],52:272,79:pt,87:512,88:273,89:be,231:156,233:157,264:152,267:vt,268:bt,269:mt,270:xt,271:wt,272:Et,273:Ft,274:Tt,275:kt,276:It,277:Ct,278:St,279:At,280:jt,281:D},{40:[1,513]},{40:[2,298]},{79:[1,514]},{79:[1,515]},w(cr,[2,246]),w(cr,[2,25]),w(cr,[2,26]),{31:[1,516]},w(Fe,[2,65]),w(Fe,[2,314]),{38:[2,320]},w(sr,[2,70]),{38:lt,54:517},{38:[2,325]},{38:[2,326]},{30:[1,518]},w(hr,[2,353],{190:519,246:[1,520]}),w(Qe,[2,358]),w([12,15,27,28,31,79,163,210,213,214,267,268,269,270,271,272,273,274,275,276,277,278,279,280,281,301],[2,99],{302:[1,521]}),{12:A,15:j,28:[1,527],52:524,181:[1,525],199:522,200:523,203:[1,526],281:D},w(fr,[2,367]),w(H,[2,346]),{31:[1,528],246:[1,529]},{31:[1,530]},{246:[1,531]},w(Le,[2,81]),w(Ae,[2,332]),w(Le,[2,160]),w(Le,[2,161]),{31:[1,532]},{31:[2,418]},{262:[1,533]},w($e,[2,39]),w(ur,[2,254]),w(pr,[2,299],{137:534,298:[1,535]}),w(Me,[2,31]),w(Me,[2,32]),w(Ve,[2,21]),w(sr,[2,71]),{27:[1,536]},w([38,40,82,107,155,156,158,161,162,211,298],[2,95],{191:537,192:[1,538]}),w(H,[2,352]),w(Qe,[2,360]),w(dr,[2,101]),w(dr,[2,364],{201:539,303:540,287:[1,542],304:[1,541],305:[1,543]}),w(_r,[2,102]),w(_r,[2,103]),{12:A,15:j,28:[1,547],52:548,163:[1,546],181:gr,204:544,205:545,208:yr,281:D},w(Qe,We,{195:390,194:551}),w(Le,[2,79]),w(Ae,[2,330]),w(Le,[2,153]),w(Nt,Lt,{215:176,219:177,223:178,227:179,235:180,239:181,29:552,203:Rt,241:Pt,305:Ut}),w(Le,[2,162]),{263:[1,553]},w(H,it,{140:122,138:554,139:555,40:vr,107:vr}),w(pr,[2,300]),{31:[1,556]},w(hr,[2,354]),w(hr,[2,96],{195:390,193:557,194:558,12:We,15:We,28:We,181:We,203:We,208:We,281:We,27:[1,559]}),w(dr,[2,100]),w(dr,[2,365]),w(dr,[2,361]),w(dr,[2,362]),w(dr,[2,363]),w(_r,[2,104]),w(_r,[2,106]),w(_r,[2,107]),w(br,[2,368],{206:560}),w(_r,[2,109]),w(_r,[2,110]),{12:A,15:j,52:561,181:[1,562],281:D},{31:[1,563]},{31:[1,564]},{264:565,271:wt,272:Et,273:Ft,274:Tt},w(qt,[2,60]),w(qt,[2,302]),w(sr,[2,73]),w(H,Ye,{182:402,180:566}),w(H,[2,355]),w(H,[2,356]),{12:A,15:j,31:[2,370],52:548,181:gr,205:568,207:567,208:yr,281:D},w(_r,[2,111]),w(_r,[2,112]),w(_r,[2,105]),w(Le,[2,154]),{31:[2,163]},w(hr,[2,97]),{31:[1,569]},{31:[2,371],301:[1,570]},w(_r,[2,108]),w(br,[2,369])],defaultActions:{5:[2,191],6:[2,192],22:[2,1],23:[2,2],24:[2,198],74:[2,271],89:[2,232],94:[2,334],212:[2,216],213:[2,83],239:[2,387],267:[2,408],359:[2,295],360:[2,296],442:[2,6],443:[2,202],450:[2,321],451:[2,322],474:[2,411],475:[2,412],480:[2,298],489:[2,320],492:[2,325],493:[2,326],509:[2,418],565:[2,163]},parseError:function(t,e){if(!e.recoverable){var r=new Error(t);throw r.hash=e,r}this.trace(t)},parse:function(t){var e=this,r=[0],n=[null],i=[],s=this.table,a="",o=0,u=0,c=0,l=2,f=1,h=i.slice.call(arguments,1),p=Object.create(this.lexer),d={yy:{}};for(var _ in this.yy)Object.prototype.hasOwnProperty.call(this.yy,_)&&(d.yy[_]=this.yy[_]);p.setInput(t,d.yy),d.yy.lexer=p,d.yy.parser=this,"undefined"==typeof p.yylloc&&(p.yylloc={});var g=p.yylloc;i.push(g);var y=p.options&&p.options.ranges;"function"==typeof d.yy.parseError?this.parseError=d.yy.parseError:this.parseError=Object.getPrototypeOf(this).parseError;for(var v,b,m,x,w,E,F,T,k,I=function(){var t;return t=p.lex()||f,"number"!=typeof t&&(t=e.symbols_[t]||t),t},C={};;){if(m=r[r.length-1],this.defaultActions[m]?x=this.defaultActions[m]:(null!==v&&"undefined"!=typeof v||(v=I()),x=s[m]&&s[m][v]),"undefined"==typeof x||!x.length||!x[0]){var S="";k=[];for(E in s[m])this.terminals_[E]&&E>l&&k.push("'"+this.terminals_[E]+"'");S=p.showPosition?"Parse error on line "+(o+1)+":\n"+p.showPosition()+"\nExpecting "+k.join(", ")+", got '"+(this.terminals_[v]||v)+"'":"Parse error on line "+(o+1)+": Unexpected "+(v==f?"end of input":"'"+(this.terminals_[v]||v)+"'"),this.parseError(S,{text:p.match,token:this.terminals_[v]||v,line:p.yylineno,loc:g,expected:k})}if(x[0]instanceof Array&&x.length>1)throw new Error("Parse Error: multiple actions possible at state: "+m+", token: "+v);switch(x[0]){case 1:r.push(v),n.push(p.yytext),i.push(p.yylloc),r.push(x[1]),v=null,b?(v=b,b=null):(u=p.yyleng,a=p.yytext,o=p.yylineno,g=p.yylloc,c>0&&c--);break;case 2:if(F=this.productions_[x[1]][1],C.$=n[n.length-F],C._$={first_line:i[i.length-(F||1)].first_line,last_line:i[i.length-1].last_line,first_column:i[i.length-(F||1)].first_column,last_column:i[i.length-1].last_column},y&&(C._$.range=[i[i.length-(F||1)].range[0],i[i.length-1].range[1]]),w=this.performAction.apply(C,[a,u,o,d.yy,x[1],n,i].concat(h)),"undefined"!=typeof w)return w;F&&(r=r.slice(0,-1*F*2),n=n.slice(0,-1*F),i=i.slice(0,-1*F)),r.push(this.productions_[x[1]][0]),n.push(C.$),i.push(C._$),T=s[r[r.length-2]][r[r.length-1]],r.push(T);break;case 3:return!0}}return!0}},xr="http://www.w3.org/1999/02/22-rdf-syntax-ns#",wr=xr+"type",Er=xr+"first",Fr=xr+"rest",Tr=xr+"nil",kr="http://www.w3.org/2001/XMLSchema#",Ir=kr+"integer",Cr=kr+"decimal",Sr=kr+"double",Ar=kr+"boolean",jr='"true"^^'+Ar,Or='"false"^^'+Ar,Dr="",Nr="",Lr="",Rr=0;x._resetBlanks=function(){Rr=0};var Pr=/\\u([a-fA-F0-9]{4})|\\U([a-fA-F0-9]{8})|\\(.)/g,Ur={"\\":"\\","'":"'",'"':'"',t:"\t",b:"\b",n:"\n",r:"\r",f:"\f"},Br=String.fromCharCode,$r=function(){var t={EOF:1,parseError:function(t,e){if(!this.yy.parser)throw new Error(t);this.yy.parser.parseError(t,e)},setInput:function(t,e){return this.yy=e||this.yy||{},this._input=t,this._more=this._backtrack=this.done=!1,this.yylineno=this.yyleng=0,this.yytext=this.matched=this.match="",this.conditionStack=["INITIAL"],this.yylloc={first_line:1,first_column:0,last_line:1,last_column:0},this.options.ranges&&(this.yylloc.range=[0,0]),this.offset=0,this},input:function(){var t=this._input[0];this.yytext+=t,this.yyleng++,this.offset++,this.match+=t,this.matched+=t;var e=t.match(/(?:\r\n?|\n).*/g);return e?(this.yylineno++,this.yylloc.last_line++):this.yylloc.last_column++,this.options.ranges&&this.yylloc.range[1]++,this._input=this._input.slice(1),t},unput:function(t){var e=t.length,r=t.split(/(?:\r\n?|\n)/g);this._input=t+this._input,this.yytext=this.yytext.substr(0,this.yytext.length-e),this.offset-=e;var n=this.match.split(/(?:\r\n?|\n)/g);this.match=this.match.substr(0,this.match.length-1),this.matched=this.matched.substr(0,this.matched.length-1),r.length-1&&(this.yylineno-=r.length-1);var i=this.yylloc.range;return this.yylloc={first_line:this.yylloc.first_line,last_line:this.yylineno+1,first_column:this.yylloc.first_column,last_column:r?(r.length===n.length?this.yylloc.first_column:0)+n[n.length-r.length].length-r[0].length:this.yylloc.first_column-e},this.options.ranges&&(this.yylloc.range=[i[0],i[0]+this.yyleng-e]),this.yyleng=this.yytext.length,this},more:function(){return this._more=!0,this},reject:function(){return this.options.backtrack_lexer?(this._backtrack=!0,this):this.parseError("Lexical error on line "+(this.yylineno+1)+". You can only invoke reject() in the lexer when the lexer is of the backtracking persuasion (options.backtrack_lexer = true).\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},less:function(t){this.unput(this.match.slice(t))},pastInput:function(){var t=this.matched.substr(0,this.matched.length-this.match.length);return(t.length>20?"...":"")+t.substr(-20).replace(/\n/g,"")},upcomingInput:function(){var t=this.match;return t.length<20&&(t+=this._input.substr(0,20-t.length)),(t.substr(0,20)+(t.length>20?"...":"")).replace(/\n/g,"")},showPosition:function(){var t=this.pastInput(),e=new Array(t.length+1).join("-");return t+this.upcomingInput()+"\n"+e+"^"},test_match:function(t,e){var r,n,i;if(this.options.backtrack_lexer&&(i={yylineno:this.yylineno,yylloc:{first_line:this.yylloc.first_line,last_line:this.last_line,first_column:this.yylloc.first_column,last_column:this.yylloc.last_column},yytext:this.yytext,match:this.match,matches:this.matches,matched:this.matched,yyleng:this.yyleng,offset:this.offset,_more:this._more,_input:this._input,yy:this.yy,conditionStack:this.conditionStack.slice(0),done:this.done},this.options.ranges&&(i.yylloc.range=this.yylloc.range.slice(0))),n=t[0].match(/(?:\r\n?|\n).*/g),n&&(this.yylineno+=n.length),this.yylloc={first_line:this.yylloc.last_line,last_line:this.yylineno+1,first_column:this.yylloc.last_column,last_column:n?n[n.length-1].length-n[n.length-1].match(/\r?\n?/)[0].length:this.yylloc.last_column+t[0].length},this.yytext+=t[0],this.match+=t[0],this.matches=t,this.yyleng=this.yytext.length,this.options.ranges&&(this.yylloc.range=[this.offset,this.offset+=this.yyleng]),this._more=!1,this._backtrack=!1,this._input=this._input.slice(t[0].length),this.matched+=t[0],r=this.performAction.call(this,this.yy,this,e,this.conditionStack[this.conditionStack.length-1]),this.done&&this._input&&(this.done=!1),r)return r;if(this._backtrack){for(var s in i)this[s]=i[s];return!1}return!1},next:function(){if(this.done)return this.EOF;this._input||(this.done=!0);var t,e,r,n;this._more||(this.yytext="",this.match="");for(var i=this._currentRules(),s=0;se[0].length)){if(e=r,n=s,this.options.backtrack_lexer){if(t=this.test_match(r,i[s]),t!==!1)return t;if(this._backtrack){e=!1;continue}return!1}if(!this.options.flex)break}return e?(t=this.test_match(e,i[n]),t!==!1&&t):""===this._input?this.EOF:this.parseError("Lexical error on line "+(this.yylineno+1)+". Unrecognized text.\n"+this.showPosition(),{text:"",token:null,line:this.yylineno})},lex:function(){var t=this.next();return t?t:this.lex()},begin:function(t){this.conditionStack.push(t)},popState:function(){var t=this.conditionStack.length-1;return t>0?this.conditionStack.pop():this.conditionStack[0]},_currentRules:function(){return this.conditionStack.length&&this.conditionStack[this.conditionStack.length-1]?this.conditions[this.conditionStack[this.conditionStack.length-1]].rules:this.conditions.INITIAL.rules},topState:function(t){return t=this.conditionStack.length-1-Math.abs(t||0),t>=0?this.conditionStack[t]:"INITIAL"},pushState:function(t){this.begin(t)},stateStackSize:function(){return this.conditionStack.length},options:{flex:!0,"case-insensitive":!0},performAction:function(t,e,r,n){switch(r){case 0:break;case 1:return 11;case 2:return 14;case 3:return 23;case 4:return 284;case 5:return 285;case 6:return 28;case 7:return 30;case 8:return 31;case 9:return 287;case 10:return 33;case 11:return 37;case 12:return 38;case 13:return 40;case 14:return 42;case 15:return 47;case 16:return 50;case 17:return 290;case 18:return 60;case 19:return 61;case 20:return 67;case 21:return 70;case 22:return 73;case 23:return 75;case 24:return 78;case 25:return 80;case 26:return 82;case 27:return 192;case 28:return 95;case 29:return 291;case 30:return 128;case 31:return 292;case 32:return 293;case 33:return 105;case 34:return 294;case 35:return 104;case 36:return 295;case 37:return 296;case 38:return 108;case 39:return 110;case 40:return 111;case 41:return 126;case 42:return 120;case 43:return 121;case 44:return 123;case 45:return 129;case 46:return 107;case 47:return 297;case 48:return 298;case 49:return 155;case 50:return 158;case 51:return 162;case 52:return 89;case 53:return 156;case 54:return 299;case 55:return 161;case 56:return 246;case 57:return 181;case 58:return 301;case 59:return 302;case 60:return 208;case 61:return 304;case 62:return 305;case 63:return 203;case 64:return 210;case 65:return 211;case 66:return 218;case 67:return 222;case 68:return 263;case 69:return 306;case 70:return 307;case 71:return 308;case 72:return 309;case 73:return 310;case 74:return 226;case 75:return 311;case 76:return 241;case 77:return 249;case 78:return 250;case 79:return 243;case 80:return 244;case 81:return 245;case 82:return 312;case 83:return 313;case 84:return 247;case 85:return 315;case 86:return 314;case 87:return 316;case 88:return 252;case 89:return 253;case 90:return 256;case 91:return 258;case 92:return 262;case 93:return 266;case 94:return 269;case 95:return 270;case 96:return 12;case 97:return 15;case 98:return 281;case 99:return 213;case 100:return 27;case 101:return 265;case 102:return 79;case 103:return 267;case 104:return 268;case 105:return 275;case 106:return 276;case 107:return 277;case 108:return 278;case 109:return 279;case 110:return 280;case 111:return"EXPONENT";case 112:return 271;case 113:return 272;case 114:return 273;case 115:return 274;case 116:return 163;case 117:return 214;case 118:return 6;case 119:return"INVALID";case 120:console.log(e.yytext)}},rules:[/^(?:\s+|#[^\n\r]*)/i,/^(?:BASE)/i,/^(?:PREFIX)/i,/^(?:SELECT)/i,/^(?:DISTINCT)/i,/^(?:REDUCED)/i,/^(?:\()/i,/^(?:AS)/i,/^(?:\))/i,/^(?:\*)/i,/^(?:CONSTRUCT)/i,/^(?:WHERE)/i,/^(?:\{)/i,/^(?:\})/i,/^(?:DESCRIBE)/i,/^(?:ASK)/i,/^(?:FROM)/i,/^(?:NAMED)/i,/^(?:GROUP)/i,/^(?:BY)/i,/^(?:HAVING)/i,/^(?:ORDER)/i,/^(?:ASC)/i,/^(?:DESC)/i,/^(?:LIMIT)/i,/^(?:OFFSET)/i,/^(?:VALUES)/i,/^(?:;)/i,/^(?:LOAD)/i,/^(?:SILENT)/i,/^(?:INTO)/i,/^(?:CLEAR)/i,/^(?:DROP)/i,/^(?:CREATE)/i,/^(?:ADD)/i,/^(?:TO)/i,/^(?:MOVE)/i,/^(?:COPY)/i,/^(?:INSERT\s+DATA)/i,/^(?:DELETE\s+DATA)/i,/^(?:DELETE\s+WHERE)/i,/^(?:WITH)/i,/^(?:DELETE)/i,/^(?:INSERT)/i,/^(?:USING)/i,/^(?:DEFAULT)/i,/^(?:GRAPH)/i,/^(?:ALL)/i,/^(?:\.)/i,/^(?:OPTIONAL)/i,/^(?:SERVICE)/i,/^(?:BIND)/i,/^(?:UNDEF)/i,/^(?:MINUS)/i,/^(?:UNION)/i,/^(?:FILTER)/i,/^(?:,)/i,/^(?:a)/i,/^(?:\|)/i,/^(?:\/)/i,/^(?:\^)/i,/^(?:\?)/i,/^(?:\+)/i,/^(?:!)/i,/^(?:\[)/i,/^(?:\])/i,/^(?:\|\|)/i,/^(?:&&)/i,/^(?:=)/i,/^(?:!=)/i,/^(?:<)/i,/^(?:>)/i,/^(?:<=)/i,/^(?:>=)/i,/^(?:IN)/i,/^(?:NOT)/i,/^(?:-)/i,/^(?:BOUND)/i,/^(?:BNODE)/i,/^(?:(RAND|NOW|UUID|STRUUID))/i,/^(?:(LANG|DATATYPE|IRI|URI|ABS|CEIL|FLOOR|ROUND|STRLEN|STR|UCASE|LCASE|ENCODE_FOR_URI|YEAR|MONTH|DAY|HOURS|MINUTES|SECONDS|TIMEZONE|TZ|MD5|SHA1|SHA256|SHA384|SHA512|isIRI|isURI|isBLANK|isLITERAL|isNUMERIC))/i,/^(?:(LANGMATCHES|CONTAINS|STRSTARTS|STRENDS|STRBEFORE|STRAFTER|STRLANG|STRDT|sameTerm))/i,/^(?:CONCAT)/i,/^(?:COALESCE)/i,/^(?:IF)/i,/^(?:REGEX)/i,/^(?:SUBSTR)/i,/^(?:REPLACE)/i,/^(?:EXISTS)/i,/^(?:COUNT)/i,/^(?:SUM|MIN|MAX|AVG|SAMPLE)/i,/^(?:GROUP_CONCAT)/i,/^(?:SEPARATOR)/i,/^(?:\^\^)/i,/^(?:true)/i,/^(?:false)/i,/^(?:(<([^<>\"\{\}\|\^`\\\u0000-\u0020])*>))/i,/^(?:((([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])(((((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F]|[\u203F-\u2040])|\.)*(((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F]|[\u203F-\u2040]))?)?:))/i,/^(?:(((([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])(((((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F]|[\u203F-\u2040])|\.)*(((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F]|[\u203F-\u2040]))?)?:)((((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|:|[0-9]|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))(((((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F]|[\u203F-\u2040])|\.|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%))))*((((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F]|[\u203F-\u2040])|:|((%([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))|(\\(_|~|\.|-|!|\$|&|'|\(|\)|\*|\+|,|;|=|\/|\?|#|@|%)))))?)))/i,/^(?:(_:(((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(((((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F]|[\u203F-\u2040])|\.)*(((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|-|[0-9]|\u00B7|[\u0300-\u036F]|[\u203F-\u2040]))?))/i,/^(?:([\?\$]((((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9])(((?:([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]|[\uD800-\uDB7F][\uDC00-\uDFFF])|_))|[0-9]|\u00B7|[\u0300-\u036F]|[\u203F-\u2040])*)))/i,/^(?:(@[a-zA-Z]+(-[a-zA-Z0-9]+)*))/i,/^(?:([0-9]+))/i,/^(?:([0-9]*\.[0-9]+))/i,/^(?:([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+)))/i,/^(?:(\+([0-9]+)))/i,/^(?:(\+([0-9]*\.[0-9]+)))/i,/^(?:(\+([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:(-([0-9]+)))/i,/^(?:(-([0-9]*\.[0-9]+)))/i,/^(?:(-([0-9]+\.[0-9]*([eE][+-]?[0-9]+)|\.([0-9])+([eE][+-]?[0-9]+)|([0-9])+([eE][+-]?[0-9]+))))/i,/^(?:([eE][+-]?[0-9]+))/i,/^(?:('(([^\u0027\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*'))/i,/^(?:("(([^\u0022\u005C\u000A\u000D])|(\\[tbnrf\\\"']|\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])))*"))/i,/^(?:('''(('|'')?([^'\\]|(\\[tbnrf\\\"']|\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*'''))/i,/^(?:("""(("|"")?([^\"\\]|(\\[tbnrf\\\"']|\\u([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])|\\U([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f])([0-9]|[A-F]|[a-f]))))*"""))/i,/^(?:(\((\u0020|\u0009|\u000D|\u000A)*\)))/i,/^(?:(\[(\u0020|\u0009|\u000D|\u000A)*\]))/i,/^(?:$)/i,/^(?:.)/i,/^(?:.)/i],
    conditions:{INITIAL:{rules:[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120],inclusive:!0}}};return t}();return mr.lexer=$r,x.prototype=mr,mr.Parser=x,new x}();"undefined"!=typeof t&&"undefined"!=typeof r&&(r.parser=i,r.Parser=i.Parser,r.parse=function(){return i.parse.apply(i,arguments)},r.main=function(e){e[1]||(console.log("Usage: "+e[0]+" FILE"),n.exit(1));var i=t("fs").readFileSync(t("path").normalize(e[1]),"utf8");return r.parser.parse(i)},"undefined"!=typeof e&&t.main===e&&r.main(n.argv.slice(1)))}).call(this,t("_process"))},{_process:3,fs:3,path:3}],56:[function(t,e,r){var n=t("./lib/SparqlParser").Parser,i=t("./lib/SparqlGenerator");e.exports={Parser:function(t,e){var r={};for(var i in t||{})r[i]=t[i];var s=new n;return s.parse=function(){return n.base=e||"",n.prefixes=Object.create(r),n.prototype.parse.apply(s,arguments)},s._resetBlanks=n._resetBlanks,s},Generator:i}},{"./lib/SparqlGenerator":54,"./lib/SparqlParser":55}],57:[function(e,r,n){(function(e){/*
 UriTemplate Copyright (c) 2012-2013 Franz Antesberger. All Rights Reserved.
 Available via the MIT license.
 */
    !function(t){"use strict";function e(t){var r;if(null===t||void 0===t)return!1;if(n.isArray(t))return t.length>0;if("string"==typeof t||"number"==typeof t||"boolean"==typeof t)return!0;for(r in t)if(t.hasOwnProperty(r)&&e(t[r]))return!0;return!1}var r=function(){function t(t){this.options=t}return t.prototype.toString=function(){return JSON&&JSON.stringify?JSON.stringify(this.options):this.options},t}(),n=function(){function t(t){return"[object Array]"===Object.prototype.toString.apply(t)}function e(t){return"[object String]"===Object.prototype.toString.apply(t)}function r(t){return"[object Number]"===Object.prototype.toString.apply(t)}function n(t){return"[object Boolean]"===Object.prototype.toString.apply(t)}function i(t,e){var r,n="",i=!0;for(r=0;r="a"&&t<="z"||t>="A"&&t<="Z"}function e(t){return t>="0"&&t<="9"}function r(t){return e(t)||t>="a"&&t<="f"||t>="A"&&t<="F"}return{isAlpha:t,isDigit:e,isHexDigit:r}}(),s=function(){function t(t){var e,r,n="",i=a.encode(t);for(r=0;r1?r:a.isReserved(r)||a.isUnreserved(r)?r:s.encodeCharacter(r)}function n(t){var e,r="",n="";for(e=0;e1?n:a.isReserved(n)||a.isUnreserved(n)?n:s.encodeCharacter(n);return r}return{encode:t,encodePassReserved:e,encodeLiteral:n,encodeLiteralCharacter:r}}(),u=function(){function t(t){e[t]={symbol:t,separator:"?"===t?"&":""===t||"+"===t||"#"===t?",":t,named:";"===t||"&"===t||"?"===t,ifEmpty:"&"===t||"?"===t?"=":"",first:"+"===t?"":t,encode:"+"===t||"#"===t?o.encodePassReserved:o.encode,toString:function(){return this.symbol}}}var e={};return t(""),t("+"),t("#"),t("."),t("/"),t(";"),t("?"),t("&"),{valueOf:function(t){return e[t]?e[t]:"=,!@|".indexOf(t)>=0?null:e[""]}}}(),c=function(){function t(t){this.literal=o.encodeLiteral(t)}return t.prototype.expand=function(){return this.literal},t.prototype.toString=t.prototype.expand,t}(),l=function(){function t(t){function e(){var e=t.substring(p,c);if(0===e.length)throw new r({expressionText:t,message:"a varname must be specified",position:c});h={varname:e,exploded:!1,maxLength:null},p=null}function n(){if(d===c)throw new r({expressionText:t,message:"after a ':' you have to specify the length",position:c});h.maxLength=parseInt(t.substring(d,c),10),d=null}var o,c,l=[],h=null,p=null,d=null,_="";for(o=function(e){var n=u.valueOf(e);if(null===n)throw new r({expressionText:t,message:"illegal use of reserved operator",position:c,operator:e});return n}(t.charAt(0)),c=o.symbol.length,p=c;c=4)throw new r({expressionText:t,message:"A :prefix must have max 4 digits",position:c});continue}n()}if(":"!==_)if("*"!==_){if(","!==_)throw new r({expressionText:t,message:"illegal character",character:_,position:c});l.push(h),h=null,p=c+1}else{if(null===h)throw new r({expressionText:t,message:"exploded without varspec",position:c});if(h.exploded)throw new r({expressionText:t,message:"exploded twice",position:c});if(h.maxLength)throw new r({expressionText:t,message:"an explode (*) MUST NOT follow to a prefix",position:c});h.exploded=!0}else{if(null!==h.maxLength)throw new r({expressionText:t,message:"only one :maxLength is allowed per varspec",position:c});if(h.exploded)throw new r({expressionText:t,message:"an exploeded varspec MUST NOT be varspeced",position:c});d=c+1}}return null!==p&&e(),null!==d&&n(),l.push(h),new f(t,o,l)}function e(e){var n,i,s=[],a=null,o=0;for(n=0;n",'"',"`"," ","\r","\n","\t"],d=["{","}","|","\\","^","`"].concat(p),_=["'"].concat(d),g=["%","/","?",";","#"].concat(_),y=["/","?","#"],v=255,b=/^[+a-z0-9A-Z_-]{0,63}$/,m=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,x={javascript:!0,"javascript:":!0},w={javascript:!0,"javascript:":!0},E={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},F=t("querystring");n.prototype.parse=function(t,e,r){if(!c.isString(t))throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var n=t.indexOf("?"),i=n!==-1&&n127?"x":N[R];if(!L.match(b)){var U=O.slice(0,I),B=O.slice(I+1),$=N.match(m);$&&(U.push($[1]),B.unshift($[2])),B.length&&(o="/"+B.join(".")+o),this.hostname=U.join(".");break}}}this.hostname.length>v?this.hostname="":this.hostname=this.hostname.toLowerCase(),j||(this.hostname=u.toASCII(this.hostname));var q=this.port?":"+this.port:"",M=this.hostname||"";this.host=M+q,this.href+=this.host,j&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),"/"!==o[0]&&(o="/"+o))}if(!x[d])for(var I=0,D=_.length;I0)&&r.host.split("@");T&&(r.auth=T.shift(),r.host=r.hostname=T.shift())}return r.search=t.search,r.query=t.query,c.isNull(r.pathname)&&c.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!x.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var k=x.slice(-1)[0],I=(r.host||t.host||x.length>1)&&("."===k||".."===k)||""===k,C=0,S=x.length;S>=0;S--)k=x[S],"."===k?x.splice(S,1):".."===k?(x.splice(S,1),C++):C&&(x.splice(S,1),C--);if(!b&&!m)for(;C--;C)x.unshift("..");!b||""===x[0]||x[0]&&"/"===x[0].charAt(0)||x.unshift(""),I&&"/"!==x.join("/").substr(-1)&&x.push("");var A=""===x[0]||x[0]&&"/"===x[0].charAt(0);if(F){r.hostname=r.host=A?"":x.length?x.shift():"";var T=!!(r.host&&r.host.indexOf("@")>0)&&r.host.split("@");T&&(r.auth=T.shift(),r.host=r.hostname=T.shift())}return b=b||r.host&&x.length,b&&!A&&x.unshift(""),x.length?r.pathname=x.join("/"):(r.pathname=null,r.path=null),c.isNull(r.pathname)&&c.isNull(r.search)||(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r},n.prototype.parseHost=function(){var t=this.host,e=f.exec(t);e&&(e=e[0],":"!==e&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)}},{"./util":59,punycode:49,querystring:52}],59:[function(t,e,r){"use strict";e.exports={isString:function(t){return"string"==typeof t},isObject:function(t){return"object"==typeof t&&null!==t},isNull:function(t){return null===t},isNullOrUndefined:function(t){return null==t}}},{}],60:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(t,e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}},{}],61:[function(t,e,r){e.exports=function(t){return t&&"object"==typeof t&&"function"==typeof t.copy&&"function"==typeof t.fill&&"function"==typeof t.readUInt8}},{}],62:[function(t,e,r){(function(e,n){function i(t,e){var n={seen:[],stylize:a};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),_(e)?n.showHidden=e:e&&r._extend(n,e),x(n.showHidden)&&(n.showHidden=!1),x(n.depth)&&(n.depth=2),x(n.colors)&&(n.colors=!1),x(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=s),u(n,t,n.depth)}function s(t,e){var r=i.styles[e];return r?"["+i.colors[r][0]+"m"+t+"["+i.colors[r][1]+"m":t}function a(t,e){return t}function o(t){var e={};return t.forEach(function(t,r){e[t]=!0}),e}function u(t,e,n){if(t.customInspect&&e&&k(e.inspect)&&e.inspect!==r.inspect&&(!e.constructor||e.constructor.prototype!==e)){var i=e.inspect(n,t);return b(i)||(i=u(t,i,n)),i}var s=c(t,e);if(s)return s;var a=Object.keys(e),_=o(a);if(t.showHidden&&(a=Object.getOwnPropertyNames(e)),T(e)&&(a.indexOf("message")>=0||a.indexOf("description")>=0))return l(e);if(0===a.length){if(k(e)){var g=e.name?": "+e.name:"";return t.stylize("[Function"+g+"]","special")}if(w(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(F(e))return t.stylize(Date.prototype.toString.call(e),"date");if(T(e))return l(e)}var y="",v=!1,m=["{","}"];if(d(e)&&(v=!0,m=["[","]"]),k(e)){var x=e.name?": "+e.name:"";y=" [Function"+x+"]"}if(w(e)&&(y=" "+RegExp.prototype.toString.call(e)),F(e)&&(y=" "+Date.prototype.toUTCString.call(e)),T(e)&&(y=" "+l(e)),0===a.length&&(!v||0==e.length))return m[0]+y+m[1];if(n<0)return w(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var E;return E=v?f(t,e,n,_,a):a.map(function(r){return h(t,e,n,_,r,v)}),t.seen.pop(),p(E,y,m)}function c(t,e){if(x(e))return t.stylize("undefined","undefined");if(b(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}return v(e)?t.stylize(""+e,"number"):_(e)?t.stylize(""+e,"boolean"):g(e)?t.stylize("null","null"):void 0}function l(t){return"["+Error.prototype.toString.call(t)+"]"}function f(t,e,r,n,i){for(var s=[],a=0,o=e.length;a-1&&(o=s?o.split("\n").map(function(t){return"  "+t}).join("\n").substr(2):"\n"+o.split("\n").map(function(t){return"   "+t}).join("\n"))):o=t.stylize("[Circular]","special")),x(a)){if(s&&i.match(/^\d+$/))return o;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+o}function p(t,e,r){var n=0,i=t.reduce(function(t,e){return n++,e.indexOf("\n")>=0&&n++,t+e.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(""===e?"":e+"\n ")+" "+t.join(",\n  ")+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function d(t){return Array.isArray(t)}function _(t){return"boolean"==typeof t}function g(t){return null===t}function y(t){return null==t}function v(t){return"number"==typeof t}function b(t){return"string"==typeof t}function m(t){return"symbol"==typeof t}function x(t){return void 0===t}function w(t){return E(t)&&"[object RegExp]"===C(t)}function E(t){return"object"==typeof t&&null!==t}function F(t){return E(t)&&"[object Date]"===C(t)}function T(t){return E(t)&&("[object Error]"===C(t)||t instanceof Error)}function k(t){return"function"==typeof t}function I(t){return null===t||"boolean"==typeof t||"number"==typeof t||"string"==typeof t||"symbol"==typeof t||"undefined"==typeof t}function C(t){return Object.prototype.toString.call(t)}function S(t){return t<10?"0"+t.toString(10):t.toString(10)}function A(){var t=new Date,e=[S(t.getHours()),S(t.getMinutes()),S(t.getSeconds())].join(":");return[t.getDate(),L[t.getMonth()],e].join(" ")}function j(t,e){return Object.prototype.hasOwnProperty.call(t,e)}
// Copyright Joyent, Inc. and other Node contributors.
//
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to permit
// persons to whom the Software is furnished to do so, subject to the
// following conditions:
//
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
// USE OR OTHER DEALINGS IN THE SOFTWARE.
    var O=/%[sdj%]/g;r.format=function(t){if(!b(t)){for(var e=[],r=0;r=s)return t;switch(t){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(t){return"[Circular]"}default:return t}}),o=n[r];r0)for(var r=0,i=arguments.length;r1)r=e;else{if(!this.head)throw new TypeError("Reduce of empty list with no initial value");n=this.head.next,r=this.head.value}for(var i=0;null!==n;i++)r=t(r,n.value,i),n=n.next;return r},n.prototype.reduceReverse=function(t,e){var r,n=this.tail;if(arguments.length>1)r=e;else{if(!this.tail)throw new TypeError("Reduce of empty list with no initial value");n=this.tail.prev,r=this.tail.value}for(var i=this.length-1;null!==n;i--)r=t(r,n.value,i),n=n.prev;return r},n.prototype.toArray=function(){for(var t=new Array(this.length),e=0,r=this.head;null!==r;e++)t[e]=r.value,r=r.next;return t},n.prototype.toArrayReverse=function(){for(var t=new Array(this.length),e=0,r=this.tail;null!==r;e++)t[e]=r.value,r=r.prev;return t},n.prototype.slice=function(t,e){e=e||this.length,e<0&&(e+=this.length),t=t||0,t<0&&(t+=this.length);var r=new n;if(ethis.length&&(e=this.length);for(var i=0,s=this.head;null!==s&&ithis.length&&(e=this.length);for(var i=this.length,s=this.tail;null!==s&&i>e;i--)s=s.prev;for(;null!==s&&i>t;i--,s=s.prev)r.push(s.value);return r},n.prototype.reverse=function(){for(var t=this.head,e=this.tail,r=t;null!==r;r=r.prev){var n=r.prev;r.prev=r.next,r.next=n}return this.head=e,this.tail=t,this}},{}]},{},[34])(34)});var fragmentsClient,resultsIterator,logger=new ldf.Logger;ldf.Logger.setLevel("info"),logger._print=function(t){postMessage({type:"log",log:t.slice(2).join(" ").trim()+"\n"})};var handlers={query:function(t){t.logger=logger,t.fragmentsClient=fragmentsClient=new ldf.FragmentsClient(t.datasources,t);try{resultsIterator=new ldf.SparqlIterator(t.query,t)}catch(t){return postMessage({type:"error",error:t})}postMessage({type:"queryInfo",queryType:resultsIterator.queryType}),resultsIterator.on("data",function(t){postMessage({type:"result",result:t})}),resultsIterator.on("end",function(){postMessage({type:"end"})}),resultsIterator.on("error",function(t){t={message:t.message||t.toString()},postMessage({type:"error",error:t})})},stop:function(){resultsIterator&&(resultsIterator.removeAllListeners(),resultsIterator=null),fragmentsClient&&(fragmentsClient.abortAll(),fragmentsClient=null)}};self.onmessage=function(t){handlers[t.data.type](t.data)};
//# sourceMappingURL=ldf-client-worker.js.map




© 2015 - 2024 Weber Informatics LLC | Privacy Policy