rdflib 2.2.21 → 2.2.22-0de51c50

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 (115) hide show
  1. package/dist/rdflib.min.js +1 -1
  2. package/dist/rdflib.min.js.LICENSE.txt +13 -1
  3. package/dist/rdflib.min.js.map +1 -1
  4. package/esm/blank-node.js +3 -27
  5. package/esm/collection.js +7 -29
  6. package/esm/default-graph.js +1 -15
  7. package/esm/empty.js +0 -13
  8. package/esm/factories/canonical-data-factory.js +5 -40
  9. package/esm/factories/extended-term-factory.js +0 -11
  10. package/esm/factories/factory-types.js +2 -1
  11. package/esm/factories/rdflib-data-factory.js +0 -8
  12. package/esm/fetcher.js +257 -481
  13. package/esm/formula.js +43 -142
  14. package/esm/index.js +19 -36
  15. package/esm/jsonldparser.js +20 -29
  16. package/esm/jsonparser.js +0 -7
  17. package/esm/lists.js +18 -33
  18. package/esm/literal.js +10 -42
  19. package/esm/n3parser.js +38 -351
  20. package/esm/named-node.js +8 -27
  21. package/esm/namespace.js +0 -1
  22. package/esm/node-internal.js +11 -24
  23. package/esm/node.js +1 -6
  24. package/esm/parse.js +10 -17
  25. package/esm/patch-parser.js +9 -29
  26. package/esm/query-to-sparql.js +0 -18
  27. package/esm/query.js +50 -133
  28. package/esm/rdfaparser.js +72 -210
  29. package/esm/rdfxmlparser.js +31 -128
  30. package/esm/serialize.js +8 -33
  31. package/esm/serializer.js +122 -286
  32. package/esm/sparql-to-query.js +44 -134
  33. package/esm/statement.js +8 -19
  34. package/esm/store.js +109 -280
  35. package/esm/types.js +3 -2
  36. package/esm/update-manager.js +110 -246
  37. package/esm/updates-via.js +0 -27
  38. package/esm/uri.js +6 -50
  39. package/esm/utils/default-graph-uri.js +1 -0
  40. package/esm/utils/termValue.js +0 -1
  41. package/esm/utils/terms.js +15 -16
  42. package/esm/utils-js.js +16 -57
  43. package/esm/utils.js +4 -15
  44. package/esm/variable.js +0 -20
  45. package/lib/blank-node.js +3 -28
  46. package/lib/class-order.js +0 -1
  47. package/lib/collection.js +7 -34
  48. package/lib/default-graph.js +0 -20
  49. package/lib/empty.js +0 -18
  50. package/lib/factories/canonical-data-factory.js +4 -51
  51. package/lib/factories/extended-term-factory.js +0 -18
  52. package/lib/factories/factory-types.d.ts +6 -6
  53. package/lib/factories/factory-types.js +0 -3
  54. package/lib/factories/rdflib-data-factory.js +0 -12
  55. package/lib/fetcher.d.ts +6 -6
  56. package/lib/fetcher.js +258 -470
  57. package/lib/formula.d.ts +1 -1
  58. package/lib/formula.js +43 -151
  59. package/lib/index.d.ts +1 -2
  60. package/lib/index.js +14 -82
  61. package/lib/jsonldparser.js +19 -33
  62. package/lib/jsonparser.js +0 -9
  63. package/lib/lists.js +14 -39
  64. package/lib/literal.js +10 -49
  65. package/lib/log.d.ts +0 -6
  66. package/lib/log.js +0 -1
  67. package/lib/n3parser.d.ts +1 -0
  68. package/lib/n3parser.js +39 -359
  69. package/lib/named-node.js +7 -35
  70. package/lib/namespace.js +0 -3
  71. package/lib/node-internal.js +11 -21
  72. package/lib/node.js +1 -11
  73. package/lib/parse.d.ts +1 -1
  74. package/lib/parse.js +8 -27
  75. package/lib/patch-parser.js +10 -33
  76. package/lib/query-to-sparql.js +0 -23
  77. package/lib/query.js +46 -152
  78. package/lib/rdfaparser.js +72 -220
  79. package/lib/rdfxmlparser.js +31 -132
  80. package/lib/serialize.d.ts +1 -1
  81. package/lib/serialize.js +8 -43
  82. package/lib/serializer.d.ts +1 -0
  83. package/lib/serializer.js +121 -297
  84. package/lib/sparql-to-query.js +42 -167
  85. package/lib/statement.js +8 -24
  86. package/lib/store.d.ts +2 -2
  87. package/lib/store.js +102 -282
  88. package/lib/tf-types.d.ts +4 -4
  89. package/lib/types.d.ts +8 -8
  90. package/lib/types.js +3 -3
  91. package/lib/update-manager.d.ts +2 -2
  92. package/lib/update-manager.js +110 -254
  93. package/lib/updates-via.js +0 -30
  94. package/lib/uri.js +5 -58
  95. package/lib/utils/default-graph-uri.js +1 -3
  96. package/lib/utils/termValue.js +0 -2
  97. package/lib/utils/terms.js +15 -34
  98. package/lib/utils-js.js +16 -80
  99. package/lib/utils.js +4 -21
  100. package/lib/variable.js +0 -25
  101. package/lib/xsd-internal.js +0 -3
  102. package/lib/xsd.js +0 -4
  103. package/package.json +40 -39
  104. package/src/fetcher.ts +2 -2
  105. package/src/index.ts +0 -2
  106. package/src/jsonldparser.js +13 -4
  107. package/src/n3parser.js +12 -4
  108. package/src/serialize.ts +4 -11
  109. package/src/serializer.js +24 -0
  110. package/src/update-manager.ts +18 -7
  111. package/changes.txt +0 -59
  112. package/esm/convert.js +0 -61
  113. package/lib/convert.d.ts +0 -2
  114. package/lib/convert.js +0 -77
  115. package/src/convert.js +0 -70
