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/blank-node.js
CHANGED
|
@@ -5,116 +5,89 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
9
|
var _classOrder = _interopRequireDefault(require("./class-order"));
|
|
16
10
|
var _nodeInternal = _interopRequireDefault(require("./node-internal"));
|
|
17
11
|
var _types = require("./types");
|
|
18
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
19
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
20
12
|
/**
|
|
21
13
|
* An RDF blank node is a Node without a URI
|
|
22
14
|
* @link https://rdf.js.org/data-model-spec/#blanknode-interface
|
|
23
15
|
*/
|
|
24
|
-
|
|
25
|
-
(
|
|
26
|
-
|
|
16
|
+
class BlankNode extends _nodeInternal.default {
|
|
17
|
+
static getId(id) {
|
|
18
|
+
if (id) {
|
|
19
|
+
if (typeof id !== 'string') {
|
|
20
|
+
throw new Error('Bad id argument to new blank node: ' + id);
|
|
21
|
+
}
|
|
22
|
+
if (id.includes('#')) {
|
|
23
|
+
// Is a URI with hash fragment
|
|
24
|
+
let fragments = id.split('#');
|
|
25
|
+
return fragments[fragments.length - 1];
|
|
26
|
+
}
|
|
27
|
+
return id;
|
|
28
|
+
}
|
|
29
|
+
return 'n' + BlankNode.nextId++;
|
|
30
|
+
}
|
|
27
31
|
/**
|
|
28
32
|
* Initializes this node
|
|
29
33
|
* @param [id] The identifier for the blank node
|
|
30
34
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
(0,
|
|
34
|
-
|
|
35
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "termType", _types.BlankNodeTermType);
|
|
36
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "classOrder", _classOrder.default.BlankNode);
|
|
35
|
+
constructor(id) {
|
|
36
|
+
super(BlankNode.getId(id));
|
|
37
|
+
(0, _defineProperty2.default)(this, "termType", _types.BlankNodeTermType);
|
|
38
|
+
(0, _defineProperty2.default)(this, "classOrder", _classOrder.default.BlankNode);
|
|
37
39
|
/** Whether this is a blank node */
|
|
38
|
-
(0, _defineProperty2.default)(
|
|
40
|
+
(0, _defineProperty2.default)(this, "isBlank", 1);
|
|
39
41
|
/**
|
|
40
42
|
* This type of node is a variable.
|
|
41
43
|
*
|
|
42
44
|
* Note that the existence of this property already indicates that it is a variable.
|
|
43
45
|
*/
|
|
44
|
-
(0, _defineProperty2.default)(
|
|
45
|
-
return _this;
|
|
46
|
+
(0, _defineProperty2.default)(this, "isVar", 1);
|
|
46
47
|
}
|
|
47
48
|
|
|
48
49
|
/**
|
|
49
50
|
* The identifier for the blank node
|
|
50
51
|
*/
|
|
51
|
-
(
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
key: "compareTerm",
|
|
61
|
-
value: function compareTerm(other) {
|
|
62
|
-
if (this.classOrder < other.classOrder) {
|
|
63
|
-
return -1;
|
|
64
|
-
}
|
|
65
|
-
if (this.classOrder > other.classOrder) {
|
|
66
|
-
return +1;
|
|
67
|
-
}
|
|
68
|
-
if (this.id < other.id) {
|
|
69
|
-
return -1;
|
|
70
|
-
}
|
|
71
|
-
if (this.id > other.id) {
|
|
72
|
-
return +1;
|
|
73
|
-
}
|
|
74
|
-
return 0;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* Gets a copy of this blank node in the specified formula
|
|
79
|
-
* @param formula The formula
|
|
80
|
-
*/
|
|
81
|
-
}, {
|
|
82
|
-
key: "copy",
|
|
83
|
-
value: function copy(formula) {
|
|
84
|
-
// depends on the formula
|
|
85
|
-
var bnodeNew = new BlankNode();
|
|
86
|
-
formula.copyTo(this, bnodeNew);
|
|
87
|
-
return bnodeNew;
|
|
52
|
+
get id() {
|
|
53
|
+
return this.value;
|
|
54
|
+
}
|
|
55
|
+
set id(value) {
|
|
56
|
+
this.value = value;
|
|
57
|
+
}
|
|
58
|
+
compareTerm(other) {
|
|
59
|
+
if (this.classOrder < other.classOrder) {
|
|
60
|
+
return -1;
|
|
88
61
|
}
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
value: function toCanonical() {
|
|
92
|
-
return BlankNode.NTAnonymousNodePrefix + this.value;
|
|
62
|
+
if (this.classOrder > other.classOrder) {
|
|
63
|
+
return +1;
|
|
93
64
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
value: function toString() {
|
|
97
|
-
return BlankNode.NTAnonymousNodePrefix + this.id;
|
|
65
|
+
if (this.id < other.id) {
|
|
66
|
+
return -1;
|
|
98
67
|
}
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
value: function getId(id) {
|
|
102
|
-
if (id) {
|
|
103
|
-
if (typeof id !== 'string') {
|
|
104
|
-
throw new Error('Bad id argument to new blank node: ' + id);
|
|
105
|
-
}
|
|
106
|
-
if (id.includes('#')) {
|
|
107
|
-
// Is a URI with hash fragment
|
|
108
|
-
var fragments = id.split('#');
|
|
109
|
-
return fragments[fragments.length - 1];
|
|
110
|
-
}
|
|
111
|
-
return id;
|
|
112
|
-
}
|
|
113
|
-
return 'n' + BlankNode.nextId++;
|
|
68
|
+
if (this.id > other.id) {
|
|
69
|
+
return +1;
|
|
114
70
|
}
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
71
|
+
return 0;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* Gets a copy of this blank node in the specified formula
|
|
76
|
+
* @param formula The formula
|
|
77
|
+
*/
|
|
78
|
+
copy(formula) {
|
|
79
|
+
// depends on the formula
|
|
80
|
+
var bnodeNew = new BlankNode();
|
|
81
|
+
formula.copyTo(this, bnodeNew);
|
|
82
|
+
return bnodeNew;
|
|
83
|
+
}
|
|
84
|
+
toCanonical() {
|
|
85
|
+
return BlankNode.NTAnonymousNodePrefix + this.value;
|
|
86
|
+
}
|
|
87
|
+
toString() {
|
|
88
|
+
return BlankNode.NTAnonymousNodePrefix + this.id;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
118
91
|
exports.default = BlankNode;
|
|
119
92
|
/**
|
|
120
93
|
* The next unique identifier for blank nodes
|
package/lib/class-order.js
CHANGED
|
@@ -7,7 +7,7 @@ exports.default = void 0;
|
|
|
7
7
|
/**
|
|
8
8
|
* Class orders
|
|
9
9
|
*/
|
|
10
|
-
|
|
10
|
+
const ClassOrder = {
|
|
11
11
|
'Literal': 1,
|
|
12
12
|
'Collection': 3,
|
|
13
13
|
'Graph': 4,
|
|
@@ -15,5 +15,4 @@ var ClassOrder = {
|
|
|
15
15
|
'BlankNode': 6,
|
|
16
16
|
'Variable': 7
|
|
17
17
|
};
|
|
18
|
-
var _default = ClassOrder;
|
|
19
|
-
exports.default = _default;
|
|
18
|
+
var _default = exports.default = ClassOrder;
|
package/lib/collection.js
CHANGED
|
@@ -6,12 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
exports.fromValue = fromValue;
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
10
|
var _blankNode = _interopRequireDefault(require("./blank-node"));
|
|
17
11
|
var _classOrder = _interopRequireDefault(require("./class-order"));
|
|
@@ -19,8 +13,6 @@ var _literal = _interopRequireDefault(require("./literal"));
|
|
|
19
13
|
var _nodeInternal = _interopRequireDefault(require("./node-internal"));
|
|
20
14
|
var _types = require("./types");
|
|
21
15
|
var _terms = require("./utils/terms");
|
|
22
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
23
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
24
16
|
/**
|
|
25
17
|
* Creates an RDF Node from a native javascript value.
|
|
26
18
|
* RDF Nodes are returned unchanged, undefined returned as itself.
|
|
@@ -48,113 +40,86 @@ function fromValue(value) {
|
|
|
48
40
|
*
|
|
49
41
|
* Use generic T to control the contents of the array.
|
|
50
42
|
*/
|
|
51
|
-
|
|
52
|
-
(
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
(0,
|
|
57
|
-
|
|
58
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "termType", _types.CollectionTermType);
|
|
59
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "classOrder", _classOrder.default.Collection);
|
|
60
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "closed", false);
|
|
61
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "compareTerm", _blankNode.default.prototype.compareTerm);
|
|
43
|
+
class Collection extends _nodeInternal.default {
|
|
44
|
+
constructor(initial) {
|
|
45
|
+
super((_blankNode.default.nextId++).toString());
|
|
46
|
+
(0, _defineProperty2.default)(this, "termType", _types.CollectionTermType);
|
|
47
|
+
(0, _defineProperty2.default)(this, "classOrder", _classOrder.default.Collection);
|
|
48
|
+
(0, _defineProperty2.default)(this, "closed", false);
|
|
49
|
+
(0, _defineProperty2.default)(this, "compareTerm", _blankNode.default.prototype.compareTerm);
|
|
62
50
|
/**
|
|
63
51
|
* The nodes in this collection
|
|
64
52
|
*/
|
|
65
|
-
(0, _defineProperty2.default)(
|
|
66
|
-
(0, _defineProperty2.default)(
|
|
53
|
+
(0, _defineProperty2.default)(this, "elements", []);
|
|
54
|
+
(0, _defineProperty2.default)(this, "isVar", 0);
|
|
67
55
|
if (initial && initial.length > 0) {
|
|
68
|
-
initial.forEach(
|
|
69
|
-
|
|
56
|
+
initial.forEach(element => {
|
|
57
|
+
this.elements.push(fromValue(element));
|
|
70
58
|
});
|
|
71
59
|
}
|
|
72
|
-
return _this;
|
|
73
60
|
}
|
|
74
|
-
(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
this.value = value;
|
|
81
|
-
}
|
|
61
|
+
get id() {
|
|
62
|
+
return this.value;
|
|
63
|
+
}
|
|
64
|
+
set id(value) {
|
|
65
|
+
this.value = value;
|
|
66
|
+
}
|
|
82
67
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
return this.elements.push(element);
|
|
91
|
-
}
|
|
68
|
+
/**
|
|
69
|
+
* Appends an element to this collection
|
|
70
|
+
* @param element - The new element
|
|
71
|
+
*/
|
|
72
|
+
append(element) {
|
|
73
|
+
return this.elements.push(element);
|
|
74
|
+
}
|
|
92
75
|
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
return this.closed;
|
|
101
|
-
}
|
|
76
|
+
/**
|
|
77
|
+
* Closes this collection
|
|
78
|
+
*/
|
|
79
|
+
close() {
|
|
80
|
+
this.closed = true;
|
|
81
|
+
return this.closed;
|
|
82
|
+
}
|
|
102
83
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
return this.elements.shift();
|
|
110
|
-
}
|
|
84
|
+
/**
|
|
85
|
+
* Removes the first element from the collection (and return it)
|
|
86
|
+
*/
|
|
87
|
+
shift() {
|
|
88
|
+
return this.elements.shift();
|
|
89
|
+
}
|
|
111
90
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
}, {
|
|
130
|
-
key: "toString",
|
|
131
|
-
value:
|
|
132
|
-
/**
|
|
133
|
-
* Serializes the collection to a string.
|
|
134
|
-
* Surrounded by (parentheses) and separated by spaces.
|
|
135
|
-
*/
|
|
136
|
-
function toString() {
|
|
137
|
-
return '(' + this.elements.join(' ') + ')';
|
|
138
|
-
}
|
|
91
|
+
/**
|
|
92
|
+
* Creates a new Collection with the substituting bindings applied
|
|
93
|
+
* @param bindings - The bindings to substitute
|
|
94
|
+
*/
|
|
95
|
+
substitute(bindings) {
|
|
96
|
+
const elementsCopy = this.elements.map(ea => ea.substitute(bindings));
|
|
97
|
+
return new Collection(elementsCopy);
|
|
98
|
+
}
|
|
99
|
+
toNT() {
|
|
100
|
+
return Collection.toNT(this);
|
|
101
|
+
}
|
|
102
|
+
static toNT(collection) {
|
|
103
|
+
// return '(' + collection.elements.map(x => x.toNT()).join(' ') + ')'
|
|
104
|
+
// As lists are not in NT and toNT() must be a reversible function, we kludge it for a list
|
|
105
|
+
return _blankNode.default.NTAnonymousNodePrefix + collection.id;
|
|
106
|
+
}
|
|
139
107
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
}]);
|
|
157
|
-
return Collection;
|
|
158
|
-
}(_nodeInternal.default);
|
|
108
|
+
/**
|
|
109
|
+
* Serializes the collection to a string.
|
|
110
|
+
* Surrounded by (parentheses) and separated by spaces.
|
|
111
|
+
*/
|
|
112
|
+
toString() {
|
|
113
|
+
return '(' + this.elements.join(' ') + ')';
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* Prepends the specified element to the collection's front
|
|
118
|
+
* @param element - The element to prepend
|
|
119
|
+
*/
|
|
120
|
+
unshift(element) {
|
|
121
|
+
return this.elements.unshift(element);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
159
124
|
exports.default = Collection;
|
|
160
125
|
(0, _defineProperty2.default)(Collection, "termType", _types.CollectionTermType);
|
package/lib/default-graph.js
CHANGED
|
@@ -6,44 +6,25 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
exports.isDefaultGraph = isDefaultGraph;
|
|
9
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
11
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
12
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
13
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
15
9
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
10
|
var _nodeInternal = _interopRequireDefault(require("./node-internal"));
|
|
17
11
|
var _types = require("./types");
|
|
18
12
|
var _defaultGraphUri = require("./utils/default-graph-uri");
|
|
19
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
20
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
21
13
|
/** The RDF default graph */
|
|
22
|
-
|
|
23
|
-
(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
(0,
|
|
28
|
-
_this = _super.call(this, '');
|
|
29
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "value", '');
|
|
30
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "termType", _types.DefaultGraphTermType);
|
|
31
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "uri", _defaultGraphUri.defaultGraphURI);
|
|
32
|
-
return _this;
|
|
14
|
+
class DefaultGraph extends _nodeInternal.default {
|
|
15
|
+
constructor() {
|
|
16
|
+
super('');
|
|
17
|
+
(0, _defineProperty2.default)(this, "value", '');
|
|
18
|
+
(0, _defineProperty2.default)(this, "termType", _types.DefaultGraphTermType);
|
|
19
|
+
(0, _defineProperty2.default)(this, "uri", _defaultGraphUri.defaultGraphURI);
|
|
33
20
|
}
|
|
34
|
-
(
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
value: function toString() {
|
|
42
|
-
return 'DefaultGraph';
|
|
43
|
-
}
|
|
44
|
-
}]);
|
|
45
|
-
return DefaultGraph;
|
|
46
|
-
}(_nodeInternal.default);
|
|
21
|
+
toCanonical() {
|
|
22
|
+
return this.value;
|
|
23
|
+
}
|
|
24
|
+
toString() {
|
|
25
|
+
return 'DefaultGraph';
|
|
26
|
+
}
|
|
27
|
+
}
|
|
47
28
|
exports.default = DefaultGraph;
|
|
48
29
|
function isDefaultGraph(object) {
|
|
49
30
|
return !!object && object.termType === _types.DefaultGraphTermType;
|
package/lib/empty.js
CHANGED
|
@@ -5,36 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
9
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
10
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
11
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
12
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
13
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
14
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
15
9
|
var _nodeInternal = _interopRequireDefault(require("./node-internal"));
|
|
16
10
|
var _types = require("./types");
|
|
17
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
18
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
11
|
/**
|
|
20
12
|
* An empty node
|
|
21
13
|
*/
|
|
22
|
-
|
|
23
|
-
(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var _this;
|
|
27
|
-
(0, _classCallCheck2.default)(this, Empty);
|
|
28
|
-
_this = _super.call(this, '');
|
|
29
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "termType", _types.EmptyTermType);
|
|
30
|
-
return _this;
|
|
14
|
+
class Empty extends _nodeInternal.default {
|
|
15
|
+
constructor() {
|
|
16
|
+
super('');
|
|
17
|
+
(0, _defineProperty2.default)(this, "termType", _types.EmptyTermType);
|
|
31
18
|
}
|
|
32
|
-
(
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
}]);
|
|
38
|
-
return Empty;
|
|
39
|
-
}(_nodeInternal.default);
|
|
19
|
+
toString() {
|
|
20
|
+
return '()';
|
|
21
|
+
}
|
|
22
|
+
}
|
|
40
23
|
exports.default = Empty;
|