rdflib 2.2.22 → 2.2.23-1c672b7b
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 +4 -0
- package/dist/rdflib.min.js.map +1 -1
- package/esm/blank-node.js +90 -61
- package/esm/class-order.js +1 -1
- package/esm/collection.js +106 -70
- package/esm/default-graph.js +33 -13
- package/esm/empty.js +26 -8
- package/esm/factories/canonical-data-factory.js +30 -33
- package/esm/factories/extended-term-factory.js +14 -18
- package/esm/factories/factory-types.js +1 -1
- package/esm/factories/rdflib-data-factory.js +11 -9
- package/esm/fetcher.js +1644 -1355
- package/esm/formula.js +740 -632
- package/esm/index.js +52 -33
- package/esm/jsonldparser.js +35 -19
- package/esm/jsonparser.js +1 -1
- package/esm/lists.js +86 -38
- package/esm/literal.js +157 -120
- package/esm/log.js +7 -7
- package/esm/n3parser.js +1088 -1004
- package/esm/named-node.js +99 -69
- package/esm/namespace.js +4 -2
- package/esm/node-internal.js +98 -74
- package/esm/node.js +1 -1
- package/esm/parse.js +3 -3
- package/esm/patch-parser.js +1 -1
- package/esm/query.js +16 -15
- package/esm/rdfaparser.js +846 -781
- package/esm/rdfxmlparser.js +365 -348
- package/esm/serialize.js +4 -11
- package/esm/serializer.js +886 -821
- package/esm/statement.js +72 -52
- package/esm/store.js +924 -822
- package/esm/types.js +21 -21
- package/esm/update-manager.js +983 -882
- package/esm/updates-via.js +134 -104
- package/esm/uri.js +3 -3
- package/esm/utils/default-graph-uri.js +2 -2
- package/esm/utils/terms.js +5 -4
- package/esm/utils-js.js +5 -5
- package/esm/utils.js +6 -6
- package/esm/variable.js +58 -32
- package/esm/xsd.js +2 -2
- package/lib/blank-node.js +88 -60
- package/lib/class-order.js +1 -1
- package/lib/collection.js +104 -69
- package/lib/default-graph.js +32 -13
- package/lib/empty.js +25 -8
- package/lib/factories/canonical-data-factory.js +32 -35
- package/lib/factories/extended-term-factory.js +14 -18
- package/lib/factories/factory-types.js +1 -1
- package/lib/factories/rdflib-data-factory.js +11 -9
- package/lib/fetcher.js +1646 -1385
- package/lib/formula.js +739 -632
- package/lib/index.d.ts +1 -2
- package/lib/index.js +88 -70
- package/lib/jsonldparser.js +35 -19
- package/lib/jsonparser.js +1 -1
- package/lib/lists.js +86 -54
- package/lib/literal.js +156 -120
- package/lib/log.js +7 -7
- package/lib/n3parser.d.ts +1 -0
- package/lib/n3parser.js +1092 -1006
- package/lib/named-node.js +98 -69
- package/lib/namespace.js +4 -2
- package/lib/node-internal.js +96 -73
- package/lib/node.js +1 -1
- package/lib/parse.js +6 -5
- package/lib/patch-parser.js +1 -1
- package/lib/query.js +18 -19
- package/lib/rdfaparser.js +848 -783
- package/lib/rdfxmlparser.js +366 -350
- package/lib/serialize.js +4 -13
- package/lib/serializer.d.ts +1 -0
- package/lib/serializer.js +890 -825
- package/lib/statement.js +74 -54
- package/lib/store.js +926 -844
- package/lib/types.js +21 -21
- package/lib/update-manager.d.ts +1 -1
- package/lib/update-manager.js +959 -865
- package/lib/updates-via.js +134 -105
- package/lib/uri.js +3 -3
- package/lib/utils/default-graph-uri.js +2 -2
- package/lib/utils/terms.js +6 -4
- package/lib/utils-js.js +9 -8
- package/lib/utils.js +6 -6
- package/lib/variable.js +60 -34
- package/lib/xsd.js +2 -2
- package/package.json +20 -19
- package/src/index.ts +0 -2
- package/src/jsonldparser.js +13 -4
- package/src/n3parser.js +12 -4
- package/src/serialize.ts +3 -10
- package/src/serializer.js +24 -0
- package/src/update-manager.ts +8 -2
- package/esm/convert.js +0 -60
- package/lib/convert.d.ts +0 -2
- package/lib/convert.js +0 -71
- package/src/convert.js +0 -70
package/esm/statement.js
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
|
+
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
+
import _createClass from "@babel/runtime/helpers/createClass";
|
|
1
3
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
4
|
import Node from './node-internal';
|
|
3
5
|
import { DefaultGraphTermType } from './types';
|
|
4
6
|
import DefaultGraphNode, { isDefaultGraph } from './default-graph';
|
|
5
|
-
|
|
7
|
+
var defaultGraph = new DefaultGraphNode();
|
|
6
8
|
|
|
7
9
|
/** A Statement represents an RDF Triple or Quad. */
|
|
8
|
-
|
|
10
|
+
var Statement = /*#__PURE__*/function () {
|
|
9
11
|
/** The subject of the triple. What the Statement is about. */
|
|
10
12
|
|
|
11
13
|
/** The relationship which is asserted between the subject and object */
|
|
@@ -34,7 +36,8 @@ export default class Statement {
|
|
|
34
36
|
* and give the document you are patching. In future, we may have a more
|
|
35
37
|
* powerful update() which can update more than one document.
|
|
36
38
|
*/
|
|
37
|
-
|
|
39
|
+
function Statement(subject, predicate, object, graph) {
|
|
40
|
+
_classCallCheck(this, Statement);
|
|
38
41
|
_defineProperty(this, "subject", void 0);
|
|
39
42
|
_defineProperty(this, "predicate", void 0);
|
|
40
43
|
_defineProperty(this, "object", void 0);
|
|
@@ -46,59 +49,76 @@ export default class Statement {
|
|
|
46
49
|
}
|
|
47
50
|
|
|
48
51
|
/** Alias for graph, favored by Tim */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
_createClass(Statement, [{
|
|
53
|
+
key: "why",
|
|
54
|
+
get: function get() {
|
|
55
|
+
return this.graph;
|
|
56
|
+
},
|
|
57
|
+
set: function set(g) {
|
|
58
|
+
this.graph = g;
|
|
59
|
+
}
|
|
55
60
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
61
|
+
/**
|
|
62
|
+
* Checks whether two statements are the same
|
|
63
|
+
* @param other - The other statement
|
|
64
|
+
*/
|
|
65
|
+
}, {
|
|
66
|
+
key: "equals",
|
|
67
|
+
value: function equals(other) {
|
|
68
|
+
return other.subject.equals(this.subject) && other.predicate.equals(this.predicate) && other.object.equals(this.object) && other.graph.equals(this.graph);
|
|
69
|
+
}
|
|
63
70
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
/**
|
|
72
|
+
* Creates a statement with the bindings substituted
|
|
73
|
+
* @param bindings The bindings
|
|
74
|
+
*/
|
|
75
|
+
}, {
|
|
76
|
+
key: "substitute",
|
|
77
|
+
value: function substitute(bindings) {
|
|
78
|
+
var y = new Statement(this.subject.substitute(bindings), this.predicate.substitute(bindings), this.object.substitute(bindings), isDefaultGraph(this.graph) ? this.graph : this.graph.substitute(bindings)); // 2016
|
|
79
|
+
console.log('@@@ statement substitute:' + y);
|
|
80
|
+
return y;
|
|
81
|
+
}
|
|
73
82
|
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
terms.
|
|
83
|
+
/** Creates a canonical string representation of this statement. */
|
|
84
|
+
}, {
|
|
85
|
+
key: "toCanonical",
|
|
86
|
+
value: function toCanonical() {
|
|
87
|
+
var terms = [this.subject.toCanonical(), this.predicate.toCanonical(), this.object.toCanonical()];
|
|
88
|
+
if (this.graph && this.graph.termType !== DefaultGraphTermType) {
|
|
89
|
+
terms.push(this.graph.toCanonical());
|
|
90
|
+
}
|
|
91
|
+
return terms.join(' ') + ' .';
|
|
79
92
|
}
|
|
80
|
-
return terms.join(' ') + ' .';
|
|
81
|
-
}
|
|
82
93
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
94
|
+
/** Creates a n-triples string representation of this statement */
|
|
95
|
+
}, {
|
|
96
|
+
key: "toNT",
|
|
97
|
+
value: function toNT() {
|
|
98
|
+
return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT()].join(' ') + ' .';
|
|
99
|
+
}
|
|
87
100
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
101
|
+
/** Creates a n-quads string representation of this statement */
|
|
102
|
+
}, {
|
|
103
|
+
key: "toNQ",
|
|
104
|
+
value: function toNQ() {
|
|
105
|
+
return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT(), isDefaultGraph(this.graph) ? '' : this.graph.toNT()].join(' ') + ' .';
|
|
106
|
+
}
|
|
92
107
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
108
|
+
/** Creates a string representation of this statement */
|
|
109
|
+
}, {
|
|
110
|
+
key: "toString",
|
|
111
|
+
value: function toString() {
|
|
112
|
+
/*
|
|
113
|
+
return [
|
|
114
|
+
this.subject.toString(),
|
|
115
|
+
this.predicate.toString(),
|
|
116
|
+
this.object.toString(),
|
|
117
|
+
].join(' ') + ' .'
|
|
118
|
+
*/
|
|
119
|
+
return this.toNT();
|
|
120
|
+
}
|
|
121
|
+
}]);
|
|
122
|
+
return Statement;
|
|
123
|
+
}();
|
|
124
|
+
export { Statement as default };
|