rdflib 2.2.21 → 2.2.22-0de51c50
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 +13 -1
- package/dist/rdflib.min.js.map +1 -1
- package/esm/blank-node.js +3 -27
- package/esm/collection.js +7 -29
- package/esm/default-graph.js +1 -15
- package/esm/empty.js +0 -13
- package/esm/factories/canonical-data-factory.js +5 -40
- package/esm/factories/extended-term-factory.js +0 -11
- package/esm/factories/factory-types.js +2 -1
- package/esm/factories/rdflib-data-factory.js +0 -8
- package/esm/fetcher.js +257 -481
- package/esm/formula.js +43 -142
- package/esm/index.js +19 -36
- package/esm/jsonldparser.js +20 -29
- package/esm/jsonparser.js +0 -7
- package/esm/lists.js +18 -33
- package/esm/literal.js +10 -42
- package/esm/n3parser.js +38 -351
- package/esm/named-node.js +8 -27
- package/esm/namespace.js +0 -1
- package/esm/node-internal.js +11 -24
- package/esm/node.js +1 -6
- package/esm/parse.js +10 -17
- package/esm/patch-parser.js +9 -29
- package/esm/query-to-sparql.js +0 -18
- package/esm/query.js +50 -133
- package/esm/rdfaparser.js +72 -210
- package/esm/rdfxmlparser.js +31 -128
- package/esm/serialize.js +8 -33
- package/esm/serializer.js +122 -286
- package/esm/sparql-to-query.js +44 -134
- package/esm/statement.js +8 -19
- package/esm/store.js +109 -280
- package/esm/types.js +3 -2
- package/esm/update-manager.js +110 -246
- package/esm/updates-via.js +0 -27
- package/esm/uri.js +6 -50
- package/esm/utils/default-graph-uri.js +1 -0
- package/esm/utils/termValue.js +0 -1
- package/esm/utils/terms.js +15 -16
- package/esm/utils-js.js +16 -57
- package/esm/utils.js +4 -15
- package/esm/variable.js +0 -20
- package/lib/blank-node.js +3 -28
- package/lib/class-order.js +0 -1
- package/lib/collection.js +7 -34
- package/lib/default-graph.js +0 -20
- package/lib/empty.js +0 -18
- package/lib/factories/canonical-data-factory.js +4 -51
- package/lib/factories/extended-term-factory.js +0 -18
- package/lib/factories/factory-types.d.ts +6 -6
- package/lib/factories/factory-types.js +0 -3
- package/lib/factories/rdflib-data-factory.js +0 -12
- package/lib/fetcher.d.ts +6 -6
- package/lib/fetcher.js +258 -470
- package/lib/formula.d.ts +1 -1
- package/lib/formula.js +43 -151
- package/lib/index.d.ts +1 -2
- package/lib/index.js +14 -82
- package/lib/jsonldparser.js +19 -33
- package/lib/jsonparser.js +0 -9
- package/lib/lists.js +14 -39
- package/lib/literal.js +10 -49
- package/lib/log.d.ts +0 -6
- package/lib/log.js +0 -1
- package/lib/n3parser.d.ts +1 -0
- package/lib/n3parser.js +39 -359
- package/lib/named-node.js +7 -35
- package/lib/namespace.js +0 -3
- package/lib/node-internal.js +11 -21
- package/lib/node.js +1 -11
- package/lib/parse.d.ts +1 -1
- package/lib/parse.js +8 -27
- package/lib/patch-parser.js +10 -33
- package/lib/query-to-sparql.js +0 -23
- package/lib/query.js +46 -152
- package/lib/rdfaparser.js +72 -220
- package/lib/rdfxmlparser.js +31 -132
- package/lib/serialize.d.ts +1 -1
- package/lib/serialize.js +8 -43
- package/lib/serializer.d.ts +1 -0
- package/lib/serializer.js +121 -297
- package/lib/sparql-to-query.js +42 -167
- package/lib/statement.js +8 -24
- package/lib/store.d.ts +2 -2
- package/lib/store.js +102 -282
- package/lib/tf-types.d.ts +4 -4
- package/lib/types.d.ts +8 -8
- package/lib/types.js +3 -3
- package/lib/update-manager.d.ts +2 -2
- package/lib/update-manager.js +110 -254
- package/lib/updates-via.js +0 -30
- package/lib/uri.js +5 -58
- package/lib/utils/default-graph-uri.js +1 -3
- package/lib/utils/termValue.js +0 -2
- package/lib/utils/terms.js +15 -34
- package/lib/utils-js.js +16 -80
- package/lib/utils.js +4 -21
- package/lib/variable.js +0 -25
- package/lib/xsd-internal.js +0 -3
- package/lib/xsd.js +0 -4
- package/package.json +40 -39
- package/src/fetcher.ts +2 -2
- package/src/index.ts +0 -2
- package/src/jsonldparser.js +13 -4
- package/src/n3parser.js +12 -4
- package/src/serialize.ts +4 -11
- package/src/serializer.js +24 -0
- package/src/update-manager.ts +18 -7
- package/changes.txt +0 -59
- package/esm/convert.js +0 -61
- package/lib/convert.d.ts +0 -2
- package/lib/convert.js +0 -77
- package/src/convert.js +0 -70
package/lib/query-to-sparql.js
CHANGED
|
@@ -1,59 +1,43 @@
|
|
|
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 = queryToSPARQL;
|
|
9
|
-
|
|
10
8
|
var _log = _interopRequireDefault(require("./log"));
|
|
11
|
-
|
|
12
9
|
function queryToSPARQL(query) {
|
|
13
10
|
var indent = 0;
|
|
14
|
-
|
|
15
11
|
function getSelect(query) {
|
|
16
12
|
var str = addIndent() + 'SELECT ';
|
|
17
|
-
|
|
18
13
|
for (var i = 0; i < query.vars.length; i++) {
|
|
19
14
|
str += query.vars[i] + ' ';
|
|
20
15
|
}
|
|
21
|
-
|
|
22
16
|
str += '\n';
|
|
23
17
|
return str;
|
|
24
18
|
}
|
|
25
|
-
|
|
26
19
|
function getPattern(pat) {
|
|
27
20
|
var str = '';
|
|
28
21
|
var st = pat.statements;
|
|
29
|
-
|
|
30
22
|
for (var x in st) {
|
|
31
23
|
_log.default.debug('Found statement: ' + st);
|
|
32
|
-
|
|
33
24
|
str += addIndent() + st[x] + '\n';
|
|
34
25
|
}
|
|
35
|
-
|
|
36
26
|
return str;
|
|
37
27
|
}
|
|
38
|
-
|
|
39
28
|
function getConstraints(pat) {
|
|
40
29
|
var str = '';
|
|
41
|
-
|
|
42
30
|
for (var v in pat.constraints) {
|
|
43
31
|
var foo = pat.constraints[v];
|
|
44
32
|
str += addIndent() + 'FILTER ( ' + foo.describe(v) + ' ) ' + '\n';
|
|
45
33
|
}
|
|
46
|
-
|
|
47
34
|
return str;
|
|
48
35
|
}
|
|
49
|
-
|
|
50
36
|
function getOptionals(pat) {
|
|
51
37
|
var str = '';
|
|
52
|
-
|
|
53
38
|
for (var x = 0; x < pat.optional.length; x++) {
|
|
54
39
|
// alert(pat.optional.termType)
|
|
55
40
|
_log.default.debug('Found optional query');
|
|
56
|
-
|
|
57
41
|
str += addIndent() + 'OPTIONAL { ' + '\n';
|
|
58
42
|
indent++;
|
|
59
43
|
str += getPattern(pat.optional[x]);
|
|
@@ -62,10 +46,8 @@ function queryToSPARQL(query) {
|
|
|
62
46
|
indent--;
|
|
63
47
|
str += addIndent() + '}' + '\n';
|
|
64
48
|
}
|
|
65
|
-
|
|
66
49
|
return str;
|
|
67
50
|
}
|
|
68
|
-
|
|
69
51
|
function getWhere(pat) {
|
|
70
52
|
var str = addIndent() + 'WHERE \n' + '{ \n';
|
|
71
53
|
indent++;
|
|
@@ -76,20 +58,15 @@ function queryToSPARQL(query) {
|
|
|
76
58
|
str += '}';
|
|
77
59
|
return str;
|
|
78
60
|
}
|
|
79
|
-
|
|
80
61
|
function addIndent() {
|
|
81
62
|
var str = '';
|
|
82
|
-
|
|
83
63
|
for (var i = 0; i < indent; i++) {
|
|
84
64
|
str += ' ';
|
|
85
65
|
}
|
|
86
|
-
|
|
87
66
|
return str;
|
|
88
67
|
}
|
|
89
|
-
|
|
90
68
|
function getSPARQL(query) {
|
|
91
69
|
return getSelect(query) + getWhere(query.pat);
|
|
92
70
|
}
|
|
93
|
-
|
|
94
71
|
return getSPARQL(query);
|
|
95
72
|
}
|