rdflib 2.2.26-0aa57642 → 2.2.26-2

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 (194) hide show
  1. package/.babelrc +0 -0
  2. package/README.md +0 -0
  3. package/dist/670.rdflib.min.js +0 -0
  4. package/dist/730.rdflib.min.js +0 -0
  5. package/dist/730.rdflib.min.js.LICENSE.txt +0 -0
  6. package/dist/730.rdflib.min.js.map +0 -0
  7. package/dist/rdflib.min.js +1 -1
  8. package/dist/rdflib.min.js.LICENSE.txt +59 -0
  9. package/dist/rdflib.min.js.map +1 -1
  10. package/esm/blank-node.js +0 -0
  11. package/esm/class-order.js +0 -0
  12. package/esm/collection.js +4 -3
  13. package/esm/default-graph.js +0 -0
  14. package/esm/empty.js +0 -0
  15. package/esm/factories/canonical-data-factory.js +0 -0
  16. package/esm/factories/extended-term-factory.js +0 -0
  17. package/esm/factories/factory-types.js +0 -0
  18. package/esm/factories/rdflib-data-factory.js +0 -0
  19. package/esm/fetcher.js +0 -0
  20. package/esm/formula.js +0 -0
  21. package/esm/index.js +0 -0
  22. package/esm/jsonldparser.js +6 -4
  23. package/esm/jsonparser.js +0 -0
  24. package/esm/lists.js +0 -0
  25. package/esm/literal.js +0 -0
  26. package/esm/log.js +0 -0
  27. package/esm/n3parser.js +0 -0
  28. package/esm/named-node.js +0 -0
  29. package/esm/namespace.js +0 -0
  30. package/esm/node-internal.js +0 -0
  31. package/esm/node.js +0 -0
  32. package/esm/parse.js +0 -0
  33. package/esm/patch-parser.js +0 -0
  34. package/esm/query-to-sparql.js +0 -0
  35. package/esm/query.js +0 -0
  36. package/esm/rdfaparser.js +0 -0
  37. package/esm/rdfxmlparser.js +0 -0
  38. package/esm/serialize.js +0 -0
  39. package/esm/serializer.js +0 -0
  40. package/esm/sparql-to-query.js +0 -0
  41. package/esm/statement.js +0 -0
  42. package/esm/store.js +4 -4
  43. package/esm/tf-types.js +0 -0
  44. package/esm/types.js +0 -0
  45. package/esm/update-manager.js +0 -0
  46. package/esm/updates-via.js +0 -0
  47. package/esm/uri.js +0 -0
  48. package/esm/utils/default-graph-uri.js +0 -0
  49. package/esm/utils/termValue.js +0 -0
  50. package/esm/utils/terms.js +0 -0
  51. package/esm/utils-js.js +0 -0
  52. package/esm/utils.js +0 -0
  53. package/esm/variable.js +0 -0
  54. package/esm/xsd-internal.js +0 -0
  55. package/esm/xsd.js +0 -0
  56. package/lib/blank-node.d.ts +0 -0
  57. package/lib/blank-node.js +0 -0
  58. package/lib/class-order.d.ts +0 -0
  59. package/lib/class-order.js +0 -0
  60. package/lib/collection.d.ts +0 -0
  61. package/lib/collection.js +4 -3
  62. package/lib/default-graph.d.ts +0 -0
  63. package/lib/default-graph.js +0 -0
  64. package/lib/empty.d.ts +0 -0
  65. package/lib/empty.js +0 -0
  66. package/lib/factories/canonical-data-factory.d.ts +0 -0
  67. package/lib/factories/canonical-data-factory.js +0 -0
  68. package/lib/factories/extended-term-factory.d.ts +0 -0
  69. package/lib/factories/extended-term-factory.js +0 -0
  70. package/lib/factories/factory-types.d.ts +0 -0
  71. package/lib/factories/factory-types.js +0 -0
  72. package/lib/factories/rdflib-data-factory.d.ts +0 -0
  73. package/lib/factories/rdflib-data-factory.js +0 -0
  74. package/lib/fetcher.d.ts +0 -0
  75. package/lib/fetcher.js +0 -0
  76. package/lib/formula.d.ts +0 -0
  77. package/lib/formula.js +0 -0
  78. package/lib/index.d.ts +0 -0
  79. package/lib/index.js +0 -0
  80. package/lib/jsonldparser.d.ts +0 -0
  81. package/lib/jsonldparser.js +6 -9
  82. package/lib/jsonparser.d.ts +0 -0
  83. package/lib/jsonparser.js +0 -0
  84. package/lib/lists.d.ts +0 -0
  85. package/lib/lists.js +0 -0
  86. package/lib/literal.d.ts +0 -0
  87. package/lib/literal.js +0 -0
  88. package/lib/log.d.ts +0 -0
  89. package/lib/log.js +0 -0
  90. package/lib/n3parser.d.ts +0 -0
  91. package/lib/n3parser.js +0 -0
  92. package/lib/named-node.d.ts +0 -0
  93. package/lib/named-node.js +0 -0
  94. package/lib/namespace.d.ts +0 -0
  95. package/lib/namespace.js +0 -0
  96. package/lib/node-internal.d.ts +0 -0
  97. package/lib/node-internal.js +0 -0
  98. package/lib/node.d.ts +0 -0
  99. package/lib/node.js +0 -0
  100. package/lib/parse.d.ts +0 -0
  101. package/lib/parse.js +0 -0
  102. package/lib/patch-parser.d.ts +0 -0
  103. package/lib/patch-parser.js +0 -0
  104. package/lib/query-to-sparql.d.ts +0 -0
  105. package/lib/query-to-sparql.js +0 -0
  106. package/lib/query.d.ts +0 -0
  107. package/lib/query.js +0 -0
  108. package/lib/rdfaparser.d.ts +0 -0
  109. package/lib/rdfaparser.js +0 -0
  110. package/lib/rdfxmlparser.d.ts +0 -0
  111. package/lib/rdfxmlparser.js +0 -0
  112. package/lib/serialize.d.ts +0 -0
  113. package/lib/serialize.js +0 -0
  114. package/lib/serializer.d.ts +0 -0
  115. package/lib/serializer.js +0 -0
  116. package/lib/sparql-to-query.d.ts +0 -0
  117. package/lib/sparql-to-query.js +0 -0
  118. package/lib/statement.d.ts +0 -0
  119. package/lib/statement.js +0 -0
  120. package/lib/store.d.ts +1 -1
  121. package/lib/store.js +4 -4
  122. package/lib/tf-types.d.ts +0 -0
  123. package/lib/tf-types.js +0 -0
  124. package/lib/types.d.ts +0 -0
  125. package/lib/types.js +0 -0
  126. package/lib/update-manager.d.ts +0 -0
  127. package/lib/update-manager.js +0 -0
  128. package/lib/updates-via.d.ts +0 -0
  129. package/lib/updates-via.js +0 -0
  130. package/lib/uri.d.ts +0 -0
  131. package/lib/uri.js +0 -0
  132. package/lib/utils/default-graph-uri.d.ts +0 -0
  133. package/lib/utils/default-graph-uri.js +0 -0
  134. package/lib/utils/termValue.d.ts +0 -0
  135. package/lib/utils/termValue.js +0 -0
  136. package/lib/utils/terms.d.ts +0 -0
  137. package/lib/utils/terms.js +0 -0
  138. package/lib/utils-js.d.ts +0 -0
  139. package/lib/utils-js.js +0 -0
  140. package/lib/utils.d.ts +0 -0
  141. package/lib/utils.js +0 -0
  142. package/lib/variable.d.ts +0 -0
  143. package/lib/variable.js +0 -0
  144. package/lib/xsd-internal.d.ts +0 -0
  145. package/lib/xsd-internal.js +0 -0
  146. package/lib/xsd.d.ts +0 -0
  147. package/lib/xsd.js +0 -0
  148. package/package.json +3 -3
  149. package/src/blank-node.ts +0 -0
  150. package/src/class-order.ts +0 -0
  151. package/src/collection.ts +3 -3
  152. package/src/default-graph.ts +0 -0
  153. package/src/empty.ts +0 -0
  154. package/src/factories/canonical-data-factory.ts +0 -0
  155. package/src/factories/extended-term-factory.ts +0 -0
  156. package/src/factories/factory-types.ts +0 -0
  157. package/src/factories/rdflib-data-factory.ts +0 -0
  158. package/src/fetcher.ts +0 -0
  159. package/src/formula.ts +0 -0
  160. package/src/index.ts +0 -0
  161. package/src/jsonldparser.js +4 -2
  162. package/src/jsonparser.js +0 -0
  163. package/src/lists.ts +0 -0
  164. package/src/literal.ts +0 -0
  165. package/src/log.js +0 -0
  166. package/src/n3parser.js +0 -0
  167. package/src/named-node.ts +0 -0
  168. package/src/namespace.ts +0 -0
  169. package/src/node-internal.ts +0 -0
  170. package/src/node.ts +0 -0
  171. package/src/parse.ts +0 -0
  172. package/src/patch-parser.js +0 -0
  173. package/src/query-to-sparql.js +0 -0
  174. package/src/query.js +0 -0
  175. package/src/rdfaparser.js +0 -0
  176. package/src/rdfxmlparser.js +0 -0
  177. package/src/serialize.ts +0 -0
  178. package/src/serializer.js +0 -0
  179. package/src/sparql-to-query.js +0 -0
  180. package/src/statement.ts +0 -0
  181. package/src/store.ts +6 -5
  182. package/src/tf-types.ts +0 -0
  183. package/src/types.ts +0 -0
  184. package/src/update-manager.ts +0 -0
  185. package/src/updates-via.js +0 -0
  186. package/src/uri.ts +0 -0
  187. package/src/utils/default-graph-uri.ts +0 -0
  188. package/src/utils/termValue.ts +0 -0
  189. package/src/utils/terms.ts +0 -0
  190. package/src/utils-js.js +0 -0
  191. package/src/utils.ts +0 -0
  192. package/src/variable.ts +0 -0
  193. package/src/xsd-internal.js +0 -0
  194. package/src/xsd.js +0 -0
