rdflib 2.2.34 → 2.2.35
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.map +1 -1
- package/esm/blank-node.js +10 -13
- package/esm/collection.js +12 -15
- package/esm/default-graph.js +9 -12
- package/esm/empty.js +7 -10
- package/esm/factories/canonical-data-factory.js +1 -2
- package/esm/factories/extended-term-factory.js +3 -4
- package/esm/factories/rdflib-data-factory.js +2 -2
- package/esm/fetcher.js +34 -53
- package/esm/formula.js +12 -15
- package/esm/index.js +12 -15
- package/esm/lists.js +3 -0
- package/esm/literal.js +11 -14
- package/esm/n3parser.js +1 -6
- package/esm/named-node.js +8 -11
- package/esm/node-internal.js +1 -2
- package/esm/node.js +0 -1
- package/esm/patch-parser.js +0 -1
- package/esm/query.js +0 -14
- package/esm/rdfaparser.js +1 -6
- package/esm/rdfxmlparser.js +3 -4
- package/esm/serialize.js +0 -1
- package/esm/serializer.js +1 -14
- package/esm/sparql-to-query.js +0 -2
- package/esm/statement.js +1 -2
- package/esm/store.js +25 -32
- package/esm/types.js +5 -0
- package/esm/update-manager.js +3 -8
- package/esm/updates-via.js +2 -4
- package/esm/utils-js.js +0 -1
- package/esm/utils.js +1 -0
- package/esm/variable.js +11 -14
- package/lib/blank-node.js +11 -15
- package/lib/class-order.js +1 -2
- package/lib/collection.js +13 -17
- package/lib/default-graph.js +10 -14
- package/lib/empty.js +9 -13
- package/lib/factories/canonical-data-factory.js +2 -4
- package/lib/factories/extended-term-factory.js +4 -6
- package/lib/factories/factory-types.js +2 -3
- package/lib/factories/rdflib-data-factory.js +3 -4
- package/lib/fetcher.js +60 -80
- package/lib/formula.js +14 -18
- package/lib/index.js +30 -49
- package/lib/jsonldparser.js +2 -2
- package/lib/jsonparser.js +2 -3
- package/lib/lists.js +1 -1
- package/lib/literal.js +13 -17
- package/lib/log.js +1 -2
- package/lib/n3parser.js +5 -12
- package/lib/named-node.js +10 -14
- package/lib/node-internal.js +2 -4
- package/lib/node.js +1 -3
- package/lib/parse.js +2 -2
- package/lib/patch-parser.js +0 -1
- package/lib/query.js +1 -16
- package/lib/rdfaparser.js +5 -12
- package/lib/rdfxmlparser.js +6 -8
- package/lib/serialize.js +0 -1
- package/lib/serializer.js +4 -18
- package/lib/sparql-to-query.js +0 -2
- package/lib/statement.js +5 -7
- package/lib/store.js +42 -49
- package/lib/types.js +22 -43
- package/lib/update-manager.js +12 -18
- package/lib/updates-via.js +5 -9
- package/lib/utils/default-graph-uri.js +2 -4
- package/lib/utils-js.js +6 -7
- package/lib/utils.js +1 -2
- package/lib/variable.js +15 -19
- package/lib/xsd-internal.js +2 -3
- package/lib/xsd.js +1 -2
- package/package.json +31 -31
- package/src/rdfxmlparser.js +2 -1
- 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/esm/blank-node.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
9
|
-
function _isNativeReflectConstruct() {
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import ClassOrder from './class-order';
|
|
11
10
|
import Node from './node-internal';
|
|
12
11
|
import { BlankNodeTermType } from './types';
|
|
@@ -15,8 +14,6 @@ import { BlankNodeTermType } from './types';
|
|
|
15
14
|
* @link https://rdf.js.org/data-model-spec/#blanknode-interface
|
|
16
15
|
*/
|
|
17
16
|
var BlankNode = /*#__PURE__*/function (_Node) {
|
|
18
|
-
_inherits(BlankNode, _Node);
|
|
19
|
-
var _super = _createSuper(BlankNode);
|
|
20
17
|
/**
|
|
21
18
|
* Initializes this node
|
|
22
19
|
* @param [id] The identifier for the blank node
|
|
@@ -24,24 +21,25 @@ var BlankNode = /*#__PURE__*/function (_Node) {
|
|
|
24
21
|
function BlankNode(id) {
|
|
25
22
|
var _this;
|
|
26
23
|
_classCallCheck(this, BlankNode);
|
|
27
|
-
_this =
|
|
28
|
-
_defineProperty(
|
|
29
|
-
_defineProperty(
|
|
24
|
+
_this = _callSuper(this, BlankNode, [BlankNode.getId(id)]);
|
|
25
|
+
_defineProperty(_this, "termType", BlankNodeTermType);
|
|
26
|
+
_defineProperty(_this, "classOrder", ClassOrder.BlankNode);
|
|
30
27
|
/** Whether this is a blank node */
|
|
31
|
-
_defineProperty(
|
|
28
|
+
_defineProperty(_this, "isBlank", 1);
|
|
32
29
|
/**
|
|
33
30
|
* This type of node is a variable.
|
|
34
31
|
*
|
|
35
32
|
* Note that the existence of this property already indicates that it is a variable.
|
|
36
33
|
*/
|
|
37
|
-
_defineProperty(
|
|
34
|
+
_defineProperty(_this, "isVar", 1);
|
|
38
35
|
return _this;
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
/**
|
|
42
39
|
* The identifier for the blank node
|
|
43
40
|
*/
|
|
44
|
-
|
|
41
|
+
_inherits(BlankNode, _Node);
|
|
42
|
+
return _createClass(BlankNode, [{
|
|
45
43
|
key: "id",
|
|
46
44
|
get: function get() {
|
|
47
45
|
return this.value;
|
|
@@ -106,7 +104,6 @@ var BlankNode = /*#__PURE__*/function (_Node) {
|
|
|
106
104
|
return 'n' + BlankNode.nextId++;
|
|
107
105
|
}
|
|
108
106
|
}]);
|
|
109
|
-
return BlankNode;
|
|
110
107
|
}(Node);
|
|
111
108
|
/**
|
|
112
109
|
* The next unique identifier for blank nodes
|
package/esm/collection.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
9
|
-
function _isNativeReflectConstruct() {
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import RdflibBlankNode from './blank-node';
|
|
11
10
|
import ClassOrder from './class-order';
|
|
12
11
|
import Literal from './literal';
|
|
@@ -41,21 +40,19 @@ export function fromValue(value) {
|
|
|
41
40
|
* Use generic T to control the contents of the array.
|
|
42
41
|
*/
|
|
43
42
|
var Collection = /*#__PURE__*/function (_Node) {
|
|
44
|
-
_inherits(Collection, _Node);
|
|
45
|
-
var _super = _createSuper(Collection);
|
|
46
43
|
function Collection(initial) {
|
|
47
44
|
var _this;
|
|
48
45
|
_classCallCheck(this, Collection);
|
|
49
|
-
_this =
|
|
50
|
-
_defineProperty(
|
|
51
|
-
_defineProperty(
|
|
52
|
-
_defineProperty(
|
|
53
|
-
_defineProperty(
|
|
46
|
+
_this = _callSuper(this, Collection, [(RdflibBlankNode.nextId++).toString()]);
|
|
47
|
+
_defineProperty(_this, "termType", CollectionTermType);
|
|
48
|
+
_defineProperty(_this, "classOrder", ClassOrder.Collection);
|
|
49
|
+
_defineProperty(_this, "closed", false);
|
|
50
|
+
_defineProperty(_this, "compareTerm", RdflibBlankNode.prototype.compareTerm);
|
|
54
51
|
/**
|
|
55
52
|
* The nodes in this collection
|
|
56
53
|
*/
|
|
57
|
-
_defineProperty(
|
|
58
|
-
_defineProperty(
|
|
54
|
+
_defineProperty(_this, "elements", []);
|
|
55
|
+
_defineProperty(_this, "isVar", 0);
|
|
59
56
|
if (initial && initial.length > 0) {
|
|
60
57
|
initial.forEach(function (element) {
|
|
61
58
|
_this.elements.push(fromValue(element));
|
|
@@ -63,7 +60,8 @@ var Collection = /*#__PURE__*/function (_Node) {
|
|
|
63
60
|
}
|
|
64
61
|
return _this;
|
|
65
62
|
}
|
|
66
|
-
|
|
63
|
+
_inherits(Collection, _Node);
|
|
64
|
+
return _createClass(Collection, [{
|
|
67
65
|
key: "id",
|
|
68
66
|
get: function get() {
|
|
69
67
|
return this.value;
|
|
@@ -146,7 +144,6 @@ var Collection = /*#__PURE__*/function (_Node) {
|
|
|
146
144
|
return RdflibBlankNode.NTAnonymousNodePrefix + collection.id;
|
|
147
145
|
}
|
|
148
146
|
}]);
|
|
149
|
-
return Collection;
|
|
150
147
|
}(Node);
|
|
151
148
|
_defineProperty(Collection, "termType", CollectionTermType);
|
|
152
149
|
export { Collection as default };
|
package/esm/default-graph.js
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
9
|
-
function _isNativeReflectConstruct() {
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import Node from './node-internal';
|
|
11
10
|
import { DefaultGraphTermType } from './types';
|
|
12
11
|
import { defaultGraphURI } from './utils/default-graph-uri';
|
|
13
12
|
|
|
14
13
|
/** The RDF default graph */
|
|
15
14
|
var DefaultGraph = /*#__PURE__*/function (_Node) {
|
|
16
|
-
_inherits(DefaultGraph, _Node);
|
|
17
|
-
var _super = _createSuper(DefaultGraph);
|
|
18
15
|
function DefaultGraph() {
|
|
19
16
|
var _this;
|
|
20
17
|
_classCallCheck(this, DefaultGraph);
|
|
21
|
-
_this =
|
|
22
|
-
_defineProperty(
|
|
23
|
-
_defineProperty(
|
|
24
|
-
_defineProperty(
|
|
18
|
+
_this = _callSuper(this, DefaultGraph, ['']);
|
|
19
|
+
_defineProperty(_this, "value", '');
|
|
20
|
+
_defineProperty(_this, "termType", DefaultGraphTermType);
|
|
21
|
+
_defineProperty(_this, "uri", defaultGraphURI);
|
|
25
22
|
return _this;
|
|
26
23
|
}
|
|
27
|
-
|
|
24
|
+
_inherits(DefaultGraph, _Node);
|
|
25
|
+
return _createClass(DefaultGraph, [{
|
|
28
26
|
key: "toCanonical",
|
|
29
27
|
value: function toCanonical() {
|
|
30
28
|
return this.value;
|
|
@@ -35,7 +33,6 @@ var DefaultGraph = /*#__PURE__*/function (_Node) {
|
|
|
35
33
|
return 'DefaultGraph';
|
|
36
34
|
}
|
|
37
35
|
}]);
|
|
38
|
-
return DefaultGraph;
|
|
39
36
|
}(Node);
|
|
40
37
|
export { DefaultGraph as default };
|
|
41
38
|
export function isDefaultGraph(object) {
|
package/esm/empty.js
CHANGED
|
@@ -1,33 +1,30 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
9
|
-
function _isNativeReflectConstruct() {
|
|
7
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
9
|
import Node from './node-internal';
|
|
11
10
|
import { EmptyTermType } from './types';
|
|
12
11
|
/**
|
|
13
12
|
* An empty node
|
|
14
13
|
*/
|
|
15
14
|
var Empty = /*#__PURE__*/function (_Node) {
|
|
16
|
-
_inherits(Empty, _Node);
|
|
17
|
-
var _super = _createSuper(Empty);
|
|
18
15
|
function Empty() {
|
|
19
16
|
var _this;
|
|
20
17
|
_classCallCheck(this, Empty);
|
|
21
|
-
_this =
|
|
22
|
-
_defineProperty(
|
|
18
|
+
_this = _callSuper(this, Empty, ['']);
|
|
19
|
+
_defineProperty(_this, "termType", EmptyTermType);
|
|
23
20
|
return _this;
|
|
24
21
|
}
|
|
25
|
-
|
|
22
|
+
_inherits(Empty, _Node);
|
|
23
|
+
return _createClass(Empty, [{
|
|
26
24
|
key: "toString",
|
|
27
25
|
value: function toString() {
|
|
28
26
|
return '()';
|
|
29
27
|
}
|
|
30
28
|
}]);
|
|
31
|
-
return Empty;
|
|
32
29
|
}(Node);
|
|
33
30
|
export { Empty as default };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
var _supports;
|
|
3
2
|
import BlankNode from '../blank-node';
|
|
4
3
|
import Literal from '../literal';
|
|
5
4
|
import NamedNode from '../named-node';
|
|
@@ -18,7 +17,7 @@ var _defaultGraph = new DefaultGraph();
|
|
|
18
17
|
|
|
19
18
|
/** A basic internal RDFlib datafactory, which does not support Collections */
|
|
20
19
|
var CanonicalDataFactory = {
|
|
21
|
-
supports: (
|
|
20
|
+
supports: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Feature.collections, false), Feature.defaultGraphType, false), Feature.equalsMethod, true), Feature.identity, false), Feature.id, true), Feature.reversibleId, false), Feature.variableType, true),
|
|
22
21
|
/**
|
|
23
22
|
* Creates a new blank node
|
|
24
23
|
* @param value - The blank node's identifier
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
4
|
import Collection from '../collection';
|
|
6
5
|
import CanonicalDataFactory from './canonical-data-factory';
|
|
7
6
|
import { CollectionTermType } from '../types';
|
|
@@ -14,7 +13,7 @@ import Variable from '../variable';
|
|
|
14
13
|
* Necessary for preventing circular dependencies.
|
|
15
14
|
*/
|
|
16
15
|
var ExtendedTermFactory = _objectSpread(_objectSpread({}, CanonicalDataFactory), {}, {
|
|
17
|
-
supports: (
|
|
16
|
+
supports: _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({}, Feature.collections, true), Feature.defaultGraphType, false), Feature.equalsMethod, true), Feature.identity, false), Feature.id, true), Feature.reversibleId, false), Feature.variableType, true),
|
|
18
17
|
/**
|
|
19
18
|
* Creates a new collection
|
|
20
19
|
* @param elements - The initial element
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
function ownKeys(
|
|
3
|
-
function _objectSpread(
|
|
2
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
import IndexedFormula from '../store';
|
|
5
5
|
import Fetcher from '../fetcher';
|
|
6
6
|
import ExtendedTermFactory from './extended-term-factory';
|
package/esm/fetcher.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
2
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
2
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
3
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
4
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
6
6
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
@@ -9,8 +9,8 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
|
9
9
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
10
10
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
11
11
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
12
|
-
function
|
|
13
|
-
function _isNativeReflectConstruct() {
|
|
12
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
13
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
14
14
|
/* global $SolidTestEnvironment */
|
|
15
15
|
/**
|
|
16
16
|
*
|
|
@@ -112,14 +112,13 @@ var Handler = /*#__PURE__*/_createClass(function Handler(response, dom) {
|
|
|
112
112
|
this.dom = dom;
|
|
113
113
|
});
|
|
114
114
|
_defineProperty(Handler, "pattern", void 0);
|
|
115
|
-
var RDFXMLHandler = /*#__PURE__*/function (
|
|
116
|
-
_inherits(RDFXMLHandler, _Handler);
|
|
117
|
-
var _super = _createSuper(RDFXMLHandler);
|
|
115
|
+
var RDFXMLHandler = /*#__PURE__*/function (_Handler2) {
|
|
118
116
|
function RDFXMLHandler() {
|
|
119
117
|
_classCallCheck(this, RDFXMLHandler);
|
|
120
|
-
return
|
|
118
|
+
return _callSuper(this, RDFXMLHandler, arguments);
|
|
121
119
|
}
|
|
122
|
-
|
|
120
|
+
_inherits(RDFXMLHandler, _Handler2);
|
|
121
|
+
return _createClass(RDFXMLHandler, [{
|
|
123
122
|
key: "parse",
|
|
124
123
|
value: function parse(fetcher, /** An XML String */
|
|
125
124
|
responseText, /** Requires .original */
|
|
@@ -158,17 +157,15 @@ var RDFXMLHandler = /*#__PURE__*/function (_Handler) {
|
|
|
158
157
|
};
|
|
159
158
|
}
|
|
160
159
|
}]);
|
|
161
|
-
return RDFXMLHandler;
|
|
162
160
|
}(Handler);
|
|
163
161
|
RDFXMLHandler.pattern = new RegExp('application/rdf\\+xml');
|
|
164
|
-
var XHTMLHandler = /*#__PURE__*/function (
|
|
165
|
-
_inherits(XHTMLHandler, _Handler2);
|
|
166
|
-
var _super2 = _createSuper(XHTMLHandler);
|
|
162
|
+
var XHTMLHandler = /*#__PURE__*/function (_Handler3) {
|
|
167
163
|
function XHTMLHandler() {
|
|
168
164
|
_classCallCheck(this, XHTMLHandler);
|
|
169
|
-
return
|
|
165
|
+
return _callSuper(this, XHTMLHandler, arguments);
|
|
170
166
|
}
|
|
171
|
-
|
|
167
|
+
_inherits(XHTMLHandler, _Handler3);
|
|
168
|
+
return _createClass(XHTMLHandler, [{
|
|
172
169
|
key: "parse",
|
|
173
170
|
value: function parse(fetcher, responseText, options) {
|
|
174
171
|
var relation, reverse;
|
|
@@ -236,17 +233,15 @@ var XHTMLHandler = /*#__PURE__*/function (_Handler2) {
|
|
|
236
233
|
fetcher.mediatypes[XHTMLContentType] = {};
|
|
237
234
|
}
|
|
238
235
|
}]);
|
|
239
|
-
return XHTMLHandler;
|
|
240
236
|
}(Handler);
|
|
241
237
|
XHTMLHandler.pattern = new RegExp('application/xhtml');
|
|
242
|
-
var XMLHandler = /*#__PURE__*/function (
|
|
243
|
-
_inherits(XMLHandler, _Handler3);
|
|
244
|
-
var _super3 = _createSuper(XMLHandler);
|
|
238
|
+
var XMLHandler = /*#__PURE__*/function (_Handler4) {
|
|
245
239
|
function XMLHandler() {
|
|
246
240
|
_classCallCheck(this, XMLHandler);
|
|
247
|
-
return
|
|
241
|
+
return _callSuper(this, XMLHandler, arguments);
|
|
248
242
|
}
|
|
249
|
-
|
|
243
|
+
_inherits(XMLHandler, _Handler4);
|
|
244
|
+
return _createClass(XMLHandler, [{
|
|
250
245
|
key: "parse",
|
|
251
246
|
value: function parse(fetcher, responseText, options) {
|
|
252
247
|
var dom = Util.parseXML(responseText);
|
|
@@ -320,17 +315,15 @@ var XMLHandler = /*#__PURE__*/function (_Handler3) {
|
|
|
320
315
|
return node.nodeType === Node.ELEMENT_NODE;
|
|
321
316
|
}
|
|
322
317
|
}]);
|
|
323
|
-
return XMLHandler;
|
|
324
318
|
}(Handler);
|
|
325
319
|
XMLHandler.pattern = new RegExp('(text|application)/(.*)xml');
|
|
326
|
-
var HTMLHandler = /*#__PURE__*/function (
|
|
327
|
-
_inherits(HTMLHandler, _Handler4);
|
|
328
|
-
var _super4 = _createSuper(HTMLHandler);
|
|
320
|
+
var HTMLHandler = /*#__PURE__*/function (_Handler5) {
|
|
329
321
|
function HTMLHandler() {
|
|
330
322
|
_classCallCheck(this, HTMLHandler);
|
|
331
|
-
return
|
|
323
|
+
return _callSuper(this, HTMLHandler, arguments);
|
|
332
324
|
}
|
|
333
|
-
|
|
325
|
+
_inherits(HTMLHandler, _Handler5);
|
|
326
|
+
return _createClass(HTMLHandler, [{
|
|
334
327
|
key: "parse",
|
|
335
328
|
value: function parse(fetcher, responseText, options) {
|
|
336
329
|
var kb = fetcher.store;
|
|
@@ -363,7 +356,6 @@ var HTMLHandler = /*#__PURE__*/function (_Handler4) {
|
|
|
363
356
|
if (titleMatch) {
|
|
364
357
|
kb.add(options.resource, ns.dc('title'), kb.rdfFactory.literal(titleMatch[1]), options.resource); // think about xml:lang later
|
|
365
358
|
}
|
|
366
|
-
|
|
367
359
|
kb.add(options.resource, ns.rdf('type'), ns.link('WebPage'), fetcher.appNode);
|
|
368
360
|
fetcher.addStatus(options.req, 'non-XML HTML document, not parsed for data.');
|
|
369
361
|
return fetcher.doneFetch(options, this.response);
|
|
@@ -381,17 +373,15 @@ var HTMLHandler = /*#__PURE__*/function (_Handler4) {
|
|
|
381
373
|
};
|
|
382
374
|
}
|
|
383
375
|
}]);
|
|
384
|
-
return HTMLHandler;
|
|
385
376
|
}(Handler);
|
|
386
377
|
HTMLHandler.pattern = new RegExp('text/html');
|
|
387
|
-
var JsonLdHandler = /*#__PURE__*/function (
|
|
388
|
-
_inherits(JsonLdHandler, _Handler5);
|
|
389
|
-
var _super5 = _createSuper(JsonLdHandler);
|
|
378
|
+
var JsonLdHandler = /*#__PURE__*/function (_Handler6) {
|
|
390
379
|
function JsonLdHandler() {
|
|
391
380
|
_classCallCheck(this, JsonLdHandler);
|
|
392
|
-
return
|
|
381
|
+
return _callSuper(this, JsonLdHandler, arguments);
|
|
393
382
|
}
|
|
394
|
-
|
|
383
|
+
_inherits(JsonLdHandler, _Handler6);
|
|
384
|
+
return _createClass(JsonLdHandler, [{
|
|
395
385
|
key: "parse",
|
|
396
386
|
value: function parse(fetcher, responseText, options, response) {
|
|
397
387
|
var kb = fetcher.store;
|
|
@@ -419,17 +409,15 @@ var JsonLdHandler = /*#__PURE__*/function (_Handler5) {
|
|
|
419
409
|
};
|
|
420
410
|
}
|
|
421
411
|
}]);
|
|
422
|
-
return JsonLdHandler;
|
|
423
412
|
}(Handler);
|
|
424
413
|
JsonLdHandler.pattern = /application\/ld\+json/;
|
|
425
|
-
var TextHandler = /*#__PURE__*/function (
|
|
426
|
-
_inherits(TextHandler, _Handler6);
|
|
427
|
-
var _super6 = _createSuper(TextHandler);
|
|
414
|
+
var TextHandler = /*#__PURE__*/function (_Handler7) {
|
|
428
415
|
function TextHandler() {
|
|
429
416
|
_classCallCheck(this, TextHandler);
|
|
430
|
-
return
|
|
417
|
+
return _callSuper(this, TextHandler, arguments);
|
|
431
418
|
}
|
|
432
|
-
|
|
419
|
+
_inherits(TextHandler, _Handler7);
|
|
420
|
+
return _createClass(TextHandler, [{
|
|
433
421
|
key: "parse",
|
|
434
422
|
value: function parse(fetcher, responseText, options) {
|
|
435
423
|
// We only speak dialects of XML right now. Is this XML?
|
|
@@ -465,17 +453,15 @@ var TextHandler = /*#__PURE__*/function (_Handler6) {
|
|
|
465
453
|
};
|
|
466
454
|
}
|
|
467
455
|
}]);
|
|
468
|
-
return TextHandler;
|
|
469
456
|
}(Handler);
|
|
470
457
|
TextHandler.pattern = new RegExp('text/plain');
|
|
471
|
-
var N3Handler = /*#__PURE__*/function (
|
|
472
|
-
_inherits(N3Handler, _Handler7);
|
|
473
|
-
var _super7 = _createSuper(N3Handler);
|
|
458
|
+
var N3Handler = /*#__PURE__*/function (_Handler8) {
|
|
474
459
|
function N3Handler() {
|
|
475
460
|
_classCallCheck(this, N3Handler);
|
|
476
|
-
return
|
|
461
|
+
return _callSuper(this, N3Handler, arguments);
|
|
477
462
|
}
|
|
478
|
-
|
|
463
|
+
_inherits(N3Handler, _Handler8);
|
|
464
|
+
return _createClass(N3Handler, [{
|
|
479
465
|
key: "parse",
|
|
480
466
|
value: function parse(fetcher, responseText, options, response) {
|
|
481
467
|
// Parse the text of this N3 file
|
|
@@ -513,7 +499,6 @@ var N3Handler = /*#__PURE__*/function (_Handler7) {
|
|
|
513
499
|
}; // post 2008
|
|
514
500
|
}
|
|
515
501
|
}]);
|
|
516
|
-
return N3Handler;
|
|
517
502
|
}(Handler);
|
|
518
503
|
N3Handler.pattern = new RegExp('(application|text)/(x-)?(rdf\\+)?(n3|turtle)');
|
|
519
504
|
var defaultHandlers = {
|
|
@@ -630,7 +615,7 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
630
615
|
return _this.addHandler(defaultHandlers[key]);
|
|
631
616
|
});
|
|
632
617
|
}
|
|
633
|
-
_createClass(Fetcher, [{
|
|
618
|
+
return _createClass(Fetcher, [{
|
|
634
619
|
key: "load",
|
|
635
620
|
value:
|
|
636
621
|
/**
|
|
@@ -973,7 +958,6 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
973
958
|
if (fetchResponse.responseText) {
|
|
974
959
|
oops += ' ' + fetchResponse.responseText; // not in 404, dns error, nock failure
|
|
975
960
|
}
|
|
976
|
-
|
|
977
961
|
userCallback(false, oops, fetchResponse);
|
|
978
962
|
}
|
|
979
963
|
} else {
|
|
@@ -1204,7 +1188,7 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
1204
1188
|
*/
|
|
1205
1189
|
}, {
|
|
1206
1190
|
key: "createIfNotExists",
|
|
1207
|
-
value: function () {
|
|
1191
|
+
value: (function () {
|
|
1208
1192
|
var _createIfNotExists = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(doc) {
|
|
1209
1193
|
var contentType,
|
|
1210
1194
|
data,
|
|
@@ -1269,6 +1253,7 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
1269
1253
|
* @param folderName - Optional folder name (slug)
|
|
1270
1254
|
* @param data - Optional folder metadata
|
|
1271
1255
|
*/
|
|
1256
|
+
)
|
|
1272
1257
|
}, {
|
|
1273
1258
|
key: "createContainer",
|
|
1274
1259
|
value: function createContainer(parentURI, folderName, data) {
|
|
@@ -1307,7 +1292,6 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
1307
1292
|
// console.log('*** Fetcher: pending fetchQueue deleted ' + uri)
|
|
1308
1293
|
}
|
|
1309
1294
|
}
|
|
1310
|
-
|
|
1311
1295
|
if (fetcher.requested[uri] && fetcher.requested[uri] !== 'done' && fetcher.requested[uri] !== 'failed' && fetcher.requested[uri] !== 404) {
|
|
1312
1296
|
var msg = "Rdflib: fetcher: Destructive operation on <".concat(fetcher.requested[uri], "> file being fetched! ") + uri;
|
|
1313
1297
|
console.error(msg);
|
|
@@ -1472,7 +1456,6 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
1472
1456
|
);
|
|
1473
1457
|
}
|
|
1474
1458
|
});
|
|
1475
|
-
|
|
1476
1459
|
return responseNode;
|
|
1477
1460
|
}
|
|
1478
1461
|
}, {
|
|
@@ -1822,7 +1805,6 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
1822
1805
|
kb.add(oldReq, this.ns.link('redirectedTo'), kb.rdfFactory.namedNode(newURI), oldReq);
|
|
1823
1806
|
this.addStatus(oldReq, 'redirected to new request'); // why
|
|
1824
1807
|
}
|
|
1825
|
-
|
|
1826
1808
|
this.requested[options.resource.value] = 'redirected';
|
|
1827
1809
|
this.redirectedTo[options.resource.value] = newURI;
|
|
1828
1810
|
var newOptions = Object.assign({}, options);
|
|
@@ -1984,7 +1966,6 @@ var Fetcher = /*#__PURE__*/function () {
|
|
|
1984
1966
|
}
|
|
1985
1967
|
}
|
|
1986
1968
|
}]);
|
|
1987
|
-
return Fetcher;
|
|
1988
1969
|
}();
|
|
1989
1970
|
_defineProperty(Fetcher, "HANDLERS", void 0);
|
|
1990
1971
|
_defineProperty(Fetcher, "CONTENT_TYPE_BY_EXT", void 0);
|
package/esm/formula.js
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
1
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
2
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
3
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
4
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
|
+
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
7
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
9
8
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
9
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
-
function
|
|
12
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
13
12
|
import ClassOrder from './class-order';
|
|
14
13
|
import Collection from './collection';
|
|
15
14
|
import CanonicalDataFactory from './factories/canonical-data-factory';
|
|
@@ -26,8 +25,6 @@ import NamedNode from './named-node';
|
|
|
26
25
|
* A formula, or store of RDF statements
|
|
27
26
|
*/
|
|
28
27
|
var Formula = /*#__PURE__*/function (_Node) {
|
|
29
|
-
_inherits(Formula, _Node);
|
|
30
|
-
var _super = _createSuper(Formula);
|
|
31
28
|
/**
|
|
32
29
|
* Initializes this formula
|
|
33
30
|
* @constructor
|
|
@@ -46,27 +43,27 @@ var Formula = /*#__PURE__*/function (_Node) {
|
|
|
46
43
|
var optional = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : [];
|
|
47
44
|
var opts = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
48
45
|
_classCallCheck(this, Formula);
|
|
49
|
-
_this =
|
|
46
|
+
_this = _callSuper(this, Formula, ['']);
|
|
50
47
|
_this.statements = statements;
|
|
51
48
|
_this.constraints = constraints;
|
|
52
49
|
_this.initBindings = initBindings;
|
|
53
50
|
_this.optional = optional;
|
|
54
|
-
_defineProperty(
|
|
55
|
-
_defineProperty(
|
|
51
|
+
_defineProperty(_this, "termType", GraphTermType);
|
|
52
|
+
_defineProperty(_this, "classOrder", ClassOrder.Graph);
|
|
56
53
|
/**
|
|
57
54
|
* The accompanying fetcher instance.
|
|
58
55
|
*
|
|
59
56
|
* Is set by the fetcher when initialized.
|
|
60
57
|
*/
|
|
61
|
-
_defineProperty(
|
|
62
|
-
_defineProperty(
|
|
58
|
+
_defineProperty(_this, "fetcher", void 0);
|
|
59
|
+
_defineProperty(_this, "isVar", 0);
|
|
63
60
|
/**
|
|
64
61
|
* A namespace for the specified namespace's URI
|
|
65
62
|
* @param nsuri The URI for the namespace
|
|
66
63
|
*/
|
|
67
|
-
_defineProperty(
|
|
64
|
+
_defineProperty(_this, "ns", Namespace);
|
|
68
65
|
/** The factory used to generate statements and terms */
|
|
69
|
-
_defineProperty(
|
|
66
|
+
_defineProperty(_this, "rdfFactory", void 0);
|
|
70
67
|
_this.rdfFactory = opts && opts.rdfFactory || CanonicalDataFactory;
|
|
71
68
|
// Enable default factory methods on this while preserving factory context.
|
|
72
69
|
var _iterator = _createForOfIteratorHelper(appliedFactoryMethods),
|
|
@@ -96,7 +93,8 @@ var Formula = /*#__PURE__*/function (_Node) {
|
|
|
96
93
|
* @param object - the third part of the statement
|
|
97
94
|
* @param graph - the last part of the statement
|
|
98
95
|
*/
|
|
99
|
-
|
|
96
|
+
_inherits(Formula, _Node);
|
|
97
|
+
return _createClass(Formula, [{
|
|
100
98
|
key: "add",
|
|
101
99
|
value: function add(subject, predicate, object, graph) {
|
|
102
100
|
var _this2 = this;
|
|
@@ -854,6 +852,5 @@ var Formula = /*#__PURE__*/function (_Node) {
|
|
|
854
852
|
return this.statementsMatching(s, p, o, g, false).length;
|
|
855
853
|
}
|
|
856
854
|
}]);
|
|
857
|
-
return Formula;
|
|
858
855
|
}(Node);
|
|
859
856
|
export { Formula as default };
|