rdflib 2.2.22 → 2.2.23-6384f9a2
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 +4 -0
- package/dist/rdflib.min.js.map +1 -1
- package/esm/blank-node.js +90 -61
- package/esm/class-order.js +1 -1
- package/esm/collection.js +106 -70
- package/esm/default-graph.js +33 -13
- package/esm/empty.js +26 -8
- package/esm/factories/canonical-data-factory.js +30 -33
- package/esm/factories/extended-term-factory.js +14 -18
- package/esm/factories/factory-types.js +1 -1
- package/esm/factories/rdflib-data-factory.js +11 -9
- package/esm/fetcher.js +1644 -1355
- package/esm/formula.js +740 -632
- package/esm/index.js +52 -33
- package/esm/jsonldparser.js +35 -19
- package/esm/jsonparser.js +1 -1
- package/esm/lists.js +86 -38
- package/esm/literal.js +157 -120
- package/esm/log.js +7 -7
- package/esm/n3parser.js +1088 -1004
- package/esm/named-node.js +99 -69
- package/esm/namespace.js +4 -2
- package/esm/node-internal.js +98 -74
- package/esm/node.js +1 -1
- package/esm/parse.js +3 -3
- package/esm/patch-parser.js +1 -1
- package/esm/query.js +16 -15
- package/esm/rdfaparser.js +846 -781
- package/esm/rdfxmlparser.js +365 -348
- package/esm/serialize.js +4 -11
- package/esm/serializer.js +886 -821
- package/esm/statement.js +72 -52
- package/esm/store.js +924 -822
- package/esm/types.js +21 -21
- package/esm/update-manager.js +983 -882
- package/esm/updates-via.js +134 -104
- package/esm/uri.js +3 -3
- package/esm/utils/default-graph-uri.js +2 -2
- package/esm/utils/terms.js +5 -4
- package/esm/utils-js.js +5 -5
- package/esm/utils.js +6 -6
- package/esm/variable.js +58 -32
- package/esm/xsd.js +2 -2
- package/lib/blank-node.js +88 -60
- package/lib/class-order.js +1 -1
- package/lib/collection.js +104 -69
- package/lib/default-graph.js +32 -13
- package/lib/empty.js +25 -8
- package/lib/factories/canonical-data-factory.js +32 -35
- package/lib/factories/extended-term-factory.js +14 -18
- package/lib/factories/factory-types.js +1 -1
- package/lib/factories/rdflib-data-factory.js +11 -9
- package/lib/fetcher.js +1646 -1385
- package/lib/formula.d.ts +1 -1
- package/lib/formula.js +739 -632
- package/lib/index.d.ts +1 -2
- package/lib/index.js +88 -70
- package/lib/jsonldparser.js +35 -19
- package/lib/jsonparser.js +1 -1
- package/lib/lists.js +86 -54
- package/lib/literal.js +156 -120
- package/lib/log.js +7 -7
- package/lib/n3parser.d.ts +1 -0
- package/lib/n3parser.js +1092 -1006
- package/lib/named-node.js +98 -69
- package/lib/namespace.js +4 -2
- package/lib/node-internal.js +96 -73
- package/lib/node.js +1 -1
- package/lib/parse.js +6 -5
- package/lib/patch-parser.js +1 -1
- package/lib/query.js +18 -19
- package/lib/rdfaparser.js +848 -783
- package/lib/rdfxmlparser.js +366 -350
- package/lib/serialize.d.ts +1 -1
- package/lib/serialize.js +4 -13
- package/lib/serializer.d.ts +1 -0
- package/lib/serializer.js +890 -825
- package/lib/statement.js +74 -54
- package/lib/store.d.ts +1 -1
- package/lib/store.js +926 -844
- package/lib/types.js +21 -21
- package/lib/update-manager.d.ts +1 -1
- package/lib/update-manager.js +959 -865
- package/lib/updates-via.js +134 -105
- package/lib/uri.js +3 -3
- package/lib/utils/default-graph-uri.js +2 -2
- package/lib/utils/terms.js +6 -4
- package/lib/utils-js.js +9 -8
- package/lib/utils.js +6 -6
- package/lib/variable.js +60 -34
- package/lib/xsd.js +2 -2
- package/package.json +20 -19
- 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 +8 -2
- package/esm/convert.js +0 -60
- package/lib/convert.d.ts +0 -2
- package/lib/convert.js +0 -71
- package/src/convert.js +0 -70
package/esm/serialize.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import * as convert from './convert';
|
|
2
1
|
import Serializer from './serializer';
|
|
3
2
|
import { JSONLDContentType, N3ContentType, N3LegacyContentType, NQuadsAltContentType, NQuadsContentType, NTriplesContentType, RDFXMLContentType, TurtleContentType, TurtleLegacyContentType } from './types';
|
|
4
3
|
/**
|
|
@@ -13,14 +12,13 @@ kb, base,
|
|
|
13
12
|
*/
|
|
14
13
|
contentType, callback, options) {
|
|
15
14
|
base = base || (target === null || target === void 0 ? void 0 : target.value);
|
|
16
|
-
|
|
15
|
+
var opts = options || {};
|
|
17
16
|
contentType = contentType || TurtleContentType; // text/n3 if complex?
|
|
18
17
|
var documentString = undefined;
|
|
19
18
|
try {
|
|
20
19
|
var sz = Serializer(kb);
|
|
21
20
|
if (opts.flags) sz.setFlags(opts.flags);
|
|
22
21
|
var newSts = kb.statementsMatching(undefined, undefined, undefined, target);
|
|
23
|
-
var n3String;
|
|
24
22
|
|
|
25
23
|
// If an IndexedFormula, use the namespaces from the given graph as suggestions
|
|
26
24
|
if ('namespaces' in kb) {
|
|
@@ -50,20 +48,15 @@ contentType, callback, options) {
|
|
|
50
48
|
documentString = sz.statementsToNTriples(newSts);
|
|
51
49
|
return executeCallback(null, documentString);
|
|
52
50
|
case JSONLDContentType:
|
|
53
|
-
sz.setFlags('
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
convert.convertToJson(n3String, callback);
|
|
57
|
-
break;
|
|
51
|
+
sz.setFlags('si'); // use turtle parameters
|
|
52
|
+
documentString = sz.statementsToJsonld(newSts); // convert via turtle
|
|
53
|
+
return executeCallback(null, documentString);
|
|
58
54
|
case NQuadsContentType:
|
|
59
55
|
case NQuadsAltContentType:
|
|
60
56
|
// @@@ just outpout the quads? Does not work for collections
|
|
61
57
|
sz.setFlags('deinprstux q'); // Suppress nice parts of N3 to make ntriples
|
|
62
58
|
documentString = sz.statementsToNTriples(newSts); // q in flag means actually quads
|
|
63
59
|
return executeCallback(null, documentString);
|
|
64
|
-
// n3String = sz.statementsToN3(newSts)
|
|
65
|
-
// documentString = convert.convertToNQuads(n3String, callback)
|
|
66
|
-
// break
|
|
67
60
|
default:
|
|
68
61
|
throw new Error('Serialize: Content-type ' + contentType + ' not supported for data write.');
|
|
69
62
|
}
|