rdflib 2.2.21-d55d15fa → 2.2.21-e3e59ee9
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 +9 -1
- package/dist/rdflib.min.js.map +1 -1
- package/esm/blank-node.js +61 -114
- package/esm/class-order.js +1 -1
- package/esm/collection.js +70 -128
- package/esm/convert.js +1 -2
- package/esm/default-graph.js +14 -48
- package/esm/empty.js +8 -39
- package/esm/factories/canonical-data-factory.js +33 -65
- package/esm/factories/extended-term-factory.js +18 -25
- package/esm/factories/factory-types.js +3 -2
- package/esm/factories/rdflib-data-factory.js +9 -19
- package/esm/fetcher.js +1341 -1854
- package/esm/formula.js +639 -846
- package/esm/index.js +40 -76
- package/esm/jsonldparser.js +24 -49
- package/esm/jsonparser.js +1 -8
- package/esm/lists.js +47 -110
- package/esm/literal.js +120 -189
- package/esm/log.js +7 -7
- package/esm/n3parser.js +1015 -1412
- package/esm/named-node.js +70 -119
- package/esm/namespace.js +2 -5
- package/esm/node-internal.js +73 -110
- package/esm/node.js +2 -7
- package/esm/parse.js +12 -19
- package/esm/patch-parser.js +10 -30
- package/esm/query-to-sparql.js +0 -18
- package/esm/query.js +63 -147
- package/esm/rdfaparser.js +794 -997
- package/esm/rdfxmlparser.js +347 -461
- package/esm/serialize.js +10 -28
- package/esm/serializer.js +820 -1049
- package/esm/sparql-to-query.js +44 -134
- package/esm/statement.js +54 -85
- package/esm/store.js +829 -1103
- package/esm/types.js +22 -21
- package/esm/update-manager.js +862 -1094
- package/esm/updates-via.js +104 -161
- package/esm/uri.js +9 -53
- package/esm/utils/default-graph-uri.js +3 -2
- package/esm/utils/termValue.js +0 -1
- package/esm/utils/terms.js +19 -21
- package/esm/utils-js.js +20 -61
- package/esm/utils.js +10 -21
- package/esm/variable.js +32 -78
- package/esm/xsd.js +2 -2
- package/lib/blank-node.js +60 -113
- package/lib/class-order.js +1 -2
- package/lib/collection.js +69 -131
- package/lib/convert.js +3 -9
- package/lib/default-graph.js +13 -52
- package/lib/empty.js +8 -43
- package/lib/factories/canonical-data-factory.js +35 -79
- package/lib/factories/extended-term-factory.js +18 -32
- package/lib/factories/factory-types.d.ts +6 -6
- package/lib/factories/factory-types.js +1 -4
- package/lib/factories/rdflib-data-factory.js +9 -23
- package/lib/fetcher.d.ts +6 -6
- package/lib/fetcher.js +1370 -1843
- package/lib/formula.js +640 -855
- package/lib/index.js +66 -152
- package/lib/jsonldparser.js +23 -53
- package/lib/jsonparser.js +1 -10
- package/lib/lists.js +55 -112
- package/lib/literal.js +120 -195
- package/lib/log.d.ts +0 -6
- package/lib/log.js +7 -8
- package/lib/n3parser.js +1030 -1436
- package/lib/named-node.js +69 -126
- package/lib/namespace.js +2 -7
- package/lib/node-internal.js +74 -107
- package/lib/node.js +2 -12
- package/lib/parse.d.ts +1 -1
- package/lib/parse.js +12 -32
- package/lib/patch-parser.js +11 -34
- package/lib/query-to-sparql.js +0 -23
- package/lib/query.js +62 -167
- package/lib/rdfaparser.js +796 -1009
- package/lib/rdfxmlparser.js +349 -466
- package/lib/serialize.js +12 -38
- package/lib/serializer.js +823 -1064
- package/lib/sparql-to-query.js +42 -167
- package/lib/statement.js +55 -91
- package/lib/store.d.ts +1 -1
- package/lib/store.js +849 -1112
- package/lib/tf-types.d.ts +4 -4
- package/lib/types.d.ts +8 -8
- package/lib/types.js +23 -23
- package/lib/update-manager.d.ts +2 -2
- package/lib/update-manager.js +870 -1103
- package/lib/updates-via.js +105 -164
- package/lib/uri.js +8 -61
- package/lib/utils/default-graph-uri.js +3 -5
- package/lib/utils/termValue.js +0 -2
- package/lib/utils/terms.js +19 -40
- package/lib/utils-js.js +23 -88
- package/lib/utils.js +10 -27
- package/lib/variable.js +34 -85
- package/lib/xsd-internal.js +0 -3
- package/lib/xsd.js +2 -6
- package/package.json +37 -36
- package/src/fetcher.ts +2 -2
- package/src/update-manager.ts +18 -7
- package/changes.txt +0 -59
package/lib/variable.js
CHANGED
|
@@ -1,44 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
4
|
Object.defineProperty(exports, "__esModule", {
|
|
8
5
|
value: true
|
|
9
6
|
});
|
|
10
7
|
exports.default = void 0;
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
8
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
9
|
var _classOrder = _interopRequireDefault(require("./class-order"));
|
|
27
|
-
|
|
28
10
|
var _nodeInternal = _interopRequireDefault(require("./node-internal"));
|
|
29
|
-
|
|
30
11
|
var _types = require("./types");
|
|
31
|
-
|
|
32
12
|
var Uri = _interopRequireWildcard(require("./uri"));
|
|
33
|
-
|
|
34
|
-
function
|
|
35
|
-
|
|
36
|
-
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; }
|
|
37
|
-
|
|
38
|
-
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); }; }
|
|
39
|
-
|
|
40
|
-
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; } }
|
|
41
|
-
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
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; }
|
|
42
15
|
/**
|
|
43
16
|
* Variables are placeholders used in patterns to be matched.
|
|
44
17
|
* In cwm they are symbols which are the formula's list of quantified variables.
|
|
@@ -46,11 +19,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
46
19
|
* a common special base URI for variables. Their names are uris,
|
|
47
20
|
* but the ? notation has an implicit base uri of 'varid:'
|
|
48
21
|
*/
|
|
49
|
-
|
|
50
|
-
(0, _inherits2.default)(Variable, _Node);
|
|
51
|
-
|
|
52
|
-
var _super = _createSuper(Variable);
|
|
53
|
-
|
|
22
|
+
class Variable extends _nodeInternal.default {
|
|
54
23
|
/** The base string for a variable's name */
|
|
55
24
|
|
|
56
25
|
/** The unique identifier of this variable */
|
|
@@ -59,58 +28,38 @@ var Variable = /*#__PURE__*/function (_Node) {
|
|
|
59
28
|
* Initializes this variable
|
|
60
29
|
* @param name The variable's name
|
|
61
30
|
*/
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
(0,
|
|
67
|
-
|
|
68
|
-
(0, _defineProperty2.default)(
|
|
69
|
-
(0, _defineProperty2.default)(
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "uri", void 0);
|
|
73
|
-
_this.base = 'varid:';
|
|
74
|
-
_this.uri = Uri.join(name, _this.base);
|
|
75
|
-
return _this;
|
|
31
|
+
constructor() {
|
|
32
|
+
let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
33
|
+
super(name);
|
|
34
|
+
(0, _defineProperty2.default)(this, "termType", _types.VariableTermType);
|
|
35
|
+
(0, _defineProperty2.default)(this, "base", 'varid:');
|
|
36
|
+
(0, _defineProperty2.default)(this, "classOrder", _classOrder.default.Variable);
|
|
37
|
+
(0, _defineProperty2.default)(this, "isVar", 1);
|
|
38
|
+
(0, _defineProperty2.default)(this, "uri", void 0);
|
|
39
|
+
this.base = 'varid:';
|
|
40
|
+
this.uri = Uri.join(name, this.base);
|
|
76
41
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
value: function equals(other) {
|
|
81
|
-
if (!other) {
|
|
82
|
-
return false;
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
return this.termType === other.termType && this.value === other.value;
|
|
86
|
-
}
|
|
87
|
-
}, {
|
|
88
|
-
key: "hashString",
|
|
89
|
-
value: function hashString() {
|
|
90
|
-
return this.toString();
|
|
91
|
-
}
|
|
92
|
-
}, {
|
|
93
|
-
key: "substitute",
|
|
94
|
-
value: function substitute(bindings) {
|
|
95
|
-
var ref;
|
|
96
|
-
return (ref = bindings[this.toNT()]) != null ? ref : this;
|
|
42
|
+
equals(other) {
|
|
43
|
+
if (!other) {
|
|
44
|
+
return false;
|
|
97
45
|
}
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
46
|
+
return this.termType === other.termType && this.value === other.value;
|
|
47
|
+
}
|
|
48
|
+
hashString() {
|
|
49
|
+
return this.toString();
|
|
50
|
+
}
|
|
51
|
+
substitute(bindings) {
|
|
52
|
+
var ref;
|
|
53
|
+
return (ref = bindings[this.toNT()]) != null ? ref : this;
|
|
54
|
+
}
|
|
55
|
+
toString() {
|
|
56
|
+
return Variable.toString(this);
|
|
57
|
+
}
|
|
58
|
+
static toString(variable) {
|
|
59
|
+
if (variable.uri.slice(0, variable.base.length) === variable.base) {
|
|
60
|
+
return `?${variable.uri.slice(variable.base.length)}`;
|
|
111
61
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
}
|
|
115
|
-
|
|
62
|
+
return `?${variable.uri}`;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
116
65
|
exports.default = Variable;
|
package/lib/xsd-internal.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.default = void 0;
|
|
9
|
-
|
|
10
8
|
var _namedNode = _interopRequireDefault(require("./named-node"));
|
|
11
|
-
|
|
12
9
|
var _default = {
|
|
13
10
|
boolean: new _namedNode.default('http://www.w3.org/2001/XMLSchema#boolean'),
|
|
14
11
|
dateTime: new _namedNode.default('http://www.w3.org/2001/XMLSchema#dateTime'),
|
package/lib/xsd.js
CHANGED
|
@@ -1,17 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.createXSD = createXSD;
|
|
9
8
|
exports.default = void 0;
|
|
10
|
-
|
|
11
9
|
var _canonicalDataFactory = _interopRequireDefault(require("./factories/canonical-data-factory"));
|
|
12
|
-
|
|
13
10
|
function createXSD() {
|
|
14
|
-
|
|
11
|
+
let localFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : _canonicalDataFactory.default;
|
|
15
12
|
return {
|
|
16
13
|
boolean: localFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),
|
|
17
14
|
dateTime: localFactory.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),
|
|
@@ -22,7 +19,6 @@ function createXSD() {
|
|
|
22
19
|
string: localFactory.namedNode("http://www.w3.org/2001/XMLSchema#string")
|
|
23
20
|
};
|
|
24
21
|
}
|
|
25
|
-
|
|
26
|
-
var defaultXSD = createXSD(_canonicalDataFactory.default);
|
|
22
|
+
const defaultXSD = createXSD(_canonicalDataFactory.default);
|
|
27
23
|
var _default = defaultXSD;
|
|
28
24
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rdflib",
|
|
3
3
|
"description": "an RDF library for node.js. Suitable for client and server side.",
|
|
4
|
-
"version": "2.2.21-
|
|
4
|
+
"version": "2.2.21-e3e59ee9",
|
|
5
5
|
"private": false,
|
|
6
6
|
"browserslist": [
|
|
7
7
|
"> 0.5%"
|
|
@@ -44,56 +44,57 @@
|
|
|
44
44
|
"homepage": "http://github.com/linkeddata/rdflib.js",
|
|
45
45
|
"bugs": "http://github.com/linkeddata/rdflib.js/issues",
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@babel/runtime": "^7.
|
|
48
|
-
"@xmldom/xmldom": "^0.8.
|
|
49
|
-
"async": "^3.2.
|
|
47
|
+
"@babel/runtime": "^7.20.1",
|
|
48
|
+
"@xmldom/xmldom": "^0.8.6",
|
|
49
|
+
"async": "^3.2.4",
|
|
50
50
|
"cross-fetch": "^3.1.5",
|
|
51
|
-
"jsonld": "^
|
|
52
|
-
"n3": "^1.16.
|
|
51
|
+
"jsonld": "^8.1.0",
|
|
52
|
+
"n3": "^1.16.3",
|
|
53
53
|
"solid-namespace": "^0.5.2"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@babel/cli": "^7.
|
|
57
|
-
"@babel/core": "^7.
|
|
58
|
-
"@babel/plugin-proposal-class-properties": "^7.
|
|
59
|
-
"@babel/plugin-transform-runtime": "^7.
|
|
60
|
-
"@babel/preset-env": "^7.
|
|
61
|
-
"@babel/preset-typescript": "^7.
|
|
62
|
-
"@babel/register": "^7.
|
|
63
|
-
"@types/chai": "^4.3.
|
|
56
|
+
"@babel/cli": "^7.19.3",
|
|
57
|
+
"@babel/core": "^7.20.2",
|
|
58
|
+
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
59
|
+
"@babel/plugin-transform-runtime": "^7.19.6",
|
|
60
|
+
"@babel/preset-env": "^7.20.2",
|
|
61
|
+
"@babel/preset-typescript": "^7.18.6",
|
|
62
|
+
"@babel/register": "^7.18.9",
|
|
63
|
+
"@types/chai": "^4.3.4",
|
|
64
64
|
"@types/dirty-chai": "^2.0.2",
|
|
65
|
-
"@types/express": "^4.17.
|
|
66
|
-
"@types/jsonld": "^1.5.
|
|
67
|
-
"@types/
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"diff": "^5.0.0",
|
|
65
|
+
"@types/express": "^4.17.14",
|
|
66
|
+
"@types/jsonld": "^1.5.8",
|
|
67
|
+
"@types/sinon-chai": "^3.2.9",
|
|
68
|
+
"babel-loader": "^9.1.0",
|
|
69
|
+
"chai": "^4.3.7",
|
|
70
|
+
"diff": "^5.1.0",
|
|
72
71
|
"dirty-chai": "^2.0.1",
|
|
73
|
-
"eslint": "^8.
|
|
72
|
+
"eslint": "^8.28.0",
|
|
74
73
|
"fs-grep": "0.0.5",
|
|
75
|
-
"locate-path": "^7.1.
|
|
76
|
-
"mocha": "^
|
|
77
|
-
"nock": "^13.2.
|
|
78
|
-
"node-fetch": "^
|
|
79
|
-
"node-polyfill-webpack-plugin": "^
|
|
80
|
-
"
|
|
74
|
+
"locate-path": "^7.1.1",
|
|
75
|
+
"mocha": "^10.1.0",
|
|
76
|
+
"nock": "^13.2.9",
|
|
77
|
+
"node-fetch": "^3.3.0",
|
|
78
|
+
"node-polyfill-webpack-plugin": "^2.0.1",
|
|
79
|
+
"rdf-js": "^4.0.2",
|
|
80
|
+
"sinon": "^14.0.2",
|
|
81
81
|
"sinon-chai": "^3.7.0",
|
|
82
|
-
"source-map-loader": "^
|
|
83
|
-
"ts-node": "^10.
|
|
84
|
-
"typedoc": "^0.
|
|
85
|
-
"typescript": "^4.
|
|
86
|
-
"webpack": "^5.
|
|
87
|
-
"webpack-cli": "^
|
|
88
|
-
"webpack-dev-server": "
|
|
82
|
+
"source-map-loader": "^4.0.1",
|
|
83
|
+
"ts-node": "^10.9.1",
|
|
84
|
+
"typedoc": "^0.23.21",
|
|
85
|
+
"typescript": "^4.9.3",
|
|
86
|
+
"webpack": "^5.75.0",
|
|
87
|
+
"webpack-cli": "^5.0.0",
|
|
88
|
+
"webpack-dev-server": "4.11"
|
|
89
89
|
},
|
|
90
90
|
"scripts": {
|
|
91
91
|
"build": "babel src --extensions \".ts,.js\" -d lib",
|
|
92
92
|
"build:esm": "babel src --extensions \".ts,.js\" --env-name esm -d esm",
|
|
93
93
|
"build:browser": "webpack --progress",
|
|
94
94
|
"build:types": "tsc --emitDeclarationOnly -d --moduleResolution node --declarationDir lib",
|
|
95
|
+
"build:all": "npm run build && npm run build:types && npm run build:browser && npm run build:esm",
|
|
95
96
|
"doc": "typedoc --out ./doc ./src/index.ts --excludePrivate --excludeInternal --tsconfig ./tsconfig.json",
|
|
96
|
-
"ignore:prepublishOnly": "npm ci && npm run build
|
|
97
|
+
"ignore:prepublishOnly": "npm ci && npm run build:all && npm run doc && npm run test",
|
|
97
98
|
"postversion": "git push --follow-tags",
|
|
98
99
|
"start": "webpack serve --port 4800",
|
|
99
100
|
"test": "npm run test:unit && npm run test:serialize && npm run test:types",
|
package/src/fetcher.ts
CHANGED
|
@@ -979,7 +979,7 @@ export default class Fetcher implements CallbackifyInterface {
|
|
|
979
979
|
return this.pendingFetchPromise(docuri, initialisedOptions.baseURI, initialisedOptions) as any
|
|
980
980
|
}
|
|
981
981
|
|
|
982
|
-
pendingFetchPromise (
|
|
982
|
+
async pendingFetchPromise (
|
|
983
983
|
uri: string,
|
|
984
984
|
originalUri: string,
|
|
985
985
|
options: AutoInitOptions
|
|
@@ -987,7 +987,7 @@ export default class Fetcher implements CallbackifyInterface {
|
|
|
987
987
|
let pendingPromise
|
|
988
988
|
|
|
989
989
|
// Check to see if some request is already dealing with this uri
|
|
990
|
-
if (!options.force && this.fetchQueue[originalUri]) {
|
|
990
|
+
if (!options.force && await this.fetchQueue[originalUri]) {
|
|
991
991
|
pendingPromise = this.fetchQueue[originalUri]
|
|
992
992
|
} else {
|
|
993
993
|
pendingPromise = Promise
|
package/src/update-manager.ts
CHANGED
|
@@ -213,7 +213,7 @@ export default class UpdateManager {
|
|
|
213
213
|
* Returns a list of all bnodes occurring in a list of statements
|
|
214
214
|
* @private
|
|
215
215
|
*/
|
|
216
|
-
statementArrayBnodes (sts: Quad
|
|
216
|
+
statementArrayBnodes (sts: ReadonlyArray<Quad>) {
|
|
217
217
|
var bnodes: BlankNode[] = []
|
|
218
218
|
for (let i = 0; i < sts.length; i++) {
|
|
219
219
|
bnodes = bnodes.concat(this.statementBnodes(sts[i]))
|
|
@@ -752,7 +752,13 @@ export default class UpdateManager {
|
|
|
752
752
|
// console.log(message)
|
|
753
753
|
throw new Error(message)
|
|
754
754
|
}
|
|
755
|
+
if (doc.termType !== 'NamedNode') {
|
|
756
|
+
let message = 'Error patching: document not a NamedNode:' + ds[0] + ', ' + is[0]
|
|
757
|
+
// console.log(message)
|
|
758
|
+
throw new Error(message)
|
|
759
|
+
}
|
|
755
760
|
var control = this.patchControlFor(doc)
|
|
761
|
+
|
|
756
762
|
var startTime = Date.now()
|
|
757
763
|
|
|
758
764
|
var props = ['subject', 'predicate', 'object', 'why']
|
|
@@ -781,7 +787,7 @@ export default class UpdateManager {
|
|
|
781
787
|
throw new Error('Update: Loaded ' + doc + "but stil can't figure out what editing protcol it supports.")
|
|
782
788
|
}
|
|
783
789
|
// console.log(`Update: have not loaded ${doc} before: loading now...`);
|
|
784
|
-
(this.store.fetcher.load(doc) as Promise<Response>).then(response => {
|
|
790
|
+
(this.store.fetcher.load(doc as NamedNode) as Promise<Response>).then(response => {
|
|
785
791
|
this.update(deletions, insertions, callback, true, options)
|
|
786
792
|
}, err => {
|
|
787
793
|
if (err.response.status === 404) { // nonexistent files are fine
|
|
@@ -793,8 +799,13 @@ export default class UpdateManager {
|
|
|
793
799
|
return
|
|
794
800
|
} else if ((protocol as string).indexOf('SPARQL') >= 0) {
|
|
795
801
|
var bnodes: BlankNode[] = []
|
|
796
|
-
|
|
797
|
-
|
|
802
|
+
// change ReadOnly type to Mutable type
|
|
803
|
+
type Mutable<Type> = {
|
|
804
|
+
-readonly [Key in keyof Type]: Type[Key];
|
|
805
|
+
}
|
|
806
|
+
|
|
807
|
+
if (ds.length) bnodes = this.statementArrayBnodes(ds as Mutable<typeof ds>)
|
|
808
|
+
if (is.length) bnodes = bnodes.concat(this.statementArrayBnodes(is as Mutable<typeof is>))
|
|
798
809
|
var context = this.bnodeContext(bnodes, doc)
|
|
799
810
|
var whereClause = this.contextWhere(context)
|
|
800
811
|
var query = ''
|
|
@@ -846,7 +857,7 @@ export default class UpdateManager {
|
|
|
846
857
|
*/
|
|
847
858
|
if (success) {
|
|
848
859
|
try {
|
|
849
|
-
kb.remove(ds)
|
|
860
|
+
kb.remove(ds as Mutable<typeof ds>)
|
|
850
861
|
} catch (e) {
|
|
851
862
|
success = false
|
|
852
863
|
body = 'Remote Ok BUT error deleting ' + ds.length + ' from store!!! ' + e
|
|
@@ -867,11 +878,11 @@ export default class UpdateManager {
|
|
|
867
878
|
}
|
|
868
879
|
}, options)
|
|
869
880
|
} else if ((protocol as string).indexOf('DAV') >= 0) {
|
|
870
|
-
this.updateDav(doc, ds, is, callback, options)
|
|
881
|
+
this.updateDav(doc as NamedNode, ds, is, callback, options)
|
|
871
882
|
} else {
|
|
872
883
|
if ((protocol as string).indexOf('LOCALFILE') >= 0) {
|
|
873
884
|
try {
|
|
874
|
-
this.updateLocalFile(doc, ds, is, callback, options)
|
|
885
|
+
this.updateLocalFile(doc as NamedNode, ds, is, callback, options)
|
|
875
886
|
} catch (e) {
|
|
876
887
|
callback(doc.value, false,
|
|
877
888
|
'Exception trying to write back file <' + doc.value + '>\n'
|
package/changes.txt
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
REMOVED FILES:
|
|
2
|
-
|
|
3
|
-
plistClosure.js -> no refs to about() or pickOne.
|
|
4
|
-
unify.js -> contained _no_ code !
|
|
5
|
-
remote.js -> remoteQuery ref'd in query.js, but commented out.
|
|
6
|
-
parser.js -> not used anymore.
|
|
7
|
-
|
|
8
|
-
LOGGING:
|
|
9
|
-
|
|
10
|
-
Without assuming that there is a global log var, logging can be weird. What do we do?
|
|
11
|
-
(bring in the log js)
|
|
12
|
-
|
|
13
|
-
ORDERING:
|
|
14
|
-
|
|
15
|
-
util.js - done (util-nonlib.js) - FIGURE OUT AJAR_HandleNew (should be in sources probably..) for now in util class.
|
|
16
|
-
uri.js - done (REMOVED URIjoin, uri_docpart, uri_protocol
|
|
17
|
-
term.js - done..
|
|
18
|
-
rdfparser.js -done..
|
|
19
|
-
n3parser.js -ew, but done.
|
|
20
|
-
identity.js 21k -RDFArrayRemove now in Util.RDFArrayRemove.
|
|
21
|
-
query.js 21k -NEEDS MORE WORK.
|
|
22
|
-
sources.js 37k -ok??
|
|
23
|
-
serialize.js 24k -OK!
|
|
24
|
-
sparqlUpdate.js 8k -ok, seemingly.
|
|
25
|
-
sparql.js 21k -SPARQLtoQuery needs kb in calls to it now.. isbnode: /^[]$/ -> /^$/ NO! Take it back.
|
|
26
|
-
|
|
27
|
-
TODO: Add the minor sources bugfix into sources.js!
|
|
28
|
-
|
|
29
|
-
HANGING GLOBALS:
|
|
30
|
-
|
|
31
|
-
isExtension
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
=========================================================================
|
|
37
|
-
extension code!
|
|
38
|
-
|
|
39
|
-
KILLED GLOBALS:
|
|
40
|
-
string_startswith
|
|
41
|
-
kb
|
|
42
|
-
sf
|
|
43
|
-
qs
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
NAMESPACE GLOBALS DELETED:
|
|
47
|
-
mo
|
|
48
|
-
contact
|
|
49
|
-
xsd
|
|
50
|
-
rss
|
|
51
|
-
dc
|
|
52
|
-
owl
|
|
53
|
-
rdfs
|
|
54
|
-
rdf
|
|
55
|
-
tabont
|
|
56
|
-
foaf
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
WEBDAV.js -- WHERE IS IT NEEDED.
|