rdflib 2.2.34 → 2.2.35-2bb9ed0b

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.
Files changed (100) hide show
  1. package/dist/515.rdflib.min.js +3 -0
  2. package/dist/515.rdflib.min.js.map +1 -0
  3. package/dist/789.rdflib.min.js +1 -0
  4. package/dist/rdflib.min.js +1 -1
  5. package/dist/rdflib.min.js.LICENSE.txt +0 -2
  6. package/dist/rdflib.min.js.map +1 -1
  7. package/esm/blank-node.js +57 -85
  8. package/esm/class-order.js +1 -1
  9. package/esm/collection.js +70 -106
  10. package/esm/default-graph.js +13 -33
  11. package/esm/empty.js +8 -26
  12. package/esm/factories/canonical-data-factory.js +33 -30
  13. package/esm/factories/extended-term-factory.js +18 -14
  14. package/esm/factories/factory-types.js +1 -1
  15. package/esm/factories/rdflib-data-factory.js +9 -11
  16. package/esm/fetcher.js +1364 -1668
  17. package/esm/formula.js +631 -739
  18. package/esm/index.js +31 -51
  19. package/esm/jsonldparser.js +19 -26
  20. package/esm/jsonparser.js +1 -1
  21. package/esm/lists.js +41 -86
  22. package/esm/literal.js +120 -157
  23. package/esm/log.js +7 -7
  24. package/esm/n3parser.js +1008 -1090
  25. package/esm/named-node.js +69 -99
  26. package/esm/namespace.js +2 -4
  27. package/esm/node-internal.js +73 -97
  28. package/esm/node.js +1 -2
  29. package/esm/parse.js +3 -3
  30. package/esm/patch-parser.js +1 -2
  31. package/esm/query.js +15 -30
  32. package/esm/rdfaparser.js +775 -846
  33. package/esm/rdfxmlparser.js +348 -365
  34. package/esm/serialize.js +2 -3
  35. package/esm/serializer.js +834 -889
  36. package/esm/sparql-to-query.js +0 -2
  37. package/esm/statement.js +52 -72
  38. package/esm/store.js +852 -963
  39. package/esm/types.js +26 -21
  40. package/esm/update-manager.js +963 -1104
  41. package/esm/updates-via.js +104 -134
  42. package/esm/uri.js +3 -3
  43. package/esm/utils/default-graph-uri.js +2 -2
  44. package/esm/utils/terms.js +4 -5
  45. package/esm/utils-js.js +5 -6
  46. package/esm/utils.js +7 -6
  47. package/esm/variable.js +32 -58
  48. package/esm/xsd.js +2 -2
  49. package/lib/blank-node.js +56 -83
  50. package/lib/class-order.js +2 -3
  51. package/lib/collection.js +69 -104
  52. package/lib/default-graph.js +13 -32
  53. package/lib/empty.js +8 -25
  54. package/lib/factories/canonical-data-factory.js +36 -34
  55. package/lib/factories/extended-term-factory.js +19 -16
  56. package/lib/factories/factory-types.js +2 -3
  57. package/lib/factories/rdflib-data-factory.js +10 -13
  58. package/lib/fetcher.js +1394 -1693
  59. package/lib/formula.js +631 -738
  60. package/lib/index.js +66 -89
  61. package/lib/jsonldparser.js +21 -32
  62. package/lib/jsonparser.js +3 -4
  63. package/lib/lists.js +47 -87
  64. package/lib/literal.js +120 -156
  65. package/lib/log.js +8 -9
  66. package/lib/n3parser.js +1011 -1096
  67. package/lib/named-node.js +69 -98
  68. package/lib/namespace.js +2 -4
  69. package/lib/node-internal.js +72 -95
  70. package/lib/node.js +2 -4
  71. package/lib/parse.js +5 -6
  72. package/lib/patch-parser.js +1 -2
  73. package/lib/query.js +19 -32
  74. package/lib/rdfaparser.js +777 -849
  75. package/lib/rdfxmlparser.js +350 -366
  76. package/lib/serialize.js +2 -3
  77. package/lib/serializer.js +838 -892
  78. package/lib/sparql-to-query.js +0 -2
  79. package/lib/statement.js +54 -74
  80. package/lib/store.js +873 -978
  81. package/lib/types.js +22 -43
  82. package/lib/update-manager.js +972 -1111
  83. package/lib/updates-via.js +105 -134
  84. package/lib/uri.js +3 -3
  85. package/lib/utils/default-graph-uri.js +2 -4
  86. package/lib/utils/terms.js +4 -6
  87. package/lib/utils-js.js +11 -13
  88. package/lib/utils.js +6 -7
  89. package/lib/variable.js +34 -60
  90. package/lib/xsd-internal.js +2 -3
  91. package/lib/xsd.js +3 -4
  92. package/package.json +31 -31
  93. package/src/n3parser.js +1 -1
  94. package/src/rdfxmlparser.js +2 -1
  95. package/src/serializer.js +1 -1
  96. package/.babelrc +0 -20
  97. package/dist/670.rdflib.min.js +0 -1
  98. package/dist/730.rdflib.min.js +0 -3
  99. package/dist/730.rdflib.min.js.map +0 -1
  100. /package/dist/{730.rdflib.min.js.LICENSE.txt → 515.rdflib.min.js.LICENSE.txt} +0 -0