package/esm/blank-node.js CHANGED
File without changes
File without changes
package/esm/collection.js CHANGED
@@ -109,10 +109,11 @@ var Collection = /*#__PURE__*/function (_Node) {
109
109
  }, {
110
110
  key: "substitute",
111
111
  value: function substitute(bindings) {
112
- var elementsCopy = this.elements.map(function (ea) {
113
- return ea.substitute(bindings);
112
+ var collection = new Collection();
113
+ this.elements.forEach(function (ea) {
114
+ collection.append(ea.substitute(bindings));
114
115
  });
115
- return new Collection(elementsCopy);
116
+ return collection;
116
117
  }
117
118
  }, {
118
119
  key: "toNT",
File without changes
package/esm/empty.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
package/esm/fetcher.js CHANGED
File without changes
package/esm/formula.js CHANGED
File without changes
package/esm/index.js CHANGED
File without changes
@@ -1,3 +1,4 @@
1
+ import jsonld from 'jsonld';
1
2
  import { arrayToStatements } from './utils';
2
3
 
3
4
  /**
@@ -59,10 +60,11 @@ function listToCollection(kb, obj) {
59
60
  */
60
61
  export default function jsonldParser(str, kb, base, callback) {
61
62
  var baseString = base && Object.prototype.hasOwnProperty.call(base, 'termType') ? base.value : base;
62
- return import('jsonld').then(function (jsonld) {
63
- return jsonld.flatten(JSON.parse(str), null, {
64
- base: baseString
65
- });
63
+ return jsonld.flatten(JSON.parse(str), null, {
64
+ base: baseString
65
+ }).then(function (flattened) {
66
+ console.log(flattened);
67
+ return flattened;
66
68
  }).then(function (flattened) {
67
69
  return flattened.reduce(function (store, flatResource) {
68
70
  kb = processResource(kb, base, flatResource);
package/esm/jsonparser.js CHANGED
File without changes
package/esm/lists.js CHANGED
File without changes
package/esm/literal.js CHANGED
File without changes
package/esm/log.js CHANGED
File without changes
package/esm/n3parser.js CHANGED
File without changes
package/esm/named-node.js CHANGED
File without changes
package/esm/namespace.js CHANGED
File without changes
File without changes
package/esm/node.js CHANGED
File without changes
package/esm/parse.js CHANGED
File without changes
File without changes
File without changes
package/esm/query.js CHANGED
File without changes
package/esm/rdfaparser.js CHANGED
File without changes
File without changes
package/esm/serialize.js CHANGED
File without changes
package/esm/serializer.js CHANGED
File without changes
File without changes
package/esm/statement.js CHANGED
File without changes
package/esm/store.js CHANGED
@@ -237,9 +237,9 @@ var IndexedFormula = /*#__PURE__*/function (_Formula) {
237
237
  // console.log('ds before substitute: ' + ds)
238
238
  if (binding) ds = ds.substitute(binding);
239
239
  // console.log('applyPatch: delete: ' + ds)
240
- ds = ds.statements;
240
+
241
241
  var bad = [];
242
- var ds2 = ds.map(function (st) {
242
+ var ds2 = ds.elements.map(function (st) {
243
243
  // Find the actual statements in the store
244
244
  var sts = targetKB.statementsMatching(st.subject, st.predicate, st.object, target);
245
245
  if (sts.length === 0) {
@@ -264,8 +264,7 @@ var IndexedFormula = /*#__PURE__*/function (_Formula) {
264
264
  // log.info("doPatch insert "+patch['insert'])
265
265
  ds = patch['insert'];
266
266
  if (binding) ds = ds.substitute(binding);
267
- ds = ds.statements;
268
- ds.map(function (st) {
267
+ ds.elements.map(function (st) {
269
268
  st.graph = target;
270
269
  targetKB.add(st.subject, st.predicate, st.object, st.graph);
271
270
  });
@@ -282,6 +281,7 @@ var IndexedFormula = /*#__PURE__*/function (_Formula) {
282
281
  //@ts-ignore TODO: add sync property to Query when converting Query to typescript
283
282
  query.sync = true;
284
283
  var bindingsFound = [];
284
+ query.pat.initBindings = [];
285
285
  targetKB.query(query, function onBinding(binding) {
286
286
  bindingsFound.push(binding);
287
287
  // console.log(' got a binding: ' + bindingDebug(binding))
package/esm/tf-types.js CHANGED
File without changes
package/esm/types.js CHANGED
File without changes
File without changes
File without changes
package/esm/uri.js CHANGED
File without changes
File without changes
File without changes
File without changes
package/esm/utils-js.js CHANGED
File without changes
package/esm/utils.js CHANGED
File without changes
package/esm/variable.js CHANGED
File without changes
File without changes
package/esm/xsd.js CHANGED
File without changes
File without changes
package/lib/blank-node.js CHANGED
File without changes
File without changes
File without changes
File without changes
package/lib/collection.js CHANGED
@@ -117,10 +117,11 @@ var Collection = /*#__PURE__*/function (_Node) {
117
117
  }, {
118
118
  key: "substitute",
119
119
  value: function substitute(bindings) {
120
- var elementsCopy = this.elements.map(function (ea) {
121
- return ea.substitute(bindings);
120
+ var collection = new Collection();
121
+ this.elements.forEach(function (ea) {
122
+ collection.append(ea.substitute(bindings));
122
123
  });
123
- return new Collection(elementsCopy);
124
+ return collection;
124
125
  }
125
126
  }, {
126
127
  key: "toNT",
File without changes
File without changes
package/lib/empty.d.ts CHANGED
File without changes
package/lib/empty.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/fetcher.d.ts CHANGED
File without changes
package/lib/fetcher.js CHANGED
File without changes
package/lib/formula.d.ts CHANGED
File without changes
package/lib/formula.js CHANGED
File without changes
package/lib/index.d.ts CHANGED
File without changes
package/lib/index.js CHANGED
File without changes
File without changes
@@ -6,10 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = jsonldParser;
8
8
  exports.jsonldObjectToTerm = jsonldObjectToTerm;
9
- var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
+ var _jsonld = _interopRequireDefault(require("jsonld"));
10
10
  var _utils = require("./utils");
11
- function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
12
- function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || (0, _typeof2.default)(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
13
11
  /**
14
12
  * Parses json-ld formatted JS objects to a rdf Term.
15
13
  * @param kb - The DataFactory to use.
@@ -69,12 +67,11 @@ function listToCollection(kb, obj) {
69
67
  */
70
68
  function jsonldParser(str, kb, base, callback) {
71
69
  var baseString = base && Object.prototype.hasOwnProperty.call(base, 'termType') ? base.value : base;
72
- return Promise.resolve().then(function () {
73
- return _interopRequireWildcard(require('jsonld'));
74
- }).then(function (jsonld) {
75
- return jsonld.flatten(JSON.parse(str), null, {
76
- base: baseString
77
- });
70
+ return _jsonld.default.flatten(JSON.parse(str), null, {
71
+ base: baseString
72
+ }).then(function (flattened) {
73
+ console.log(flattened);
74
+ return flattened;
78
75
  }).then(function (flattened) {
79
76
  return flattened.reduce(function (store, flatResource) {
80
77
  kb = processResource(kb, base, flatResource);
File without changes
package/lib/jsonparser.js CHANGED
File without changes
package/lib/lists.d.ts CHANGED
File without changes
package/lib/lists.js CHANGED
File without changes
package/lib/literal.d.ts CHANGED
File without changes
package/lib/literal.js CHANGED
File without changes
package/lib/log.d.ts CHANGED
File without changes
package/lib/log.js CHANGED
File without changes
package/lib/n3parser.d.ts CHANGED
File without changes
package/lib/n3parser.js CHANGED
File without changes
File without changes
package/lib/named-node.js CHANGED
File without changes
File without changes
package/lib/namespace.js CHANGED
File without changes
File without changes
File without changes
package/lib/node.d.ts CHANGED
File without changes
package/lib/node.js CHANGED
File without changes
package/lib/parse.d.ts CHANGED
File without changes
package/lib/parse.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/query.d.ts CHANGED
File without changes
package/lib/query.js CHANGED
File without changes
File without changes
package/lib/rdfaparser.js CHANGED
File without changes
File without changes
File without changes
File without changes
package/lib/serialize.js CHANGED
File without changes
File without changes
package/lib/serializer.js CHANGED
File without changes
File without changes
File without changes
File without changes
package/lib/statement.js CHANGED
File without changes
package/lib/store.d.ts CHANGED
@@ -95,7 +95,7 @@ export default class IndexedFormula extends Formula {
95
95
  */
96
96
  applyPatch(patch: {
97
97
  delete?: ReadonlyArray<Statement>;
98
- patch?: ReadonlyArray<Statement>;
98
+ insert?: ReadonlyArray<Statement>;
99
99
  where?: any;
100
100
  }, target: TFNamedNode, patchCallback: (errorString?: string) => void): void;
101
101
  /**
package/lib/store.js CHANGED
@@ -226,9 +226,9 @@ var IndexedFormula = /*#__PURE__*/function (_Formula) {
226
226
  // console.log('ds before substitute: ' + ds)
227
227
  if (binding) ds = ds.substitute(binding);
228
228
  // console.log('applyPatch: delete: ' + ds)
229
- ds = ds.statements;
229
+
230
230
  var bad = [];
231
- var ds2 = ds.map(function (st) {
231
+ var ds2 = ds.elements.map(function (st) {
232
232
  // Find the actual statements in the store
233
233
  var sts = targetKB.statementsMatching(st.subject, st.predicate, st.object, target);
234
234
  if (sts.length === 0) {
@@ -253,8 +253,7 @@ var IndexedFormula = /*#__PURE__*/function (_Formula) {
253
253
  // log.info("doPatch insert "+patch['insert'])
254
254
  ds = patch['insert'];
255
255
  if (binding) ds = ds.substitute(binding);
256
- ds = ds.statements;
257
- ds.map(function (st) {
256
+ ds.elements.map(function (st) {
258
257
  st.graph = target;
259
258
  targetKB.add(st.subject, st.predicate, st.object, st.graph);
260
259
  });
@@ -271,6 +270,7 @@ var IndexedFormula = /*#__PURE__*/function (_Formula) {
271
270
  //@ts-ignore TODO: add sync property to Query when converting Query to typescript
272
271
  query.sync = true;
273
272
  var bindingsFound = [];
273
+ query.pat.initBindings = [];
274
274
  targetKB.query(query, function onBinding(binding) {
275
275
  bindingsFound.push(binding);
276
276
  // console.log(' got a binding: ' + bindingDebug(binding))
package/lib/tf-types.d.ts CHANGED
File without changes
package/lib/tf-types.js CHANGED
File without changes
package/lib/types.d.ts CHANGED
File without changes
package/lib/types.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/uri.d.ts CHANGED
File without changes
package/lib/uri.js CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
package/lib/utils-js.d.ts CHANGED
File without changes
package/lib/utils-js.js CHANGED
File without changes
package/lib/utils.d.ts CHANGED
File without changes
package/lib/utils.js CHANGED
File without changes
package/lib/variable.d.ts CHANGED
File without changes
package/lib/variable.js CHANGED
File without changes
File without changes
File without changes
package/lib/xsd.d.ts CHANGED
File without changes
package/lib/xsd.js CHANGED
File without changes
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "rdflib",
3
3
  "description": "an RDF library for node.js. Suitable for client and server side.",
4
- "version": "2.2.26-0aa57642",
4
+ "version": "2.2.26-2",
5
5
  "private": false,
6
6
  "browserslist": [
7
7
  "> 0.5%"
@@ -48,7 +48,7 @@
48
48
  "@frogcat/ttl2jsonld": "^0.0.9",
49
49
  "@xmldom/xmldom": "^0.8.6",
50
50
  "cross-fetch": "^3.1.5",
51
- "jsonld": "^8.1.0",
51
+ "jsonld": "^5.2.0",
52
52
  "n3": "^1.16.3",
53
53
  "solid-namespace": "^0.5.2"
54
54
  },
@@ -94,7 +94,7 @@
94
94
  "build:types": "tsc --emitDeclarationOnly -d --moduleResolution node --declarationDir lib",
95
95
  "build:all": "npm run build && npm run build:types && npm run build:browser && npm run build:esm",
96
96
  "doc": "typedoc --out ./doc ./src/index.ts --excludePrivate --excludeInternal --tsconfig ./tsconfig.json",
97
- "ignore:prepublishOnly": "npm ci && npm run build:all && npm run doc && npm run test",
97
+ "prepublishOnly": "npm ci && npm run build:all && npm run doc && npm run test",
98
98
  "postversion": "git push --follow-tags",
99
99
  "start": "webpack serve --port 4800",
100
100
  "test": "npm run test:unit && npm run test:serialize && npm run test:types",
package/src/blank-node.ts CHANGED
File without changes
File without changes
package/src/collection.ts CHANGED
@@ -102,9 +102,9 @@ export default class Collection<
102
102
  * @param bindings - The bindings to substitute
103
103
  */
104
104
  substitute (bindings: Bindings) {
105
- const elementsCopy = this.elements.map((ea) => ea.substitute(bindings))
106
-
107
- return new Collection(elementsCopy) as Collection<Node | Collection<any> | Literal | Variable>
105
+ let collection = new Collection();
106
+ this.elements.forEach((ea) => {collection.append(ea.substitute(bindings))})
107
+ return collection as Collection<Node | Collection<any> | Literal | Variable>;
108
108
  }
109
109
 
110
110
  toNT () {
File without changes
package/src/empty.ts CHANGED
File without changes
File without changes
File without changes
File without changes
File without changes
package/src/fetcher.ts CHANGED
File without changes
package/src/formula.ts CHANGED
File without changes
package/src/index.ts CHANGED
File without changes
@@ -1,3 +1,4 @@
1
+ import jsonld from 'jsonld'
1
2
  import { arrayToStatements } from './utils'
2
3
 
3
4
  /**
@@ -68,8 +69,9 @@ export default function jsonldParser (str, kb, base, callback) {
68
69
  ? base.value
69
70
  : base
70
71
 
71
- return import('jsonld')
72
- .then(jsonld => { return jsonld.flatten(JSON.parse(str), null, { base: baseString }) })
72
+ return jsonld
73
+ .flatten(JSON.parse(str), null, { base: baseString })
74
+ .then(flattened => { console.log(flattened); return flattened })
73
75
  .then((flattened) => flattened.reduce((store, flatResource) => {
74
76
 
75
77
  kb = processResource(kb, base, flatResource)
package/src/jsonparser.js CHANGED
File without changes
package/src/lists.ts CHANGED
File without changes
package/src/literal.ts CHANGED
File without changes
package/src/log.js CHANGED
File without changes
package/src/n3parser.js CHANGED
File without changes
package/src/named-node.ts CHANGED
File without changes
package/src/namespace.ts CHANGED
File without changes
File without changes
package/src/node.ts CHANGED
File without changes
package/src/parse.ts CHANGED
File without changes
File without changes
File without changes