rdflib 2.2.35 → 2.2.36

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 (90) hide show
  1. package/dist/rdflib.min.js +1 -1
  2. package/dist/rdflib.min.js.LICENSE.txt +0 -2
  3. package/dist/rdflib.min.js.map +1 -1
  4. package/esm/blank-node.js +57 -82
  5. package/esm/class-order.js +1 -1
  6. package/esm/collection.js +70 -103
  7. package/esm/default-graph.js +13 -30
  8. package/esm/empty.js +8 -23
  9. package/esm/factories/canonical-data-factory.js +33 -29
  10. package/esm/factories/extended-term-factory.js +18 -13
  11. package/esm/factories/factory-types.js +1 -1
  12. package/esm/factories/rdflib-data-factory.js +9 -11
  13. package/esm/fetcher.js +1366 -1651
  14. package/esm/formula.js +631 -736
  15. package/esm/index.js +31 -48
  16. package/esm/jsonldparser.js +19 -26
  17. package/esm/jsonparser.js +1 -1
  18. package/esm/lists.js +38 -86
  19. package/esm/literal.js +120 -154
  20. package/esm/log.js +7 -7
  21. package/esm/n3parser.js +1009 -1086
  22. package/esm/named-node.js +69 -96
  23. package/esm/namespace.js +2 -4
  24. package/esm/node-internal.js +73 -96
  25. package/esm/node.js +1 -1
  26. package/esm/parse.js +3 -3
  27. package/esm/patch-parser.js +1 -1
  28. package/esm/query.js +15 -16
  29. package/esm/rdfaparser.js +775 -841
  30. package/esm/rdfxmlparser.js +348 -364
  31. package/esm/serialize.js +2 -2
  32. package/esm/serializer.js +835 -877
  33. package/esm/statement.js +52 -71
  34. package/esm/store.js +853 -957
  35. package/esm/types.js +21 -21
  36. package/esm/update-manager.js +965 -1100
  37. package/esm/updates-via.js +104 -132
  38. package/esm/uri.js +3 -3
  39. package/esm/utils/default-graph-uri.js +2 -2
  40. package/esm/utils/terms.js +4 -5
  41. package/esm/utils-js.js +5 -5
  42. package/esm/utils.js +6 -6
  43. package/esm/variable.js +32 -55
  44. package/esm/xsd.js +2 -2
  45. package/lib/blank-node.js +57 -80
  46. package/lib/class-order.js +1 -1
  47. package/lib/collection.js +70 -101
  48. package/lib/default-graph.js +14 -29
  49. package/lib/empty.js +9 -22
  50. package/lib/factories/canonical-data-factory.js +35 -31
  51. package/lib/factories/extended-term-factory.js +18 -13
  52. package/lib/factories/factory-types.js +1 -1
  53. package/lib/factories/rdflib-data-factory.js +9 -11
  54. package/lib/fetcher.js +1375 -1654
  55. package/lib/formula.js +632 -735
  56. package/lib/index.js +80 -84
  57. package/lib/jsonldparser.js +21 -32
  58. package/lib/jsonparser.js +1 -1
  59. package/lib/lists.js +47 -87
  60. package/lib/literal.js +121 -153
  61. package/lib/log.js +7 -7
  62. package/lib/n3parser.js +1012 -1090
  63. package/lib/named-node.js +70 -95
  64. package/lib/namespace.js +2 -4
  65. package/lib/node-internal.js +73 -94
  66. package/lib/node.js +1 -1
  67. package/lib/parse.js +5 -6
  68. package/lib/patch-parser.js +1 -1
  69. package/lib/query.js +20 -18
  70. package/lib/rdfaparser.js +778 -843
  71. package/lib/rdfxmlparser.js +351 -365
  72. package/lib/serialize.js +2 -2
  73. package/lib/serializer.js +840 -880
  74. package/lib/statement.js +55 -73
  75. package/lib/store.js +860 -958
  76. package/lib/types.js +21 -21
  77. package/lib/update-manager.js +970 -1102
  78. package/lib/updates-via.js +107 -132
  79. package/lib/uri.js +3 -3
  80. package/lib/utils/default-graph-uri.js +2 -2
  81. package/lib/utils/terms.js +4 -6
  82. package/lib/utils-js.js +8 -9
  83. package/lib/utils.js +6 -6
  84. package/lib/variable.js +35 -57
  85. package/lib/xsd.js +2 -2
  86. package/package.json +2 -2
  87. package/src/n3parser.js +1 -1
  88. package/src/serializer.js +1 -1
  89. package/src/update-manager.ts +2 -1
  90. package/.babelrc +0 -20