package/lib/statement.js CHANGED
@@ -1,33 +1,22 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
4
  var _typeof = require("@babel/runtime/helpers/typeof");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports.default = void 0;
11
-
12
9
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
13
-
14
10
  var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
17
-
18
12
  var _nodeInternal = _interopRequireDefault(require("./node-internal"));
19
-
20
13
  var _types = require("./types");
21
-
22
14
  var _defaultGraph = _interopRequireWildcard(require("./default-graph"));
23
-
24
15
  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); }
25
-
26
16
  function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(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; }
27
-
28
17
  var defaultGraph = new _defaultGraph.default();
29
- /** A Statement represents an RDF Triple or Quad. */
30
18
 
19
+ /** A Statement represents an RDF Triple or Quad. */
31
20
  var Statement = /*#__PURE__*/function () {
32
21
  /** The subject of the triple. What the Statement is about. */
33
22
 
@@ -68,9 +57,8 @@ var Statement = /*#__PURE__*/function () {
68
57
  this.object = _nodeInternal.default.fromValue(object);
69
58
  this.graph = graph == undefined ? defaultGraph : _nodeInternal.default.fromValue(graph); // property currently used by rdflib
70
59
  }
71
- /** Alias for graph, favored by Tim */
72
-
73
60
 
61
+ /** Alias for graph, favored by Tim */
74
62
  (0, _createClass2.default)(Statement, [{
75
63
  key: "why",
76
64
  get: function get() {
@@ -79,58 +67,55 @@ var Statement = /*#__PURE__*/function () {
79
67
  set: function set(g) {
80
68
  this.graph = g;
81
69
  }
70
+
82
71
  /**
83
72
  * Checks whether two statements are the same
84
73
  * @param other - The other statement
85
74
  */
86
-
87
75
  }, {
88
76
  key: "equals",
89
77
  value: function equals(other) {
90
78
  return other.subject.equals(this.subject) && other.predicate.equals(this.predicate) && other.object.equals(this.object) && other.graph.equals(this.graph);
91
79
  }
80
+
92
81
  /**
93
82
  * Creates a statement with the bindings substituted
94
83
  * @param bindings The bindings
95
84
  */
96
-
97
85
  }, {
98
86
  key: "substitute",
99
87
  value: function substitute(bindings) {
100
88
  var y = new Statement(this.subject.substitute(bindings), this.predicate.substitute(bindings), this.object.substitute(bindings), (0, _defaultGraph.isDefaultGraph)(this.graph) ? this.graph : this.graph.substitute(bindings)); // 2016
101
-
102
89
  console.log('@@@ statement substitute:' + y);
103
90
  return y;
104
91
  }
105
- /** Creates a canonical string representation of this statement. */
106
92
 
93
+ /** Creates a canonical string representation of this statement. */
107
94
  }, {
108
95
  key: "toCanonical",
109
96
  value: function toCanonical() {
110
97
  var terms = [this.subject.toCanonical(), this.predicate.toCanonical(), this.object.toCanonical()];
111
-
112
98
  if (this.graph && this.graph.termType !== _types.DefaultGraphTermType) {
113
99
  terms.push(this.graph.toCanonical());
114
100
  }
115
-
116
101
  return terms.join(' ') + ' .';
117
102
  }
118
- /** Creates a n-triples string representation of this statement */
119
103
 
104
+ /** Creates a n-triples string representation of this statement */
120
105
  }, {
121
106
  key: "toNT",
122
107
  value: function toNT() {
123
108
  return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT()].join(' ') + ' .';
124
109
  }
125
- /** Creates a n-quads string representation of this statement */
126
110
 
111
+ /** Creates a n-quads string representation of this statement */
127
112
  }, {
128
113
  key: "toNQ",
129
114
  value: function toNQ() {
130
115
  return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT(), (0, _defaultGraph.isDefaultGraph)(this.graph) ? '' : this.graph.toNT()].join(' ') + ' .';
131
116
  }
132
- /** Creates a string representation of this statement */
133
117
 
118
+ /** Creates a string representation of this statement */
134
119
  }, {
135
120
  key: "toString",
136
121
  value: function toString() {
@@ -146,5 +131,4 @@ var Statement = /*#__PURE__*/function () {
146
131
  }]);
147
132
  return Statement;
148
133
  }();
149
-
150
134
  exports.default = Statement;
package/lib/store.d.ts CHANGED
@@ -10,7 +10,7 @@ import NamedNode from './named-node';
10
10
  import Fetcher from './fetcher';
11
11
  import { Quad_Graph, NamedNode as TFNamedNode, Quad_Object, Quad_Predicate, Quad, Quad_Subject, Term } from './tf-types';
12
12
  import BlankNode from './blank-node';
13
- declare type FeaturesType = Array<('sameAs' | 'InverseFunctionalProperty' | 'FunctionalProperty')> | undefined;
13
+ type FeaturesType = Array<('sameAs' | 'InverseFunctionalProperty' | 'FunctionalProperty')> | undefined;
14
14
  export { defaultGraphURI };
15
15
  /**
16
16
  * Indexed Formula aka Store
@@ -299,5 +299,5 @@ export default class IndexedFormula extends Formula {
299
299
  * @param term
300
300
  */
301
301
  uris(term: Quad_Subject): string[];
302
- serialize(base: any, contentType: any, provenance: any, options?: any): string | undefined;
302
+ serialize(base: any, contentType: any, provenance: any, options?: any): string | Promise<string> | undefined;
303
303
  }