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.
- package/dist/rdflib.min.js +1 -1
- package/dist/rdflib.min.js.LICENSE.txt +13 -1
- package/dist/rdflib.min.js.map +1 -1
- package/esm/blank-node.js +3 -27
- package/esm/collection.js +7 -29
- package/esm/default-graph.js +1 -15
- package/esm/empty.js +0 -13
- package/esm/factories/canonical-data-factory.js +5 -40
- package/esm/factories/extended-term-factory.js +0 -11
- package/esm/factories/factory-types.js +2 -1
- package/esm/factories/rdflib-data-factory.js +0 -8
- package/esm/fetcher.js +257 -481
- package/esm/formula.js +43 -142
- package/esm/index.js +19 -36
- package/esm/jsonldparser.js +20 -29
- package/esm/jsonparser.js +0 -7
- package/esm/lists.js +18 -33
- package/esm/literal.js +10 -42
- package/esm/n3parser.js +38 -351
- package/esm/named-node.js +8 -27
- package/esm/namespace.js +0 -1
- package/esm/node-internal.js +11 -24
- package/esm/node.js +1 -6
- package/esm/parse.js +10 -17
- package/esm/patch-parser.js +9 -29
- package/esm/query-to-sparql.js +0 -18
- package/esm/query.js +50 -133
- package/esm/rdfaparser.js +72 -210
- package/esm/rdfxmlparser.js +31 -128
- package/esm/serialize.js +8 -33
- package/esm/serializer.js +122 -286
- package/esm/sparql-to-query.js +44 -134
- package/esm/statement.js +8 -19
- package/esm/store.js +109 -280
- package/esm/types.js +3 -2
- package/esm/update-manager.js +110 -246
- package/esm/updates-via.js +0 -27
- package/esm/uri.js +6 -50
- package/esm/utils/default-graph-uri.js +1 -0
- package/esm/utils/termValue.js +0 -1
- package/esm/utils/terms.js +15 -16
- package/esm/utils-js.js +16 -57
- package/esm/utils.js +4 -15
- package/esm/variable.js +0 -20
- package/lib/blank-node.js +3 -28
- package/lib/class-order.js +0 -1
- package/lib/collection.js +7 -34
- package/lib/default-graph.js +0 -20
- package/lib/empty.js +0 -18
- package/lib/factories/canonical-data-factory.js +4 -51
- package/lib/factories/extended-term-factory.js +0 -18
- package/lib/factories/factory-types.d.ts +6 -6
- package/lib/factories/factory-types.js +0 -3
- package/lib/factories/rdflib-data-factory.js +0 -12
- package/lib/fetcher.d.ts +6 -6
- package/lib/fetcher.js +258 -470
- package/lib/formula.d.ts +1 -1
- package/lib/formula.js +43 -151
- package/lib/index.d.ts +1 -2
- package/lib/index.js +14 -82
- package/lib/jsonldparser.js +19 -33
- package/lib/jsonparser.js +0 -9
- package/lib/lists.js +14 -39
- package/lib/literal.js +10 -49
- package/lib/log.d.ts +0 -6
- package/lib/log.js +0 -1
- package/lib/n3parser.d.ts +1 -0
- package/lib/n3parser.js +39 -359
- package/lib/named-node.js +7 -35
- package/lib/namespace.js +0 -3
- package/lib/node-internal.js +11 -21
- package/lib/node.js +1 -11
- package/lib/parse.d.ts +1 -1
- package/lib/parse.js +8 -27
- package/lib/patch-parser.js +10 -33
- package/lib/query-to-sparql.js +0 -23
- package/lib/query.js +46 -152
- package/lib/rdfaparser.js +72 -220
- package/lib/rdfxmlparser.js +31 -132
- package/lib/serialize.d.ts +1 -1
- package/lib/serialize.js +8 -43
- package/lib/serializer.d.ts +1 -0
- package/lib/serializer.js +121 -297
- package/lib/sparql-to-query.js +42 -167
- package/lib/statement.js +8 -24
- package/lib/store.d.ts +2 -2
- package/lib/store.js +102 -282
- package/lib/tf-types.d.ts +4 -4
- package/lib/types.d.ts +8 -8
- package/lib/types.js +3 -3
- package/lib/update-manager.d.ts +2 -2
- package/lib/update-manager.js +110 -254
- package/lib/updates-via.js +0 -30
- package/lib/uri.js +5 -58
- package/lib/utils/default-graph-uri.js +1 -3
- package/lib/utils/termValue.js +0 -2
- package/lib/utils/terms.js +15 -34
- package/lib/utils-js.js +16 -80
- package/lib/utils.js +4 -21
- package/lib/variable.js +0 -25
- package/lib/xsd-internal.js +0 -3
- package/lib/xsd.js +0 -4
- package/package.json +40 -39
- package/src/fetcher.ts +2 -2
- package/src/index.ts +0 -2
- package/src/jsonldparser.js +13 -4
- package/src/n3parser.js +12 -4
- package/src/serialize.ts +4 -11
- package/src/serializer.js +24 -0
- package/src/update-manager.ts +18 -7
- package/changes.txt +0 -59
- package/esm/convert.js +0 -61
- package/lib/convert.d.ts +0 -2
- package/lib/convert.js +0 -77
- 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
|
-
|
|
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
|
}
|