@@ -118,7 +118,6 @@ export default function SPARQLToQuery(SPARQL, testMode, kb) {
118
118
  log.info('Literal found: ' + res[1]);
119
119
  res = res.concat(parseLiterals(str.slice(end + ind + 2))); // finds any other literals
120
120
  }
121
-
122
121
  return res;
123
122
  }
124
123
  function spaceDelimit(str) {
@@ -346,7 +345,6 @@ export default function SPARQLToQuery(SPARQL, testMode, kb) {
346
345
  // log.warn("I don't know how to handle the constraint: "+input)
347
346
  // alert("length: "+input.length+" input 0 type: "+input[0].termType+" input 1: "+input[1]+" input[2] type: "+input[2].termType)
348
347
  }
349
-
350
348
  function setOptional(terms, pat) {
351
349
  log.debug('Optional query: ' + terms + ' not yet implemented.');
352
350
  var opt = kb.formula();
package/esm/statement.js CHANGED
@@ -1,13 +1,11 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
2
  import Node from './node-internal';
5
3
  import { DefaultGraphTermType } from './types';
6
4
  import DefaultGraphNode, { isDefaultGraph } from './default-graph';
7
- var defaultGraph = new DefaultGraphNode();
5
+ const defaultGraph = new DefaultGraphNode();
8
6
 
9
7
  /** A Statement represents an RDF Triple or Quad. */
10
- var Statement = /*#__PURE__*/function () {
8
+ export default class Statement {
11
9
  /**
12
10
  * Construct a new statement
13
11
  *
@@ -25,8 +23,7 @@ var Statement = /*#__PURE__*/function () {
25
23
  * and give the document you are patching. In future, we may have a more
26
24
  * powerful update() which can update more than one document.
27
25
  */
28
- function Statement(subject, predicate, object, graph) {
29
- _classCallCheck(this, Statement);
26
+ constructor(subject, predicate, object, graph) {
30
27
  /** The subject of the triple. What the Statement is about. */
31
28
  _defineProperty(this, "subject", void 0);
32
29
  /** The relationship which is asserted between the subject and object */
@@ -45,76 +42,59 @@ var Statement = /*#__PURE__*/function () {
45
42
  }
46
43
 
47
44
  /** Alias for graph, favored by Tim */
48
- _createClass(Statement, [{
49
- key: "why",
50
- get: function get() {
51
- return this.graph;
52
- },
53
- set: function set(g) {
54
- this.graph = g;
55
- }
45
+ get why() {
46
+ return this.graph;
47
+ }
48
+ set why(g) {
49
+ this.graph = g;
50
+ }
56
51
 
57
- /**
58
- * Checks whether two statements are the same
59
- * @param other - The other statement
60
- */
61
- }, {
62
- key: "equals",
63
- value: function equals(other) {
64
- return other.subject.equals(this.subject) && other.predicate.equals(this.predicate) && other.object.equals(this.object) && other.graph.equals(this.graph);
65
- }
52
+ /**
53
+ * Checks whether two statements are the same
54
+ * @param other - The other statement
55
+ */
56
+ equals(other) {
57
+ return other.subject.equals(this.subject) && other.predicate.equals(this.predicate) && other.object.equals(this.object) && other.graph.equals(this.graph);
58
+ }
66
59
 
67
- /**
68
- * Creates a statement with the bindings substituted
69
- * @param bindings The bindings
70
- */
71
- }, {
72
- key: "substitute",
73
- value: function substitute(bindings) {
74
- var y = new Statement(this.subject.substitute(bindings), this.predicate.substitute(bindings), this.object.substitute(bindings), isDefaultGraph(this.graph) ? this.graph : this.graph.substitute(bindings)); // 2016
75
- // console.log('@@@ statement substitute:' + y)
76
- return y;
77
- }
60
+ /**
61
+ * Creates a statement with the bindings substituted
62
+ * @param bindings The bindings
63
+ */
64
+ substitute(bindings) {
65
+ const y = new Statement(this.subject.substitute(bindings), this.predicate.substitute(bindings), this.object.substitute(bindings), isDefaultGraph(this.graph) ? this.graph : this.graph.substitute(bindings)); // 2016
66
+ // console.log('@@@ statement substitute:' + y)
67
+ return y;
68
+ }
78
69
 
79
- /** Creates a canonical string representation of this statement. */
80
- }, {
81
- key: "toCanonical",
82
- value: function toCanonical() {
83
- var terms = [this.subject.toCanonical(), this.predicate.toCanonical(), this.object.toCanonical()];
84
- if (this.graph && this.graph.termType !== DefaultGraphTermType) {
85
- terms.push(this.graph.toCanonical());
86
- }
87
- return terms.join(' ') + ' .';
70
+ /** Creates a canonical string representation of this statement. */
71
+ toCanonical() {
72
+ let terms = [this.subject.toCanonical(), this.predicate.toCanonical(), this.object.toCanonical()];
73
+ if (this.graph && this.graph.termType !== DefaultGraphTermType) {
74
+ terms.push(this.graph.toCanonical());
88
75
  }
76
+ return terms.join(' ') + ' .';
77
+ }
89
78
 
90
- /** Creates a n-triples string representation of this statement */
91
- }, {
92
- key: "toNT",
93
- value: function toNT() {
94
- return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT()].join(' ') + ' .';
95
- }
79
+ /** Creates a n-triples string representation of this statement */
80
+ toNT() {
81
+ return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT()].join(' ') + ' .';
82
+ }
96
83
 
97
- /** Creates a n-quads string representation of this statement */
98
- }, {
99
- key: "toNQ",
100
- value: function toNQ() {
101
- return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT(), isDefaultGraph(this.graph) ? '' : this.graph.toNT()].join(' ') + ' .';
102
- }
84
+ /** Creates a n-quads string representation of this statement */
85
+ toNQ() {
86
+ return [this.subject.toNT(), this.predicate.toNT(), this.object.toNT(), isDefaultGraph(this.graph) ? '' : this.graph.toNT()].join(' ') + ' .';
87
+ }
103
88
 
104
- /** Creates a string representation of this statement */
105
- }, {
106
- key: "toString",
107
- value: function toString() {
108
- /*
109
- return [
110
- this.subject.toString(),
111
- this.predicate.toString(),
112
- this.object.toString(),
113
- ].join(' ') + ' .'
114
- */
115
- return this.toNT();
116
- }
117
- }]);
118
- return Statement;
119
- }();
120
- export { Statement as default };
89
+ /** Creates a string representation of this statement */
90
+ toString() {
91
+ /*
92
+ return [
93
+ this.subject.toString(),
94
+ this.predicate.toString(),
95
+ this.object.toString(),
96
+ ].join(' ') + ' .'
97
+ */
98
+ return this.toNT();
99
+ }
100
+ }