package/esm/index.js CHANGED
@@ -1,11 +1,4 @@
1
- import _createClass from "@babel/runtime/helpers/createClass";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
2
  import BlankNode from './blank-node';
10
3
  import Collection from './collection';
11
4
  import Empty from './empty';
@@ -38,30 +31,30 @@ import Variable from './variable';
38
31
  import DataFactory from './factories/rdflib-data-factory';
39
32
 
40
33
  // Prepare bound versions of data factory methods for export
41
- var boundDataFactory = {};
42
- for (var name in DataFactory) {
34
+ const boundDataFactory = {};
35
+ for (const name in DataFactory) {
43
36
  if (typeof DataFactory[name] === 'function') boundDataFactory[name] = DataFactory[name].bind(DataFactory);
44
37
  }
45
- var fetcher = boundDataFactory.fetcher,
46
- graph = boundDataFactory.graph,
47
- lit = boundDataFactory.lit,
48
- st = boundDataFactory.st,
49
- namedNode = boundDataFactory.namedNode,
50
- variable = boundDataFactory.variable,
51
- blankNode = boundDataFactory.blankNode,
52
- defaultGraph = boundDataFactory.defaultGraph,
53
- literal = boundDataFactory.literal,
54
- quad = boundDataFactory.quad,
55
- triple = boundDataFactory.triple;
56
- var formula = new Formula();
57
- var fromNT = function fromNT(str) {
58
- return formula.fromNT(str);
59
- };
60
- var term = Node.fromValue;
38
+ const {
39
+ fetcher,
40
+ graph,
41
+ lit,
42
+ st,
43
+ namedNode,
44
+ variable,
45
+ blankNode,
46
+ defaultGraph,
47
+ literal,
48
+ quad,
49
+ triple
50
+ } = boundDataFactory;
51
+ const formula = new Formula();
52
+ const fromNT = str => formula.fromNT(str);
53
+ const term = Node.fromValue;
61
54
 
62
55
  // TODO: this export is broken;
63
56
  // it exports the _current_ value of nextId, which is always 0
64
- var NextId = BlankNode.nextId;
57
+ const NextId = BlankNode.nextId;
65
58
  export * from './utils/terms';
66
59
  export { BlankNode, Collection, DataFactory, Empty, Fetcher, Formula, Store, jsonParser, Literal, log, N3Parser, NamedNode, Namespace, Node, parse, Query, queryToSPARQL, RDFaProcessor, RDFParser, serialize, Serializer, SPARQLToQuery, sparqlUpdateParser, Statement, term, UpdateManager, UpdatesSocket, UpdatesVia, uri, Util, Variable, Store as IndexedFormula,
67
60
  // Alias
@@ -70,27 +63,17 @@ NextId, fromNT, fetcher, graph, lit, st, namedNode as sym,
70
63
  // RDFJS DataFactory interface
71
64
  blankNode, defaultGraph, literal, namedNode, quad, triple, variable };
72
65
  export { termValue } from './utils/termValue';
73
- export var ConnectedStore = /*#__PURE__*/function (_Store) {
74
- function ConnectedStore(features) {
75
- var _this;
76
- _classCallCheck(this, ConnectedStore);
77
- _this = _callSuper(this, ConnectedStore, [features]);
78
- _defineProperty(_this, "fetcher", void 0);
79
- _this.fetcher = new Fetcher(_this, {});
80
- return _this;
66
+ export class ConnectedStore extends Store {
67
+ constructor(features) {
68
+ super(features);
69
+ _defineProperty(this, "fetcher", void 0);
70
+ this.fetcher = new Fetcher(this, {});
81
71
  }
82
- _inherits(ConnectedStore, _Store);
83
- return _createClass(ConnectedStore);
84
- }(Store);
85
- export var LiveStore = /*#__PURE__*/function (_ConnectedStore2) {
86
- function LiveStore(features) {
87
- var _this2;
88
- _classCallCheck(this, LiveStore);
89
- _this2 = _callSuper(this, LiveStore, [features]);
90
- _defineProperty(_this2, "updater", void 0);
91
- _this2.updater = new UpdateManager(_this2);
92
- return _this2;
72
+ }
73
+ export class LiveStore extends ConnectedStore {
74
+ constructor(features) {
75
+ super(features);
76
+ _defineProperty(this, "updater", void 0);
77
+ this.updater = new UpdateManager(this);
93
78
  }
94
- _inherits(LiveStore, _ConnectedStore2);
95
- return _createClass(LiveStore);
96
- }(ConnectedStore);
79
+ }
@@ -35,11 +35,9 @@ export function jsonldObjectToTerm(kb, obj) {
35
35
  * Adds the statements in a json-ld list object to {kb}.
36
36
  */
37
37
  function listToStatements(kb, obj) {
38
- var listId = obj['@id'] ? nodeType(kb, obj) : kb.rdfFactory.blankNode();
39
- var items = obj['@list'].map(function (listItem) {
40
- return jsonldObjectToTerm(kb, listItem);
41
- });
42
- var statements = arrayToStatements(kb.rdfFactory, listId, items);
38
+ const listId = obj['@id'] ? nodeType(kb, obj) : kb.rdfFactory.blankNode();
39
+ const items = obj['@list'].map(listItem => jsonldObjectToTerm(kb, listItem));
40
+ const statements = arrayToStatements(kb.rdfFactory, listId, items);
43
41
  kb.addAll(statements);
44
42
  return listId;
45
43
  }
@@ -47,9 +45,7 @@ function listToCollection(kb, obj) {
47
45
  if (!Array.isArray(obj)) {
48
46
  throw new TypeError("Object must be an array");
49
47
  }
50
- return kb.rdfFactory.collection(obj.map(function (o) {
51
- return jsonldObjectToTerm(kb, o);
52
- }));
48
+ return kb.rdfFactory.collection(obj.map(o => jsonldObjectToTerm(kb, o)));
53
49
  }
54
50
 
55
51
  /**
@@ -58,17 +54,15 @@ function listToCollection(kb, obj) {
58
54
  * Ensure that {kb.rdfFactory} is a DataFactory.
59
55
  */
60
56
  export default function jsonldParser(str, kb, base, callback) {
61
- var baseString = base && Object.prototype.hasOwnProperty.call(base, 'termType') ? base.value : base;
62
- return import('jsonld').then(function (jsonld) {
57
+ const baseString = base && Object.prototype.hasOwnProperty.call(base, 'termType') ? base.value : base;
58
+ return import('jsonld').then(jsonld => {
63
59
  return jsonld.flatten(JSON.parse(str), null, {
64
60
  base: baseString
65
61
  });
66
- }).then(function (flattened) {
67
- return flattened.reduce(function (store, flatResource) {
68
- kb = processResource(kb, base, flatResource);
69
- return kb;
70
- }, kb);
71
- }).then(callback).catch(callback);
62
+ }).then(flattened => flattened.reduce((store, flatResource) => {
63
+ kb = processResource(kb, base, flatResource);
64
+ return kb;
65
+ }, kb)).then(callback).catch(callback);
72
66
  }
73
67
  function nodeType(kb, obj) {
74
68
  if (obj['@id'].startsWith('_:')) {
@@ -80,27 +74,26 @@ function nodeType(kb, obj) {
80
74
  }
81
75
  }
82
76
  function processResource(kb, base, flatResource) {
83
- var id = flatResource['@id'] ? nodeType(kb, flatResource) : kb.rdfFactory.blankNode();
84
- for (var _i = 0, _Object$keys = Object.keys(flatResource); _i < _Object$keys.length; _i++) {
85
- var property = _Object$keys[_i];
77
+ const id = flatResource['@id'] ? nodeType(kb, flatResource) : kb.rdfFactory.blankNode();
78
+ for (const property of Object.keys(flatResource)) {
86
79
  if (property === '@id') {
87
80
  continue;
88
81
  } else if (property == '@graph') {
89
82
  // the JSON-LD flattened structure may contain nested graphs
90
83
  // the id value for this object is the new base (named graph id) for all nested flat resources
91
- var graphId = id;
84
+ const graphId = id;
92
85
  // this is an array of resources
93
- var nestedFlatResources = flatResource[property];
86
+ const nestedFlatResources = flatResource[property];
94
87
 
95
88
  // recursively process all flat resources in the array, but with the graphId as base.
96
- for (var i = 0; i < nestedFlatResources.length; i++) {
89
+ for (let i = 0; i < nestedFlatResources.length; i++) {
97
90
  kb = processResource(kb, graphId, nestedFlatResources[i]);
98
91
  }
99
92
  }
100
- var value = flatResource[property];
93
+ const value = flatResource[property];
101
94
  if (Array.isArray(value)) {
102
- for (var _i2 = 0; _i2 < value.length; _i2++) {
103
- kb.addStatement(createStatement(kb, id, property, value[_i2], base));
95
+ for (let i = 0; i < value.length; i++) {
96
+ kb.addStatement(createStatement(kb, id, property, value[i], base));
104
97
  }
105
98
  } else {
106
99
  kb.addStatement(createStatement(kb, id, property, value, base));
@@ -118,7 +111,7 @@ function processResource(kb, base, flatResource) {
118
111
  * @return quad statement
119
112
  */
120
113
  function createStatement(kb, id, property, value, base) {
121
- var predicate, object;
114
+ let predicate, object;
122
115
  if (property === "@type") {
123
116
  predicate = kb.rdfFactory.namedNode("http://www.w3.org/1999/02/22-rdf-syntax-ns#type");
124
117
  object = kb.rdfFactory.namedNode(value);
package/esm/jsonparser.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default (function () {
2
2
  return {
3
- parseJSON: function parseJSON(data, source, store) {
3
+ parseJSON: function (data, source, store) {
4
4
  var subject, predicate, object;
5
5
  var bnodes = {};
6
6
  var why = store.sym(source);
package/esm/lists.js CHANGED
@@ -1,6 +1,3 @@
1
- function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
2
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
3
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
4
1
  /* Lists form conversion
5
2
  */
6
3
 
@@ -25,7 +22,7 @@ import Statement from './statement';
25
22
  // import { Quad } from './tf-types'
26
23
 
27
24
  import Namespace from './namespace';
28
- var RDF = Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#');
25
+ const RDF = Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#');
29
26
 
30
27
  /* Replace a given node with another node throughout a given document
31
28
  *
@@ -33,83 +30,38 @@ var RDF = Namespace('http://www.w3.org/1999/02/22-rdf-syntax-ns#');
33
30
  */
34
31
  export function substituteInDoc(store, x, y, doc) {
35
32
  // console.log(`substituteInDoc put ${x} for ${y} in ${doc}}`)
36
- var _iterator = _createForOfIteratorHelper(store.statementsMatching(y, null, null, doc)),
37
- _step;
38
- try {
39
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
40
- var quad = _step.value;
41
- var newStatement = new Statement(x, quad.predicate, quad.object, doc);
42
- store.remove(quad);
43
- store.add(newStatement);
44
- }
45
- } catch (err) {
46
- _iterator.e(err);
47
- } finally {
48
- _iterator.f();
33
+ for (const quad of store.statementsMatching(y, null, null, doc)) {
34
+ const newStatement = new Statement(x, quad.predicate, quad.object, doc);
35
+ store.remove(quad);
36
+ store.add(newStatement);
49
37
  }
50
- var _iterator2 = _createForOfIteratorHelper(store.statementsMatching(null, y, null, doc)),
51
- _step2;
52
- try {
53
- for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
54
- var _quad = _step2.value;
55
- store.remove(_quad);
56
- // console.log(` substituteInDoc predicate ${x} in ${quad}}`)
57
- store.add(new Statement(_quad.subject, x, _quad.object, doc));
58
- }
59
- } catch (err) {
60
- _iterator2.e(err);
61
- } finally {
62
- _iterator2.f();
38
+ for (const quad of store.statementsMatching(null, y, null, doc)) {
39
+ store.remove(quad);
40
+ // console.log(` substituteInDoc predicate ${x} in ${quad}}`)
41
+ store.add(new Statement(quad.subject, x, quad.object, doc));
63
42
  }
64
- var _iterator3 = _createForOfIteratorHelper(store.statementsMatching(null, null, y, doc)),
65
- _step3;
66
- try {
67
- for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
68
- var _quad2 = _step3.value;
69
- store.remove(_quad2);
70
- store.add(new Statement(_quad2.subject, _quad2.predicate, x, doc));
71
- }
72
- } catch (err) {
73
- _iterator3.e(err);
74
- } finally {
75
- _iterator3.f();
43
+ for (const quad of store.statementsMatching(null, null, y, doc)) {
44
+ store.remove(quad);
45
+ store.add(new Statement(quad.subject, quad.predicate, x, doc));
76
46
  }
77
47
  }
78
48
 
79
49
  /* Change all lone rdf:nil nodes into empty Collections
80
50
  */
81
51
  export function substituteNillsInDoc(store, doc) {
82
- var x = RDF('nil');
83
- var _iterator4 = _createForOfIteratorHelper(store.statementsMatching(x, null, null, doc)),
84
- _step4;
85
- try {
86
- for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
87
- var quad = _step4.value;
88
- store.remove(quad);
89
- var y = new Collection();
90
- store.add(new Statement(y, quad.predicate, quad.object, doc));
91
- }
92
- } catch (err) {
93
- _iterator4.e(err);
94
- } finally {
95
- _iterator4.f();
52
+ const x = RDF('nil');
53
+ for (const quad of store.statementsMatching(x, null, null, doc)) {
54
+ store.remove(quad);
55
+ const y = new Collection();
56
+ store.add(new Statement(y, quad.predicate, quad.object, doc));
96
57
  }
97
- var _iterator5 = _createForOfIteratorHelper(store.statementsMatching(null, null, x, doc)),
98
- _step5;
99
- try {
100
- for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {
101
- var _quad3 = _step5.value;
102
- if (!_quad3.predicate.sameTerm(RDF('rest'))) {
103
- // If not a tail
104
- store.remove(_quad3);
105
- var _y = new Collection();
106
- store.add(new Statement(_quad3.subject, _quad3.predicate, _y, doc));
107
- }
58
+ for (const quad of store.statementsMatching(null, null, x, doc)) {
59
+ if (!quad.predicate.sameTerm(RDF('rest'))) {
60
+ // If not a tail
61
+ store.remove(quad);
62
+ const y = new Collection();
63
+ store.add(new Statement(quad.subject, quad.predicate, y, doc));
108
64
  }
109
- } catch (err) {
110
- _iterator5.e(err);
111
- } finally {
112
- _iterator5.f();
113
65
  }
114
66
  }
115
67
  /**
@@ -124,34 +76,34 @@ export function substituteNillsInDoc(store, doc) {
124
76
  export function convertFirstRestNil(store, doc // Do whole store?
125
77
  ) {
126
78
  function preceding(ele, listSoFar, trash) {
127
- var rests = store.statementsMatching(ele, RDF('rest'), null, doc);
128
- if (rests.length !== 1) throw new Error("Bad list structure: no rest at ".concat(ele));
129
- var firsts = store.statementsMatching(ele, RDF('first'), null, doc);
130
- if (firsts.length !== 1) throw new Error("Bad list structure: rest but ".concat(firsts.length, " firsts at ").concat(ele));
131
- var value = firsts[0].object;
132
- var total = [value].concat(listSoFar);
79
+ const rests = store.statementsMatching(ele, RDF('rest'), null, doc);
80
+ if (rests.length !== 1) throw new Error(`Bad list structure: no rest at ${ele}`);
81
+ const firsts = store.statementsMatching(ele, RDF('first'), null, doc);
82
+ if (firsts.length !== 1) throw new Error(`Bad list structure: rest but ${firsts.length} firsts at ${ele}`);
83
+ const value = firsts[0].object;
84
+ const total = [value].concat(listSoFar);
133
85
  // console.log(' List now is: ', total)
134
- var totalTrash = trash.concat(rests).concat(firsts);
135
- var pres = store.statementsMatching(null, RDF('rest'), ele, doc);
86
+ const totalTrash = trash.concat(rests).concat(firsts);
87
+ const pres = store.statementsMatching(null, RDF('rest'), ele, doc);
136
88
  if (pres.length === 0) {
137
89
  // Head of the list
138
- var newList = new Collection(total);
90
+ const newList = new Collection(total);
139
91
  store.remove(totalTrash);
140
92
  // Replace old list with new list:
141
93
  substituteInDoc(store, newList, ele, doc);
142
94
  return;
143
95
  }
144
- if (pres.length !== 1) throw new Error("Bad list structure: ".concat(pres.length, " pres at ").concat(ele));
145
- var pre = pres[0].subject;
146
- if (pre.termType !== 'BlankNode') throw new Error("Bad list element node ".concat(pre, " type: ").concat(pre.termType, " "));
96
+ if (pres.length !== 1) throw new Error(`Bad list structure: ${pres.length} pres at ${ele}`);
97
+ const pre = pres[0].subject;
98
+ if (pre.termType !== 'BlankNode') throw new Error(`Bad list element node ${pre} type: ${pre.termType} `);
147
99
  preceding(pre, total, totalTrash);
148
100
  return;
149
101
  }
150
102
  substituteNillsInDoc(store, doc); // lone ones only
151
103
 
152
- var tails = store.statementsMatching(null, RDF('rest'), RDF('nil'), doc);
153
- tails.forEach(function (tail) {
154
- if (tail.subject.termType !== 'BlankNode') throw new Error("Bad list element node ".concat(tail.subject, " type: ").concat(tail.subject.termType, " "));
104
+ const tails = store.statementsMatching(null, RDF('rest'), RDF('nil'), doc);
105
+ tails.forEach(tail => {
106
+ if (tail.subject.termType !== 'BlankNode') throw new Error(`Bad list element node ${tail.subject} type: ${tail.subject.termType} `);
155
107
  preceding(tail.subject, [], []);
156
108
  });
157
109
  }