@pod-os/core 0.6.1-2196a40.0 → 0.6.1-4ea2c6e.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/dist/index.js +1630 -228
  2. package/lib/index.js +1630 -228
  3. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -40,6 +40,10 @@ var __copyProps = (to, from, except, desc) => {
40
40
  return to;
41
41
  };
42
42
  var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
43
+ // If the importer is in node compatibility mode or this is not an ESM
44
+ // file that has been converted to a CommonJS file using a Babel-
45
+ // compatible transform (i.e. "__esModule" has not been set), then set
46
+ // "default" to the CommonJS "module.exports" for node compatibility.
43
47
  isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
44
48
  mod
45
49
  ));
@@ -1046,6 +1050,9 @@ var JOSEError, JWTClaimValidationFailed, JWTExpired, JOSEAlgNotAllowed, JOSENotS
1046
1050
  var init_errors = __esm({
1047
1051
  "../node_modules/jose/dist/browser/util/errors.js"() {
1048
1052
  JOSEError = class extends Error {
1053
+ static get code() {
1054
+ return "ERR_JOSE_GENERIC";
1055
+ }
1049
1056
  constructor(message2) {
1050
1057
  var _a;
1051
1058
  super(message2);
@@ -1053,31 +1060,28 @@ var init_errors = __esm({
1053
1060
  this.name = this.constructor.name;
1054
1061
  (_a = Error.captureStackTrace) === null || _a === void 0 ? void 0 : _a.call(Error, this, this.constructor);
1055
1062
  }
1056
- static get code() {
1057
- return "ERR_JOSE_GENERIC";
1058
- }
1059
1063
  };
1060
1064
  JWTClaimValidationFailed = class extends JOSEError {
1065
+ static get code() {
1066
+ return "ERR_JWT_CLAIM_VALIDATION_FAILED";
1067
+ }
1061
1068
  constructor(message2, claim = "unspecified", reason = "unspecified") {
1062
1069
  super(message2);
1063
1070
  this.code = "ERR_JWT_CLAIM_VALIDATION_FAILED";
1064
1071
  this.claim = claim;
1065
1072
  this.reason = reason;
1066
1073
  }
1067
- static get code() {
1068
- return "ERR_JWT_CLAIM_VALIDATION_FAILED";
1069
- }
1070
1074
  };
1071
1075
  JWTExpired = class extends JOSEError {
1076
+ static get code() {
1077
+ return "ERR_JWT_EXPIRED";
1078
+ }
1072
1079
  constructor(message2, claim = "unspecified", reason = "unspecified") {
1073
1080
  super(message2);
1074
1081
  this.code = "ERR_JWT_EXPIRED";
1075
1082
  this.claim = claim;
1076
1083
  this.reason = reason;
1077
1084
  }
1078
- static get code() {
1079
- return "ERR_JWT_EXPIRED";
1080
- }
1081
1085
  };
1082
1086
  JOSEAlgNotAllowed = class extends JOSEError {
1083
1087
  constructor() {
@@ -8264,7 +8268,9 @@ var require_oidc_client_min = __commonJS({
8264
8268
  }
8265
8269
  }
8266
8270
  return true;
8267
- }, w.prototype.clone = function Wt() {
8271
+ }, w.prototype.clone = /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
8272
+ */
8273
+ function Wt() {
8268
8274
  var t3 = F();
8269
8275
  return this.copyTo(t3), t3;
8270
8276
  }, w.prototype.intValue = function zt() {
@@ -8657,7 +8663,9 @@ var require_oidc_client_min = __commonJS({
8657
8663
  default:
8658
8664
  return null;
8659
8665
  }
8660
- }, He.prototype.getByteLength = function() {
8666
+ }, /*! (c) Stefan Thomas | https://github.com/bitcoinjs/bitcoinjs-lib
8667
+ */
8668
+ He.prototype.getByteLength = function() {
8661
8669
  return Math.floor((this.toBigInteger().bitLength() + 7) / 8);
8662
8670
  }, Ve.prototype.getEncoded = function(t3) {
8663
8671
  var e2 = function t4(e3, r4) {
@@ -14661,15 +14669,36 @@ var require_IdentifierIssuer = __commonJS({
14661
14669
  "../node_modules/rdf-canonize/lib/IdentifierIssuer.js"(exports, module2) {
14662
14670
  "use strict";
14663
14671
  module2.exports = class IdentifierIssuer {
14672
+ /**
14673
+ * Creates a new IdentifierIssuer. A IdentifierIssuer issues unique
14674
+ * identifiers, keeping track of any previously issued identifiers.
14675
+ *
14676
+ * @param prefix the prefix to use ('<prefix><counter>').
14677
+ * @param existing an existing Map to use.
14678
+ * @param counter the counter to use.
14679
+ */
14664
14680
  constructor(prefix, existing = /* @__PURE__ */ new Map(), counter = 0) {
14665
14681
  this.prefix = prefix;
14666
14682
  this._existing = existing;
14667
14683
  this.counter = counter;
14668
14684
  }
14685
+ /**
14686
+ * Copies this IdentifierIssuer.
14687
+ *
14688
+ * @return a copy of this IdentifierIssuer.
14689
+ */
14669
14690
  clone() {
14670
14691
  const { prefix, _existing, counter } = this;
14671
14692
  return new IdentifierIssuer(prefix, new Map(_existing), counter);
14672
14693
  }
14694
+ /**
14695
+ * Gets the new identifier for the given old identifier, where if no old
14696
+ * identifier is given a new identifier will be generated.
14697
+ *
14698
+ * @param [old] the old identifier to get the new identifier for.
14699
+ *
14700
+ * @return the new identifier.
14701
+ */
14673
14702
  getId(old) {
14674
14703
  const existing = old && this._existing.get(old);
14675
14704
  if (existing) {
@@ -14682,9 +14711,24 @@ var require_IdentifierIssuer = __commonJS({
14682
14711
  }
14683
14712
  return identifier;
14684
14713
  }
14714
+ /**
14715
+ * Returns true if the given old identifer has already been assigned a new
14716
+ * identifier.
14717
+ *
14718
+ * @param old the old identifier to check.
14719
+ *
14720
+ * @return true if the old identifier has been assigned a new identifier,
14721
+ * false if not.
14722
+ */
14685
14723
  hasId(old) {
14686
14724
  return this._existing.has(old);
14687
14725
  }
14726
+ /**
14727
+ * Returns all of the IDs that have been issued new IDs in the order in
14728
+ * which they were issued new IDs.
14729
+ *
14730
+ * @return the list of old IDs that has been issued new IDs in order.
14731
+ */
14688
14732
  getOldIds() {
14689
14733
  return [...this._existing.keys()];
14690
14734
  }
@@ -14847,6 +14891,11 @@ var require_MessageDigest_browser = __commonJS({
14847
14891
  require_setImmediate();
14848
14892
  var crypto2 = self.crypto || self.msCrypto;
14849
14893
  module2.exports = class MessageDigest {
14894
+ /**
14895
+ * Creates a new MessageDigest.
14896
+ *
14897
+ * @param algorithm the algorithm to use.
14898
+ */
14850
14899
  constructor(algorithm) {
14851
14900
  if (!(crypto2 && crypto2.subtle)) {
14852
14901
  throw new Error("crypto.subtle not found.");
@@ -14883,6 +14932,12 @@ var require_Permuter = __commonJS({
14883
14932
  "../node_modules/rdf-canonize/lib/Permuter.js"(exports, module2) {
14884
14933
  "use strict";
14885
14934
  module2.exports = class Permuter {
14935
+ /**
14936
+ * A Permuter iterates over all possible permutations of the given array
14937
+ * of elements.
14938
+ *
14939
+ * @param list the array of elements to iterate over.
14940
+ */
14886
14941
  constructor(list) {
14887
14942
  this.current = list.sort();
14888
14943
  this.done = false;
@@ -14891,9 +14946,20 @@ var require_Permuter = __commonJS({
14891
14946
  this.dir.set(list[i], true);
14892
14947
  }
14893
14948
  }
14949
+ /**
14950
+ * Returns true if there is another permutation.
14951
+ *
14952
+ * @return true if there is another permutation, false if not.
14953
+ */
14894
14954
  hasNext() {
14895
14955
  return !this.done;
14896
14956
  }
14957
+ /**
14958
+ * Gets the next permutation. Call hasNext() to ensure there is another one
14959
+ * first.
14960
+ *
14961
+ * @return the next permutation.
14962
+ */
14897
14963
  next() {
14898
14964
  const { current, dir: dir2 } = this;
14899
14965
  const rval = current.slice();
@@ -14962,6 +15028,13 @@ var require_NQuads = __commonJS({
14962
15028
  );
14963
15029
  })();
14964
15030
  module2.exports = class NQuads {
15031
+ /**
15032
+ * Parses RDF in the form of N-Quads.
15033
+ *
15034
+ * @param input the N-Quads input to parse.
15035
+ *
15036
+ * @return an RDF dataset (an array of quads per http://rdf.js.org/).
15037
+ */
14965
15038
  static parse(input) {
14966
15039
  const dataset = [];
14967
15040
  const graphs = {};
@@ -15041,6 +15114,13 @@ var require_NQuads = __commonJS({
15041
15114
  }
15042
15115
  return dataset;
15043
15116
  }
15117
+ /**
15118
+ * Converts an RDF dataset to N-Quads.
15119
+ *
15120
+ * @param dataset (array of quads) the RDF dataset to convert.
15121
+ *
15122
+ * @return the N-Quads string.
15123
+ */
15044
15124
  static serialize(dataset) {
15045
15125
  if (!Array.isArray(dataset)) {
15046
15126
  dataset = NQuads.legacyDatasetToQuads(dataset);
@@ -15051,6 +15131,16 @@ var require_NQuads = __commonJS({
15051
15131
  }
15052
15132
  return quads.sort().join("");
15053
15133
  }
15134
+ /**
15135
+ * Converts RDF quad components to an N-Quad string (a single quad).
15136
+ *
15137
+ * @param {Object} s - N-Quad subject component.
15138
+ * @param {Object} p - N-Quad predicate component.
15139
+ * @param {Object} o - N-Quad object component.
15140
+ * @param {Object} g - N-Quad graph component.
15141
+ *
15142
+ * @return {string} the N-Quad.
15143
+ */
15054
15144
  static serializeQuadComponents(s, p, o, g) {
15055
15145
  let nquad = "";
15056
15146
  if (s.termType === TYPE_NAMED_NODE) {
@@ -15081,6 +15171,13 @@ var require_NQuads = __commonJS({
15081
15171
  nquad += " .\n";
15082
15172
  return nquad;
15083
15173
  }
15174
+ /**
15175
+ * Converts an RDF quad to an N-Quad string (a single quad).
15176
+ *
15177
+ * @param quad the RDF quad convert.
15178
+ *
15179
+ * @return the N-Quad string.
15180
+ */
15084
15181
  static serializeQuad(quad5) {
15085
15182
  return NQuads.serializeQuadComponents(
15086
15183
  quad5.subject,
@@ -15089,6 +15186,14 @@ var require_NQuads = __commonJS({
15089
15186
  quad5.graph
15090
15187
  );
15091
15188
  }
15189
+ /**
15190
+ * Converts a legacy-formatted dataset to an array of quads dataset per
15191
+ * http://rdf.js.org/.
15192
+ *
15193
+ * @param dataset the legacy dataset to convert.
15194
+ *
15195
+ * @return the array of quads dataset.
15196
+ */
15092
15197
  static legacyDatasetToQuads(dataset) {
15093
15198
  const quads = [];
15094
15199
  const termTypeMap = {
@@ -15223,6 +15328,7 @@ var require_URDNA2015 = __commonJS({
15223
15328
  this.quads = null;
15224
15329
  this.deepIterations = null;
15225
15330
  }
15331
+ // 4.4) Normalization Algorithm
15226
15332
  async main(dataset) {
15227
15333
  this.deepIterations = /* @__PURE__ */ new Map();
15228
15334
  this.quads = dataset;
@@ -15283,6 +15389,7 @@ var require_URDNA2015 = __commonJS({
15283
15389
  normalized.sort();
15284
15390
  return normalized.join("");
15285
15391
  }
15392
+ // 4.6) Hash First Degree Quads
15286
15393
  async hashFirstDegreeQuads(id3) {
15287
15394
  const nquads = [];
15288
15395
  const info2 = this.blankNodeInfo.get(id3);
@@ -15319,6 +15426,7 @@ var require_URDNA2015 = __commonJS({
15319
15426
  info2.hash = await md.digest();
15320
15427
  return info2.hash;
15321
15428
  }
15429
+ // 4.7) Hash Related Blank Node
15322
15430
  async hashRelatedBlankNode(related, quad5, issuer, position) {
15323
15431
  let id3;
15324
15432
  if (this.canonicalIssuer.hasId(related)) {
@@ -15336,6 +15444,7 @@ var require_URDNA2015 = __commonJS({
15336
15444
  md.update(id3);
15337
15445
  return md.digest();
15338
15446
  }
15447
+ // 4.8) Hash N-Degree Quads
15339
15448
  async hashNDegreeQuads(id3, issuer) {
15340
15449
  const deepIterations = this.deepIterations.get(id3) || 0;
15341
15450
  if (deepIterations > this.maxDeepIterations) {
@@ -15402,6 +15511,7 @@ var require_URDNA2015 = __commonJS({
15402
15511
  }
15403
15512
  return { hash: await md.digest(), issuer };
15404
15513
  }
15514
+ // helper for modifying component during Hash First Degree Quads
15405
15515
  modifyFirstDegreeComponent(id3, component) {
15406
15516
  if (component.termType !== "BlankNode") {
15407
15517
  return component;
@@ -15411,9 +15521,11 @@ var require_URDNA2015 = __commonJS({
15411
15521
  value: component.value === id3 ? "_:a" : "_:z"
15412
15522
  };
15413
15523
  }
15524
+ // helper for getting a related predicate
15414
15525
  getRelatedPredicate(quad5) {
15415
15526
  return `<${quad5.predicate.value}>`;
15416
15527
  }
15528
+ // helper for creating hash to related blank nodes map
15417
15529
  async createHashToRelated(id3, issuer) {
15418
15530
  const hashToRelated = /* @__PURE__ */ new Map();
15419
15531
  const quads = this.blankNodeInfo.get(id3).quads;
@@ -15490,6 +15602,7 @@ var require_URDNA2015 = __commonJS({
15490
15602
  hashToRelated.set(hash, [related]);
15491
15603
  }
15492
15604
  }
15605
+ // canonical ids for 7.1
15493
15606
  _componentWithCanonicalId(component) {
15494
15607
  if (component.termType === "BlankNode" && !component.value.startsWith(this.canonicalIssuer.prefix)) {
15495
15608
  return {
@@ -15521,6 +15634,7 @@ var require_URGNA2012 = __commonJS({
15521
15634
  this.name = "URGNA2012";
15522
15635
  this.createMessageDigest = () => new MessageDigest("sha1");
15523
15636
  }
15637
+ // helper for modifying component during Hash First Degree Quads
15524
15638
  modifyFirstDegreeComponent(id3, component, key) {
15525
15639
  if (component.termType !== "BlankNode") {
15526
15640
  return component;
@@ -15536,9 +15650,11 @@ var require_URGNA2012 = __commonJS({
15536
15650
  value: component.value === id3 ? "_:a" : "_:z"
15537
15651
  };
15538
15652
  }
15653
+ // helper for getting a related predicate
15539
15654
  getRelatedPredicate(quad5) {
15540
15655
  return quad5.predicate.value;
15541
15656
  }
15657
+ // helper for creating hash to related blank nodes map
15542
15658
  async createHashToRelated(id3, issuer) {
15543
15659
  const hashToRelated = /* @__PURE__ */ new Map();
15544
15660
  const quads = this.blankNodeInfo.get(id3).quads;
@@ -15598,6 +15714,7 @@ var require_URDNA2015Sync = __commonJS({
15598
15714
  this.quads = null;
15599
15715
  this.deepIterations = null;
15600
15716
  }
15717
+ // 4.4) Normalization Algorithm
15601
15718
  main(dataset) {
15602
15719
  this.deepIterations = /* @__PURE__ */ new Map();
15603
15720
  this.quads = dataset;
@@ -15654,6 +15771,7 @@ var require_URDNA2015Sync = __commonJS({
15654
15771
  normalized.sort();
15655
15772
  return normalized.join("");
15656
15773
  }
15774
+ // 4.6) Hash First Degree Quads
15657
15775
  hashFirstDegreeQuads(id3) {
15658
15776
  const nquads = [];
15659
15777
  const info2 = this.blankNodeInfo.get(id3);
@@ -15690,6 +15808,7 @@ var require_URDNA2015Sync = __commonJS({
15690
15808
  info2.hash = md.digest();
15691
15809
  return info2.hash;
15692
15810
  }
15811
+ // 4.7) Hash Related Blank Node
15693
15812
  hashRelatedBlankNode(related, quad5, issuer, position) {
15694
15813
  let id3;
15695
15814
  if (this.canonicalIssuer.hasId(related)) {
@@ -15707,6 +15826,7 @@ var require_URDNA2015Sync = __commonJS({
15707
15826
  md.update(id3);
15708
15827
  return md.digest();
15709
15828
  }
15829
+ // 4.8) Hash N-Degree Quads
15710
15830
  hashNDegreeQuads(id3, issuer) {
15711
15831
  const deepIterations = this.deepIterations.get(id3) || 0;
15712
15832
  if (deepIterations > this.maxDeepIterations) {
@@ -15769,6 +15889,7 @@ var require_URDNA2015Sync = __commonJS({
15769
15889
  }
15770
15890
  return { hash: md.digest(), issuer };
15771
15891
  }
15892
+ // helper for modifying component during Hash First Degree Quads
15772
15893
  modifyFirstDegreeComponent(id3, component) {
15773
15894
  if (component.termType !== "BlankNode") {
15774
15895
  return component;
@@ -15778,9 +15899,11 @@ var require_URDNA2015Sync = __commonJS({
15778
15899
  value: component.value === id3 ? "_:a" : "_:z"
15779
15900
  };
15780
15901
  }
15902
+ // helper for getting a related predicate
15781
15903
  getRelatedPredicate(quad5) {
15782
15904
  return `<${quad5.predicate.value}>`;
15783
15905
  }
15906
+ // helper for creating hash to related blank nodes map
15784
15907
  createHashToRelated(id3, issuer) {
15785
15908
  const hashToRelated = /* @__PURE__ */ new Map();
15786
15909
  const quads = this.blankNodeInfo.get(id3).quads;
@@ -15846,6 +15969,7 @@ var require_URDNA2015Sync = __commonJS({
15846
15969
  hashToRelated.set(hash, [related]);
15847
15970
  }
15848
15971
  }
15972
+ // canonical ids for 7.1
15849
15973
  _componentWithCanonicalId({ component }) {
15850
15974
  if (component.termType === "BlankNode" && !component.value.startsWith(this.canonicalIssuer.prefix)) {
15851
15975
  return {
@@ -15874,6 +15998,7 @@ var require_URGNA2012Sync = __commonJS({
15874
15998
  this.name = "URGNA2012";
15875
15999
  this.createMessageDigest = () => new MessageDigest("sha1");
15876
16000
  }
16001
+ // helper for modifying component during Hash First Degree Quads
15877
16002
  modifyFirstDegreeComponent(id3, component, key) {
15878
16003
  if (component.termType !== "BlankNode") {
15879
16004
  return component;
@@ -15889,9 +16014,11 @@ var require_URGNA2012Sync = __commonJS({
15889
16014
  value: component.value === id3 ? "_:a" : "_:z"
15890
16015
  };
15891
16016
  }
16017
+ // helper for getting a related predicate
15892
16018
  getRelatedPredicate(quad5) {
15893
16019
  return quad5.predicate.value;
15894
16020
  }
16021
+ // helper for creating hash to related blank nodes map
15895
16022
  createHashToRelated(id3, issuer) {
15896
16023
  const hashToRelated = /* @__PURE__ */ new Map();
15897
16024
  const quads = this.blankNodeInfo.get(id3).quads;
@@ -16057,8 +16184,14 @@ var require_graphTypes = __commonJS({
16057
16184
  return false;
16058
16185
  };
16059
16186
  api.isSubjectReference = (v) => types2.isObject(v) && Object.keys(v).length === 1 && "@id" in v;
16060
- api.isValue = (v) => types2.isObject(v) && "@value" in v;
16061
- api.isList = (v) => types2.isObject(v) && "@list" in v;
16187
+ api.isValue = (v) => // Note: A value is a @value if all of these hold true:
16188
+ // 1. It is an Object.
16189
+ // 2. It has the @value property.
16190
+ types2.isObject(v) && "@value" in v;
16191
+ api.isList = (v) => // Note: A value is a @list if all of these hold true:
16192
+ // 1. It is an Object.
16193
+ // 2. It has the @list property.
16194
+ types2.isObject(v) && "@list" in v;
16062
16195
  api.isGraph = (v) => {
16063
16196
  return types2.isObject(v) && "@graph" in v && Object.keys(v).filter((key) => key !== "@id" && key !== "@index").length === 1;
16064
16197
  };
@@ -16082,6 +16215,13 @@ var require_JsonLdError = __commonJS({
16082
16215
  "../node_modules/jsonld/lib/JsonLdError.js"(exports, module2) {
16083
16216
  "use strict";
16084
16217
  module2.exports = class JsonLdError extends Error {
16218
+ /**
16219
+ * Creates a JSON-LD Error.
16220
+ *
16221
+ * @param msg the error message.
16222
+ * @param type the error type.
16223
+ * @param details the error details.
16224
+ */
16085
16225
  constructor(message2 = "An unspecified JSON-LD error occurred.", name = "jsonld.Error", details = {}) {
16086
16226
  super(message2);
16087
16227
  this.name = name;
@@ -16351,6 +16491,7 @@ var require_constants = __commonJS({
16351
16491
  var RDF2 = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
16352
16492
  var XSD2 = "http://www.w3.org/2001/XMLSchema#";
16353
16493
  module2.exports = {
16494
+ // TODO: Deprecated and will be removed later. Use LINK_HEADER_CONTEXT.
16354
16495
  LINK_HEADER_REL: "http://www.w3.org/ns/json-ld#context",
16355
16496
  LINK_HEADER_CONTEXT: "http://www.w3.org/ns/json-ld#context",
16356
16497
  RDF: RDF2,
@@ -16378,6 +16519,9 @@ var require_RequestQueue = __commonJS({
16378
16519
  "../node_modules/jsonld/lib/RequestQueue.js"(exports, module2) {
16379
16520
  "use strict";
16380
16521
  module2.exports = class RequestQueue {
16522
+ /**
16523
+ * Creates a simple queue for requesting documents.
16524
+ */
16381
16525
  constructor() {
16382
16526
  this._requests = {};
16383
16527
  }
@@ -16413,6 +16557,7 @@ var require_url = __commonJS({
16413
16557
  module2.exports = api;
16414
16558
  api.parsers = {
16415
16559
  simple: {
16560
+ // RFC 3986 basic parts
16416
16561
  keys: [
16417
16562
  "href",
16418
16563
  "scheme",
@@ -16421,6 +16566,7 @@ var require_url = __commonJS({
16421
16566
  "query",
16422
16567
  "fragment"
16423
16568
  ],
16569
+ /* eslint-disable-next-line max-len */
16424
16570
  regex: /^(?:([^:\/?#]+):)?(?:\/\/([^\/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?/
16425
16571
  },
16426
16572
  full: {
@@ -16440,6 +16586,7 @@ var require_url = __commonJS({
16440
16586
  "query",
16441
16587
  "fragment"
16442
16588
  ],
16589
+ /* eslint-disable-next-line max-len */
16443
16590
  regex: /^(([^:\/?#]+):)?(?:\/\/((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?))?(?:(((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/
16444
16591
  }
16445
16592
  };
@@ -16728,9 +16875,9 @@ var require_platform_browser = __commonJS({
16728
16875
  }
16729
16876
  });
16730
16877
 
16731
- // ../node_modules/yallist/iterator.js
16878
+ // ../node_modules/jsonld/node_modules/yallist/iterator.js
16732
16879
  var require_iterator = __commonJS({
16733
- "../node_modules/yallist/iterator.js"(exports, module2) {
16880
+ "../node_modules/jsonld/node_modules/yallist/iterator.js"(exports, module2) {
16734
16881
  "use strict";
16735
16882
  module2.exports = function(Yallist) {
16736
16883
  Yallist.prototype[Symbol.iterator] = function* () {
@@ -16742,9 +16889,9 @@ var require_iterator = __commonJS({
16742
16889
  }
16743
16890
  });
16744
16891
 
16745
- // ../node_modules/yallist/yallist.js
16892
+ // ../node_modules/jsonld/node_modules/yallist/yallist.js
16746
16893
  var require_yallist = __commonJS({
16747
- "../node_modules/yallist/yallist.js"(exports, module2) {
16894
+ "../node_modules/jsonld/node_modules/yallist/yallist.js"(exports, module2) {
16748
16895
  "use strict";
16749
16896
  module2.exports = Yallist;
16750
16897
  Yallist.Node = Node3;
@@ -17111,9 +17258,9 @@ var require_yallist = __commonJS({
17111
17258
  }
17112
17259
  });
17113
17260
 
17114
- // ../node_modules/lru-cache/index.js
17261
+ // ../node_modules/jsonld/node_modules/lru-cache/index.js
17115
17262
  var require_lru_cache = __commonJS({
17116
- "../node_modules/lru-cache/index.js"(exports, module2) {
17263
+ "../node_modules/jsonld/node_modules/lru-cache/index.js"(exports, module2) {
17117
17264
  "use strict";
17118
17265
  var Yallist = require_yallist();
17119
17266
  var MAX = Symbol("max");
@@ -17147,6 +17294,7 @@ var require_lru_cache = __commonJS({
17147
17294
  this[UPDATE_AGE_ON_GET] = options.updateAgeOnGet || false;
17148
17295
  this.reset();
17149
17296
  }
17297
+ // resize the cache when the max changes.
17150
17298
  set max(mL) {
17151
17299
  if (typeof mL !== "number" || mL < 0)
17152
17300
  throw new TypeError("max must be a non-negative number");
@@ -17171,6 +17319,7 @@ var require_lru_cache = __commonJS({
17171
17319
  get maxAge() {
17172
17320
  return this[MAX_AGE];
17173
17321
  }
17322
+ // resize the cache when the lengthCalculator changes.
17174
17323
  set lengthCalculator(lC) {
17175
17324
  if (typeof lC !== "function")
17176
17325
  lC = naiveLength;
@@ -17386,6 +17535,11 @@ var require_ResolvedContext = __commonJS({
17386
17535
  var LRU = require_lru_cache();
17387
17536
  var MAX_ACTIVE_CONTEXTS = 10;
17388
17537
  module2.exports = class ResolvedContext {
17538
+ /**
17539
+ * Creates a ResolvedContext.
17540
+ *
17541
+ * @param document the context document.
17542
+ */
17389
17543
  constructor({ document: document3 }) {
17390
17544
  this.document = document3;
17391
17545
  this.cache = new LRU({ max: MAX_ACTIVE_CONTEXTS });
@@ -17417,6 +17571,11 @@ var require_ContextResolver = __commonJS({
17417
17571
  var ResolvedContext = require_ResolvedContext();
17418
17572
  var MAX_CONTEXT_URLS = 10;
17419
17573
  module2.exports = class ContextResolver {
17574
+ /**
17575
+ * Creates a ContextResolver.
17576
+ *
17577
+ * @param sharedCache a shared LRU cache with `get` and `set` APIs.
17578
+ */
17420
17579
  constructor({ sharedCache }) {
17421
17580
  this.perOpCache = /* @__PURE__ */ new Map();
17422
17581
  this.sharedCache = sharedCache;
@@ -19387,6 +19546,7 @@ var require_expand = __commonJS({
19387
19546
  });
19388
19547
  } else if (container.includes("@type") && _isObject(value)) {
19389
19548
  expandedValue = await _expandIndexMap({
19549
+ // since container is `@type`, revert type scoped context when expanding
19390
19550
  activeCtx: termCtx.revertToPreviousContext(),
19391
19551
  options,
19392
19552
  activeProperty: key,
@@ -19930,12 +20090,18 @@ var require_fromRdf = __commonJS({
19930
20090
  var types2 = require_types();
19931
20091
  var util = require_util();
19932
20092
  var {
20093
+ // RDF,
19933
20094
  RDF_LIST,
19934
20095
  RDF_FIRST,
19935
20096
  RDF_REST,
19936
20097
  RDF_NIL,
19937
20098
  RDF_TYPE,
20099
+ // RDF_PLAIN_LITERAL,
20100
+ // RDF_XML_LITERAL,
19938
20101
  RDF_JSON_LITERAL,
20102
+ // RDF_OBJECT,
20103
+ // RDF_LANGSTRING,
20104
+ // XSD,
19939
20105
  XSD_BOOLEAN,
19940
20106
  XSD_DOUBLE,
19941
20107
  XSD_INTEGER,
@@ -20156,12 +20322,18 @@ var require_toRdf = __commonJS({
20156
20322
  var types2 = require_types();
20157
20323
  var util = require_util();
20158
20324
  var {
20325
+ // RDF,
20326
+ // RDF_LIST,
20159
20327
  RDF_FIRST,
20160
20328
  RDF_REST,
20161
20329
  RDF_NIL,
20162
20330
  RDF_TYPE,
20331
+ // RDF_PLAIN_LITERAL,
20332
+ // RDF_XML_LITERAL,
20163
20333
  RDF_JSON_LITERAL,
20334
+ // RDF_OBJECT,
20164
20335
  RDF_LANGSTRING,
20336
+ // XSD,
20165
20337
  XSD_BOOLEAN,
20166
20338
  XSD_DOUBLE,
20167
20339
  XSD_INTEGER,
@@ -22588,10 +22760,9 @@ var require_regeneratorRuntime = __commonJS({
22588
22760
  return iterable;
22589
22761
  if (!isNaN(iterable.length)) {
22590
22762
  var i = -1, next = function next2() {
22591
- for (; ++i < iterable.length; ) {
22763
+ for (; ++i < iterable.length; )
22592
22764
  if (hasOwn.call(iterable, i))
22593
22765
  return next2.value = iterable[i], next2.done = false, next2;
22594
- }
22595
22766
  return next2.value = void 0, next2.done = true, next2;
22596
22767
  };
22597
22768
  return next.next = next;
@@ -22636,9 +22807,8 @@ var require_regeneratorRuntime = __commonJS({
22636
22807
  return "[object Generator]";
22637
22808
  }), exports2.keys = function(val) {
22638
22809
  var object = Object(val), keys = [];
22639
- for (var key in object) {
22810
+ for (var key in object)
22640
22811
  keys.push(key);
22641
- }
22642
22812
  return keys.reverse(), function next() {
22643
22813
  for (; keys.length; ) {
22644
22814
  var key2 = keys.pop();
@@ -22651,9 +22821,8 @@ var require_regeneratorRuntime = __commonJS({
22651
22821
  constructor: Context,
22652
22822
  reset: function reset(skipTempReset) {
22653
22823
  if (this.prev = 0, this.next = 0, this.sent = this._sent = void 0, this.done = false, this.delegate = null, this.method = "next", this.arg = void 0, this.tryEntries.forEach(resetTryEntry), !skipTempReset)
22654
- for (var name in this) {
22824
+ for (var name in this)
22655
22825
  "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = void 0);
22656
- }
22657
22826
  },
22658
22827
  stop: function stop() {
22659
22828
  this.done = true;
@@ -22798,22 +22967,97 @@ var require_conventions = __commonJS({
22798
22967
  return target;
22799
22968
  }
22800
22969
  var MIME_TYPE = freeze({
22970
+ /**
22971
+ * `text/html`, the only mime type that triggers treating an XML document as HTML.
22972
+ *
22973
+ * @see DOMParser.SupportedType.isHTML
22974
+ * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration
22975
+ * @see https://en.wikipedia.org/wiki/HTML Wikipedia
22976
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN
22977
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring WHATWG HTML Spec
22978
+ */
22801
22979
  HTML: "text/html",
22980
+ /**
22981
+ * Helper method to check a mime type if it indicates an HTML document
22982
+ *
22983
+ * @param {string} [value]
22984
+ * @returns {boolean}
22985
+ *
22986
+ * @see https://www.iana.org/assignments/media-types/text/html IANA MimeType registration
22987
+ * @see https://en.wikipedia.org/wiki/HTML Wikipedia
22988
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMParser/parseFromString MDN
22989
+ * @see https://html.spec.whatwg.org/multipage/dynamic-markup-insertion.html#dom-domparser-parsefromstring */
22802
22990
  isHTML: function(value) {
22803
22991
  return value === MIME_TYPE.HTML;
22804
22992
  },
22993
+ /**
22994
+ * `application/xml`, the standard mime type for XML documents.
22995
+ *
22996
+ * @see https://www.iana.org/assignments/media-types/application/xml IANA MimeType registration
22997
+ * @see https://tools.ietf.org/html/rfc7303#section-9.1 RFC 7303
22998
+ * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia
22999
+ */
22805
23000
  XML_APPLICATION: "application/xml",
23001
+ /**
23002
+ * `text/html`, an alias for `application/xml`.
23003
+ *
23004
+ * @see https://tools.ietf.org/html/rfc7303#section-9.2 RFC 7303
23005
+ * @see https://www.iana.org/assignments/media-types/text/xml IANA MimeType registration
23006
+ * @see https://en.wikipedia.org/wiki/XML_and_MIME Wikipedia
23007
+ */
22806
23008
  XML_TEXT: "text/xml",
23009
+ /**
23010
+ * `application/xhtml+xml`, indicates an XML document that has the default HTML namespace,
23011
+ * but is parsed as an XML document.
23012
+ *
23013
+ * @see https://www.iana.org/assignments/media-types/application/xhtml+xml IANA MimeType registration
23014
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument WHATWG DOM Spec
23015
+ * @see https://en.wikipedia.org/wiki/XHTML Wikipedia
23016
+ */
22807
23017
  XML_XHTML_APPLICATION: "application/xhtml+xml",
23018
+ /**
23019
+ * `image/svg+xml`,
23020
+ *
23021
+ * @see https://www.iana.org/assignments/media-types/image/svg+xml IANA MimeType registration
23022
+ * @see https://www.w3.org/TR/SVG11/ W3C SVG 1.1
23023
+ * @see https://en.wikipedia.org/wiki/Scalable_Vector_Graphics Wikipedia
23024
+ */
22808
23025
  XML_SVG_IMAGE: "image/svg+xml"
22809
23026
  });
22810
23027
  var NAMESPACE = freeze({
23028
+ /**
23029
+ * The XHTML namespace.
23030
+ *
23031
+ * @see http://www.w3.org/1999/xhtml
23032
+ */
22811
23033
  HTML: "http://www.w3.org/1999/xhtml",
23034
+ /**
23035
+ * Checks if `uri` equals `NAMESPACE.HTML`.
23036
+ *
23037
+ * @param {string} [uri]
23038
+ *
23039
+ * @see NAMESPACE.HTML
23040
+ */
22812
23041
  isHTML: function(uri) {
22813
23042
  return uri === NAMESPACE.HTML;
22814
23043
  },
23044
+ /**
23045
+ * The SVG namespace.
23046
+ *
23047
+ * @see http://www.w3.org/2000/svg
23048
+ */
22815
23049
  SVG: "http://www.w3.org/2000/svg",
23050
+ /**
23051
+ * The `xml:` namespace.
23052
+ *
23053
+ * @see http://www.w3.org/XML/1998/namespace
23054
+ */
22816
23055
  XML: "http://www.w3.org/XML/1998/namespace",
23056
+ /**
23057
+ * The `xmlns:` namespace
23058
+ *
23059
+ * @see https://www.w3.org/2000/xmlns/
23060
+ */
22817
23061
  XMLNS: "http://www.w3.org/2000/xmlns/"
22818
23062
  });
22819
23063
  exports.assign = assign;
@@ -22929,7 +23173,19 @@ var require_dom = __commonJS({
22929
23173
  function NodeList() {
22930
23174
  }
22931
23175
  NodeList.prototype = {
23176
+ /**
23177
+ * The number of nodes in the list. The range of valid child node indices is 0 to length-1 inclusive.
23178
+ * @standard level1
23179
+ */
22932
23180
  length: 0,
23181
+ /**
23182
+ * Returns the indexth item in the collection. If index is greater than or equal to the number of nodes in the list, this returns null.
23183
+ * @standard level1
23184
+ * @param index unsigned long
23185
+ * Index into the collection.
23186
+ * @return Node
23187
+ * The node at the indexth position in the NodeList, or null if that is not a valid index.
23188
+ */
22933
23189
  item: function(index2) {
22934
23190
  return this[index2] || null;
22935
23191
  },
@@ -22939,9 +23195,19 @@ var require_dom = __commonJS({
22939
23195
  }
22940
23196
  return buf.join("");
22941
23197
  },
23198
+ /**
23199
+ * @private
23200
+ * @param {function (Node):boolean} predicate
23201
+ * @returns {Node[]}
23202
+ */
22942
23203
  filter: function(predicate) {
22943
23204
  return Array.prototype.filter.call(this, predicate);
22944
23205
  },
23206
+ /**
23207
+ * @private
23208
+ * @param {Node} item
23209
+ * @returns {number}
23210
+ */
22945
23211
  indexOf: function(item) {
22946
23212
  return Array.prototype.indexOf.call(this, item);
22947
23213
  }
@@ -23030,6 +23296,7 @@ var require_dom = __commonJS({
23030
23296
  _addNamedNode(this._ownerElement, this, attr, oldAttr);
23031
23297
  return oldAttr;
23032
23298
  },
23299
+ /* returns Node */
23033
23300
  setNamedItemNS: function(attr) {
23034
23301
  var el = attr.ownerElement, oldAttr;
23035
23302
  if (el && el != this._ownerElement) {
@@ -23039,11 +23306,14 @@ var require_dom = __commonJS({
23039
23306
  _addNamedNode(this._ownerElement, this, attr, oldAttr);
23040
23307
  return oldAttr;
23041
23308
  },
23309
+ /* returns Node */
23042
23310
  removeNamedItem: function(key) {
23043
23311
  var attr = this.getNamedItem(key);
23044
23312
  _removeNamedNode(this._ownerElement, this, attr);
23045
23313
  return attr;
23046
23314
  },
23315
+ // raises: NOT_FOUND_ERR,NO_MODIFICATION_ALLOWED_ERR
23316
+ //for level2
23047
23317
  removeNamedItemNS: function(namespaceURI, localName) {
23048
23318
  var attr = this.getNamedItemNS(namespaceURI, localName);
23049
23319
  _removeNamedNode(this._ownerElement, this, attr);
@@ -23063,9 +23333,46 @@ var require_dom = __commonJS({
23063
23333
  function DOMImplementation() {
23064
23334
  }
23065
23335
  DOMImplementation.prototype = {
23336
+ /**
23337
+ * The DOMImplementation.hasFeature() method returns a Boolean flag indicating if a given feature is supported.
23338
+ * The different implementations fairly diverged in what kind of features were reported.
23339
+ * The latest version of the spec settled to force this method to always return true, where the functionality was accurate and in use.
23340
+ *
23341
+ * @deprecated It is deprecated and modern browsers return true in all cases.
23342
+ *
23343
+ * @param {string} feature
23344
+ * @param {string} [version]
23345
+ * @returns {boolean} always true
23346
+ *
23347
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/hasFeature MDN
23348
+ * @see https://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#ID-5CED94D7 DOM Level 1 Core
23349
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-hasfeature DOM Living Standard
23350
+ */
23066
23351
  hasFeature: function(feature, version) {
23067
23352
  return true;
23068
23353
  },
23354
+ /**
23355
+ * Creates an XML Document object of the specified type with its document element.
23356
+ *
23357
+ * __It behaves slightly different from the description in the living standard__:
23358
+ * - There is no interface/class `XMLDocument`, it returns a `Document` instance.
23359
+ * - `contentType`, `encoding`, `mode`, `origin`, `url` fields are currently not declared.
23360
+ * - this implementation is not validating names or qualified names
23361
+ * (when parsing XML strings, the SAX parser takes care of that)
23362
+ *
23363
+ * @param {string|null} namespaceURI
23364
+ * @param {string} qualifiedName
23365
+ * @param {DocumentType=null} doctype
23366
+ * @returns {Document}
23367
+ *
23368
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocument MDN
23369
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocument DOM Level 2 Core (initial)
23370
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocument DOM Level 2 Core
23371
+ *
23372
+ * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract
23373
+ * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names
23374
+ * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names
23375
+ */
23069
23376
  createDocument: function(namespaceURI, qualifiedName, doctype) {
23070
23377
  var doc = new Document();
23071
23378
  doc.implementation = this;
@@ -23080,6 +23387,27 @@ var require_dom = __commonJS({
23080
23387
  }
23081
23388
  return doc;
23082
23389
  },
23390
+ /**
23391
+ * Returns a doctype, with the given `qualifiedName`, `publicId`, and `systemId`.
23392
+ *
23393
+ * __This behavior is slightly different from the in the specs__:
23394
+ * - this implementation is not validating names or qualified names
23395
+ * (when parsing XML strings, the SAX parser takes care of that)
23396
+ *
23397
+ * @param {string} qualifiedName
23398
+ * @param {string} [publicId]
23399
+ * @param {string} [systemId]
23400
+ * @returns {DocumentType} which can either be used with `DOMImplementation.createDocument` upon document creation
23401
+ * or can be put into the document via methods like `Node.insertBefore()` or `Node.replaceChild()`
23402
+ *
23403
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation/createDocumentType MDN
23404
+ * @see https://www.w3.org/TR/DOM-Level-2-Core/core.html#Level-2-Core-DOM-createDocType DOM Level 2 Core
23405
+ * @see https://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype DOM Living Standard
23406
+ *
23407
+ * @see https://dom.spec.whatwg.org/#validate-and-extract DOM: Validate and extract
23408
+ * @see https://www.w3.org/TR/xml/#NT-NameStartChar XML Spec: Names
23409
+ * @see https://www.w3.org/TR/xml-names/#ns-qualnames XML Namespaces: Qualified names
23410
+ */
23083
23411
  createDocumentType: function(qualifiedName, publicId, systemId) {
23084
23412
  var node = new DocumentType();
23085
23413
  node.name = qualifiedName;
@@ -23104,6 +23432,7 @@ var require_dom = __commonJS({
23104
23432
  namespaceURI: null,
23105
23433
  prefix: null,
23106
23434
  localName: null,
23435
+ // Modified in DOM Level 2:
23107
23436
  insertBefore: function(newChild, refChild) {
23108
23437
  return _insertBefore(this, newChild, refChild);
23109
23438
  },
@@ -23125,6 +23454,7 @@ var require_dom = __commonJS({
23125
23454
  cloneNode: function(deep) {
23126
23455
  return cloneNode(this.ownerDocument || this, this, deep);
23127
23456
  },
23457
+ // Modified in DOM Level 2:
23128
23458
  normalize: function() {
23129
23459
  var child = this.firstChild;
23130
23460
  while (child) {
@@ -23138,12 +23468,28 @@ var require_dom = __commonJS({
23138
23468
  }
23139
23469
  }
23140
23470
  },
23471
+ // Introduced in DOM Level 2:
23141
23472
  isSupported: function(feature, version) {
23142
23473
  return this.ownerDocument.implementation.hasFeature(feature, version);
23143
23474
  },
23475
+ // Introduced in DOM Level 2:
23144
23476
  hasAttributes: function() {
23145
23477
  return this.attributes.length > 0;
23146
23478
  },
23479
+ /**
23480
+ * Look up the prefix associated to the given namespace URI, starting from this node.
23481
+ * **The default namespace declarations are ignored by this method.**
23482
+ * See Namespace Prefix Lookup for details on the algorithm used by this method.
23483
+ *
23484
+ * _Note: The implementation seems to be incomplete when compared to the algorithm described in the specs._
23485
+ *
23486
+ * @param {string | null} namespaceURI
23487
+ * @returns {string | null}
23488
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/core.html#Node3-lookupNamespacePrefix
23489
+ * @see https://www.w3.org/TR/DOM-Level-3-Core/namespaces-algorithms.html#lookupNamespacePrefixAlgo
23490
+ * @see https://dom.spec.whatwg.org/#dom-node-lookupprefix
23491
+ * @see https://github.com/xmldom/xmldom/issues/322
23492
+ */
23147
23493
  lookupPrefix: function(namespaceURI) {
23148
23494
  var el = this;
23149
23495
  while (el) {
@@ -23159,6 +23505,7 @@ var require_dom = __commonJS({
23159
23505
  }
23160
23506
  return null;
23161
23507
  },
23508
+ // Introduced in DOM Level 3:
23162
23509
  lookupNamespaceURI: function(prefix) {
23163
23510
  var el = this;
23164
23511
  while (el) {
@@ -23172,6 +23519,7 @@ var require_dom = __commonJS({
23172
23519
  }
23173
23520
  return null;
23174
23521
  },
23522
+ // Introduced in DOM Level 3:
23175
23523
  isDefaultNamespace: function(namespaceURI) {
23176
23524
  var prefix = this.lookupPrefix(namespaceURI);
23177
23525
  return prefix == null;
@@ -23289,7 +23637,8 @@ var require_dom = __commonJS({
23289
23637
  if (child && child.parentNode !== parent2) {
23290
23638
  throw new DOMException(NOT_FOUND_ERR, "child not in parent");
23291
23639
  }
23292
- if (!hasInsertableNodeType(node) || isDocTypeNode(node) && parent2.nodeType !== Node3.DOCUMENT_NODE) {
23640
+ if (// 4. If `node` is not a DocumentFragment, DocumentType, Element, or CharacterData node, then throw a "HierarchyRequestError" DOMException.
23641
+ !hasInsertableNodeType(node) || isDocTypeNode(node) && parent2.nodeType !== Node3.DOCUMENT_NODE) {
23293
23642
  throw new DOMException(
23294
23643
  HIERARCHY_REQUEST_ERR,
23295
23644
  "Unexpected node type " + node.nodeType + " for parent node type " + parent2.nodeType
@@ -23414,8 +23763,15 @@ var require_dom = __commonJS({
23414
23763
  return newChild;
23415
23764
  }
23416
23765
  Document.prototype = {
23766
+ //implementation : null,
23417
23767
  nodeName: "#document",
23418
23768
  nodeType: DOCUMENT_NODE,
23769
+ /**
23770
+ * The DocumentType node of the document.
23771
+ *
23772
+ * @readonly
23773
+ * @type DocumentType
23774
+ */
23419
23775
  doctype: null,
23420
23776
  documentElement: null,
23421
23777
  _inc: 1,
@@ -23452,9 +23808,11 @@ var require_dom = __commonJS({
23452
23808
  this.documentElement = newChild;
23453
23809
  }
23454
23810
  },
23811
+ // Introduced in DOM Level 2:
23455
23812
  importNode: function(importedNode, deep) {
23456
23813
  return importNode(this, importedNode, deep);
23457
23814
  },
23815
+ // Introduced in DOM Level 2:
23458
23816
  getElementById: function(id3) {
23459
23817
  var rtv = null;
23460
23818
  _visitNode(this.documentElement, function(node) {
@@ -23467,6 +23825,23 @@ var require_dom = __commonJS({
23467
23825
  });
23468
23826
  return rtv;
23469
23827
  },
23828
+ /**
23829
+ * The `getElementsByClassName` method of `Document` interface returns an array-like object
23830
+ * of all child elements which have **all** of the given class name(s).
23831
+ *
23832
+ * Returns an empty list if `classeNames` is an empty string or only contains HTML white space characters.
23833
+ *
23834
+ *
23835
+ * Warning: This is a live LiveNodeList.
23836
+ * Changes in the DOM will reflect in the array as the changes occur.
23837
+ * If an element selected by this array no longer qualifies for the selector,
23838
+ * it will automatically be removed. Be aware of this for iteration purposes.
23839
+ *
23840
+ * @param {string} classNames is a string representing the class name(s) to match; multiple class names are separated by (ASCII-)whitespace
23841
+ *
23842
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/Document/getElementsByClassName
23843
+ * @see https://dom.spec.whatwg.org/#concept-getelementsbyclassname
23844
+ */
23470
23845
  getElementsByClassName: function(classNames) {
23471
23846
  var classNamesSet = toOrderedSet(classNames);
23472
23847
  return new LiveNodeList(this, function(base) {
@@ -23491,6 +23866,7 @@ var require_dom = __commonJS({
23491
23866
  return ls;
23492
23867
  });
23493
23868
  },
23869
+ //document factory method:
23494
23870
  createElement: function(tagName) {
23495
23871
  var node = new Element();
23496
23872
  node.ownerDocument = this;
@@ -23548,6 +23924,7 @@ var require_dom = __commonJS({
23548
23924
  node.nodeName = name;
23549
23925
  return node;
23550
23926
  },
23927
+ // Introduced in DOM Level 2:
23551
23928
  createElementNS: function(namespaceURI, qualifiedName) {
23552
23929
  var node = new Element();
23553
23930
  var pl = qualifiedName.split(":");
@@ -23566,6 +23943,7 @@ var require_dom = __commonJS({
23566
23943
  attrs._ownerElement = node;
23567
23944
  return node;
23568
23945
  },
23946
+ // Introduced in DOM Level 2:
23569
23947
  createAttributeNS: function(namespaceURI, qualifiedName) {
23570
23948
  var node = new Attr();
23571
23949
  var pl = qualifiedName.split(":");
@@ -23608,6 +23986,7 @@ var require_dom = __commonJS({
23608
23986
  var attr = this.getAttributeNode(name);
23609
23987
  attr && this.removeAttributeNode(attr);
23610
23988
  },
23989
+ //four real opeartion method
23611
23990
  appendChild: function(newChild) {
23612
23991
  if (newChild.nodeType === DOCUMENT_FRAGMENT_NODE) {
23613
23992
  return this.insertBefore(newChild, null);
@@ -23624,6 +24003,7 @@ var require_dom = __commonJS({
23624
24003
  removeAttributeNode: function(oldAttr) {
23625
24004
  return this.attributes.removeNamedItem(oldAttr.nodeName);
23626
24005
  },
24006
+ //get real attribute name,and remove it by removeAttributeNode
23627
24007
  removeAttributeNS: function(namespaceURI, localName) {
23628
24008
  var old = this.getAttributeNodeNS(namespaceURI, localName);
23629
24009
  old && this.removeAttributeNode(old);
@@ -23777,6 +24157,7 @@ var require_dom = __commonJS({
23777
24157
  if (prefix == null) {
23778
24158
  var visibleNamespaces = [
23779
24159
  { namespace: uri, prefix: null }
24160
+ //{namespace:uri,prefix:''}
23780
24161
  ];
23781
24162
  }
23782
24163
  }
@@ -24536,6 +24917,10 @@ var require_sax = __commonJS({
24536
24917
  }
24537
24918
  el.addValue(
24538
24919
  qname,
24920
+ // @see https://www.w3.org/TR/xml/#AVNormalize
24921
+ // since the xmldom sax parser does not "interpret" DTD the following is not implemented:
24922
+ // - recursive replacement of (DTD) entity references
24923
+ // - trimming and collapsing multiple spaces into a single one for attributes that are not of type CDATA
24539
24924
  value2.replace(/[\t\n\r]/g, " ").replace(/&#?\w+;/g, entityReplacer),
24540
24925
  startIndex
24541
24926
  );
@@ -24883,6 +25268,16 @@ var require_sax = __commonJS({
24883
25268
  getValue: function(i) {
24884
25269
  return this[i].value;
24885
25270
  }
25271
+ // ,getIndex:function(uri, localName)){
25272
+ // if(localName){
25273
+ //
25274
+ // }else{
25275
+ // var qName = uri
25276
+ // }
25277
+ // },
25278
+ // getValue:function(){return this.getValue(this.getIndex.apply(this,arguments))},
25279
+ // getType:function(uri,localName){}
25280
+ // getType:function(i){},
24886
25281
  };
24887
25282
  function split(source, start) {
24888
25283
  var match;
@@ -25048,6 +25443,7 @@ var require_dom_parser = __commonJS({
25048
25443
  locator.lineNumber = 0;
25049
25444
  }
25050
25445
  },
25446
+ //LexicalHandler
25051
25447
  comment: function(chars, start, length) {
25052
25448
  chars = _toString.apply(this, arguments);
25053
25449
  var comm = this.doc.createComment(chars);
@@ -25069,6 +25465,10 @@ var require_dom_parser = __commonJS({
25069
25465
  this.doc.doctype = dt;
25070
25466
  }
25071
25467
  },
25468
+ /**
25469
+ * @see org.xml.sax.ErrorHandler
25470
+ * @link http://www.saxproject.org/apidoc/org/xml/sax/ErrorHandler.html
25471
+ */
25072
25472
  warning: function(error2) {
25073
25473
  console.warn("[xmldom warning] " + error2, _locator(this.locator));
25074
25474
  },
@@ -25141,6 +25541,7 @@ var require_solid_namespace = __commonJS({
25141
25541
  http: "http://www.w3.org/2007/ont/http#",
25142
25542
  httph: "http://www.w3.org/2007/ont/httph#",
25143
25543
  icalTZ: "http://www.w3.org/2002/12/cal/icaltzd#",
25544
+ // Beware: not cal:
25144
25545
  ldp: "http://www.w3.org/ns/ldp#",
25145
25546
  link: "http://www.w3.org/2007/ont/link#",
25146
25547
  log: "http://www.w3.org/2000/10/swap/log#",
@@ -25158,6 +25559,7 @@ var require_solid_namespace = __commonJS({
25158
25559
  rss: "http://purl.org/rss/1.0/",
25159
25560
  sched: "http://www.w3.org/ns/pim/schedule#",
25160
25561
  schema: "http://schema.org/",
25562
+ // @@ beware confusion with documents no 303
25161
25563
  sioc: "http://rdfs.org/sioc/ns#",
25162
25564
  solid: "http://www.w3.org/ns/solid/terms#",
25163
25565
  space: "http://www.w3.org/ns/pim/space#",
@@ -25198,6 +25600,8 @@ var BrowserSession = class {
25198
25600
  handleIncomingRedirect() {
25199
25601
  return __async(this, null, function* () {
25200
25602
  return this.session.handleIncomingRedirect({
25603
+ // session restore disabled, due to
25604
+ // https://github.com/inrupt/solid-client-authn-js/issues/1647
25201
25605
  restorePreviousSession: false
25202
25606
  });
25203
25607
  });
@@ -25436,6 +25840,11 @@ var Node2 = /* @__PURE__ */ function() {
25436
25840
  console.log("@@@ node substitute" + this);
25437
25841
  return this;
25438
25842
  }
25843
+ /**
25844
+ * Compares this node with another
25845
+ * @see {equals} to check if two nodes are equal
25846
+ * @param other - The other node
25847
+ */
25439
25848
  }, {
25440
25849
  key: "compareTerm",
25441
25850
  value: function compareTerm(other) {
@@ -25453,6 +25862,10 @@ var Node2 = /* @__PURE__ */ function() {
25453
25862
  }
25454
25863
  return 0;
25455
25864
  }
25865
+ /**
25866
+ * Compares whether the two nodes are equal
25867
+ * @param other The other node
25868
+ */
25456
25869
  }, {
25457
25870
  key: "equals",
25458
25871
  value: function equals2(other) {
@@ -25461,31 +25874,51 @@ var Node2 = /* @__PURE__ */ function() {
25461
25874
  }
25462
25875
  return this.termType === other.termType && this.value === other.value;
25463
25876
  }
25877
+ /**
25878
+ * Creates a hash for this node
25879
+ * @deprecated use {rdfFactory.id} instead if possible
25880
+ */
25464
25881
  }, {
25465
25882
  key: "hashString",
25466
25883
  value: function hashString() {
25467
25884
  return this.toCanonical();
25468
25885
  }
25886
+ /**
25887
+ * Compares whether this node is the same as the other one
25888
+ * @param other - Another node
25889
+ */
25469
25890
  }, {
25470
25891
  key: "sameTerm",
25471
25892
  value: function sameTerm(other) {
25472
25893
  return this.equals(other);
25473
25894
  }
25895
+ /**
25896
+ * Creates a canonical string representation of this node
25897
+ */
25474
25898
  }, {
25475
25899
  key: "toCanonical",
25476
25900
  value: function toCanonical() {
25477
25901
  return this.toNT();
25478
25902
  }
25903
+ /**
25904
+ * Creates a n-triples string representation of this node
25905
+ */
25479
25906
  }, {
25480
25907
  key: "toNT",
25481
25908
  value: function toNT() {
25482
25909
  return this.toString();
25483
25910
  }
25911
+ /**
25912
+ * Creates a n-quads string representation of this node
25913
+ */
25484
25914
  }, {
25485
25915
  key: "toNQ",
25486
25916
  value: function toNQ2() {
25487
25917
  return this.toNT();
25488
25918
  }
25919
+ /**
25920
+ * Creates a string representation of this node
25921
+ */
25489
25922
  }, {
25490
25923
  key: "toString",
25491
25924
  value: function toString() {
@@ -25587,6 +26020,10 @@ var BlankNode = /* @__PURE__ */ function(_Node) {
25587
26020
  }
25588
26021
  return 0;
25589
26022
  }
26023
+ /**
26024
+ * Gets a copy of this blank node in the specified formula
26025
+ * @param formula The formula
26026
+ */
25590
26027
  }, {
25591
26028
  key: "copy",
25592
26029
  value: function copy(formula2) {
@@ -25606,20 +26043,25 @@ var BlankNode = /* @__PURE__ */ function(_Node) {
25606
26043
  }
25607
26044
  }], [{
25608
26045
  key: "getId",
25609
- value: function getId(id3) {
25610
- if (id3) {
25611
- if (typeof id3 !== "string") {
25612
- console.log("Bad blank id:", id3);
25613
- throw new Error("Bad id argument to new blank node: " + id3);
25614
- }
25615
- if (id3.includes("#")) {
25616
- var fragments = id3.split("#");
25617
- return fragments[fragments.length - 1];
26046
+ value: (
26047
+ /**
26048
+ * The next unique identifier for blank nodes
26049
+ */
26050
+ function getId(id3) {
26051
+ if (id3) {
26052
+ if (typeof id3 !== "string") {
26053
+ console.log("Bad blank id:", id3);
26054
+ throw new Error("Bad id argument to new blank node: " + id3);
26055
+ }
26056
+ if (id3.includes("#")) {
26057
+ var fragments = id3.split("#");
26058
+ return fragments[fragments.length - 1];
26059
+ }
26060
+ return id3;
25618
26061
  }
25619
- return id3;
26062
+ return "n" + BlankNode3.nextId++;
25620
26063
  }
25621
- return "n" + BlankNode3.nextId++;
25622
- }
26064
+ )
25623
26065
  }]);
25624
26066
  return BlankNode3;
25625
26067
  }(Node2);
@@ -25735,6 +26177,10 @@ var NamedNode = /* @__PURE__ */ function(_Node) {
25735
26177
  return null;
25736
26178
  return new NamedNode3(str.slice(0, p + 1));
25737
26179
  }
26180
+ /**
26181
+ * Returns an NN for the whole web site, ending in slash.
26182
+ * Contrast with the "origin" which does NOT have a trailing slash
26183
+ */
25738
26184
  }, {
25739
26185
  key: "site",
25740
26186
  value: function site() {
@@ -25749,6 +26195,10 @@ var NamedNode = /* @__PURE__ */ function(_Node) {
25749
26195
  return new NamedNode3(str.slice(0, q + 1));
25750
26196
  }
25751
26197
  }
26198
+ /**
26199
+ * Creates the fetchable named node for the document.
26200
+ * Removes everything from the # anchor tag.
26201
+ */
25752
26202
  }, {
25753
26203
  key: "doc",
25754
26204
  value: function doc() {
@@ -25758,16 +26208,21 @@ var NamedNode = /* @__PURE__ */ function(_Node) {
25758
26208
  return new NamedNode3(this.value.split("#")[0]);
25759
26209
  }
25760
26210
  }
26211
+ /**
26212
+ * Returns the URI including <brackets>
26213
+ */
25761
26214
  }, {
25762
26215
  key: "toString",
25763
26216
  value: function toString() {
25764
26217
  return "<" + this.value + ">";
25765
26218
  }
26219
+ /** The local identifier with the document */
25766
26220
  }, {
25767
26221
  key: "id",
25768
26222
  value: function id3() {
25769
26223
  return this.value.split("#")[1];
25770
26224
  }
26225
+ /** Alias for value, favored by Tim */
25771
26226
  }, {
25772
26227
  key: "uri",
25773
26228
  get: function get() {
@@ -25776,6 +26231,10 @@ var NamedNode = /* @__PURE__ */ function(_Node) {
25776
26231
  set: function set(uri) {
25777
26232
  this.value = uri;
25778
26233
  }
26234
+ /**
26235
+ * Creates a named node from the specified input value
26236
+ * @param value - An input value
26237
+ */
25779
26238
  }], [{
25780
26239
  key: "fromValue",
25781
26240
  value: function fromValue2(value) {
@@ -25858,6 +26317,10 @@ var Literal = /* @__PURE__ */ function(_Node) {
25858
26317
  value: function copy() {
25859
26318
  return new Literal3(this.value, this.lang, this.datatype);
25860
26319
  }
26320
+ /**
26321
+ * Gets whether two literals are the same
26322
+ * @param other The other statement
26323
+ */
25861
26324
  }, {
25862
26325
  key: "equals",
25863
26326
  value: function equals2(other) {
@@ -25866,6 +26329,10 @@ var Literal = /* @__PURE__ */ function(_Node) {
25866
26329
  }
25867
26330
  return this.termType === other.termType && this.value === other.value && this.language === other.language && (!this.datatype && !other.datatype || this.datatype && this.datatype.equals(other.datatype));
25868
26331
  }
26332
+ /**
26333
+ * The language for the literal
26334
+ * @deprecated use {language} instead
26335
+ */
25869
26336
  }, {
25870
26337
  key: "lang",
25871
26338
  get: function get() {
@@ -25879,11 +26346,16 @@ var Literal = /* @__PURE__ */ function(_Node) {
25879
26346
  value: function toNT() {
25880
26347
  return Literal3.toNT(this);
25881
26348
  }
26349
+ /** Serializes a literal to an N-Triples string */
25882
26350
  }, {
25883
26351
  key: "toString",
25884
26352
  value: function toString() {
25885
26353
  return "" + this.value;
25886
26354
  }
26355
+ /**
26356
+ * Builds a literal node from a boolean value
26357
+ * @param value - The value
26358
+ */
25887
26359
  }], [{
25888
26360
  key: "toNT",
25889
26361
  value: function toNT(literal4) {
@@ -25911,6 +26383,10 @@ var Literal = /* @__PURE__ */ function(_Node) {
25911
26383
  var strValue = value ? "1" : "0";
25912
26384
  return new Literal3(strValue, null, xsd_internal_default.boolean);
25913
26385
  }
26386
+ /**
26387
+ * Builds a literal node from a date value
26388
+ * @param value The value
26389
+ */
25914
26390
  }, {
25915
26391
  key: "fromDate",
25916
26392
  value: function fromDate(value) {
@@ -25923,6 +26399,10 @@ var Literal = /* @__PURE__ */ function(_Node) {
25923
26399
  var date = "" + value.getUTCFullYear() + "-" + d2(value.getUTCMonth() + 1) + "-" + d2(value.getUTCDate()) + "T" + d2(value.getUTCHours()) + ":" + d2(value.getUTCMinutes()) + ":" + d2(value.getUTCSeconds()) + "Z";
25924
26400
  return new Literal3(date, null, xsd_internal_default.dateTime);
25925
26401
  }
26402
+ /**
26403
+ * Builds a literal node from a number value
26404
+ * @param value - The value
26405
+ */
25926
26406
  }, {
25927
26407
  key: "fromNumber",
25928
26408
  value: function fromNumber(value) {
@@ -25938,6 +26418,10 @@ var Literal = /* @__PURE__ */ function(_Node) {
25938
26418
  }
25939
26419
  return new Literal3(strValue, null, datatype);
25940
26420
  }
26421
+ /**
26422
+ * Builds a literal node from an input value
26423
+ * @param value - The input value
26424
+ */
25941
26425
  }, {
25942
26426
  key: "fromValue",
25943
26427
  value: function fromValue2(value) {
@@ -26031,22 +26515,36 @@ var Collection = /* @__PURE__ */ function(_Node) {
26031
26515
  set: function set(value) {
26032
26516
  this.value = value;
26033
26517
  }
26518
+ /**
26519
+ * Appends an element to this collection
26520
+ * @param element - The new element
26521
+ */
26034
26522
  }, {
26035
26523
  key: "append",
26036
26524
  value: function append(element) {
26037
26525
  return this.elements.push(element);
26038
26526
  }
26527
+ /**
26528
+ * Closes this collection
26529
+ */
26039
26530
  }, {
26040
26531
  key: "close",
26041
26532
  value: function close() {
26042
26533
  this.closed = true;
26043
26534
  return this.closed;
26044
26535
  }
26536
+ /**
26537
+ * Removes the first element from the collection (and return it)
26538
+ */
26045
26539
  }, {
26046
26540
  key: "shift",
26047
26541
  value: function shift() {
26048
26542
  return this.elements.shift();
26049
26543
  }
26544
+ /**
26545
+ * Creates a new Collection with the substituting bindings applied
26546
+ * @param bindings - The bindings to substitute
26547
+ */
26050
26548
  }, {
26051
26549
  key: "substitute",
26052
26550
  value: function substitute(bindings) {
@@ -26062,9 +26560,19 @@ var Collection = /* @__PURE__ */ function(_Node) {
26062
26560
  }
26063
26561
  }, {
26064
26562
  key: "toString",
26065
- value: function toString() {
26066
- return "(" + this.elements.join(" ") + ")";
26067
- }
26563
+ value: (
26564
+ /**
26565
+ * Serializes the collection to a string.
26566
+ * Surrounded by (parentheses) and separated by spaces.
26567
+ */
26568
+ function toString() {
26569
+ return "(" + this.elements.join(" ") + ")";
26570
+ }
26571
+ )
26572
+ /**
26573
+ * Prepends the specified element to the collection's front
26574
+ * @param element - The element to prepend
26575
+ */
26068
26576
  }, {
26069
26577
  key: "unshift",
26070
26578
  value: function unshift(element) {
@@ -27869,6 +28377,7 @@ var index = {
27869
28377
  until,
27870
28378
  waterfall: waterfall$1,
27871
28379
  whilst: whilst$1,
28380
+ // aliases
27872
28381
  all: every$1,
27873
28382
  allLimit: everyLimit$1,
27874
28383
  allSeries: everySeries$1,
@@ -28012,6 +28521,8 @@ var N3Lexer = class {
28012
28521
  this._comments = !!options.comments;
28013
28522
  this._literalClosingPos = 0;
28014
28523
  }
28524
+ // ## Private methods
28525
+ // ### `_tokenizeToEnd` tokenizes as for as possible, emitting tokens through the callback
28015
28526
  _tokenizeToEnd(callback, inputFinished) {
28016
28527
  let input = this._input;
28017
28528
  let currentLineLength = input.length;
@@ -28230,6 +28741,7 @@ var N3Lexer = class {
28230
28741
  callback(self2._syntaxError(/^\S*/.exec(input)[0]));
28231
28742
  }
28232
28743
  }
28744
+ // ### `_unescape` replaces N3 escape codes by their corresponding characters
28233
28745
  _unescape(item) {
28234
28746
  let invalid = false;
28235
28747
  const replaced = item.replace(escapeSequence, (sequence, unicode4, unicode8, escapedChar) => {
@@ -28246,6 +28758,7 @@ var N3Lexer = class {
28246
28758
  });
28247
28759
  return invalid ? null : replaced;
28248
28760
  }
28761
+ // ### `_parseLiteral` parses a literal into an unescaped value
28249
28762
  _parseLiteral(input) {
28250
28763
  if (input.length >= 3) {
28251
28764
  const opening = input.match(/^(?:"""|"|'''|'|)/)[0];
@@ -28270,6 +28783,7 @@ var N3Lexer = class {
28270
28783
  }
28271
28784
  return { value: "", matchLength: 0 };
28272
28785
  }
28786
+ // ### `_syntaxError` creates a syntax error for the given issue
28273
28787
  _syntaxError(issue) {
28274
28788
  this._input = null;
28275
28789
  const err = new Error(`Unexpected "${issue}" on line ${this._line}.`);
@@ -28280,9 +28794,13 @@ var N3Lexer = class {
28280
28794
  };
28281
28795
  return err;
28282
28796
  }
28797
+ // ### Strips off any starting UTF BOM mark.
28283
28798
  _readStartingBom(input) {
28284
28799
  return input.startsWith("\uFEFF") ? input.substr(1) : input;
28285
28800
  }
28801
+ // ## Public methods
28802
+ // ### `tokenize` starts the transformation of an N3 document into an array of tokens.
28803
+ // The input can be a string or a stream.
28286
28804
  tokenize(input, callback) {
28287
28805
  this._line = 1;
28288
28806
  if (typeof input === "string") {
@@ -28350,17 +28868,22 @@ var Term = class {
28350
28868
  constructor(id3) {
28351
28869
  this.id = id3;
28352
28870
  }
28871
+ // ### The value of this term
28353
28872
  get value() {
28354
28873
  return this.id;
28355
28874
  }
28875
+ // ### Returns whether this object represents the same term as the other
28356
28876
  equals(other) {
28357
28877
  if (other instanceof Term)
28358
28878
  return this.id === other.id;
28359
28879
  return !!other && this.termType === other.termType && this.value === other.value;
28360
28880
  }
28881
+ // ### Implement hashCode for Immutable.js, since we implement `equals`
28882
+ // https://immutable-js.com/docs/v4.0.0/ValueObject/#hashCode()
28361
28883
  hashCode() {
28362
28884
  return 0;
28363
28885
  }
28886
+ // ### Returns a plain object representation of this term
28364
28887
  toJSON() {
28365
28888
  return {
28366
28889
  termType: this.termType,
@@ -28369,30 +28892,37 @@ var Term = class {
28369
28892
  }
28370
28893
  };
28371
28894
  var NamedNode2 = class extends Term {
28895
+ // ### The term type of this term
28372
28896
  get termType() {
28373
28897
  return "NamedNode";
28374
28898
  }
28375
28899
  };
28376
28900
  var Literal2 = class extends Term {
28901
+ // ### The term type of this term
28377
28902
  get termType() {
28378
28903
  return "Literal";
28379
28904
  }
28905
+ // ### The text value of this literal
28380
28906
  get value() {
28381
28907
  return this.id.substring(1, this.id.lastIndexOf('"'));
28382
28908
  }
28909
+ // ### The language of this literal
28383
28910
  get language() {
28384
28911
  const id3 = this.id;
28385
28912
  let atPos = id3.lastIndexOf('"') + 1;
28386
28913
  return atPos < id3.length && id3[atPos++] === "@" ? id3.substr(atPos).toLowerCase() : "";
28387
28914
  }
28915
+ // ### The datatype IRI of this literal
28388
28916
  get datatype() {
28389
28917
  return new NamedNode2(this.datatypeString);
28390
28918
  }
28919
+ // ### The datatype string of this literal
28391
28920
  get datatypeString() {
28392
28921
  const id3 = this.id, dtPos = id3.lastIndexOf('"') + 1;
28393
28922
  const char = dtPos < id3.length ? id3[dtPos] : "";
28394
28923
  return char === "^" ? id3.substr(dtPos + 2) : char !== "@" ? xsd2.string : rdf.langString;
28395
28924
  }
28925
+ // ### Returns whether this object represents the same term as the other
28396
28926
  equals(other) {
28397
28927
  if (other instanceof Literal2)
28398
28928
  return this.id === other.id;
@@ -28411,9 +28941,11 @@ var BlankNode2 = class extends Term {
28411
28941
  constructor(name) {
28412
28942
  super(`_:${name}`);
28413
28943
  }
28944
+ // ### The term type of this term
28414
28945
  get termType() {
28415
28946
  return "BlankNode";
28416
28947
  }
28948
+ // ### The name of this blank node
28417
28949
  get value() {
28418
28950
  return this.id.substr(2);
28419
28951
  }
@@ -28422,9 +28954,11 @@ var Variable = class extends Term {
28422
28954
  constructor(name) {
28423
28955
  super(`?${name}`);
28424
28956
  }
28957
+ // ### The term type of this term
28425
28958
  get termType() {
28426
28959
  return "Variable";
28427
28960
  }
28961
+ // ### The name of this variable
28428
28962
  get value() {
28429
28963
  return this.id.substr(1);
28430
28964
  }
@@ -28434,9 +28968,11 @@ var DefaultGraph = class extends Term {
28434
28968
  super("");
28435
28969
  return DEFAULTGRAPH || this;
28436
28970
  }
28971
+ // ### The term type of this term
28437
28972
  get termType() {
28438
28973
  return "DefaultGraph";
28439
28974
  }
28975
+ // ### Returns whether this object represents the same term as the other
28440
28976
  equals(other) {
28441
28977
  return this === other || !!other && this.termType === other.termType;
28442
28978
  }
@@ -28450,6 +28986,7 @@ var Quad = class extends Term {
28450
28986
  this._object = object;
28451
28987
  this._graph = graph3 || DEFAULTGRAPH;
28452
28988
  }
28989
+ // ### The term type of this term
28453
28990
  get termType() {
28454
28991
  return "Quad";
28455
28992
  }
@@ -28465,6 +29002,7 @@ var Quad = class extends Term {
28465
29002
  get graph() {
28466
29003
  return this._graph;
28467
29004
  }
29005
+ // ### Returns a plain object representation of this quad
28468
29006
  toJSON() {
28469
29007
  return {
28470
29008
  termType: this.termType,
@@ -28474,6 +29012,7 @@ var Quad = class extends Term {
28474
29012
  graph: this._graph.toJSON()
28475
29013
  };
28476
29014
  }
29015
+ // ### Returns whether this object represents the same quad as the other
28477
29016
  equals(other) {
28478
29017
  return !!other && this._subject.equals(other.subject) && this._predicate.equals(other.predicate) && this._object.equals(other.object) && this._graph.equals(other.graph);
28479
29018
  }
@@ -28535,9 +29074,13 @@ var N3Parser = class {
28535
29074
  this._lexer = options.lexer || new N3Lexer({ lineMode: isLineMode, n3: isN3 });
28536
29075
  this._explicitQuantifiers = !!options.explicitQuantifiers;
28537
29076
  }
29077
+ // ## Static class methods
29078
+ // ### `_resetBlankNodePrefix` restarts blank node prefix identification
28538
29079
  static _resetBlankNodePrefix() {
28539
29080
  blankNodePrefix = 0;
28540
29081
  }
29082
+ // ## Private methods
29083
+ // ### `_setBase` sets the base IRI to resolve relative IRIs
28541
29084
  _setBase(baseIRI) {
28542
29085
  if (!baseIRI) {
28543
29086
  this._base = "";
@@ -28553,6 +29096,8 @@ var N3Parser = class {
28553
29096
  this._baseScheme = baseIRI[1];
28554
29097
  }
28555
29098
  }
29099
+ // ### `_saveContext` stores the current parsing context
29100
+ // when entering a new scope (list, blank node, formula)
28556
29101
  _saveContext(type, graph3, subject, predicate, object) {
28557
29102
  const n3Mode = this._n3Mode;
28558
29103
  this._contextStack.push({
@@ -28571,6 +29116,8 @@ var N3Parser = class {
28571
29116
  this._quantified = Object.create(this._quantified);
28572
29117
  }
28573
29118
  }
29119
+ // ### `_restoreContext` restores the parent context
29120
+ // when leaving a scope (list, blank node, formula)
28574
29121
  _restoreContext(type, token) {
28575
29122
  const context = this._contextStack.pop();
28576
29123
  if (!context || context.type !== type)
@@ -28585,6 +29132,7 @@ var N3Parser = class {
28585
29132
  this._quantified = context.quantified;
28586
29133
  }
28587
29134
  }
29135
+ // ### `_readInTopContext` reads a token when in the top context
28588
29136
  _readInTopContext(token) {
28589
29137
  switch (token.type) {
28590
29138
  case "eof":
@@ -28613,6 +29161,7 @@ var N3Parser = class {
28613
29161
  return this._readSubject(token);
28614
29162
  }
28615
29163
  }
29164
+ // ### `_readEntity` reads an IRI, prefixed name, blank node, or variable
28616
29165
  _readEntity(token, quantifier) {
28617
29166
  let value;
28618
29167
  switch (token.type) {
@@ -28643,6 +29192,7 @@ var N3Parser = class {
28643
29192
  value = this._quantified[value.id];
28644
29193
  return value;
28645
29194
  }
29195
+ // ### `_readSubject` reads a quad's subject
28646
29196
  _readSubject(token) {
28647
29197
  this._predicate = null;
28648
29198
  switch (token.type) {
@@ -28709,6 +29259,7 @@ var N3Parser = class {
28709
29259
  }
28710
29260
  return this._readPredicateOrNamedGraph;
28711
29261
  }
29262
+ // ### `_readPredicate` reads a quad's predicate
28712
29263
  _readPredicate(token) {
28713
29264
  const type = token.type;
28714
29265
  switch (type) {
@@ -28746,6 +29297,7 @@ var N3Parser = class {
28746
29297
  }
28747
29298
  return this._readObject;
28748
29299
  }
29300
+ // ### `_readObject` reads a quad's object
28749
29301
  _readObject(token) {
28750
29302
  switch (token.type) {
28751
29303
  case "literal":
@@ -28793,15 +29345,18 @@ var N3Parser = class {
28793
29345
  }
28794
29346
  return this._getContextEndReader();
28795
29347
  }
29348
+ // ### `_readPredicateOrNamedGraph` reads a quad's predicate, or a named graph
28796
29349
  _readPredicateOrNamedGraph(token) {
28797
29350
  return token.type === "{" ? this._readGraph(token) : this._readPredicate(token);
28798
29351
  }
29352
+ // ### `_readGraph` reads a graph
28799
29353
  _readGraph(token) {
28800
29354
  if (token.type !== "{")
28801
29355
  return this._error(`Expected graph but got ${token.type}`, token);
28802
29356
  this._graph = this._subject, this._subject = null;
28803
29357
  return this._readSubject;
28804
29358
  }
29359
+ // ### `_readBlankNodeHead` reads the head of a blank node
28805
29360
  _readBlankNodeHead(token) {
28806
29361
  if (token.type === "]") {
28807
29362
  this._subject = null;
@@ -28811,6 +29366,7 @@ var N3Parser = class {
28811
29366
  return this._readPredicate(token);
28812
29367
  }
28813
29368
  }
29369
+ // ### `_readBlankNodeTail` reads the end of a blank node
28814
29370
  _readBlankNodeTail(token) {
28815
29371
  if (token.type !== "]")
28816
29372
  return this._readBlankNodePunctuation(token);
@@ -28825,6 +29381,7 @@ var N3Parser = class {
28825
29381
  else
28826
29382
  return empty ? this._readPredicateOrNamedGraph : this._readPredicateAfterBlank;
28827
29383
  }
29384
+ // ### `_readPredicateAfterBlank` reads a predicate after an anonymous blank node
28828
29385
  _readPredicateAfterBlank(token) {
28829
29386
  switch (token.type) {
28830
29387
  case ".":
@@ -28835,6 +29392,7 @@ var N3Parser = class {
28835
29392
  return this._readPredicate(token);
28836
29393
  }
28837
29394
  }
29395
+ // ### `_readListItem` reads items from a list
28838
29396
  _readListItem(token) {
28839
29397
  let item = null, list = null, next = this._readListItem;
28840
29398
  const previousList = this._subject, stack = this._contextStack, parent2 = stack[stack.length - 1];
@@ -28918,12 +29476,15 @@ var N3Parser = class {
28918
29476
  }
28919
29477
  return next;
28920
29478
  }
29479
+ // ### `_readDataTypeOrLang` reads an _optional_ datatype or language
28921
29480
  _readDataTypeOrLang(token) {
28922
29481
  return this._completeObjectLiteral(token, false);
28923
29482
  }
29483
+ // ### `_readListItemDataTypeOrLang` reads an _optional_ datatype or language in a list
28924
29484
  _readListItemDataTypeOrLang(token) {
28925
29485
  return this._completeObjectLiteral(token, true);
28926
29486
  }
29487
+ // ### `_completeLiteral` completes a literal with an optional datatype or language
28927
29488
  _completeLiteral(token) {
28928
29489
  let literal4 = this._literal(this._literalValue);
28929
29490
  switch (token.type) {
@@ -28942,10 +29503,12 @@ var N3Parser = class {
28942
29503
  }
28943
29504
  return { token, literal: literal4 };
28944
29505
  }
29506
+ // Completes a literal in subject position
28945
29507
  _completeSubjectLiteral(token) {
28946
29508
  this._subject = this._completeLiteral(token).literal;
28947
29509
  return this._readPredicateOrNamedGraph;
28948
29510
  }
29511
+ // Completes a literal in object position
28949
29512
  _completeObjectLiteral(token, listItem) {
28950
29513
  const completed = this._completeLiteral(token);
28951
29514
  if (!completed)
@@ -28960,6 +29523,7 @@ var N3Parser = class {
28960
29523
  return this._readCallback(completed.token);
28961
29524
  }
28962
29525
  }
29526
+ // ### `_readFormulaTail` reads the end of a formula
28963
29527
  _readFormulaTail(token) {
28964
29528
  if (token.type !== "}")
28965
29529
  return this._readPunctuation(token);
@@ -28968,6 +29532,7 @@ var N3Parser = class {
28968
29532
  this._restoreContext("formula", token);
28969
29533
  return this._object === null ? this._readPredicate : this._getContextEndReader();
28970
29534
  }
29535
+ // ### `_readPunctuation` reads punctuation between quads or quad parts
28971
29536
  _readPunctuation(token) {
28972
29537
  let next, graph3 = this._graph;
28973
29538
  const subject = this._subject, inversePredicate = this._inversePredicate;
@@ -29006,6 +29571,7 @@ var N3Parser = class {
29006
29571
  }
29007
29572
  return next;
29008
29573
  }
29574
+ // ### `_readBlankNodePunctuation` reads punctuation in a blank node
29009
29575
  _readBlankNodePunctuation(token) {
29010
29576
  let next;
29011
29577
  switch (token.type) {
@@ -29021,17 +29587,20 @@ var N3Parser = class {
29021
29587
  this._emit(this._subject, this._predicate, this._object, this._graph);
29022
29588
  return next;
29023
29589
  }
29590
+ // ### `_readQuadPunctuation` reads punctuation after a quad
29024
29591
  _readQuadPunctuation(token) {
29025
29592
  if (token.type !== ".")
29026
29593
  return this._error("Expected dot to follow quad", token);
29027
29594
  return this._readInTopContext;
29028
29595
  }
29596
+ // ### `_readPrefix` reads the prefix of a prefix declaration
29029
29597
  _readPrefix(token) {
29030
29598
  if (token.type !== "prefix")
29031
29599
  return this._error("Expected prefix to follow @prefix", token);
29032
29600
  this._prefix = token.value;
29033
29601
  return this._readPrefixIRI;
29034
29602
  }
29603
+ // ### `_readPrefixIRI` reads the IRI of a prefix declaration
29035
29604
  _readPrefixIRI(token) {
29036
29605
  if (token.type !== "IRI")
29037
29606
  return this._error(`Expected IRI to follow prefix "${this._prefix}:"`, token);
@@ -29040,6 +29609,7 @@ var N3Parser = class {
29040
29609
  this._prefixCallback(this._prefix, prefixNode);
29041
29610
  return this._readDeclarationPunctuation;
29042
29611
  }
29612
+ // ### `_readBaseIRI` reads the IRI of a base declaration
29043
29613
  _readBaseIRI(token) {
29044
29614
  const iri = token.type === "IRI" && this._resolveIRI(token.value);
29045
29615
  if (!iri)
@@ -29047,6 +29617,7 @@ var N3Parser = class {
29047
29617
  this._setBase(iri);
29048
29618
  return this._readDeclarationPunctuation;
29049
29619
  }
29620
+ // ### `_readNamedGraphLabel` reads the label of a named graph
29050
29621
  _readNamedGraphLabel(token) {
29051
29622
  switch (token.type) {
29052
29623
  case "IRI":
@@ -29059,12 +29630,14 @@ var N3Parser = class {
29059
29630
  return this._error("Invalid graph label", token);
29060
29631
  }
29061
29632
  }
29633
+ // ### `_readNamedGraphLabel` reads a blank node label of a named graph
29062
29634
  _readNamedGraphBlankLabel(token) {
29063
29635
  if (token.type !== "]")
29064
29636
  return this._error("Invalid graph label", token);
29065
29637
  this._subject = this._blankNode();
29066
29638
  return this._readGraph;
29067
29639
  }
29640
+ // ### `_readDeclarationPunctuation` reads the punctuation of a declaration
29068
29641
  _readDeclarationPunctuation(token) {
29069
29642
  if (this._sparqlStyle) {
29070
29643
  this._sparqlStyle = false;
@@ -29074,6 +29647,7 @@ var N3Parser = class {
29074
29647
  return this._error("Expected declaration to end with a dot", token);
29075
29648
  return this._readInTopContext;
29076
29649
  }
29650
+ // Reads a list of quantified symbols from a @forSome or @forAll statement
29077
29651
  _readQuantifierList(token) {
29078
29652
  let entity;
29079
29653
  switch (token.type) {
@@ -29105,6 +29679,7 @@ var N3Parser = class {
29105
29679
  }
29106
29680
  return this._readQuantifierPunctuation;
29107
29681
  }
29682
+ // Reads punctuation from a @forSome or @forAll statement
29108
29683
  _readQuantifierPunctuation(token) {
29109
29684
  if (token.type === ",")
29110
29685
  return this._readQuantifierList;
@@ -29117,10 +29692,12 @@ var N3Parser = class {
29117
29692
  return this._readCallback(token);
29118
29693
  }
29119
29694
  }
29695
+ // ### `_getPathReader` reads a potential path and then resumes with the given function
29120
29696
  _getPathReader(afterPath) {
29121
29697
  this._afterPath = afterPath;
29122
29698
  return this._readPath;
29123
29699
  }
29700
+ // ### `_readPath` reads a potential path
29124
29701
  _readPath(token) {
29125
29702
  switch (token.type) {
29126
29703
  case "!":
@@ -29137,6 +29714,7 @@ var N3Parser = class {
29137
29714
  return this._afterPath(token);
29138
29715
  }
29139
29716
  }
29717
+ // ### `_readForwardPath` reads a '!' path
29140
29718
  _readForwardPath(token) {
29141
29719
  let subject, predicate;
29142
29720
  const object = this._blankNode();
@@ -29149,6 +29727,7 @@ var N3Parser = class {
29149
29727
  this._emit(subject, predicate, object, this._graph);
29150
29728
  return this._readPath;
29151
29729
  }
29730
+ // ### `_readBackwardPath` reads a '^' path
29152
29731
  _readBackwardPath(token) {
29153
29732
  const subject = this._blankNode();
29154
29733
  let predicate, object;
@@ -29161,6 +29740,7 @@ var N3Parser = class {
29161
29740
  this._emit(subject, predicate, object, this._graph);
29162
29741
  return this._readPath;
29163
29742
  }
29743
+ // ### `_readRDFStarTailOrGraph` reads the graph of a nested RDF* quad or the end of a nested RDF* triple
29164
29744
  _readRDFStarTailOrGraph(token) {
29165
29745
  if (token.type !== ">>") {
29166
29746
  if (this._supportsQuads && this._graph === null && (this._graph = this._readEntity(token)) !== void 0)
@@ -29169,6 +29749,7 @@ var N3Parser = class {
29169
29749
  }
29170
29750
  return this._readRDFStarTail(token);
29171
29751
  }
29752
+ // ### `_readRDFStarTail` reads the end of a nested RDF* triple
29172
29753
  _readRDFStarTail(token) {
29173
29754
  if (token.type !== ">>")
29174
29755
  return this._error(`Expected >> but got ${token.type}`, token);
@@ -29187,6 +29768,7 @@ var N3Parser = class {
29187
29768
  return this._getContextEndReader();
29188
29769
  }
29189
29770
  }
29771
+ // ### `_getContextEndReader` gets the next reader function at the end of a context
29190
29772
  _getContextEndReader() {
29191
29773
  const contextStack = this._contextStack;
29192
29774
  if (!contextStack.length)
@@ -29202,9 +29784,11 @@ var N3Parser = class {
29202
29784
  return this._readRDFStarTailOrGraph;
29203
29785
  }
29204
29786
  }
29787
+ // ### `_emit` sends a quad through the callback
29205
29788
  _emit(subject, predicate, object, graph3) {
29206
29789
  this._callback(null, this._quad(subject, predicate, object, graph3 || this.DEFAULTGRAPH));
29207
29790
  }
29791
+ // ### `_error` emits an error message through the callback
29208
29792
  _error(message2, token) {
29209
29793
  const err = new Error(`${message2} on line ${token.line}.`);
29210
29794
  err.context = {
@@ -29215,9 +29799,12 @@ var N3Parser = class {
29215
29799
  this._callback(err);
29216
29800
  this._callback = noop;
29217
29801
  }
29802
+ // ### `_resolveIRI` resolves an IRI against the base path
29218
29803
  _resolveIRI(iri) {
29219
29804
  return /^[a-z][a-z0-9+.-]*:/i.test(iri) ? iri : this._resolveRelativeIRI(iri);
29220
29805
  }
29806
+ // ### `_resolveRelativeIRI` resolves an IRI against the base path,
29807
+ // assuming that a base path has been set and that the IRI is indeed relative
29221
29808
  _resolveRelativeIRI(iri) {
29222
29809
  if (!iri.length)
29223
29810
  return this._base;
@@ -29232,6 +29819,7 @@ var N3Parser = class {
29232
29819
  return /^[^/:]*:/.test(iri) ? null : this._removeDotSegments(this._basePath + iri);
29233
29820
  }
29234
29821
  }
29822
+ // ### `_removeDotSegments` resolves './' and '../' path segments in an IRI as per RFC3986
29235
29823
  _removeDotSegments(iri) {
29236
29824
  if (!/(^|\/)\.\.?($|[/#?])/.test(iri))
29237
29825
  return iri;
@@ -29279,6 +29867,8 @@ var N3Parser = class {
29279
29867
  }
29280
29868
  return result + iri.substring(segmentStart);
29281
29869
  }
29870
+ // ## Public methods
29871
+ // ### `parse` parses the N3 input and emits each parsed quad through the callback
29282
29872
  parse(input, quadCallback, prefixCallback) {
29283
29873
  this._readCallback = this._readInTopContext;
29284
29874
  this._sparqlStyle = false;
@@ -29348,6 +29938,8 @@ var escapedCharacters = {
29348
29938
  "\f": "\\f"
29349
29939
  };
29350
29940
  var SerializedTerm = class extends Term {
29941
+ // Pretty-printed nodes are not equal to any other node
29942
+ // (e.g., [] does not equal [])
29351
29943
  equals() {
29352
29944
  return false;
29353
29945
  }
@@ -29390,12 +29982,16 @@ var N3Writer = class {
29390
29982
  this._writeQuad = this._writeQuadLine;
29391
29983
  }
29392
29984
  }
29985
+ // ## Private methods
29986
+ // ### Whether the current graph is the default graph
29393
29987
  get _inDefaultGraph() {
29394
29988
  return DEFAULTGRAPH2.equals(this._graph);
29395
29989
  }
29990
+ // ### `_write` writes the argument to the output stream
29396
29991
  _write(string, callback) {
29397
29992
  this._outputStream.write(string, "utf8", callback);
29398
29993
  }
29994
+ // ### `_writeQuad` writes the quad to the output stream
29399
29995
  _writeQuad(subject, predicate, object, graph3, done) {
29400
29996
  try {
29401
29997
  if (!graph3.equals(this._graph)) {
@@ -29416,22 +30012,27 @@ var N3Writer = class {
29416
30012
  done && done(error2);
29417
30013
  }
29418
30014
  }
30015
+ // ### `_writeQuadLine` writes the quad to the output stream as a single line
29419
30016
  _writeQuadLine(subject, predicate, object, graph3, done) {
29420
30017
  delete this._prefixMatch;
29421
30018
  this._write(this.quadToString(subject, predicate, object, graph3), done);
29422
30019
  }
30020
+ // ### `quadToString` serializes a quad as a string
29423
30021
  quadToString(subject, predicate, object, graph3) {
29424
30022
  return `${this._encodeSubject(subject)} ${this._encodeIriOrBlank(predicate)} ${this._encodeObject(object)}${graph3 && graph3.value ? ` ${this._encodeIriOrBlank(graph3)} .
29425
30023
  ` : " .\n"}`;
29426
30024
  }
30025
+ // ### `quadsToString` serializes an array of quads as a string
29427
30026
  quadsToString(quads) {
29428
30027
  return quads.map((t) => {
29429
30028
  return this.quadToString(t.subject, t.predicate, t.object, t.graph);
29430
30029
  }).join("");
29431
30030
  }
30031
+ // ### `_encodeSubject` represents a subject
29432
30032
  _encodeSubject(entity) {
29433
30033
  return entity.termType === "Quad" ? this._encodeQuad(entity) : this._encodeIriOrBlank(entity);
29434
30034
  }
30035
+ // ### `_encodeIriOrBlank` represents an IRI or blank node
29435
30036
  _encodeIriOrBlank(entity) {
29436
30037
  if (entity.termType !== "NamedNode") {
29437
30038
  if (this._lists && entity.value in this._lists)
@@ -29446,6 +30047,7 @@ var N3Writer = class {
29446
30047
  const prefixMatch = this._prefixRegex.exec(iri);
29447
30048
  return !prefixMatch ? `<${iri}>` : !prefixMatch[1] ? iri : this._prefixIRIs[prefixMatch[1]] + prefixMatch[2];
29448
30049
  }
30050
+ // ### `_encodeLiteral` represents a literal
29449
30051
  _encodeLiteral(literal4) {
29450
30052
  let value = literal4.value;
29451
30053
  if (escape2.test(value))
@@ -29479,9 +30081,11 @@ var N3Writer = class {
29479
30081
  }
29480
30082
  return `"${value}"^^${this._encodeIriOrBlank(literal4.datatype)}`;
29481
30083
  }
30084
+ // ### `_encodePredicate` represents a predicate
29482
30085
  _encodePredicate(predicate) {
29483
30086
  return predicate.value === rdf2.type ? "a" : this._encodeIriOrBlank(predicate);
29484
30087
  }
30088
+ // ### `_encodeObject` represents an object
29485
30089
  _encodeObject(object) {
29486
30090
  switch (object.termType) {
29487
30091
  case "Quad":
@@ -29492,12 +30096,15 @@ var N3Writer = class {
29492
30096
  return this._encodeIriOrBlank(object);
29493
30097
  }
29494
30098
  }
30099
+ // ### `_encodeQuad` encodes an RDF* quad
29495
30100
  _encodeQuad({ subject, predicate, object, graph: graph3 }) {
29496
30101
  return `<<${this._encodeSubject(subject)} ${this._encodePredicate(predicate)} ${this._encodeObject(object)}${isDefaultGraph(graph3) ? "" : ` ${this._encodeIriOrBlank(graph3)}`}>>`;
29497
30102
  }
30103
+ // ### `_blockedWrite` replaces `_write` after the writer has been closed
29498
30104
  _blockedWrite() {
29499
30105
  throw new Error("Cannot write because the writer has been closed.");
29500
30106
  }
30107
+ // ### `addQuad` adds the quad to the output stream
29501
30108
  addQuad(subject, predicate, object, graph3, done) {
29502
30109
  if (object === void 0)
29503
30110
  this._writeQuad(subject.subject, subject.predicate, subject.object, subject.graph, predicate);
@@ -29506,15 +30113,18 @@ var N3Writer = class {
29506
30113
  else
29507
30114
  this._writeQuad(subject, predicate, object, graph3 || DEFAULTGRAPH2, done);
29508
30115
  }
30116
+ // ### `addQuads` adds the quads to the output stream
29509
30117
  addQuads(quads) {
29510
30118
  for (let i = 0; i < quads.length; i++)
29511
30119
  this.addQuad(quads[i]);
29512
30120
  }
30121
+ // ### `addPrefix` adds the prefix to the output stream
29513
30122
  addPrefix(prefix, iri, done) {
29514
30123
  const prefixes = {};
29515
30124
  prefixes[prefix] = iri;
29516
30125
  this.addPrefixes(prefixes, done);
29517
30126
  }
30127
+ // ### `addPrefixes` adds the prefixes to the output stream
29518
30128
  addPrefixes(prefixes, done) {
29519
30129
  if (!this._prefixIRIs)
29520
30130
  return done && done();
@@ -29543,6 +30153,7 @@ var N3Writer = class {
29543
30153
  }
29544
30154
  this._write(hasPrefixes ? "\n" : "", done);
29545
30155
  }
30156
+ // ### `blank` creates a blank node with the given content
29546
30157
  blank(predicate, object) {
29547
30158
  let children = predicate, child, length;
29548
30159
  if (predicate === void 0)
@@ -29573,12 +30184,14 @@ var N3Writer = class {
29573
30184
  ]`);
29574
30185
  }
29575
30186
  }
30187
+ // ### `list` creates a list node with the given content
29576
30188
  list(elements) {
29577
30189
  const length = elements && elements.length || 0, contents = new Array(length);
29578
30190
  for (let i = 0; i < length; i++)
29579
30191
  contents[i] = this._encodeObject(elements[i]);
29580
30192
  return new SerializedTerm(`(${contents.join(" ")})`);
29581
30193
  }
30194
+ // ### `end` signals the end of the output stream
29582
30195
  end(done) {
29583
30196
  if (this._subject !== null) {
29584
30197
  this._write(this._inDefaultGraph ? ".\n" : "\n}\n");
@@ -29767,11 +30380,19 @@ var Statement = /* @__PURE__ */ function() {
29767
30380
  set: function set(g) {
29768
30381
  this.graph = g;
29769
30382
  }
30383
+ /**
30384
+ * Checks whether two statements are the same
30385
+ * @param other - The other statement
30386
+ */
29770
30387
  }, {
29771
30388
  key: "equals",
29772
30389
  value: function equals2(other) {
29773
30390
  return other.subject.equals(this.subject) && other.predicate.equals(this.predicate) && other.object.equals(this.object) && other.graph.equals(this.graph);
29774
30391
  }
30392
+ /**
30393
+ * Creates a statement with the bindings substituted
30394
+ * @param bindings The bindings
30395
+ */
29775
30396
  }, {
29776
30397
  key: "substitute",
29777
30398
  value: function substitute(bindings) {
@@ -29779,6 +30400,7 @@ var Statement = /* @__PURE__ */ function() {
29779
30400
  console.log("@@@ statement substitute:" + y);
29780
30401
  return y;
29781
30402
  }
30403
+ /** Creates a canonical string representation of this statement. */
29782
30404
  }, {
29783
30405
  key: "toCanonical",
29784
30406
  value: function toCanonical() {
@@ -29788,16 +30410,19 @@ var Statement = /* @__PURE__ */ function() {
29788
30410
  }
29789
30411
  return terms.join(" ") + " .";
29790
30412
  }
30413
+ /** Creates a n-triples string representation of this statement */
29791
30414
  }, {
29792
30415
  key: "toNT",
29793
30416
  value: function toNT() {
29794
30417
  return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT()].join(" ") + " .";
29795
30418
  }
30419
+ /** Creates a n-quads string representation of this statement */
29796
30420
  }, {
29797
30421
  key: "toNQ",
29798
30422
  value: function toNQ2() {
29799
30423
  return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT(), isDefaultGraph2(this.graph) ? "" : this.graph.toNT()].join(" ") + " .";
29800
30424
  }
30425
+ /** Creates a string representation of this statement */
29801
30426
  }, {
29802
30427
  key: "toString",
29803
30428
  value: function toString() {
@@ -30075,12 +30700,19 @@ var _supports;
30075
30700
  var _defaultGraph = new DefaultGraph2();
30076
30701
  var CanonicalDataFactory = {
30077
30702
  supports: (_supports = {}, _defineProperty(_supports, Feature.collections, false), _defineProperty(_supports, Feature.defaultGraphType, false), _defineProperty(_supports, Feature.equalsMethod, true), _defineProperty(_supports, Feature.identity, false), _defineProperty(_supports, Feature.id, true), _defineProperty(_supports, Feature.reversibleId, false), _defineProperty(_supports, Feature.variableType, true), _supports),
30703
+ /**
30704
+ * Creates a new blank node
30705
+ * @param value - The blank node's identifier
30706
+ */
30078
30707
  blankNode: function blankNode2(value) {
30079
30708
  return new BlankNode(value);
30080
30709
  },
30081
30710
  defaultGraph: function defaultGraph3() {
30082
30711
  return _defaultGraph;
30083
30712
  },
30713
+ /**
30714
+ * Compares to (rdf) objects for equality.
30715
+ */
30084
30716
  equals: function equals(a, b) {
30085
30717
  if (a === b || !a || !b) {
30086
30718
  return true;
@@ -30096,6 +30728,14 @@ var CanonicalDataFactory = {
30096
30728
  }
30097
30729
  return false;
30098
30730
  },
30731
+ /**
30732
+ * Generates a uniquely identifiably *idempotent* string for the given {term}.
30733
+ *
30734
+ * Equivalent to [[Term.hashString]]
30735
+ *
30736
+ * @example Use this to associate data with a term in an object
30737
+ * { obj[id(term)] = "myData" }
30738
+ */
30099
30739
  id: function id(term2) {
30100
30740
  if (!term2) {
30101
30741
  return "undefined";
@@ -30119,6 +30759,11 @@ var CanonicalDataFactory = {
30119
30759
  isQuad: function isQuad2(obj) {
30120
30760
  return obj instanceof Statement;
30121
30761
  },
30762
+ /**
30763
+ * Creates a new literal node. Does some JS literal parsing for ease of use.
30764
+ * @param value - The lexical value
30765
+ * @param languageOrDatatype - Either the language or the datatype
30766
+ */
30122
30767
  literal: function literal2(value, languageOrDatatype) {
30123
30768
  if (typeof value !== "string" && !languageOrDatatype) {
30124
30769
  return Literal.fromValue(value);
@@ -30134,18 +30779,37 @@ var CanonicalDataFactory = {
30134
30779
  return new Literal(strValue, null, languageOrDatatype);
30135
30780
  }
30136
30781
  },
30782
+ /**
30783
+ * Creates a new named node
30784
+ * @param value - The new named node
30785
+ */
30137
30786
  namedNode: function namedNode2(value) {
30138
30787
  return new NamedNode(value);
30139
30788
  },
30789
+ /**
30790
+ * Creates a new statement
30791
+ * @param subject - The subject
30792
+ * @param predicate - The predicate
30793
+ * @param object - The object
30794
+ * @param graph - The containing graph
30795
+ */
30140
30796
  quad: function quad3(subject, predicate, object, graph3) {
30141
30797
  return new Statement(subject, predicate, object, graph3 || _defaultGraph);
30142
30798
  },
30799
+ /**
30800
+ * Creates a new statement
30801
+ * @param subject - The subject
30802
+ * @param predicate - The predicate
30803
+ * @param object - The object
30804
+ * @param graph - The containing graph
30805
+ */
30143
30806
  triple: function triple(subject, predicate, object, graph3) {
30144
30807
  return this.quad(subject, predicate, object, graph3);
30145
30808
  },
30146
30809
  quadToNQ: function quadToNQ(q) {
30147
30810
  return "".concat(this.termToNQ(q.subject), " ").concat(this.termToNQ(q.predicate), " ").concat(this.termToNQ(q.object), " ").concat(this.termToNQ(q.graph), " .");
30148
30811
  },
30812
+ /** Stringify a {term} to n-quads serialization. */
30149
30813
  termToNQ: function termToNQ(term2) {
30150
30814
  var _this = this;
30151
30815
  switch (term2.termType) {
@@ -30168,12 +30832,17 @@ var CanonicalDataFactory = {
30168
30832
  throw new Error("Can't serialize nonstandard term type (was '".concat(term2.termType, "')"));
30169
30833
  }
30170
30834
  },
30835
+ /** Convert an rdf object (term or quad) to n-quads serialization. */
30171
30836
  toNQ: function toNQ(term2) {
30172
30837
  if (this.isQuad(term2)) {
30173
30838
  return this.quadToNQ(term2);
30174
30839
  }
30175
30840
  return this.termToNQ(term2);
30176
30841
  },
30842
+ /**
30843
+ * Creates a new variable
30844
+ * @param name - The name for the variable
30845
+ */
30177
30846
  variable: function variable2(name) {
30178
30847
  return new Variable2(name);
30179
30848
  }
@@ -30475,6 +31144,12 @@ var Serializer = /* @__PURE__ */ function() {
30475
31144
  }
30476
31145
  return this.store.fromNT(s);
30477
31146
  }
31147
+ /**
31148
+ * Defines a set of [prefix, namespace] pairs to be used by this Serializer instance.
31149
+ * Overrides previous prefixes if any
31150
+ * @param namespaces
31151
+ * @return {Serializer}
31152
+ */
30478
31153
  }, {
30479
31154
  key: "setNamespaces",
30480
31155
  value: function setNamespaces(namespaces) {
@@ -30483,6 +31158,11 @@ var Serializer = /* @__PURE__ */ function() {
30483
31158
  }
30484
31159
  return this;
30485
31160
  }
31161
+ /**
31162
+ * Defines a namespace prefix, overriding any existing prefix for that URI
31163
+ * @param prefix
31164
+ * @param uri
31165
+ */
30486
31166
  }, {
30487
31167
  key: "setPrefix",
30488
31168
  value: function setPrefix(prefix, uri) {
@@ -30499,6 +31179,11 @@ var Serializer = /* @__PURE__ */ function() {
30499
31179
  this.prefixes[uri] = prefix;
30500
31180
  this.namespaces[prefix] = uri;
30501
31181
  }
31182
+ /* Accumulate Namespaces
31183
+ **
31184
+ ** These are only hints. If two overlap, only one gets used
31185
+ ** There is therefore no guarantee in general.
31186
+ */
30502
31187
  }, {
30503
31188
  key: "suggestPrefix",
30504
31189
  value: function suggestPrefix(prefix, uri) {
@@ -30513,6 +31198,7 @@ var Serializer = /* @__PURE__ */ function() {
30513
31198
  this.prefixes[uri] = prefix;
30514
31199
  this.namespaces[prefix] = uri;
30515
31200
  }
31201
+ // Takes a namespace -> prefix map
30516
31202
  }, {
30517
31203
  key: "suggestNamespaces",
30518
31204
  value: function suggestNamespaces(namespaces) {
@@ -30536,6 +31222,7 @@ var Serializer = /* @__PURE__ */ function() {
30536
31222
  }
30537
31223
  }
30538
31224
  }
31225
+ // Make up an unused prefix for a random namespace
30539
31226
  }, {
30540
31227
  key: "makeUpPrefix",
30541
31228
  value: function makeUpPrefix(uri) {
@@ -30638,6 +31325,7 @@ var Serializer = /* @__PURE__ */ function() {
30638
31325
  "incoming": incoming
30639
31326
  };
30640
31327
  }
31328
+ // //////////////////////////////////////////////////////
30641
31329
  }, {
30642
31330
  key: "toN3",
30643
31331
  value: function toN3(f) {
@@ -30776,7 +31464,8 @@ var Serializer = /* @__PURE__ */ function() {
30776
31464
  continue;
30777
31465
  }
30778
31466
  }
30779
- if (lastLength < indent * level + 4 || lastLength + branch.length + 1 < width && ";.".indexOf(str[str.length - 2]) < 0) {
31467
+ if (lastLength < indent * level + 4 || // if new line not necessary
31468
+ lastLength + branch.length + 1 < width && ";.".indexOf(str[str.length - 2]) < 0) {
30780
31469
  str = str.slice(0, -1) + " " + branch + "\n";
30781
31470
  lastLength += branch.length + 1;
30782
31471
  } else {
@@ -30884,6 +31573,8 @@ var Serializer = /* @__PURE__ */ function() {
30884
31573
  var tree = statementListToTree(sts);
30885
31574
  return prefixDirectives() + treeToString(tree);
30886
31575
  }
31576
+ // //////////////////////////////////////////// Atomic Terms
31577
+ // Deal with term level things and nesting with no bnode structure
30887
31578
  }, {
30888
31579
  key: "atomicTermToN3",
30889
31580
  value: function atomicTermToN3(expr, stats) {
@@ -30931,6 +31622,7 @@ var Serializer = /* @__PURE__ */ function() {
30931
31622
  throw new Error("Internal: atomicTermToN3 cannot handle " + expr + " of termType: " + expr.termType);
30932
31623
  }
30933
31624
  }
31625
+ // stringToN3: String escaping for N3
30934
31626
  }, {
30935
31627
  key: "stringToN3",
30936
31628
  value: function stringToN3(str, flags) {
@@ -30940,7 +31632,10 @@ var Serializer = /* @__PURE__ */ function() {
30940
31632
  var i, j, k;
30941
31633
  var delim;
30942
31634
  var forbidden;
30943
- if (str.length > 20 && str.slice(-1) !== '"' && flags.indexOf("n") < 0 && (str.indexOf("\n") > 0 || str.indexOf('"') > 0)) {
31635
+ if (str.length > 20 && // Long enough to make sense
31636
+ str.slice(-1) !== '"' && // corner case'
31637
+ flags.indexOf("n") < 0 && // Force single line
31638
+ (str.indexOf("\n") > 0 || str.indexOf('"') > 0)) {
30944
31639
  delim = '"""';
30945
31640
  forbidden = this.forbidden3;
30946
31641
  } else {
@@ -30973,6 +31668,7 @@ var Serializer = /* @__PURE__ */ function() {
30973
31668
  }
30974
31669
  return delim + res + str.slice(i) + delim;
30975
31670
  }
31671
+ // A single symbol, either in <> or namespace notation
30976
31672
  }, {
30977
31673
  key: "symbolToN3",
30978
31674
  value: function symbolToN3(x) {
@@ -30981,7 +31677,8 @@ var Serializer = /* @__PURE__ */ function() {
30981
31677
  if (j < 0 && this.flags.indexOf("/") < 0) {
30982
31678
  j = uri.lastIndexOf("/");
30983
31679
  }
30984
- if (j >= 0 && this.flags.indexOf("p") < 0 && (uri.indexOf("http") === 0 || uri.indexOf("ws") === 0 || uri.indexOf("file") === 0)) {
31680
+ if (j >= 0 && this.flags.indexOf("p") < 0 && // Can split at namespace but only if http[s]: URI or file: or ws[s] (why not others?)
31681
+ (uri.indexOf("http") === 0 || uri.indexOf("ws") === 0 || uri.indexOf("file") === 0)) {
30985
31682
  var canSplit = true;
30986
31683
  for (var k = j + 1; k < uri.length; k++) {
30987
31684
  if (this._notNameChars.indexOf(uri[k]) >= 0) {
@@ -31009,6 +31706,9 @@ var Serializer = /* @__PURE__ */ function() {
31009
31706
  }
31010
31707
  return this.explicitURI(uri);
31011
31708
  }
31709
+ // /////////////////////////// Quad store serialization
31710
+ // @para. write - a function taking a single string to be output
31711
+ //
31012
31712
  }, {
31013
31713
  key: "writeStore",
31014
31714
  value: function writeStore(write) {
@@ -31037,6 +31737,7 @@ var Serializer = /* @__PURE__ */ function() {
31037
31737
  });
31038
31738
  write(this.statementsToN3(metadata));
31039
31739
  }
31740
+ // ////////////////////////////////////////////// XML serialization
31040
31741
  }, {
31041
31742
  key: "statementsToXML",
31042
31743
  value: function statementsToXML(sts) {
@@ -31275,6 +31976,7 @@ var Serializer = /* @__PURE__ */ function() {
31275
31976
  var tree2 = [str, tree, "</rdf:RDF>"];
31276
31977
  return XMLtreeToString(tree2, -1);
31277
31978
  }
31979
+ // End @@ body
31278
31980
  }]);
31279
31981
  return Serializer2;
31280
31982
  }();
@@ -31539,16 +32241,27 @@ var Formula = /* @__PURE__ */ function(_Node) {
31539
32241
  }
31540
32242
  return this.statements.push(this.rdfFactory.quad(subject, predicate, object, graph3));
31541
32243
  }
32244
+ /** Add a statment object
32245
+ * @param {Statement} statement - An existing constructed statement to add
32246
+ */
31542
32247
  }, {
31543
32248
  key: "addStatement",
31544
32249
  value: function addStatement(statement) {
31545
32250
  return this.add(statement);
31546
32251
  }
32252
+ /**
32253
+ * Shortcut for adding blankNodes
32254
+ * @param [id]
32255
+ */
31547
32256
  }, {
31548
32257
  key: "bnode",
31549
32258
  value: function bnode(id3) {
31550
32259
  return this.rdfFactory.blankNode(id3);
31551
32260
  }
32261
+ /**
32262
+ * Adds all the statements to this formula
32263
+ * @param statements - A collection of statements
32264
+ */
31552
32265
  }, {
31553
32266
  key: "addAll",
31554
32267
  value: function addAll(statements) {
@@ -31557,6 +32270,18 @@ var Formula = /* @__PURE__ */ function(_Node) {
31557
32270
  _this3.add(quad5.subject, quad5.predicate, quad5.object, quad5.graph);
31558
32271
  });
31559
32272
  }
32273
+ /** Follow link from one node, using one wildcard, looking for one
32274
+ *
32275
+ * For example, any(me, knows, null, profile) - a person I know accoring to my profile .
32276
+ * any(me, knows, null, null) - a person I know accoring to anything in store .
32277
+ * any(null, knows, me, null) - a person who know me accoring to anything in store .
32278
+ *
32279
+ * @param s - A node to search for as subject, or if null, a wildcard
32280
+ * @param p - A node to search for as predicate, or if null, a wildcard
32281
+ * @param o - A node to search for as object, or if null, a wildcard
32282
+ * @param g - A node to search for as graph, or if null, a wildcard
32283
+ * @returns A node which match the wildcard position, or null
32284
+ */
31560
32285
  }, {
31561
32286
  key: "any",
31562
32287
  value: function any(s, p, o, g) {
@@ -31572,18 +32297,35 @@ var Formula = /* @__PURE__ */ function(_Node) {
31572
32297
  }
31573
32298
  return null;
31574
32299
  }
32300
+ /**
32301
+ * Gets the value of a node that matches the specified pattern
32302
+ * @param s The subject
32303
+ * @param p The predicate
32304
+ * @param o The object
32305
+ * @param g The graph that contains the statement
32306
+ */
31575
32307
  }, {
31576
32308
  key: "anyValue",
31577
32309
  value: function anyValue(s, p, o, g) {
31578
32310
  var y = this.any(s, p, o, g);
31579
32311
  return y ? y.value : void 0;
31580
32312
  }
32313
+ /**
32314
+ * Gets the first JavaScript object equivalent to a node based on the specified pattern
32315
+ * @param s The subject
32316
+ * @param p The predicate
32317
+ * @param o The object
32318
+ * @param g The graph that contains the statement
32319
+ */
31581
32320
  }, {
31582
32321
  key: "anyJS",
31583
32322
  value: function anyJS(s, p, o, g) {
31584
32323
  var y = this.any(s, p, o, g);
31585
32324
  return y ? Node2.toJS(y) : void 0;
31586
32325
  }
32326
+ /**
32327
+ * Gets the first statement that matches the specified pattern
32328
+ */
31587
32329
  }, {
31588
32330
  key: "anyStatementMatching",
31589
32331
  value: function anyStatementMatching(s, p, o, g) {
@@ -31593,11 +32335,27 @@ var Formula = /* @__PURE__ */ function(_Node) {
31593
32335
  }
31594
32336
  return x[0];
31595
32337
  }
32338
+ /**
32339
+ * Returns a unique index-safe identifier for the given term.
32340
+ *
32341
+ * Falls back to the rdflib hashString implementation if the given factory doesn't support id.
32342
+ */
31596
32343
  }, {
31597
32344
  key: "id",
31598
32345
  value: function id3(term2) {
31599
32346
  return this.rdfFactory.id(term2);
31600
32347
  }
32348
+ /**
32349
+ * Search the Store
32350
+ * This is really a teaching method as to do this properly you would use IndexedFormula
32351
+ *
32352
+ * @param s - A node to search for as subject, or if null, a wildcard
32353
+ * @param p - A node to search for as predicate, or if null, a wildcard
32354
+ * @param o - A node to search for as object, or if null, a wildcard
32355
+ * @param g - A node to search for as graph, or if null, a wildcard
32356
+ * @param justOne - flag - stop when found one rather than get all of them?
32357
+ * @returns {Array<Node>} - An array of nodes which match the wildcard position
32358
+ */
31601
32359
  }, {
31602
32360
  key: "statementsMatching",
31603
32361
  value: function statementsMatching(s, p, o, g, justOne) {
@@ -31609,6 +32367,13 @@ var Formula = /* @__PURE__ */ function(_Node) {
31609
32367
  }
31610
32368
  return sts;
31611
32369
  }
32370
+ /**
32371
+ * Finds the types in the list which have no *stored* subtypes
32372
+ * These are a set of classes which provide by themselves complete
32373
+ * information -- the other classes are redundant for those who
32374
+ * know the class DAG.
32375
+ * @param types A map of the types
32376
+ */
31612
32377
  }, {
31613
32378
  key: "bottomTypeURIs",
31614
32379
  value: function bottomTypeURIs(types2) {
@@ -31642,11 +32407,24 @@ var Formula = /* @__PURE__ */ function(_Node) {
31642
32407
  }
31643
32408
  return bots;
31644
32409
  }
32410
+ /** Creates a new collection */
31645
32411
  }, {
31646
32412
  key: "collection",
31647
32413
  value: function collection2() {
31648
32414
  return new Collection();
31649
32415
  }
32416
+ /** Follow links from one node, using one wildcard.
32417
+ *
32418
+ * For example, each(me, knows, null, profile) - people I know accoring to my profile .
32419
+ * each(me, knows, null, null) - people I know accoring to anything in store .
32420
+ * each(null, knows, me, null) - people who know me accoring to anything in store .
32421
+ *
32422
+ * @param s - A node to search for as subject, or if null, a wildcard
32423
+ * @param p - A node to search for as predicate, or if null, a wildcard
32424
+ * @param o - A node to search for as object, or if null, a wildcard
32425
+ * @param g - A node to search for as graph, or if null, a wildcard
32426
+ * @returns {Array<Node>} - An array of nodes which match the wildcard position
32427
+ */
31650
32428
  }, {
31651
32429
  key: "each",
31652
32430
  value: function each2(s, p, o, g) {
@@ -31671,6 +32449,10 @@ var Formula = /* @__PURE__ */ function(_Node) {
31671
32449
  }
31672
32450
  return results;
31673
32451
  }
32452
+ /**
32453
+ * Test whether this formula is equals to {other}
32454
+ * @param other - The other formula
32455
+ */
31674
32456
  }, {
31675
32457
  key: "equals",
31676
32458
  value: function equals2(other) {
@@ -31679,6 +32461,15 @@ var Formula = /* @__PURE__ */ function(_Node) {
31679
32461
  }
31680
32462
  return this.hashString() === other.hashString();
31681
32463
  }
32464
+ /**
32465
+ * For thisClass or any subclass, anything which has it is its type
32466
+ * or is the object of something which has the type as its range, or subject
32467
+ * of something which has the type as its domain
32468
+ * We don't bother doing subproperty (yet?)as it doesn't seeem to be used
32469
+ * much.
32470
+ * Get all the Classes of which we can RDFS-infer the subject is a member
32471
+ * @return a hash of URIs
32472
+ */
31682
32473
  }, {
31683
32474
  key: "findMembersNT",
31684
32475
  value: function findMembersNT(thisClass) {
@@ -31729,11 +32520,27 @@ var Formula = /* @__PURE__ */ function(_Node) {
31729
32520
  }
31730
32521
  return members;
31731
32522
  }
32523
+ /**
32524
+ * For thisClass or any subclass, anything which has it is its type
32525
+ * or is the object of something which has the type as its range, or subject
32526
+ * of something which has the type as its domain
32527
+ * We don't bother doing subproperty (yet?)as it doesn't seeem to be used
32528
+ * much.
32529
+ * Get all the Classes of which we can RDFS-infer the subject is a member
32530
+ * @param subject - A named node
32531
+ */
31732
32532
  }, {
31733
32533
  key: "findMemberURIs",
31734
32534
  value: function findMemberURIs(subject) {
31735
32535
  return this.NTtoURI(this.findMembersNT(subject));
31736
32536
  }
32537
+ /**
32538
+ * Get all the Classes of which we can RDFS-infer the subject is a superclass
32539
+ * Returns a hash table where key is NT of type and value is statement why we
32540
+ * think so.
32541
+ * Does NOT return terms, returns URI strings.
32542
+ * We use NT representations in this version because they handle blank nodes.
32543
+ */
31737
32544
  }, {
31738
32545
  key: "findSubClassesNT",
31739
32546
  value: function findSubClassesNT(subject) {
@@ -31741,6 +32548,14 @@ var Formula = /* @__PURE__ */ function(_Node) {
31741
32548
  types2[subject.toNT()] = true;
31742
32549
  return this.transitiveClosure(types2, this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"), true);
31743
32550
  }
32551
+ /**
32552
+ * Get all the Classes of which we can RDFS-infer the subject is a subclass
32553
+ * @param {RDFlibNamedNode} subject - The thing whose classes are to be found
32554
+ * @returns a hash table where key is NT of type and value is statement why we
32555
+ * think so.
32556
+ * Does NOT return terms, returns URI strings.
32557
+ * We use NT representations in this version because they handle blank nodes.
32558
+ */
31744
32559
  }, {
31745
32560
  key: "findSuperClassesNT",
31746
32561
  value: function findSuperClassesNT(subject) {
@@ -31748,6 +32563,15 @@ var Formula = /* @__PURE__ */ function(_Node) {
31748
32563
  types2[subject.toNT()] = true;
31749
32564
  return this.transitiveClosure(types2, this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"), false);
31750
32565
  }
32566
+ /**
32567
+ * Get all the Classes of which we can RDFS-infer the subject is a member
32568
+ * todo: This will loop is there is a class subclass loop (Sublass loops are
32569
+ * not illegal)
32570
+ * @param {RDFlibNamedNode} subject - The thing whose classes are to be found
32571
+ * @returns a hash table where key is NT of type and value is statement why we think so.
32572
+ * Does NOT return terms, returns URI strings.
32573
+ * We use NT representations in this version because they handle blank nodes.
32574
+ */
31751
32575
  }, {
31752
32576
  key: "findTypesNT",
31753
32577
  value: function findTypesNT(subject) {
@@ -31786,11 +32610,27 @@ var Formula = /* @__PURE__ */ function(_Node) {
31786
32610
  }
31787
32611
  return this.transitiveClosure(types2, this.rdfFactory.namedNode("http://www.w3.org/2000/01/rdf-schema#subClassOf"), false);
31788
32612
  }
32613
+ /**
32614
+ * Get all the Classes of which we can RDFS-infer the subject is a member
32615
+ * todo: This will loop is there is a class subclass loop (Sublass loops are
32616
+ * not illegal)
32617
+ * Returns a hash table where key is NT of type and value is statement why we
32618
+ * think so.
32619
+ * Does NOT return terms, returns URI strings.
32620
+ * We use NT representations in this version because they handle blank nodes.
32621
+ * @param subject - A subject node
32622
+ */
31789
32623
  }, {
31790
32624
  key: "findTypeURIs",
31791
32625
  value: function findTypeURIs(subject) {
31792
32626
  return this.NTtoURI(this.findTypesNT(subject));
31793
32627
  }
32628
+ /** Trace statements which connect directly, or through bnodes
32629
+ *
32630
+ * @param subject - The node to start looking for statments
32631
+ * @param doc - The document to be searched, or null to search all documents
32632
+ * @returns an array of statements, duplicate statements are suppresssed.
32633
+ */
31794
32634
  }, {
31795
32635
  key: "connectedStatements",
31796
32636
  value: function connectedStatements(subject, doc, excludePredicateURIs) {
@@ -31828,11 +32668,22 @@ var Formula = /* @__PURE__ */ function(_Node) {
31828
32668
  }
31829
32669
  return result;
31830
32670
  }
32671
+ /**
32672
+ * Creates a new empty formula
32673
+ *
32674
+ * @param _features - Not applicable, but necessary for typing to pass
32675
+ */
31831
32676
  }, {
31832
32677
  key: "formula",
31833
32678
  value: function formula2(_features) {
31834
32679
  return new Formula2();
31835
32680
  }
32681
+ /**
32682
+ * Transforms an NTriples string format into a Node.
32683
+ * The blank node bit should not be used on program-external values; designed
32684
+ * for internal work such as storing a blank node id in an HTML attribute.
32685
+ * This will only parse the strings generated by the various toNT() methods.
32686
+ */
31836
32687
  }, {
31837
32688
  key: "fromNT",
31838
32689
  value: function fromNT(str) {
@@ -31865,6 +32716,7 @@ var Formula = /* @__PURE__ */ function(_Node) {
31865
32716
  }
31866
32717
  throw new Error("Can't convert from NT: " + str);
31867
32718
  }
32719
+ /** Returns true if this formula holds the specified statement(s) */
31868
32720
  }, {
31869
32721
  key: "holds",
31870
32722
  value: function holds(s, p, o, g) {
@@ -31889,11 +32741,20 @@ var Formula = /* @__PURE__ */ function(_Node) {
31889
32741
  var st3 = this.anyStatementMatching(s, p, o, g);
31890
32742
  return st3 != null;
31891
32743
  }
32744
+ /**
32745
+ * Returns true if this formula holds the specified {statement}
32746
+ */
31892
32747
  }, {
31893
32748
  key: "holdsStatement",
31894
32749
  value: function holdsStatement(statement) {
31895
32750
  return this.holds(statement.subject, statement.predicate, statement.object, statement.graph);
31896
32751
  }
32752
+ /**
32753
+ * Used by the n3parser to generate list elements
32754
+ * @param values - The values of the collection
32755
+ * @param context - The store
32756
+ * @return {BlankNode|Collection} - The term for the statement
32757
+ */
31897
32758
  }, {
31898
32759
  key: "list",
31899
32760
  value: function list(values, context) {
@@ -31910,6 +32771,12 @@ var Formula = /* @__PURE__ */ function(_Node) {
31910
32771
  return node;
31911
32772
  }
31912
32773
  }
32774
+ /**
32775
+ * Transform a collection of NTriple URIs into their URI strings
32776
+ * @param t - Some iterable collection of NTriple URI strings
32777
+ * @return A collection of the URIs as strings
32778
+ * todo: explain why it is important to go through NT
32779
+ */
31913
32780
  }, {
31914
32781
  key: "NTtoURI",
31915
32782
  value: function NTtoURI(t) {
@@ -31925,11 +32792,22 @@ var Formula = /* @__PURE__ */ function(_Node) {
31925
32792
  }
31926
32793
  return uris;
31927
32794
  }
32795
+ /**
32796
+ * Serializes this formula
32797
+ * @param base - The base string
32798
+ * @param contentType - The content type of the syntax to use
32799
+ * @param provenance - The provenance URI
32800
+ * @param options - options to pass to the serializer, as defined in serialize method
32801
+ */
31928
32802
  }, {
31929
32803
  key: "serialize",
31930
32804
  value: function serialize2(base, contentType, provenance, options) {
31931
32805
  return serialize(provenance, this, base, contentType, void 0, options);
31932
32806
  }
32807
+ /**
32808
+ * Creates a new formula with the substituting bindings applied
32809
+ * @param bindings - The bindings to substitute
32810
+ */
31933
32811
  }, {
31934
32812
  key: "substitute",
31935
32813
  value: function substitute(bindings) {
@@ -31950,6 +32828,13 @@ var Formula = /* @__PURE__ */ function(_Node) {
31950
32828
  }
31951
32829
  return this.rdfFactory.namedNode(uri);
31952
32830
  }
32831
+ /**
32832
+ * Gets the node matching the specified pattern. Throws when no match could be made.
32833
+ * @param s - The subject
32834
+ * @param p - The predicate
32835
+ * @param o - The object
32836
+ * @param g - The graph that contains the statement
32837
+ */
31953
32838
  }, {
31954
32839
  key: "the",
31955
32840
  value: function the(s, p, o, g) {
@@ -31959,6 +32844,14 @@ var Formula = /* @__PURE__ */ function(_Node) {
31959
32844
  }
31960
32845
  return x;
31961
32846
  }
32847
+ /**
32848
+ * RDFS Inference
32849
+ * These are hand-written implementations of a backward-chaining reasoner
32850
+ * over the RDFS axioms.
32851
+ * @param seeds - A hash of NTs of classes to start with
32852
+ * @param predicate - The property to trace though
32853
+ * @param inverse - Trace inverse direction
32854
+ */
31962
32855
  }, {
31963
32856
  key: "transitiveClosure",
31964
32857
  value: function transitiveClosure(seeds, predicate, inverse) {
@@ -31993,6 +32886,12 @@ var Formula = /* @__PURE__ */ function(_Node) {
31993
32886
  delete agenda[t];
31994
32887
  }
31995
32888
  }
32889
+ /**
32890
+ * Finds the types in the list which have no *stored* supertypes
32891
+ * We exclude the universal class, owl:Things and rdf:Resource, as it is
32892
+ * information-free.
32893
+ * @param types - The types
32894
+ */
31996
32895
  }, {
31997
32896
  key: "topTypeURIs",
31998
32897
  value: function topTypeURIs(types2) {
@@ -32030,16 +32929,30 @@ var Formula = /* @__PURE__ */ function(_Node) {
32030
32929
  }
32031
32930
  return tops;
32032
32931
  }
32932
+ /**
32933
+ * Serializes this formula to a string
32934
+ */
32033
32935
  }, {
32034
32936
  key: "toString",
32035
32937
  value: function toString() {
32036
32938
  return "{" + this.statements.join("\n") + "}";
32037
32939
  }
32940
+ /**
32941
+ * Gets a new variable
32942
+ * @param name - The variable's name
32943
+ */
32038
32944
  }, {
32039
32945
  key: "variable",
32040
32946
  value: function variable4(name) {
32041
32947
  return new Variable2(name);
32042
32948
  }
32949
+ /**
32950
+ * Gets the number of statements in this formula that matches the specified pattern
32951
+ * @param s - The subject
32952
+ * @param p - The predicate
32953
+ * @param o - The object
32954
+ * @param g - The graph that contains the statement
32955
+ */
32043
32956
  }, {
32044
32957
  key: "whether",
32045
32958
  value: function whether(s, p, o, g) {
@@ -32345,6 +33258,7 @@ function indexedFormulaQuery(myQuery, callback, fetcher3, onDone) {
32345
33258
  bindingsSoFar,
32346
33259
  level,
32347
33260
  fetcher4,
33261
+ // match not match2 to look up any others necessary.
32348
33262
  localCallback,
32349
33263
  branch
32350
33264
  );
@@ -32632,7 +33546,13 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32632
33546
  _this.whyIndex = [];
32633
33547
  _this.index = [_this.subjectIndex, _this.predicateIndex, _this.objectIndex, _this.whyIndex];
32634
33548
  _this.namespaces = {};
32635
- _this.features = features || [];
33549
+ _this.features = features || [
33550
+ // By default, devs do not expect these features.
33551
+ // See https://github.com/linkeddata/rdflib.js/issues/458
33552
+ // 'sameAs',
33553
+ // 'InverseFunctionalProperty',
33554
+ // 'FunctionalProperty',
33555
+ ];
32636
33556
  _this.rdfArrayRemove = opts.rdfArrayRemove || RDFArrayRemove;
32637
33557
  if (opts.dataCallback) {
32638
33558
  _this.dataCallbacks = [opts.dataCallback];
@@ -32642,14 +33562,24 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32642
33562
  }
32643
33563
  _createClass(IndexedFormula5, [{
32644
33564
  key: "substitute",
32645
- value: function substitute(bindings) {
32646
- var statementsCopy = this.statements.map(function(ea) {
32647
- return ea.substitute(bindings);
32648
- });
32649
- var y = new IndexedFormula5();
32650
- y.add(statementsCopy);
32651
- return y;
32652
- }
33565
+ value: (
33566
+ /**
33567
+ * Gets this graph with the bindings substituted
33568
+ * @param bindings The bindings
33569
+ */
33570
+ function substitute(bindings) {
33571
+ var statementsCopy = this.statements.map(function(ea) {
33572
+ return ea.substitute(bindings);
33573
+ });
33574
+ var y = new IndexedFormula5();
33575
+ y.add(statementsCopy);
33576
+ return y;
33577
+ }
33578
+ )
33579
+ /**
33580
+ * Add a callback which will be triggered after a statement has been added to the store.
33581
+ * @param cb
33582
+ */
32653
33583
  }, {
32654
33584
  key: "addDataCallback",
32655
33585
  value: function addDataCallback(cb) {
@@ -32658,6 +33588,13 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32658
33588
  }
32659
33589
  this.dataCallbacks.push(cb);
32660
33590
  }
33591
+ /**
33592
+ * Apply a set of statements to be deleted and to be inserted
33593
+ *
33594
+ * @param patch - The set of statements to be deleted and to be inserted
33595
+ * @param target - The name of the document to patch
33596
+ * @param patchCallback - Callback to be called when patching is complete
33597
+ */
32661
33598
  }, {
32662
33599
  key: "applyPatch",
32663
33600
  value: function applyPatch(patch, target, patchCallback) {
@@ -32723,6 +33660,11 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32723
33660
  doPatch(patchCallback);
32724
33661
  }
32725
33662
  }
33663
+ /**
33664
+ * N3 allows for declaring blank nodes, this function enables that support
33665
+ *
33666
+ * @param x The blank node to be declared, supported in N3
33667
+ */
32726
33668
  }, {
32727
33669
  key: "declareExistential",
32728
33670
  value: function declareExistential(x) {
@@ -32731,6 +33673,9 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32731
33673
  this._existentialVariables.push(x);
32732
33674
  return x;
32733
33675
  }
33676
+ /**
33677
+ * @param features
33678
+ */
32734
33679
  }, {
32735
33680
  key: "initPropertyActions",
32736
33681
  value: function initPropertyActions(features) {
@@ -32752,12 +33697,23 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32752
33697
  }];
32753
33698
  }
32754
33699
  }
33700
+ /** @deprecated Use {add} instead */
32755
33701
  }, {
32756
33702
  key: "addStatement",
32757
33703
  value: function addStatement(st3) {
32758
33704
  this.add(st3.subject, st3.predicate, st3.object, st3.graph);
32759
33705
  return this.statements.length;
32760
33706
  }
33707
+ /**
33708
+ * Adds a triple (quad) to the store.
33709
+ *
33710
+ * @param subj - The thing about which the fact a relationship is asserted.
33711
+ * Also accepts a statement or an array of Statements.
33712
+ * @param pred - The relationship which is asserted
33713
+ * @param obj - The object of the relationship, e.g. another thing or a value. If passed a string, this will become a literal.
33714
+ * @param why - The document in which the triple (S,P,O) was or will be stored on the web
33715
+ * @returns The statement added to the store, or the store
33716
+ */
32761
33717
  }, {
32762
33718
  key: "add",
32763
33719
  value: function add(subj, pred, obj, why) {
@@ -32837,6 +33793,10 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32837
33793
  }
32838
33794
  return st3;
32839
33795
  }
33796
+ /**
33797
+ * Returns the symbol with canonical URI as smushed
33798
+ * @param term - An RDF node
33799
+ */
32840
33800
  }, {
32841
33801
  key: "canon",
32842
33802
  value: function canon(term2) {
@@ -32868,6 +33828,9 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32868
33828
  throw new Error("Term Type not recognized for canonization: ".concat(term2.termType));
32869
33829
  }
32870
33830
  }
33831
+ /**
33832
+ * Checks this formula for consistency
33833
+ */
32871
33834
  }, {
32872
33835
  key: "check",
32873
33836
  value: function check2() {
@@ -32881,6 +33844,11 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32881
33844
  }
32882
33845
  }
32883
33846
  }
33847
+ /**
33848
+ * Checks a list of statements for consistency
33849
+ * @param sts - The list of statements to check
33850
+ * @param from - An index with the array ['subject', 'predicate', 'object', 'why']
33851
+ */
32884
33852
  }, {
32885
33853
  key: "checkStatementList",
32886
33854
  value: function checkStatementList(sts, from) {
@@ -32914,6 +33882,9 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32914
33882
  }
32915
33883
  }
32916
33884
  }
33885
+ /**
33886
+ * Closes this formula (and return it)
33887
+ */
32917
33888
  }, {
32918
33889
  key: "close",
32919
33890
  value: function close() {
@@ -32939,6 +33910,13 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32939
33910
  }
32940
33911
  return 0;
32941
33912
  }
33913
+ /**
33914
+ * replaces @template with @target and add appropriate triples
33915
+ * removes no triples by default and is a one-direction replication
33916
+ * @param template node to copy
33917
+ * @param target node to copy to
33918
+ * @param flags Whether or not to do a two-directional copy and/or delete triples
33919
+ */
32942
33920
  }, {
32943
33921
  key: "copyTo",
32944
33922
  value: function copyTo(template, target, flags) {
@@ -32964,6 +33942,12 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32964
33942
  }
32965
33943
  }
32966
33944
  }
33945
+ /**
33946
+ * Simplify graph in store when we realize two identifiers are equivalent
33947
+ * We replace the bigger with the smaller.
33948
+ * @param u1in The first node
33949
+ * @param u2in The second node
33950
+ */
32967
33951
  }, {
32968
33952
  key: "equate",
32969
33953
  value: function equate(u1in, u2in) {
@@ -32979,27 +33963,59 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
32979
33963
  return this.replaceWith(u1, u2);
32980
33964
  }
32981
33965
  }
33966
+ /**
33967
+ * Creates a new empty indexed formula
33968
+ * Only applicable for IndexedFormula, but TypeScript won't allow a subclass to override a property
33969
+ * @param features The list of features
33970
+ */
32982
33971
  }, {
32983
33972
  key: "formula",
32984
33973
  value: function formula2(features) {
32985
33974
  return new IndexedFormula5(features);
32986
33975
  }
33976
+ /**
33977
+ * Returns the number of statements contained in this IndexedFormula.
33978
+ * (Getter proxy to this.statements).
33979
+ * Usage:
33980
+ * ```
33981
+ * var kb = rdf.graph()
33982
+ * kb.length // -> 0
33983
+ * ```
33984
+ * @returns {Number}
33985
+ */
32987
33986
  }, {
32988
33987
  key: "length",
32989
33988
  get: function get() {
32990
33989
  return this.statements.length;
32991
33990
  }
33991
+ /**
33992
+ * Returns any quads matching the given arguments.
33993
+ * Standard RDFJS spec method for Source objects, implemented as an
33994
+ * alias to `statementsMatching()`
33995
+ * @param subject The subject
33996
+ * @param predicate The predicate
33997
+ * @param object The object
33998
+ * @param graph The graph that contains the statement
33999
+ */
32992
34000
  }, {
32993
34001
  key: "match",
32994
34002
  value: function match(subject, predicate, object, graph3) {
32995
34003
  return this.statementsMatching(node_default.fromValue(subject), node_default.fromValue(predicate), node_default.fromValue(object), node_default.fromValue(graph3));
32996
34004
  }
34005
+ /**
34006
+ * Find out whether a given URI is used as symbol in the formula
34007
+ * @param uri The URI to look for
34008
+ */
32997
34009
  }, {
32998
34010
  key: "mentionsURI",
32999
34011
  value: function mentionsURI(uri) {
33000
34012
  var hash = "<" + uri + ">";
33001
34013
  return !!this.subjectIndex[hash] || !!this.objectIndex[hash] || !!this.predicateIndex[hash];
33002
34014
  }
34015
+ /**
34016
+ * Existentials are BNodes - something exists without naming
34017
+ * @param uri An URI
34018
+ */
33003
34019
  }, {
33004
34020
  key: "newExistential",
33005
34021
  value: function newExistential(uri) {
@@ -33008,6 +34024,11 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33008
34024
  var x = this.sym(uri);
33009
34025
  return this.declareExistential(x);
33010
34026
  }
34027
+ /**
34028
+ * Adds a new property action
34029
+ * @param pred the predicate that the function should be triggered on
34030
+ * @param action the function that should trigger
34031
+ */
33011
34032
  }, {
33012
34033
  key: "newPropertyAction",
33013
34034
  value: function newPropertyAction(pred, action) {
@@ -33023,6 +34044,11 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33023
34044
  }
33024
34045
  return done;
33025
34046
  }
34047
+ /**
34048
+ * Creates a new universal node
34049
+ * Universals are Variables
34050
+ * @param uri An URI
34051
+ */
33026
34052
  }, {
33027
34053
  key: "newUniversal",
33028
34054
  value: function newUniversal(uri) {
@@ -33032,11 +34058,17 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33032
34058
  this._universalVariables.push(x);
33033
34059
  return x;
33034
34060
  }
34061
+ // convenience function used by N3 parser
33035
34062
  }, {
33036
34063
  key: "variable",
33037
34064
  value: function variable4(name) {
33038
34065
  return new Variable2(name);
33039
34066
  }
34067
+ /**
34068
+ * Find an unused id for a file being edited: return a symbol
34069
+ * (Note: Slow iff a lot of them -- could be O(log(k)) )
34070
+ * @param doc A document named node
34071
+ */
33040
34072
  }, {
33041
34073
  key: "nextSymbol",
33042
34074
  value: function nextSymbol(doc) {
@@ -33046,11 +34078,24 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33046
34078
  return this.sym(uri);
33047
34079
  }
33048
34080
  }
34081
+ /**
34082
+ * Query this store asynchronously, return bindings in callback
34083
+ *
34084
+ * @param myQuery The query to be run
34085
+ * @param callback Function to call when bindings
34086
+ * @param Fetcher | null If you want the query to do link following
34087
+ * @param onDone OBSOLETE - do not use this // @@ Why not ?? Called when query complete
34088
+ */
33049
34089
  }, {
33050
34090
  key: "query",
33051
34091
  value: function query(myQuery, callback, fetcher3, onDone) {
33052
34092
  return indexedFormulaQuery.call(this, myQuery, callback, fetcher3, onDone);
33053
34093
  }
34094
+ /**
34095
+ * Query this store synchronously and return bindings
34096
+ *
34097
+ * @param myQuery The query to be run
34098
+ */
33054
34099
  }, {
33055
34100
  key: "querySync",
33056
34101
  value: function querySync(myQuery) {
@@ -33069,6 +34114,10 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33069
34114
  }
33070
34115
  return results;
33071
34116
  }
34117
+ /**
34118
+ * Removes one or multiple statement(s) from this formula
34119
+ * @param st - A Statement or array of Statements to remove
34120
+ */
33072
34121
  }, {
33073
34122
  key: "remove",
33074
34123
  value: function remove(st3) {
@@ -33088,6 +34137,10 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33088
34137
  this.removeStatement(sts[0]);
33089
34138
  return this;
33090
34139
  }
34140
+ /**
34141
+ * Removes all statements in a doc
34142
+ * @param doc - The document / graph
34143
+ */
33091
34144
  }, {
33092
34145
  key: "removeDocument",
33093
34146
  value: function removeDocument(doc) {
@@ -33097,6 +34150,14 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33097
34150
  }
33098
34151
  return this;
33099
34152
  }
34153
+ /**
34154
+ * Remove all statements matching args (within limit) *
34155
+ * @param subj The subject
34156
+ * @param pred The predicate
34157
+ * @param obj The object
34158
+ * @param why The graph that contains the statement
34159
+ * @param limit The number of statements to remove
34160
+ */
33100
34161
  }, {
33101
34162
  key: "removeMany",
33102
34163
  value: function removeMany(subj, pred, obj, why, limit) {
@@ -33111,12 +34172,26 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33111
34172
  this.remove(statements[i]);
33112
34173
  }
33113
34174
  }
34175
+ /**
34176
+ * Remove all matching statements
34177
+ * @param subject The subject
34178
+ * @param predicate The predicate
34179
+ * @param object The object
34180
+ * @param graph The graph that contains the statement
34181
+ */
33114
34182
  }, {
33115
34183
  key: "removeMatches",
33116
34184
  value: function removeMatches(subject, predicate, object, graph3) {
33117
34185
  this.removeMany(subject, predicate, object, graph3);
33118
34186
  return this;
33119
34187
  }
34188
+ /**
34189
+ * Remove a particular statement object from the store
34190
+ *
34191
+ * @param st - a statement which is already in the store and indexed.
34192
+ * Make sure you only use this for these.
34193
+ * Otherwise, you should use remove() above.
34194
+ */
33120
34195
  }, {
33121
34196
  key: "removeStatement",
33122
34197
  value: function removeStatement(st3) {
@@ -33132,6 +34207,10 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33132
34207
  this.rdfArrayRemove(this.statements, st3);
33133
34208
  return this;
33134
34209
  }
34210
+ /**
34211
+ * Removes statements
34212
+ * @param sts The statements to remove
34213
+ */
33135
34214
  }, {
33136
34215
  key: "removeStatements",
33137
34216
  value: function removeStatements(sts) {
@@ -33140,6 +34219,9 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33140
34219
  }
33141
34220
  return this;
33142
34221
  }
34222
+ /**
34223
+ * Replace big with small, obsoleted with obsoleting.
34224
+ */
33143
34225
  }, {
33144
34226
  key: "replaceWith",
33145
34227
  value: function replaceWith(big, small) {
@@ -33182,6 +34264,10 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33182
34264
  moveIndex(this.propertyActions);
33183
34265
  return true;
33184
34266
  }
34267
+ /**
34268
+ * Return all equivalent URIs by which this is known
34269
+ * @param x A named node
34270
+ */
33185
34271
  }, {
33186
34272
  key: "allAliases",
33187
34273
  value: function allAliases(x) {
@@ -33189,6 +34275,11 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33189
34275
  a.push(this.canon(x));
33190
34276
  return a;
33191
34277
  }
34278
+ /**
34279
+ * Compare by canonical URI as smushed
34280
+ * @param x A named node
34281
+ * @param y Another named node
34282
+ */
33192
34283
  }, {
33193
34284
  key: "sameThings",
33194
34285
  value: function sameThings(x, y) {
@@ -33218,6 +34309,16 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33218
34309
  }
33219
34310
  this.namespaces[prefix] = nsuri;
33220
34311
  }
34312
+ /** Search the Store
34313
+ *
34314
+ * ALL CONVENIENCE LOOKUP FUNCTIONS RELY ON THIS!
34315
+ * @param subj - A node to search for as subject, or if null, a wildcard
34316
+ * @param pred - A node to search for as predicate, or if null, a wildcard
34317
+ * @param obj - A node to search for as object, or if null, a wildcard
34318
+ * @param why - A node to search for as graph, or if null, a wildcard
34319
+ * @param justOne - flag - stop when found one rather than get all of them?
34320
+ * @returns An array of nodes which match the wildcard position
34321
+ */
33221
34322
  }, {
33222
34323
  key: "statementsMatching",
33223
34324
  value: function statementsMatching(subj, pred, obj, why, justOne) {
@@ -33287,6 +34388,10 @@ var IndexedFormula = /* @__PURE__ */ function(_Formula) {
33287
34388
  }
33288
34389
  return results;
33289
34390
  }
34391
+ /**
34392
+ * A list of all the URIs by which this thing is known
34393
+ * @param term
34394
+ */
33290
34395
  }, {
33291
34396
  key: "uris",
33292
34397
  value: function uris(term2) {
@@ -33328,6 +34433,7 @@ function hexify2(str) {
33328
34433
  return encodeURI(str);
33329
34434
  }
33330
34435
  var Utf8 = {
34436
+ // public method for url encoding
33331
34437
  encode: function encode3(string) {
33332
34438
  string = string.replace(/\r\n/g, "\n");
33333
34439
  var utftext = "";
@@ -33346,6 +34452,7 @@ var Utf8 = {
33346
34452
  }
33347
34453
  return utftext;
33348
34454
  },
34455
+ // public method for url decoding
33349
34456
  decode: function decode3(utftext) {
33350
34457
  var string = "";
33351
34458
  var i = 0;
@@ -34704,6 +35811,10 @@ function _objectSpread2(target) {
34704
35811
  }
34705
35812
  var ExtendedTermFactory = _objectSpread2(_objectSpread2({}, canonical_data_factory_default), {}, {
34706
35813
  supports: (_supports2 = {}, _defineProperty(_supports2, Feature.collections, true), _defineProperty(_supports2, Feature.defaultGraphType, false), _defineProperty(_supports2, Feature.equalsMethod, true), _defineProperty(_supports2, Feature.identity, false), _defineProperty(_supports2, Feature.id, true), _defineProperty(_supports2, Feature.reversibleId, false), _defineProperty(_supports2, Feature.variableType, true), _supports2),
35814
+ /**
35815
+ * Creates a new collection
35816
+ * @param elements - The initial element
35817
+ */
34707
35818
  collection: function collection(elements) {
34708
35819
  return new Collection(elements);
34709
35820
  },
@@ -35783,102 +36894,122 @@ var RDFParser = /* @__PURE__ */ function() {
35783
36894
  }
35784
36895
  _createClass(RDFParser2, [{
35785
36896
  key: "frameFactory",
35786
- value: function frameFactory(parser, parent2, element) {
35787
- return {
35788
- "NODE": 1,
35789
- "ARC": 2,
35790
- "parent": parent2,
35791
- "parser": parser,
35792
- "store": parser.store,
35793
- "element": element,
35794
- "lastChild": 0,
35795
- "base": null,
35796
- "lang": null,
35797
- "node": null,
35798
- "nodeType": null,
35799
- "listIndex": 1,
35800
- "rdfid": null,
35801
- "datatype": null,
35802
- "collection": false,
35803
- "terminateFrame": function terminateFrame() {
35804
- if (this.collection) {
35805
- this.node.close();
35806
- }
35807
- },
35808
- "addSymbol": function addSymbol(type, uri) {
35809
- uri = join(uri, this.base);
35810
- this.node = this.store.sym(uri);
35811
- this.nodeType = type;
35812
- },
35813
- "loadTriple": function loadTriple() {
35814
- if (this.parent.parent.collection) {
35815
- this.parent.parent.node.append(this.node);
35816
- } else {
35817
- this.store.add(this.parent.parent.node, this.parent.node, this.node, this.parser.why);
35818
- }
35819
- if (this.parent.rdfid != null) {
35820
- var triple3 = this.store.sym(join("#" + this.parent.rdfid, this.base));
35821
- this.store.add(triple3, this.store.sym(RDFParser2.ns.RDF + "type"), this.store.sym(RDFParser2.ns.RDF + "Statement"), this.parser.why);
35822
- this.store.add(triple3, this.store.sym(RDFParser2.ns.RDF + "subject"), this.parent.parent.node, this.parser.why);
35823
- this.store.add(triple3, this.store.sym(RDFParser2.ns.RDF + "predicate"), this.parent.node, this.parser.why);
35824
- this.store.add(triple3, this.store.sym(RDFParser2.ns.RDF + "object"), this.node, this.parser.why);
35825
- }
35826
- },
35827
- "isTripleToLoad": function isTripleToLoad() {
35828
- return this.parent != null && this.parent.parent != null && this.nodeType === this.NODE && this.parent.nodeType === this.ARC && this.parent.parent.nodeType === this.NODE;
35829
- },
35830
- "addNode": function addNode(uri) {
35831
- this.addSymbol(this.NODE, uri);
35832
- if (this.isTripleToLoad()) {
35833
- this.loadTriple();
35834
- }
35835
- },
35836
- "addCollection": function addCollection() {
35837
- this.nodeType = this.NODE;
35838
- this.node = this.store.collection();
35839
- this.collection = true;
35840
- if (this.isTripleToLoad()) {
35841
- this.loadTriple();
35842
- }
35843
- },
35844
- "addCollectionArc": function addCollectionArc() {
35845
- this.nodeType = this.ARC;
35846
- },
35847
- "addBNode": function addBNode(id3) {
35848
- if (id3 != null) {
35849
- if (this.parser.bnodes[id3] != null) {
35850
- this.node = this.parser.bnodes[id3];
36897
+ value: (
36898
+ /**
36899
+ * Frame class for namespace and base URI lookups
36900
+ * Base lookups will always resolve because the parser knows
36901
+ * the default base.
36902
+ *
36903
+ * @private
36904
+ */
36905
+ function frameFactory(parser, parent2, element) {
36906
+ return {
36907
+ "NODE": 1,
36908
+ "ARC": 2,
36909
+ "parent": parent2,
36910
+ "parser": parser,
36911
+ "store": parser.store,
36912
+ "element": element,
36913
+ "lastChild": 0,
36914
+ "base": null,
36915
+ "lang": null,
36916
+ "node": null,
36917
+ "nodeType": null,
36918
+ "listIndex": 1,
36919
+ "rdfid": null,
36920
+ "datatype": null,
36921
+ "collection": false,
36922
+ /** Terminate the frame and notify the store that we're done */
36923
+ "terminateFrame": function terminateFrame() {
36924
+ if (this.collection) {
36925
+ this.node.close();
36926
+ }
36927
+ },
36928
+ /** Add a symbol of a certain type to the this frame */
36929
+ "addSymbol": function addSymbol(type, uri) {
36930
+ uri = join(uri, this.base);
36931
+ this.node = this.store.sym(uri);
36932
+ this.nodeType = type;
36933
+ },
36934
+ /** Load any constructed triples into the store */
36935
+ "loadTriple": function loadTriple() {
36936
+ if (this.parent.parent.collection) {
36937
+ this.parent.parent.node.append(this.node);
35851
36938
  } else {
35852
- this.node = this.parser.bnodes[id3] = this.store.bnode();
36939
+ this.store.add(this.parent.parent.node, this.parent.node, this.node, this.parser.why);
36940
+ }
36941
+ if (this.parent.rdfid != null) {
36942
+ var triple3 = this.store.sym(join("#" + this.parent.rdfid, this.base));
36943
+ this.store.add(triple3, this.store.sym(RDFParser2.ns.RDF + "type"), this.store.sym(RDFParser2.ns.RDF + "Statement"), this.parser.why);
36944
+ this.store.add(triple3, this.store.sym(RDFParser2.ns.RDF + "subject"), this.parent.parent.node, this.parser.why);
36945
+ this.store.add(triple3, this.store.sym(RDFParser2.ns.RDF + "predicate"), this.parent.node, this.parser.why);
36946
+ this.store.add(triple3, this.store.sym(RDFParser2.ns.RDF + "object"), this.node, this.parser.why);
36947
+ }
36948
+ },
36949
+ /** Check if it's OK to load a triple */
36950
+ "isTripleToLoad": function isTripleToLoad() {
36951
+ return this.parent != null && this.parent.parent != null && this.nodeType === this.NODE && this.parent.nodeType === this.ARC && this.parent.parent.nodeType === this.NODE;
36952
+ },
36953
+ /** Add a symbolic node to this frame */
36954
+ "addNode": function addNode(uri) {
36955
+ this.addSymbol(this.NODE, uri);
36956
+ if (this.isTripleToLoad()) {
36957
+ this.loadTriple();
36958
+ }
36959
+ },
36960
+ /** Add a collection node to this frame */
36961
+ "addCollection": function addCollection() {
36962
+ this.nodeType = this.NODE;
36963
+ this.node = this.store.collection();
36964
+ this.collection = true;
36965
+ if (this.isTripleToLoad()) {
36966
+ this.loadTriple();
36967
+ }
36968
+ },
36969
+ /** Add a collection arc to this frame */
36970
+ "addCollectionArc": function addCollectionArc() {
36971
+ this.nodeType = this.ARC;
36972
+ },
36973
+ /** Add a bnode to this frame */
36974
+ "addBNode": function addBNode(id3) {
36975
+ if (id3 != null) {
36976
+ if (this.parser.bnodes[id3] != null) {
36977
+ this.node = this.parser.bnodes[id3];
36978
+ } else {
36979
+ this.node = this.parser.bnodes[id3] = this.store.bnode();
36980
+ }
36981
+ } else {
36982
+ this.node = this.store.bnode();
36983
+ }
36984
+ this.nodeType = this.NODE;
36985
+ if (this.isTripleToLoad()) {
36986
+ this.loadTriple();
36987
+ }
36988
+ },
36989
+ /** Add an arc or property to this frame */
36990
+ "addArc": function addArc(uri) {
36991
+ if (uri === RDFParser2.ns.RDF + "li") {
36992
+ uri = RDFParser2.ns.RDF + "_" + this.parent.listIndex;
36993
+ this.parent.listIndex++;
36994
+ }
36995
+ this.addSymbol(this.ARC, uri);
36996
+ },
36997
+ /** Add a literal to this frame */
36998
+ "addLiteral": function addLiteral(value) {
36999
+ if (this.parent.datatype && this.parent.datatype !== RDFParser2.ns.RDF + "langString") {
37000
+ this.node = this.store.literal(value, this.store.sym(this.parent.datatype));
37001
+ } else {
37002
+ this.node = this.store.literal(value, this.lang);
37003
+ }
37004
+ this.nodeType = this.NODE;
37005
+ if (this.isTripleToLoad()) {
37006
+ this.loadTriple();
35853
37007
  }
35854
- } else {
35855
- this.node = this.store.bnode();
35856
- }
35857
- this.nodeType = this.NODE;
35858
- if (this.isTripleToLoad()) {
35859
- this.loadTriple();
35860
- }
35861
- },
35862
- "addArc": function addArc(uri) {
35863
- if (uri === RDFParser2.ns.RDF + "li") {
35864
- uri = RDFParser2.ns.RDF + "_" + this.parent.listIndex;
35865
- this.parent.listIndex++;
35866
- }
35867
- this.addSymbol(this.ARC, uri);
35868
- },
35869
- "addLiteral": function addLiteral(value) {
35870
- if (this.parent.datatype && this.parent.datatype !== RDFParser2.ns.RDF + "langString") {
35871
- this.node = this.store.literal(value, this.store.sym(this.parent.datatype));
35872
- } else {
35873
- this.node = this.store.literal(value, this.lang);
35874
- }
35875
- this.nodeType = this.NODE;
35876
- if (this.isTripleToLoad()) {
35877
- this.loadTriple();
35878
37008
  }
35879
- }
35880
- };
35881
- }
37009
+ };
37010
+ }
37011
+ )
37012
+ // from the OpenLayers source .. needed to get around IE problems.
35882
37013
  }, {
35883
37014
  key: "getAttributeNodeNS",
35884
37015
  value: function getAttributeNodeNS(node, uri, name) {
@@ -35901,6 +37032,12 @@ var RDFParser = /* @__PURE__ */ function() {
35901
37032
  }
35902
37033
  return attributeNode;
35903
37034
  }
37035
+ /**
37036
+ * Build our initial scope frame and parse the DOM into triples
37037
+ * @param {HTMLDocument} document The DOM to parse
37038
+ * @param {String} base The base URL to use
37039
+ * @param {Object} why The context to which this resource belongs
37040
+ */
35904
37041
  }, {
35905
37042
  key: "parse",
35906
37043
  value: function parse3(document3, base, why) {
@@ -36088,12 +37225,20 @@ var RDFParser = /* @__PURE__ */ function() {
36088
37225
  }
36089
37226
  }
36090
37227
  }
37228
+ /**
37229
+ * Cleans out state from a previous parse run
37230
+ * @private
37231
+ */
36091
37232
  }, {
36092
37233
  key: "cleanParser",
36093
37234
  value: function cleanParser() {
36094
37235
  this.bnodes = {};
36095
37236
  this.why = null;
36096
37237
  }
37238
+ /**
37239
+ * Builds scope frame
37240
+ * @private
37241
+ */
36097
37242
  }, {
36098
37243
  key: "buildFrame",
36099
37244
  value: function buildFrame(parent2, element) {
@@ -36279,7 +37424,10 @@ function parse2(str, kb, base) {
36279
37424
  }
36280
37425
  }
36281
37426
  function executeErrorCallback(e) {
36282
- if (contentType !== JSONLDContentType || contentType !== NQuadsContentType || contentType !== NQuadsAltContentType) {
37427
+ if (// TODO: Always true, what is the right behavior
37428
+ contentType !== JSONLDContentType || // @ts-ignore always true?
37429
+ contentType !== NQuadsContentType || // @ts-ignore always true?
37430
+ contentType !== NQuadsAltContentType) {
36283
37431
  if (callback) {
36284
37432
  callback(e, kb);
36285
37433
  } else {
@@ -36361,6 +37509,7 @@ var getNS = function getNS2(factory) {
36361
37509
  link: Namespace("http://www.w3.org/2007/ont/link#", factory),
36362
37510
  http: Namespace("http://www.w3.org/2007/ont/http#", factory),
36363
37511
  httph: Namespace("http://www.w3.org/2007/ont/httph#", factory),
37512
+ // headers
36364
37513
  rdf: Namespace("http://www.w3.org/1999/02/22-rdf-syntax-ns#", factory),
36365
37514
  rdfs: Namespace("http://www.w3.org/2000/01/rdf-schema#", factory),
36366
37515
  dc: Namespace("http://purl.org/dc/elements/1.1/", factory),
@@ -36369,6 +37518,8 @@ var getNS = function getNS2(factory) {
36369
37518
  };
36370
37519
  var ns2 = getNS();
36371
37520
  var Handler = /* @__PURE__ */ _createClass(
37521
+ // TODO: Document, type
37522
+ // TODO: Document, type
36372
37523
  function Handler2(response, dom) {
36373
37524
  _classCallCheck(this, Handler2);
36374
37525
  _defineProperty(this, "response", void 0);
@@ -36791,6 +37942,7 @@ var Fetcher = /* @__PURE__ */ function() {
36791
37942
  "*/*": {
36792
37943
  "q": 0.1
36793
37944
  }
37945
+ // Must allow access to random content
36794
37946
  };
36795
37947
  callbackify(this, ["request", "fail", "refresh", "retract", "done"]);
36796
37948
  Object.keys(options.handlers || defaultHandlers).map(function(key) {
@@ -36799,22 +37951,69 @@ var Fetcher = /* @__PURE__ */ function() {
36799
37951
  }
36800
37952
  _createClass(Fetcher3, [{
36801
37953
  key: "load",
36802
- value: function load(uri) {
36803
- var _this2 = this;
36804
- var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
36805
- options = Object.assign({}, options);
36806
- if (uri instanceof Array) {
36807
- return Promise.all(uri.map(function(x) {
36808
- return _this2.load(x, Object.assign({}, options));
36809
- }));
37954
+ value: (
37955
+ /**
37956
+ * Promise-based load function
37957
+ *
37958
+ * Loads a web resource or resources into the store.
37959
+ *
37960
+ * A resource may be given as NamedNode object, or as a plain URI.
37961
+ * an array of resources will be given, in which they will be fetched in parallel.
37962
+ * By default, the HTTP headers are recorded also, in the same store, in a separate graph.
37963
+ * This allows code like editable() for example to test things about the resource.
37964
+ *
37965
+ * @param uri {Array<RDFlibNamedNode>|Array<string>|RDFlibNamedNode|string}
37966
+ *
37967
+ * @param [options={}] {Object}
37968
+ *
37969
+ * @param [options.fetch] {Function}
37970
+ *
37971
+ * @param [options.referringTerm] {RDFlibNamedNode} Referring term, the resource which
37972
+ * referred to this (for tracking bad links)
37973
+ *
37974
+ * @param [options.contentType] {string} Provided content type (for writes)
37975
+ *
37976
+ * @param [options.forceContentType] {string} Override the incoming header to
37977
+ * force the data to be treated as this content-type (for reads)
37978
+ *
37979
+ * @param [options.force] {boolean} Load the data even if loaded before.
37980
+ * Also sets the `Cache-Control:` header to `no-cache`
37981
+ *
37982
+ * @param [options.baseURI=docuri] {Node|string} Original uri to preserve
37983
+ * through proxying etc (`xhr.original`).
37984
+ *
37985
+ * @param [options.proxyUsed] {boolean} Whether this request is a retry via
37986
+ * a proxy (generally done from an error handler)
37987
+ *
37988
+ * @param [options.withCredentials] {boolean} flag for XHR/CORS etc
37989
+ *
37990
+ * @param [options.clearPreviousData] {boolean} Before we parse new data,
37991
+ * clear old, but only on status 200 responses
37992
+ *
37993
+ * @param [options.noMeta] {boolean} Prevents the addition of various metadata
37994
+ * triples (about the fetch request) to the store
37995
+ *
37996
+ * @param [options.noRDFa] {boolean}
37997
+ *
37998
+ * @returns {Promise<Result>}
37999
+ */
38000
+ function load(uri) {
38001
+ var _this2 = this;
38002
+ var options = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {};
38003
+ options = Object.assign({}, options);
38004
+ if (uri instanceof Array) {
38005
+ return Promise.all(uri.map(function(x) {
38006
+ return _this2.load(x, Object.assign({}, options));
38007
+ }));
38008
+ }
38009
+ var uriIn = uri;
38010
+ var docuri = termValue(uriIn);
38011
+ docuri = docuri.split("#")[0];
38012
+ options = this.initFetchOptions(docuri, options);
38013
+ var initialisedOptions = this.initFetchOptions(docuri, options);
38014
+ return this.pendingFetchPromise(docuri, initialisedOptions.baseURI, initialisedOptions);
36810
38015
  }
36811
- var uriIn = uri;
36812
- var docuri = termValue(uriIn);
36813
- docuri = docuri.split("#")[0];
36814
- options = this.initFetchOptions(docuri, options);
36815
- var initialisedOptions = this.initFetchOptions(docuri, options);
36816
- return this.pendingFetchPromise(docuri, initialisedOptions.baseURI, initialisedOptions);
36817
- }
38016
+ )
36818
38017
  }, {
36819
38018
  key: "pendingFetchPromise",
36820
38019
  value: function pendingFetchPromise(uri, originalUri, options) {
@@ -36835,6 +38034,9 @@ var Fetcher = /* @__PURE__ */ function() {
36835
38034
  return x;
36836
38035
  });
36837
38036
  }
38037
+ /**
38038
+ * @param _options - DEPRECATED
38039
+ */
36838
38040
  }, {
36839
38041
  key: "cleanupFetchRequest",
36840
38042
  value: function cleanupFetchRequest(originalUri, _options, timeout2) {
@@ -36879,6 +38081,14 @@ var Fetcher = /* @__PURE__ */ function() {
36879
38081
  options.actualProxyURI = actualProxyURI;
36880
38082
  return options;
36881
38083
  }
38084
+ /**
38085
+ * (The promise chain ends in either a `failFetch()` or a `doneFetch()`)
38086
+ *
38087
+ * @param docuri {string}
38088
+ * @param options {Object}
38089
+ *
38090
+ * @returns {Promise<Object>} fetch() result or an { error, status } object
38091
+ */
36882
38092
  }, {
36883
38093
  key: "fetchUri",
36884
38094
  value: function fetchUri(docuri, options) {
@@ -36893,6 +38103,7 @@ var Fetcher = /* @__PURE__ */ function() {
36893
38103
  if (!options.force) {
36894
38104
  if (state === "fetched") {
36895
38105
  return Promise.resolve(
38106
+ // @ts-ignore This is not a valid response object
36896
38107
  this.doneFetch(options, {
36897
38108
  status: 200,
36898
38109
  ok: true,
@@ -36904,10 +38115,12 @@ var Fetcher = /* @__PURE__ */ function() {
36904
38115
  var _message = "Previously failed: " + this.requested[docuri];
36905
38116
  var dummyResponse = {
36906
38117
  url: docuri,
38118
+ // This does not comply to Fetch spec, it can be a string value in rdflib
36907
38119
  status: this.requested[docuri],
36908
38120
  statusText: _message,
36909
38121
  responseText: _message,
36910
38122
  headers: new import_cross_fetch.Headers(),
38123
+ // Headers() ???
36911
38124
  ok: false,
36912
38125
  body: null,
36913
38126
  bodyUsed: false,
@@ -36931,9 +38144,11 @@ var Fetcher = /* @__PURE__ */ function() {
36931
38144
  var dummyResponse2 = {
36932
38145
  url: actualProxyURI,
36933
38146
  status: 999,
38147
+ // @@ what number/string should fetch failures report?
36934
38148
  statusText: (error2.name || "network failure") + ": " + (error2.errno || error2.code || error2.type),
36935
38149
  responseText: error2.message,
36936
38150
  headers: new import_cross_fetch.Headers(),
38151
+ // Headers() ???
36937
38152
  ok: false,
36938
38153
  body: null,
36939
38154
  bodyUsed: false,
@@ -36944,6 +38159,33 @@ var Fetcher = /* @__PURE__ */ function() {
36944
38159
  return _this5.handleError(dummyResponse2, docuri, options);
36945
38160
  });
36946
38161
  }
38162
+ /**
38163
+ * Asks for a doc to be loaded if necessary then calls back
38164
+ *
38165
+ * Calling methods:
38166
+ * nowOrWhenFetched (uri, userCallback)
38167
+ * nowOrWhenFetched (uri, options, userCallback)
38168
+ * nowOrWhenFetched (uri, referringTerm, userCallback, options) <-- old
38169
+ * nowOrWhenFetched (uri, referringTerm, userCallback) <-- old
38170
+ *
38171
+ * Options include:
38172
+ * referringTerm The document in which this link was found.
38173
+ * this is valuable when finding the source of bad URIs
38174
+ * force boolean. Never mind whether you have tried before,
38175
+ * load this from scratch.
38176
+ * forceContentType Override the incoming header to force the data to be
38177
+ * treated as this content-type.
38178
+ *
38179
+ * Callback function takes:
38180
+ *
38181
+ * ok True if the fetch worked, and got a 200 response.
38182
+ * False if any error happened
38183
+ *
38184
+ * errmessage Text error message if not OK.
38185
+ *
38186
+ * response The fetch Response object (was: XHR) if there was was one
38187
+ * includes response.status as the HTTP status if any.
38188
+ */
36947
38189
  }, {
36948
38190
  key: "nowOrWhenFetched",
36949
38191
  value: function nowOrWhenFetched(uriIn, p2, userCallback) {
@@ -36986,6 +38228,11 @@ var Fetcher = /* @__PURE__ */ function() {
36986
38228
  userCallback(false, message2, err.response);
36987
38229
  });
36988
38230
  }
38231
+ /**
38232
+ * Records a status message (as a literal node) by appending it to the
38233
+ * request's metadata status collection.
38234
+ *
38235
+ */
36989
38236
  }, {
36990
38237
  key: "addStatus",
36991
38238
  value: function addStatus(req, statusMessage) {
@@ -36999,6 +38246,14 @@ var Fetcher = /* @__PURE__ */ function() {
36999
38246
  log_default.warn("web.js: No list to add to: " + statusNode + "," + statusMessage);
37000
38247
  }
37001
38248
  }
38249
+ /**
38250
+ * Records errors in the system on failure:
38251
+ *
38252
+ * - Adds an entry to the request status collection
38253
+ * - Adds an error triple with the fail message to the metadata
38254
+ * - Fires the 'fail' callback
38255
+ * - Rejects with an error result object, which has a response object if any
38256
+ */
37002
38257
  }, {
37003
38258
  key: "failFetch",
37004
38259
  value: function failFetch(options, errorMessage, statusCode, response) {
@@ -37021,6 +38276,8 @@ var Fetcher = /* @__PURE__ */ function() {
37021
38276
  err.response = response;
37022
38277
  return Promise.reject(err);
37023
38278
  }
38279
+ // in the why part of the quad distinguish between HTML and HTTP header
38280
+ // Reverse is set iif the link was rev= as opposed to rel=
37024
38281
  }, {
37025
38282
  key: "linkData",
37026
38283
  value: function linkData(originalUri, rel, uri, why, reverse) {
@@ -37080,6 +38337,11 @@ var Fetcher = /* @__PURE__ */ function() {
37080
38337
  response.req = options.req;
37081
38338
  return response;
37082
38339
  }
38340
+ /**
38341
+ * Note two nodes are now smushed
38342
+ * If only one was flagged as looked up, then the new node is looked up again,
38343
+ * which will make sure all the URIs are dereferenced
38344
+ */
37083
38345
  }, {
37084
38346
  key: "nowKnownAs",
37085
38347
  value: function nowKnownAs(was, now) {
@@ -37093,6 +38355,9 @@ var Fetcher = /* @__PURE__ */ function() {
37093
38355
  }
37094
38356
  }
37095
38357
  }
38358
+ /**
38359
+ * Writes back to the web what we have in the store for this uri
38360
+ */
37096
38361
  }, {
37097
38362
  key: "putBack",
37098
38363
  value: function putBack(uri) {
@@ -37127,6 +38392,7 @@ var Fetcher = /* @__PURE__ */ function() {
37127
38392
  return this.webOperation("GET", here).then(function(result) {
37128
38393
  return _this7.webOperation(
37129
38394
  "PUT",
38395
+ // change to binary from text
37130
38396
  there,
37131
38397
  {
37132
38398
  data: result.responseText,
@@ -37146,6 +38412,11 @@ var Fetcher = /* @__PURE__ */ function() {
37146
38412
  return response;
37147
38413
  });
37148
38414
  }
38415
+ /** Create an empty resource if it really does not exist
38416
+ * Be absolutely sure something does not exist before creating a new empty file
38417
+ * as otherwise existing could be deleted.
38418
+ * @param doc - The resource
38419
+ */
37149
38420
  }, {
37150
38421
  key: "createIfNotExists",
37151
38422
  value: function() {
@@ -37208,10 +38479,16 @@ var Fetcher = /* @__PURE__ */ function() {
37208
38479
  }
37209
38480
  return createIfNotExists;
37210
38481
  }()
38482
+ /**
38483
+ * @param parentURI URI of parent container
38484
+ * @param folderName - Optional folder name (slug)
38485
+ * @param data - Optional folder metadata
38486
+ */
37211
38487
  }, {
37212
38488
  key: "createContainer",
37213
38489
  value: function createContainer(parentURI, folderName, data) {
37214
38490
  var headers = {
38491
+ // Force the right mime type for containers
37215
38492
  "content-type": TurtleContentType,
37216
38493
  "link": this.ns.ldp("BasicContainer") + '; rel="type"'
37217
38494
  };
@@ -37249,6 +38526,13 @@ var Fetcher = /* @__PURE__ */ function() {
37249
38526
  delete fetcher3.nonexistent[uri];
37250
38527
  }
37251
38528
  }
38529
+ /**
38530
+ * A generic web operation, at the fetch() level.
38531
+ * does not involve the quad store.
38532
+ *
38533
+ * Returns promise of Response
38534
+ * If data is returned, copies it to response.responseText before returning
38535
+ */
37252
38536
  }, {
37253
38537
  key: "webOperation",
37254
38538
  value: function webOperation(method, uriIn) {
@@ -37297,6 +38581,15 @@ var Fetcher = /* @__PURE__ */ function() {
37297
38581
  });
37298
38582
  });
37299
38583
  }
38584
+ /**
38585
+ * Looks up something.
38586
+ * Looks up all the URIs a things has.
38587
+ *
38588
+ * @param term - canonical term for the thing whose URI is
38589
+ * to be dereferenced
38590
+ * @param rterm - the resource which referred to this
38591
+ * (for tracking bad links)
38592
+ */
37300
38593
  }, {
37301
38594
  key: "lookUpThing",
37302
38595
  value: function lookUpThing(term2, rterm) {
@@ -37312,6 +38605,14 @@ var Fetcher = /* @__PURE__ */ function() {
37312
38605
  referringTerm: rterm
37313
38606
  });
37314
38607
  }
38608
+ /**
38609
+ * Looks up response header.
38610
+ *
38611
+ * @returns {Array|undefined} a list of header values found in a stored HTTP
38612
+ * response, or [] if response was found but no header found,
38613
+ * or undefined if no response is available.
38614
+ * Looks for { [] link:requestedURI ?uri; link:response [ httph:header-name ?value ] }
38615
+ */
37315
38616
  }, {
37316
38617
  key: "getHeader",
37317
38618
  value: function getHeader(doc, header) {
@@ -37381,6 +38682,11 @@ var Fetcher = /* @__PURE__ */ function() {
37381
38682
  }
37382
38683
  }
37383
38684
  }
38685
+ /* refresh Reload data from a given document
38686
+ **
38687
+ ** @param term - An RDF Named Node for the eodcument in question
38688
+ ** @param userCallback - A function userCallback(ok, message, response)
38689
+ */
37384
38690
  }, {
37385
38691
  key: "refresh",
37386
38692
  value: function refresh(term2, userCallback) {
@@ -37390,6 +38696,11 @@ var Fetcher = /* @__PURE__ */ function() {
37390
38696
  clearPreviousData: true
37391
38697
  }, userCallback);
37392
38698
  }
38699
+ /* refreshIfExpired Conditional refresh if Expired
38700
+ **
38701
+ ** @param term - An RDF Named Node for the eodcument in question
38702
+ ** @param userCallback - A function userCallback(ok, message, response)
38703
+ */
37393
38704
  }, {
37394
38705
  key: "refreshIfExpired",
37395
38706
  value: function refreshIfExpired(term2, userCallback) {
@@ -37454,6 +38765,10 @@ var Fetcher = /* @__PURE__ */ function() {
37454
38765
  this.addStatus(options.req, "Abort: Will retry with credentials SUPPRESSED to see if that helps");
37455
38766
  return this.load(docuri, newOptions);
37456
38767
  }
38768
+ /**
38769
+ * Tests whether a request is being made to a cross-site URI (for purposes
38770
+ * of retrying with a proxy)
38771
+ */
37457
38772
  }, {
37458
38773
  key: "isCrossSite",
37459
38774
  value: function isCrossSite(uri) {
@@ -37464,6 +38779,10 @@ var Fetcher = /* @__PURE__ */ function() {
37464
38779
  var here = "" + document.location;
37465
38780
  return (hostpart2(here) && hostpart2(uri) && hostpart2(here)) !== hostpart2(uri);
37466
38781
  }
38782
+ /**
38783
+ * Called when there's a network error in fetch(), or a response
38784
+ * with status of 0.
38785
+ */
37467
38786
  }, {
37468
38787
  key: "handleError",
37469
38788
  value: function handleError(response, docuri, options) {
@@ -37488,6 +38807,7 @@ var Fetcher = /* @__PURE__ */ function() {
37488
38807
  }
37489
38808
  return this.failFetch(options, message2, response.status || 998, response);
37490
38809
  }
38810
+ // deduce some things from the HTTP transaction
37491
38811
  }, {
37492
38812
  key: "addType",
37493
38813
  value: function addType(rdfType, req, kb, locURI) {
@@ -37520,6 +38840,9 @@ var Fetcher = /* @__PURE__ */ function() {
37520
38840
  }
37521
38841
  }
37522
38842
  }
38843
+ /**
38844
+ * Handle fetch() response
38845
+ */
37523
38846
  }, {
37524
38847
  key: "handleResponse",
37525
38848
  value: function handleResponse(response, docuri, options) {
@@ -37631,6 +38954,9 @@ var Fetcher = /* @__PURE__ */ function() {
37631
38954
  }
37632
38955
  return contentType;
37633
38956
  }
38957
+ /**
38958
+ * Sends a new request to the specified uri. (Extracted from `onerrorFactory()`)
38959
+ */
37634
38960
  }, {
37635
38961
  key: "redirectToProxy",
37636
38962
  value: function redirectToProxy(newURI, options) {
@@ -37690,6 +39016,9 @@ var Fetcher = /* @__PURE__ */ function() {
37690
39016
  }
37691
39017
  return acceptstring;
37692
39018
  }
39019
+ // var updatesVia = new $rdf.UpdatesVia(this) // Subscribe to headers
39020
+ // @@@@@@@@ This is turned off because it causes a websocket to be set up for ANY fetch
39021
+ // whether we want to track it ot not. including ontologies loaed though the XSSproxy
37693
39022
  }], [{
37694
39023
  key: "crossSiteProxy",
37695
39024
  value: function crossSiteProxy(uri) {
@@ -37741,17 +39070,26 @@ var Fetcher = /* @__PURE__ */ function() {
37741
39070
  return y;
37742
39071
  }
37743
39072
  }
37744
- if (Fetcher3.crossSiteProxyTemplate && typeof document !== "undefined" && document.location && ("" + document.location).slice(0, 6) === "https:" && uri.slice(0, 5) === "http:") {
39073
+ if (Fetcher3.crossSiteProxyTemplate && typeof document !== "undefined" && document.location && ("" + document.location).slice(0, 6) === "https:" && // origin is secure
39074
+ uri.slice(0, 5) === "http:") {
37745
39075
  return Fetcher3.crossSiteProxyTemplate.replace("{uri}", encodeURIComponent(uri));
37746
39076
  }
37747
39077
  return uri;
37748
39078
  }
39079
+ /**
39080
+ * Tests whether the uri's protocol is supported by the Fetcher.
39081
+ * @param uri
39082
+ */
37749
39083
  }, {
37750
39084
  key: "unsupportedProtocol",
37751
39085
  value: function unsupportedProtocol(uri) {
37752
39086
  var pcol = protocol(uri);
37753
39087
  return pcol === "tel" || pcol === "mailto" || pcol === "urn";
37754
39088
  }
39089
+ /** Decide on credentials using old XXHR api or new fetch() one
39090
+ * @param requestedURI
39091
+ * @param options
39092
+ */
37755
39093
  }, {
37756
39094
  key: "setCredentials",
37757
39095
  value: function setCredentials(requestedURI) {
@@ -37796,9 +39134,17 @@ function _objectSpread3(target) {
37796
39134
  return target;
37797
39135
  }
37798
39136
  var RDFlibDataFactory = _objectSpread3(_objectSpread3({}, extended_term_factory_default), {}, {
39137
+ /**
39138
+ * Creates a new fetcher
39139
+ * @param store - The store to use
39140
+ * @param options - The options
39141
+ */
37799
39142
  fetcher: function fetcher(store, options) {
37800
39143
  return new Fetcher(store, options);
37801
39144
  },
39145
+ /**
39146
+ * Creates a new graph (store)
39147
+ */
37802
39148
  graph: function graph() {
37803
39149
  var features = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : void 0;
37804
39150
  var opts = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : void 0;
@@ -37806,9 +39152,22 @@ var RDFlibDataFactory = _objectSpread3(_objectSpread3({}, extended_term_factory_
37806
39152
  rdfFactory: extended_term_factory_default
37807
39153
  });
37808
39154
  },
39155
+ /**
39156
+ * Creates a new literal node
39157
+ * @param val The lexical value
39158
+ * @param lang The language
39159
+ * @param dt The datatype
39160
+ */
37809
39161
  lit: function lit(val, lang, dt) {
37810
39162
  return this.literal("" + val, lang || dt);
37811
39163
  },
39164
+ /**
39165
+ * Creates a new statement
39166
+ * @param subject The subject
39167
+ * @param predicate The predicate
39168
+ * @param object The object
39169
+ * @param graph The containing graph
39170
+ */
37812
39171
  st: function st(subject, predicate, object, graph3) {
37813
39172
  return this.quad(subject, predicate, object, graph3);
37814
39173
  }
@@ -38065,68 +39424,111 @@ export {
38065
39424
  RdfDocument,
38066
39425
  Thing
38067
39426
  };
38068
- /*!
38069
- * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
38070
- */
38071
- /*!
38072
- * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
38073
- */
38074
- /*!
38075
- * The buffer module from node.js, for the browser.
38076
- *
38077
- * @author Feross Aboukhadijeh <http://feross.org>
38078
- * @license MIT
38079
- */
38080
- /*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
38081
- */
38082
- /*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
38083
- */
38084
- /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
38085
- /*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
38086
- /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
38087
- /**
38088
- * A JavaScript implementation of the JSON-LD API.
38089
- *
38090
- * @author Dave Longley
38091
- *
38092
- * @license BSD 3-Clause License
38093
- * Copyright (c) 2011-2019 Digital Bazaar, Inc.
38094
- * All rights reserved.
38095
- *
38096
- * Redistribution and use in source and binary forms, with or without
38097
- * modification, are permitted provided that the following conditions are met:
38098
- *
38099
- * Redistributions of source code must retain the above copyright notice,
38100
- * this list of conditions and the following disclaimer.
38101
- *
38102
- * Redistributions in binary form must reproduce the above copyright
38103
- * notice, this list of conditions and the following disclaimer in the
38104
- * documentation and/or other materials provided with the distribution.
38105
- *
38106
- * Neither the name of the Digital Bazaar, Inc. nor the names of its
38107
- * contributors may be used to endorse or promote products derived from
38108
- * this software without specific prior written permission.
38109
- *
38110
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
38111
- * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
38112
- * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
38113
- * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
38114
- * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
38115
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
38116
- * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
38117
- * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
38118
- * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
38119
- * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38120
- * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38121
- */
38122
- /**
38123
- * Removes the @preserve keywords from expanded result of framing.
38124
- *
38125
- * @param input the framed, framed output.
38126
- * @param options the framing options used.
38127
- *
38128
- * @return the resulting output.
38129
- */
38130
- // disallow aliasing @context and @preserve
38131
- // remove @preserve
38132
- // remove @preserve from results
39427
+ /*! Bundled license information:
39428
+
39429
+ @inrupt/oidc-client/lib/oidc-client.min.js:
39430
+ (*! (c) Tom Wu | http://www-cs-students.stanford.edu/~tjw/jsbn/
39431
+ *)
39432
+ (*! Mike Samuel (c) 2009 | code.google.com/p/json-sans-eval
39433
+ *)
39434
+ (*!
39435
+ * The buffer module from node.js, for the browser.
39436
+ *
39437
+ * @author Feross Aboukhadijeh <http://feross.org>
39438
+ * @license MIT
39439
+ *)
39440
+ (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)
39441
+
39442
+ rdf-canonize/lib/MessageDigest-browser.js:
39443
+ (*!
39444
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
39445
+ *)
39446
+
39447
+ rdf-canonize/lib/Permuter.js:
39448
+ (*!
39449
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
39450
+ *)
39451
+
39452
+ rdf-canonize/lib/NQuads.js:
39453
+ (*!
39454
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
39455
+ *)
39456
+
39457
+ rdf-canonize/lib/URDNA2015.js:
39458
+ (*!
39459
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
39460
+ *)
39461
+
39462
+ rdf-canonize/lib/URGNA2012.js:
39463
+ (*!
39464
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
39465
+ *)
39466
+
39467
+ rdf-canonize/lib/URDNA2015Sync.js:
39468
+ (*!
39469
+ * Copyright (c) 2016-2022 Digital Bazaar, Inc. All rights reserved.
39470
+ *)
39471
+
39472
+ rdf-canonize/lib/URGNA2012Sync.js:
39473
+ (*!
39474
+ * Copyright (c) 2016-2021 Digital Bazaar, Inc. All rights reserved.
39475
+ *)
39476
+
39477
+ jsonld/lib/context.js:
39478
+ (* disallow aliasing @context and @preserve *)
39479
+
39480
+ jsonld/lib/frame.js:
39481
+ (* remove @preserve from results *)
39482
+ (**
39483
+ * Removes the @preserve keywords from expanded result of framing.
39484
+ *
39485
+ * @param input the framed, framed output.
39486
+ * @param options the framing options used.
39487
+ *
39488
+ * @return the resulting output.
39489
+ *)
39490
+ (* remove @preserve *)
39491
+
39492
+ jsonld/lib/jsonld.js:
39493
+ (**
39494
+ * A JavaScript implementation of the JSON-LD API.
39495
+ *
39496
+ * @author Dave Longley
39497
+ *
39498
+ * @license BSD 3-Clause License
39499
+ * Copyright (c) 2011-2019 Digital Bazaar, Inc.
39500
+ * All rights reserved.
39501
+ *
39502
+ * Redistribution and use in source and binary forms, with or without
39503
+ * modification, are permitted provided that the following conditions are met:
39504
+ *
39505
+ * Redistributions of source code must retain the above copyright notice,
39506
+ * this list of conditions and the following disclaimer.
39507
+ *
39508
+ * Redistributions in binary form must reproduce the above copyright
39509
+ * notice, this list of conditions and the following disclaimer in the
39510
+ * documentation and/or other materials provided with the distribution.
39511
+ *
39512
+ * Neither the name of the Digital Bazaar, Inc. nor the names of its
39513
+ * contributors may be used to endorse or promote products derived from
39514
+ * this software without specific prior written permission.
39515
+ *
39516
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
39517
+ * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
39518
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
39519
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
39520
+ * HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
39521
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
39522
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
39523
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
39524
+ * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
39525
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
39526
+ * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39527
+ *)
39528
+
39529
+ queue-microtask/index.js:
39530
+ (*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
39531
+
39532
+ @babel/runtime/helpers/regeneratorRuntime.js:
39533
+ (*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE *)
39534
+ */