rdflib 2.2.33 → 2.2.34-ac7c600e
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 +41 -55
- 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 +1 -3
- 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 +62 -46
- package/esm/types.js +5 -0
- package/esm/update-manager.js +5 -10
- 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 +67 -82
- 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 +4 -7
- 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.d.ts +2 -1
- package/lib/store.js +79 -63
- package/lib/types.js +22 -43
- package/lib/update-manager.js +14 -20
- 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/fetcher.ts +7 -2
- package/src/store.ts +37 -13
- package/src/update-manager.ts +2 -2
- 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/variable.js
CHANGED
|
@@ -8,19 +8,18 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
8
8
|
exports.default = void 0;
|
|
9
9
|
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
10
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
11
|
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
14
12
|
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
13
|
+
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
15
14
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
16
15
|
var _classOrder = _interopRequireDefault(require("./class-order"));
|
|
17
16
|
var _nodeInternal = _interopRequireDefault(require("./node-internal"));
|
|
18
17
|
var _types = require("./types");
|
|
19
18
|
var Uri = _interopRequireWildcard(require("./uri"));
|
|
20
|
-
function _getRequireWildcardCache(
|
|
21
|
-
function _interopRequireWildcard(
|
|
22
|
-
function
|
|
23
|
-
function _isNativeReflectConstruct() {
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
|
|
22
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
24
23
|
/**
|
|
25
24
|
* Variables are placeholders used in patterns to be matched.
|
|
26
25
|
* In cwm they are symbols which are the formula's list of quantified variables.
|
|
@@ -28,9 +27,7 @@ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Re
|
|
|
28
27
|
* a common special base URI for variables. Their names are uris,
|
|
29
28
|
* but the ? notation has an implicit base uri of 'varid:'
|
|
30
29
|
*/
|
|
31
|
-
var Variable = /*#__PURE__*/function (_Node) {
|
|
32
|
-
(0, _inherits2.default)(Variable, _Node);
|
|
33
|
-
var _super = _createSuper(Variable);
|
|
30
|
+
var Variable = exports.default = /*#__PURE__*/function (_Node) {
|
|
34
31
|
/**
|
|
35
32
|
* Initializes this variable
|
|
36
33
|
* @param name The variable's name
|
|
@@ -39,19 +36,20 @@ var Variable = /*#__PURE__*/function (_Node) {
|
|
|
39
36
|
var _this;
|
|
40
37
|
var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
41
38
|
(0, _classCallCheck2.default)(this, Variable);
|
|
42
|
-
_this =
|
|
43
|
-
(0, _defineProperty2.default)(
|
|
39
|
+
_this = _callSuper(this, Variable, [name]);
|
|
40
|
+
(0, _defineProperty2.default)(_this, "termType", _types.VariableTermType);
|
|
44
41
|
/** The base string for a variable's name */
|
|
45
|
-
(0, _defineProperty2.default)(
|
|
46
|
-
(0, _defineProperty2.default)(
|
|
47
|
-
(0, _defineProperty2.default)(
|
|
42
|
+
(0, _defineProperty2.default)(_this, "base", 'varid:');
|
|
43
|
+
(0, _defineProperty2.default)(_this, "classOrder", _classOrder.default.Variable);
|
|
44
|
+
(0, _defineProperty2.default)(_this, "isVar", 1);
|
|
48
45
|
/** The unique identifier of this variable */
|
|
49
|
-
(0, _defineProperty2.default)(
|
|
46
|
+
(0, _defineProperty2.default)(_this, "uri", void 0);
|
|
50
47
|
_this.base = 'varid:';
|
|
51
48
|
_this.uri = Uri.join(name, _this.base);
|
|
52
49
|
return _this;
|
|
53
50
|
}
|
|
54
|
-
(0,
|
|
51
|
+
(0, _inherits2.default)(Variable, _Node);
|
|
52
|
+
return (0, _createClass2.default)(Variable, [{
|
|
55
53
|
key: "equals",
|
|
56
54
|
value: function equals(other) {
|
|
57
55
|
if (!other) {
|
|
@@ -84,6 +82,4 @@ var Variable = /*#__PURE__*/function (_Node) {
|
|
|
84
82
|
return "?".concat(variable.uri);
|
|
85
83
|
}
|
|
86
84
|
}]);
|
|
87
|
-
|
|
88
|
-
}(_nodeInternal.default);
|
|
89
|
-
exports.default = Variable;
|
|
85
|
+
}(_nodeInternal.default);
|
package/lib/xsd-internal.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
8
|
var _namedNode = _interopRequireDefault(require("./named-node"));
|
|
9
|
-
var _default = {
|
|
9
|
+
var _default = exports.default = {
|
|
10
10
|
boolean: new _namedNode.default('http://www.w3.org/2001/XMLSchema#boolean'),
|
|
11
11
|
dateTime: new _namedNode.default('http://www.w3.org/2001/XMLSchema#dateTime'),
|
|
12
12
|
decimal: new _namedNode.default('http://www.w3.org/2001/XMLSchema#decimal'),
|
|
@@ -14,5 +14,4 @@ var _default = {
|
|
|
14
14
|
integer: new _namedNode.default('http://www.w3.org/2001/XMLSchema#integer'),
|
|
15
15
|
langString: new _namedNode.default('http://www.w3.org/1999/02/22-rdf-syntax-ns#langString'),
|
|
16
16
|
string: new _namedNode.default('http://www.w3.org/2001/XMLSchema#string')
|
|
17
|
-
};
|
|
18
|
-
exports.default = _default;
|
|
17
|
+
};
|
package/lib/xsd.js
CHANGED
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.
|
|
4
|
+
"version": "2.2.34-ac7c600e",
|
|
5
5
|
"private": false,
|
|
6
6
|
"browserslist": [
|
|
7
7
|
"> 0.5%"
|
|
@@ -44,49 +44,49 @@
|
|
|
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.
|
|
47
|
+
"@babel/runtime": "^7.24.4",
|
|
48
48
|
"@frogcat/ttl2jsonld": "^0.0.9",
|
|
49
|
-
"@xmldom/xmldom": "^0.8.
|
|
50
|
-
"cross-fetch": "^3.1.
|
|
51
|
-
"jsonld": "^8.
|
|
52
|
-
"n3": "^1.
|
|
49
|
+
"@xmldom/xmldom": "^0.8.10",
|
|
50
|
+
"cross-fetch": "^3.1.8",
|
|
51
|
+
"jsonld": "^8.3.2",
|
|
52
|
+
"n3": "^1.17.3",
|
|
53
53
|
"solid-namespace": "^0.5.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
|
-
"@babel/cli": "^7.
|
|
57
|
-
"@babel/core": "^7.
|
|
56
|
+
"@babel/cli": "^7.24.1",
|
|
57
|
+
"@babel/core": "^7.24.4",
|
|
58
58
|
"@babel/plugin-proposal-class-properties": "^7.18.6",
|
|
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.
|
|
64
|
-
"@types/dirty-chai": "^2.0.
|
|
65
|
-
"@types/express": "^4.17.
|
|
66
|
-
"@types/jsonld": "^1.5.
|
|
67
|
-
"@types/mocha": "^10.0.
|
|
68
|
-
"@types/sinon-chai": "^3.2.
|
|
69
|
-
"babel-loader": "^9.1.
|
|
70
|
-
"chai": "^4.
|
|
71
|
-
"diff": "^5.
|
|
59
|
+
"@babel/plugin-transform-runtime": "^7.24.3",
|
|
60
|
+
"@babel/preset-env": "^7.24.4",
|
|
61
|
+
"@babel/preset-typescript": "^7.24.1",
|
|
62
|
+
"@babel/register": "^7.23.7",
|
|
63
|
+
"@types/chai": "^4.3.14",
|
|
64
|
+
"@types/dirty-chai": "^2.0.4",
|
|
65
|
+
"@types/express": "^4.17.21",
|
|
66
|
+
"@types/jsonld": "^1.5.13",
|
|
67
|
+
"@types/mocha": "^10.0.6",
|
|
68
|
+
"@types/sinon-chai": "^3.2.12",
|
|
69
|
+
"babel-loader": "^9.1.3",
|
|
70
|
+
"chai": "^4.4.1",
|
|
71
|
+
"diff": "^5.2.0",
|
|
72
72
|
"dirty-chai": "^2.0.1",
|
|
73
|
-
"eslint": "^8.
|
|
73
|
+
"eslint": "^8.57.0",
|
|
74
74
|
"fs-grep": "0.0.5",
|
|
75
75
|
"locate-path": "^7.2.0",
|
|
76
|
-
"mocha": "^10.
|
|
77
|
-
"nock": "^13.
|
|
78
|
-
"node-fetch": "^3.3.
|
|
76
|
+
"mocha": "^10.4.0",
|
|
77
|
+
"nock": "^13.5.4",
|
|
78
|
+
"node-fetch": "^3.3.2",
|
|
79
79
|
"node-polyfill-webpack-plugin": "^2.0.1",
|
|
80
80
|
"rdf-js": "^4.0.2",
|
|
81
81
|
"sinon": "^15.0.3",
|
|
82
82
|
"sinon-chai": "^3.7.0",
|
|
83
|
-
"source-map-loader": "^4.0.
|
|
84
|
-
"ts-node": "^10.9.
|
|
85
|
-
"typedoc": "^0.
|
|
83
|
+
"source-map-loader": "^4.0.2",
|
|
84
|
+
"ts-node": "^10.9.2",
|
|
85
|
+
"typedoc": "^0.25.13",
|
|
86
86
|
"typescript": "^5.0.4",
|
|
87
|
-
"webpack": "^5.
|
|
88
|
-
"webpack-cli": "^5.
|
|
89
|
-
"webpack-dev-server": "^4.
|
|
87
|
+
"webpack": "^5.91.0",
|
|
88
|
+
"webpack-cli": "^5.1.4",
|
|
89
|
+
"webpack-dev-server": "^4.15.2"
|
|
90
90
|
},
|
|
91
91
|
"scripts": {
|
|
92
92
|
"build": "babel src --extensions \".ts,.js\" -d lib",
|
package/src/fetcher.ts
CHANGED
|
@@ -980,7 +980,7 @@ export default class Fetcher implements CallbackifyInterface {
|
|
|
980
980
|
const requests = kb.statementsMatching(undefined, this.ns.link('requestedURI'), kb.sym(docuri), meta).map(st => st.subject)
|
|
981
981
|
for (const request of requests) {
|
|
982
982
|
const response = kb.any(request, this.ns.link('response'), null, meta) as Quad_Subject
|
|
983
|
-
if (response
|
|
983
|
+
if (response != undefined) { // ts
|
|
984
984
|
const quad = kb.statementsMatching(response, this.ns.link('outOfDate'), true as any, meta)
|
|
985
985
|
kb.remove(quad)
|
|
986
986
|
options.force = true
|
|
@@ -2004,7 +2004,12 @@ export default class Fetcher implements CallbackifyInterface {
|
|
|
2004
2004
|
|
|
2005
2005
|
// Before we parse new data clear old but only on 200
|
|
2006
2006
|
if (options.clearPreviousData) {
|
|
2007
|
-
kb.removeDocument(options.resource)
|
|
2007
|
+
// kb.removeDocument(options.resource)
|
|
2008
|
+
// only remove content, keep metatdata
|
|
2009
|
+
const sts = kb.statementsMatching(undefined, undefined, undefined, options.resource).slice() // Take a copy as this is the actual index
|
|
2010
|
+
for (let i = 0; i < sts.length; i++) {
|
|
2011
|
+
kb.removeStatement(sts[i])
|
|
2012
|
+
}
|
|
2008
2013
|
}
|
|
2009
2014
|
|
|
2010
2015
|
let isImage = contentType.includes('image/') ||
|
package/src/store.ts
CHANGED
|
@@ -871,31 +871,55 @@ export default class IndexedFormula extends Formula { // IN future - allow pass
|
|
|
871
871
|
}
|
|
872
872
|
|
|
873
873
|
/**
|
|
874
|
-
* Removes all statements in a doc, along with the related metadata including request/response
|
|
874
|
+
* Removes all statements in a doc, along with the related metadata including request/response/status
|
|
875
875
|
* @param doc - The document / graph
|
|
876
876
|
*/
|
|
877
877
|
removeDocument(doc: Quad_Graph): IndexedFormula {
|
|
878
|
+
this.removeMetadata(doc)
|
|
879
|
+
// remove document
|
|
880
|
+
var sts: Quad[] = this.statementsMatching(undefined, undefined, undefined, doc).slice() // Take a copy as this is the actual index
|
|
881
|
+
for (var i = 0; i < sts.length; i++) {
|
|
882
|
+
this.removeStatement(sts[i])
|
|
883
|
+
}
|
|
884
|
+
this.removeMatches(doc as Quad_Subject, null, null)
|
|
885
|
+
return this
|
|
886
|
+
}
|
|
887
|
+
|
|
888
|
+
removeMetadata(doc: Quad_Graph): IndexedFormula {
|
|
878
889
|
const meta = this.sym('chrome://TheCurrentSession') // or this.rdfFactory.namedNode('chrome://TheCurrentSession')
|
|
879
|
-
const linkNamespaceURI = 'http://www.w3.org/2007/ont/link#'
|
|
880
|
-
// remove
|
|
890
|
+
const linkNamespaceURI = 'http://www.w3.org/2007/ont/link#'
|
|
891
|
+
// remove status/response/request metadata
|
|
881
892
|
const requests = this.statementsMatching(undefined, this.sym(`${linkNamespaceURI}requestedURI`), this.rdfFactory.literal(doc.value), meta).map(st => st.subject)
|
|
882
893
|
for (var r = 0; r < requests.length; r++) {
|
|
883
894
|
const request = requests[r]
|
|
884
|
-
if (request
|
|
885
|
-
|
|
895
|
+
if (request != undefined) {
|
|
896
|
+
// removeMatches unresolved issue with collection https://github.com/linkeddata/rdflib.js/issues/631
|
|
897
|
+
let sts: Quad[]
|
|
898
|
+
// status collection
|
|
899
|
+
const status = this.any(request, this.sym(`${linkNamespaceURI}status`), null, meta) as Quad_Subject
|
|
900
|
+
if (status != undefined) {
|
|
901
|
+
sts = this.statementsMatching(status, this.sym(`${linkNamespaceURI}status`), null, meta).slice()
|
|
902
|
+
for (var i = 0; i < sts.length; i++) {
|
|
903
|
+
this.removeStatement(sts[i])
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
// response items list
|
|
886
907
|
const response = this.any(request, this.sym(`${linkNamespaceURI}response`), null, meta) as Quad_Subject
|
|
887
|
-
if (response
|
|
888
|
-
this.
|
|
908
|
+
if (response != undefined) {
|
|
909
|
+
sts = this.statementsMatching(response, null, null, meta).slice()
|
|
910
|
+
for (var i = 0; i < sts.length; i++) {
|
|
911
|
+
this.removeStatement(sts[i])
|
|
912
|
+
}
|
|
913
|
+
}
|
|
914
|
+
// request triples
|
|
915
|
+
sts = this.statementsMatching(request, null, null, meta).slice()
|
|
916
|
+
for (var i = 0; i < sts.length; i++) {
|
|
917
|
+
this.removeStatement(sts[i])
|
|
889
918
|
}
|
|
919
|
+
|
|
890
920
|
}
|
|
891
921
|
}
|
|
892
922
|
this.removeMatches(this.sym(doc.value), null, null, meta) // content-type
|
|
893
|
-
|
|
894
|
-
// remove document
|
|
895
|
-
var sts: Quad[] = this.statementsMatching(undefined, undefined, undefined, doc).slice() // Take a copy as this is the actual index
|
|
896
|
-
for (var i = 0; i < sts.length; i++) {
|
|
897
|
-
this.removeStatement(sts[i])
|
|
898
|
-
}
|
|
899
923
|
return this
|
|
900
924
|
}
|
|
901
925
|
|
package/src/update-manager.ts
CHANGED
|
@@ -95,7 +95,7 @@ export default class UpdateManager {
|
|
|
95
95
|
const requests = kb.statementsMatching(undefined, this.ns.link('requestedURI'), undefined, meta).map(st => st.subject)
|
|
96
96
|
for (const request of requests) {
|
|
97
97
|
const response = kb.any(request, this.ns.link('response'), null, meta) as Quad_Subject
|
|
98
|
-
if (response
|
|
98
|
+
if (response != undefined) { // ts
|
|
99
99
|
kb.add(response, this.ns.link('outOfDate'), true as any, meta) // @@ Boolean is fine - fix types
|
|
100
100
|
}
|
|
101
101
|
}
|
|
@@ -601,7 +601,7 @@ export default class UpdateManager {
|
|
|
601
601
|
}
|
|
602
602
|
} else {
|
|
603
603
|
control.reloading = false
|
|
604
|
-
if ((response as Response).status === 0) {
|
|
604
|
+
if (response && (response as Response).status === 0) {
|
|
605
605
|
// console.log('Network error refreshing the data. Retrying in ' +
|
|
606
606
|
// retryTimeout / 1000)
|
|
607
607
|
control.reloading = true
|
package/dist/670.rdflib.min.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
(self.webpackChunk$rdf=self.webpackChunk$rdf||[]).push([[670],{7670:()=>{}}]);
|