rdflib 2.2.34 → 2.2.35-0ebb696c
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/515.rdflib.min.js +3 -0
- package/dist/515.rdflib.min.js.map +1 -0
- package/dist/789.rdflib.min.js +1 -0
- package/dist/rdflib.min.js +1 -1
- package/dist/rdflib.min.js.LICENSE.txt +0 -2
- package/dist/rdflib.min.js.map +1 -1
- package/esm/blank-node.js +57 -85
- package/esm/class-order.js +1 -1
- package/esm/collection.js +70 -106
- package/esm/default-graph.js +13 -33
- package/esm/empty.js +8 -26
- package/esm/factories/canonical-data-factory.js +33 -30
- package/esm/factories/extended-term-factory.js +18 -14
- package/esm/factories/factory-types.js +1 -1
- package/esm/factories/rdflib-data-factory.js +9 -11
- package/esm/fetcher.js +1364 -1668
- package/esm/formula.js +631 -739
- package/esm/index.js +31 -51
- package/esm/jsonldparser.js +19 -26
- package/esm/jsonparser.js +1 -1
- package/esm/lists.js +41 -86
- package/esm/literal.js +120 -157
- package/esm/log.js +7 -7
- package/esm/n3parser.js +1008 -1090
- package/esm/named-node.js +69 -99
- package/esm/namespace.js +2 -4
- package/esm/node-internal.js +73 -97
- package/esm/node.js +1 -2
- package/esm/parse.js +3 -3
- package/esm/patch-parser.js +1 -2
- package/esm/query.js +15 -30
- package/esm/rdfaparser.js +775 -846
- package/esm/rdfxmlparser.js +348 -365
- package/esm/serialize.js +2 -3
- package/esm/serializer.js +834 -889
- package/esm/sparql-to-query.js +0 -2
- package/esm/statement.js +52 -72
- package/esm/store.js +852 -963
- package/esm/types.js +26 -21
- package/esm/update-manager.js +964 -1104
- package/esm/updates-via.js +104 -134
- package/esm/uri.js +3 -3
- package/esm/utils/default-graph-uri.js +2 -2
- package/esm/utils/terms.js +4 -5
- package/esm/utils-js.js +5 -6
- package/esm/utils.js +7 -6
- package/esm/variable.js +32 -58
- package/esm/xsd.js +2 -2
- package/lib/blank-node.js +56 -83
- package/lib/class-order.js +2 -3
- package/lib/collection.js +69 -104
- package/lib/default-graph.js +13 -32
- package/lib/empty.js +8 -25
- package/lib/factories/canonical-data-factory.js +36 -34
- package/lib/factories/extended-term-factory.js +19 -16
- package/lib/factories/factory-types.js +2 -3
- package/lib/factories/rdflib-data-factory.js +10 -13
- package/lib/fetcher.js +1394 -1693
- package/lib/formula.js +631 -738
- package/lib/index.js +66 -89
- package/lib/jsonldparser.js +21 -32
- package/lib/jsonparser.js +3 -4
- package/lib/lists.js +47 -87
- package/lib/literal.js +120 -156
- package/lib/log.js +8 -9
- package/lib/n3parser.js +1011 -1096
- package/lib/named-node.js +69 -98
- package/lib/namespace.js +2 -4
- package/lib/node-internal.js +72 -95
- package/lib/node.js +2 -4
- package/lib/parse.js +5 -6
- package/lib/patch-parser.js +1 -2
- package/lib/query.js +19 -32
- package/lib/rdfaparser.js +777 -849
- package/lib/rdfxmlparser.js +350 -366
- package/lib/serialize.js +2 -3
- package/lib/serializer.js +838 -892
- package/lib/sparql-to-query.js +0 -2
- package/lib/statement.js +54 -74
- package/lib/store.js +873 -978
- package/lib/types.js +22 -43
- package/lib/update-manager.js +973 -1111
- package/lib/updates-via.js +105 -134
- package/lib/uri.js +3 -3
- package/lib/utils/default-graph-uri.js +2 -4
- package/lib/utils/terms.js +4 -6
- package/lib/utils-js.js +11 -13
- package/lib/utils.js +6 -7
- package/lib/variable.js +34 -60
- package/lib/xsd-internal.js +2 -3
- package/lib/xsd.js +3 -4
- package/package.json +31 -31
- package/src/n3parser.js +1 -1
- package/src/rdfxmlparser.js +2 -1
- package/src/serializer.js +1 -1
- package/src/update-manager.ts +2 -1
- package/.babelrc +0 -20
- package/dist/670.rdflib.min.js +0 -1
- package/dist/730.rdflib.min.js +0 -3
- package/dist/730.rdflib.min.js.map +0 -1
- /package/dist/{730.rdflib.min.js.LICENSE.txt → 515.rdflib.min.js.LICENSE.txt} +0 -0
package/lib/sparql-to-query.js
CHANGED
|
@@ -124,7 +124,6 @@ function SPARQLToQuery(SPARQL, testMode, kb) {
|
|
|
124
124
|
_log.default.info('Literal found: ' + res[1]);
|
|
125
125
|
res = res.concat(parseLiterals(str.slice(end + ind + 2))); // finds any other literals
|
|
126
126
|
}
|
|
127
|
-
|
|
128
127
|
return res;
|
|
129
128
|
}
|
|
130
129
|
function spaceDelimit(str) {
|
|
@@ -352,7 +351,6 @@ function SPARQLToQuery(SPARQL, testMode, kb) {
|
|
|
352
351
|
// log.warn("I don't know how to handle the constraint: "+input)
|
|
353
352
|
// alert("length: "+input.length+" input 0 type: "+input[0].termType+" input 1: "+input[1]+" input[2] type: "+input[2].termType)
|
|
354
353
|
}
|
|
355
|
-
|
|
356
354
|
function setOptional(terms, pat) {
|
|
357
355
|
_log.default.debug('Optional query: ' + terms + ' not yet implemented.');
|
|
358
356
|
var opt = kb.formula();
|
package/lib/statement.js
CHANGED
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
9
|
var _nodeInternal = _interopRequireDefault(require("./node-internal"));
|
|
13
10
|
var _types = require("./types");
|
|
14
11
|
var _defaultGraph = _interopRequireWildcard(require("./default-graph"));
|
|
15
|
-
function _getRequireWildcardCache(
|
|
16
|
-
function _interopRequireWildcard(
|
|
17
|
-
|
|
12
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
13
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
14
|
+
const defaultGraph = new _defaultGraph.default();
|
|
18
15
|
|
|
19
16
|
/** A Statement represents an RDF Triple or Quad. */
|
|
20
|
-
|
|
17
|
+
class Statement {
|
|
21
18
|
/**
|
|
22
19
|
* Construct a new statement
|
|
23
20
|
*
|
|
@@ -35,8 +32,7 @@ var Statement = /*#__PURE__*/function () {
|
|
|
35
32
|
* and give the document you are patching. In future, we may have a more
|
|
36
33
|
* powerful update() which can update more than one document.
|
|
37
34
|
*/
|
|
38
|
-
|
|
39
|
-
(0, _classCallCheck2.default)(this, Statement);
|
|
35
|
+
constructor(subject, predicate, object, graph) {
|
|
40
36
|
/** The subject of the triple. What the Statement is about. */
|
|
41
37
|
(0, _defineProperty2.default)(this, "subject", void 0);
|
|
42
38
|
/** The relationship which is asserted between the subject and object */
|
|
@@ -55,76 +51,60 @@ var Statement = /*#__PURE__*/function () {
|
|
|
55
51
|
}
|
|
56
52
|
|
|
57
53
|
/** Alias for graph, favored by Tim */
|
|
58
|
-
(
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
this.graph = g;
|
|
65
|
-
}
|
|
54
|
+
get why() {
|
|
55
|
+
return this.graph;
|
|
56
|
+
}
|
|
57
|
+
set why(g) {
|
|
58
|
+
this.graph = g;
|
|
59
|
+
}
|
|
66
60
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
return other.subject.equals(this.subject) && other.predicate.equals(this.predicate) && other.object.equals(this.object) && other.graph.equals(this.graph);
|
|
75
|
-
}
|
|
61
|
+
/**
|
|
62
|
+
* Checks whether two statements are the same
|
|
63
|
+
* @param other - The other statement
|
|
64
|
+
*/
|
|
65
|
+
equals(other) {
|
|
66
|
+
return other.subject.equals(this.subject) && other.predicate.equals(this.predicate) && other.object.equals(this.object) && other.graph.equals(this.graph);
|
|
67
|
+
}
|
|
76
68
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
return y;
|
|
87
|
-
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates a statement with the bindings substituted
|
|
71
|
+
* @param bindings The bindings
|
|
72
|
+
*/
|
|
73
|
+
substitute(bindings) {
|
|
74
|
+
const 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
|
|
75
|
+
// console.log('@@@ statement substitute:' + y)
|
|
76
|
+
return y;
|
|
77
|
+
}
|
|
88
78
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
if (this.graph && this.graph.termType !== _types.DefaultGraphTermType) {
|
|
95
|
-
terms.push(this.graph.toCanonical());
|
|
96
|
-
}
|
|
97
|
-
return terms.join(' ') + ' .';
|
|
79
|
+
/** Creates a canonical string representation of this statement. */
|
|
80
|
+
toCanonical() {
|
|
81
|
+
let terms = [this.subject.toCanonical(), this.predicate.toCanonical(), this.object.toCanonical()];
|
|
82
|
+
if (this.graph && this.graph.termType !== _types.DefaultGraphTermType) {
|
|
83
|
+
terms.push(this.graph.toCanonical());
|
|
98
84
|
}
|
|
85
|
+
return terms.join(' ') + ' .';
|
|
86
|
+
}
|
|
99
87
|
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT()].join(' ') + ' .';
|
|
105
|
-
}
|
|
88
|
+
/** Creates a n-triples string representation of this statement */
|
|
89
|
+
toNT() {
|
|
90
|
+
return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT()].join(' ') + ' .';
|
|
91
|
+
}
|
|
106
92
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT(), (0, _defaultGraph.isDefaultGraph)(this.graph) ? '' : this.graph.toNT()].join(' ') + ' .';
|
|
112
|
-
}
|
|
93
|
+
/** Creates a n-quads string representation of this statement */
|
|
94
|
+
toNQ() {
|
|
95
|
+
return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT(), (0, _defaultGraph.isDefaultGraph)(this.graph) ? '' : this.graph.toNT()].join(' ') + ' .';
|
|
96
|
+
}
|
|
113
97
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
}]);
|
|
128
|
-
return Statement;
|
|
129
|
-
}();
|
|
98
|
+
/** Creates a string representation of this statement */
|
|
99
|
+
toString() {
|
|
100
|
+
/*
|
|
101
|
+
return [
|
|
102
|
+
this.subject.toString(),
|
|
103
|
+
this.predicate.toString(),
|
|
104
|
+
this.object.toString(),
|
|
105
|
+
].join(' ') + ' .'
|
|
106
|
+
*/
|
|
107
|
+
return this.toNT();
|
|
108
|
+
}
|
|
109
|
+
}
|
|
130
110
|
exports.default = Statement;
|