rdflib 2.2.22-2f49e8ef → 2.2.22-53d65d90

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 (101) hide show
  1. package/dist/rdflib.min.js +1 -1
  2. package/dist/rdflib.min.js.LICENSE.txt +4 -0
  3. package/dist/rdflib.min.js.map +1 -1
  4. package/esm/blank-node.js +90 -61
  5. package/esm/class-order.js +1 -1
  6. package/esm/collection.js +106 -70
  7. package/esm/default-graph.js +33 -13
  8. package/esm/empty.js +26 -8
  9. package/esm/factories/canonical-data-factory.js +30 -33
  10. package/esm/factories/extended-term-factory.js +14 -18
  11. package/esm/factories/factory-types.js +1 -1
  12. package/esm/factories/rdflib-data-factory.js +11 -9
  13. package/esm/fetcher.js +1644 -1355
  14. package/esm/formula.js +740 -632
  15. package/esm/index.js +52 -33
  16. package/esm/jsonldparser.js +35 -19
  17. package/esm/jsonparser.js +1 -1
  18. package/esm/lists.js +86 -38
  19. package/esm/literal.js +157 -120
  20. package/esm/log.js +7 -7
  21. package/esm/n3parser.js +1085 -1008
  22. package/esm/named-node.js +99 -69
  23. package/esm/namespace.js +4 -2
  24. package/esm/node-internal.js +98 -74
  25. package/esm/node.js +1 -1
  26. package/esm/parse.js +3 -3
  27. package/esm/patch-parser.js +1 -1
  28. package/esm/query.js +16 -15
  29. package/esm/rdfaparser.js +846 -781
  30. package/esm/rdfxmlparser.js +365 -348
  31. package/esm/serialize.js +4 -11
  32. package/esm/serializer.js +886 -821
  33. package/esm/statement.js +72 -52
  34. package/esm/store.js +924 -822
  35. package/esm/types.js +21 -21
  36. package/esm/update-manager.js +983 -882
  37. package/esm/updates-via.js +134 -104
  38. package/esm/uri.js +3 -3
  39. package/esm/utils/default-graph-uri.js +2 -2
  40. package/esm/utils/terms.js +5 -4
  41. package/esm/utils-js.js +5 -5
  42. package/esm/utils.js +6 -6
  43. package/esm/variable.js +58 -32
  44. package/esm/xsd.js +2 -2
  45. package/lib/blank-node.js +88 -60
  46. package/lib/class-order.js +1 -1
  47. package/lib/collection.js +104 -69
  48. package/lib/default-graph.js +32 -13
  49. package/lib/empty.js +25 -8
  50. package/lib/factories/canonical-data-factory.js +32 -35
  51. package/lib/factories/extended-term-factory.js +14 -18
  52. package/lib/factories/factory-types.js +1 -1
  53. package/lib/factories/rdflib-data-factory.js +11 -9
  54. package/lib/fetcher.js +1646 -1385
  55. package/lib/formula.d.ts +1 -1
  56. package/lib/formula.js +739 -632
  57. package/lib/index.d.ts +1 -2
  58. package/lib/index.js +88 -70
  59. package/lib/jsonldparser.js +35 -19
  60. package/lib/jsonparser.js +1 -1
  61. package/lib/lists.js +86 -54
  62. package/lib/literal.js +156 -120
  63. package/lib/log.js +7 -7
  64. package/lib/n3parser.js +1089 -1010
  65. package/lib/named-node.js +98 -69
  66. package/lib/namespace.js +4 -2
  67. package/lib/node-internal.js +96 -73
  68. package/lib/node.js +1 -1
  69. package/lib/parse.js +6 -5
  70. package/lib/patch-parser.js +1 -1
  71. package/lib/query.js +18 -19
  72. package/lib/rdfaparser.js +848 -783
  73. package/lib/rdfxmlparser.js +366 -350
  74. package/lib/serialize.d.ts +1 -1
  75. package/lib/serialize.js +4 -13
  76. package/lib/serializer.d.ts +1 -0
  77. package/lib/serializer.js +890 -825
  78. package/lib/statement.js +74 -54
  79. package/lib/store.d.ts +1 -1
  80. package/lib/store.js +926 -844
  81. package/lib/types.js +21 -21
  82. package/lib/update-manager.d.ts +1 -1
  83. package/lib/update-manager.js +959 -865
  84. package/lib/updates-via.js +134 -105
  85. package/lib/uri.js +3 -3
  86. package/lib/utils/default-graph-uri.js +2 -2
  87. package/lib/utils/terms.js +6 -4
  88. package/lib/utils-js.js +9 -8
  89. package/lib/utils.js +6 -6
  90. package/lib/variable.js +60 -34
  91. package/lib/xsd.js +2 -2
  92. package/package.json +9 -8
  93. package/src/index.ts +0 -2
  94. package/src/jsonldparser.js +13 -4
  95. package/src/serialize.ts +4 -11
  96. package/src/serializer.js +24 -0
  97. package/src/update-manager.ts +8 -2
  98. package/esm/convert.js +0 -60
  99. package/lib/convert.d.ts +0 -2
  100. package/lib/convert.js +0 -71
  101. package/src/convert.js +0 -70
@@ -1,9 +1,12 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
1
3
  /*
2
4
  * Updates-Via
3
5
  */
4
6
  import DataFactory from './factories/rdflib-data-factory';
5
- export class UpdatesSocket {
6
- constructor(parent, via) {
7
+ export var UpdatesSocket = /*#__PURE__*/function () {
8
+ function UpdatesSocket(parent, via) {
9
+ _classCallCheck(this, UpdatesSocket);
7
10
  this.parent = parent;
8
11
  this.via = via;
9
12
  this.connected = false;
@@ -20,121 +23,148 @@ export class UpdatesSocket {
20
23
  this.onError(error);
21
24
  }
22
25
  }
23
- _decode(q) {
24
- var elt;
25
- var i;
26
- var k;
27
- var r;
28
- var ref;
29
- var ref1;
30
- var v;
31
- r = {};
32
- ref = function () {
33
- var j, len, ref, results;
34
- ref = q.split('&');
35
- results = [];
36
- for (j = 0, len = ref.length; j < len; j++) {
37
- elt = ref[j];
38
- results.push(elt.split('='));
26
+ _createClass(UpdatesSocket, [{
27
+ key: "_decode",
28
+ value: function _decode(q) {
29
+ var elt;
30
+ var i;
31
+ var k;
32
+ var r;
33
+ var ref;
34
+ var ref1;
35
+ var v;
36
+ r = {};
37
+ ref = function () {
38
+ var j, len, ref, results;
39
+ ref = q.split('&');
40
+ results = [];
41
+ for (j = 0, len = ref.length; j < len; j++) {
42
+ elt = ref[j];
43
+ results.push(elt.split('='));
44
+ }
45
+ return results;
46
+ }();
47
+ for (i in ref) {
48
+ elt = ref[i];
49
+ ref1 = [decodeURIComponent(elt[0]), decodeURIComponent(elt[1])];
50
+ k = ref1[0];
51
+ v = ref1[1];
52
+ if (r[k] == null) {
53
+ r[k] = [];
54
+ }
55
+ r[k].push(v);
39
56
  }
40
- return results;
41
- }();
42
- for (i in ref) {
43
- elt = ref[i];
44
- ref1 = [decodeURIComponent(elt[0]), decodeURIComponent(elt[1])];
45
- k = ref1[0];
46
- v = ref1[1];
47
- if (r[k] == null) {
48
- r[k] = [];
57
+ return r;
58
+ }
59
+ }, {
60
+ key: "_send",
61
+ value: function _send(method, uri, data) {
62
+ var base, message;
63
+ message = [method, uri, data].join(' ');
64
+ return typeof (base = this.socket).send === 'function' ? base.send(message) : void 0;
65
+ }
66
+ }, {
67
+ key: "_subscribe",
68
+ value: function _subscribe(uri) {
69
+ this._send('sub', uri, '');
70
+ this.subscribed[uri] = true;
71
+ return this.subscribed[uri];
72
+ }
73
+ }, {
74
+ key: "onClose",
75
+ value: function onClose(e) {
76
+ var uri;
77
+ this.connected = false;
78
+ for (uri in this.subscribed) {
79
+ this.pending[uri] = true;
49
80
  }
50
- r[k].push(v);
81
+ this.subscribed = {};
82
+ return this.subscribed;
51
83
  }
52
- return r;
53
- }
54
- _send(method, uri, data) {
55
- var base, message;
56
- message = [method, uri, data].join(' ');
57
- return typeof (base = this.socket).send === 'function' ? base.send(message) : void 0;
58
- }
59
- _subscribe(uri) {
60
- this._send('sub', uri, '');
61
- this.subscribed[uri] = true;
62
- return this.subscribed[uri];
63
- }
64
- onClose(e) {
65
- var uri;
66
- this.connected = false;
67
- for (uri in this.subscribed) {
68
- this.pending[uri] = true;
84
+ }, {
85
+ key: "onError",
86
+ value: function onError(e) {
87
+ throw new Error('onError' + e);
69
88
  }
70
- this.subscribed = {};
71
- return this.subscribed;
72
- }
73
- onError(e) {
74
- throw new Error('onError' + e);
75
- }
76
- onMessage(e) {
77
- var base, message;
78
- message = e.data.split(' ');
79
- if (message[0] === 'ping') {
80
- return typeof (base = this.socket).send === 'function' ? base.send('pong ' + message.slice(1).join(' ')) : void 0;
81
- } else if (message[0] === 'pub') {
82
- return this.parent.onUpdate(message[1], this._decode(message[2]));
89
+ }, {
90
+ key: "onMessage",
91
+ value: function onMessage(e) {
92
+ var base, message;
93
+ message = e.data.split(' ');
94
+ if (message[0] === 'ping') {
95
+ return typeof (base = this.socket).send === 'function' ? base.send('pong ' + message.slice(1).join(' ')) : void 0;
96
+ } else if (message[0] === 'pub') {
97
+ return this.parent.onUpdate(message[1], this._decode(message[2]));
98
+ }
83
99
  }
84
- }
85
- onOpen(e) {
86
- var results, uri;
87
- this.connected = true;
88
- results = [];
89
- for (uri in this.pending) {
90
- delete this.pending[uri];
91
- results.push(this._subscribe(uri));
100
+ }, {
101
+ key: "onOpen",
102
+ value: function onOpen(e) {
103
+ var results, uri;
104
+ this.connected = true;
105
+ results = [];
106
+ for (uri in this.pending) {
107
+ delete this.pending[uri];
108
+ results.push(this._subscribe(uri));
109
+ }
110
+ return results;
92
111
  }
93
- return results;
94
- }
95
- subscribe(uri) {
96
- if (this.connected) {
97
- return this._subscribe(uri);
98
- } else {
99
- this.pending[uri] = true;
100
- return this.pending[uri];
112
+ }, {
113
+ key: "subscribe",
114
+ value: function subscribe(uri) {
115
+ if (this.connected) {
116
+ return this._subscribe(uri);
117
+ } else {
118
+ this.pending[uri] = true;
119
+ return this.pending[uri];
120
+ }
101
121
  }
102
- }
103
- }
104
- export class UpdatesVia {
105
- constructor(fetcher) {
122
+ }]);
123
+ return UpdatesSocket;
124
+ }();
125
+ export var UpdatesVia = /*#__PURE__*/function () {
126
+ function UpdatesVia(fetcher) {
127
+ _classCallCheck(this, UpdatesVia);
106
128
  this.fetcher = fetcher;
107
129
  this.graph = {};
108
130
  this.via = {};
109
131
  this.fetcher.addCallback('headers', this.onHeaders);
110
132
  }
111
- onHeaders(d) {
112
- var etag, uri, via;
113
- if (d.headers == null) {
114
- return true;
115
- }
116
- if (typeof WebSocket === 'undefined' || WebSocket === null) {
133
+ _createClass(UpdatesVia, [{
134
+ key: "onHeaders",
135
+ value: function onHeaders(d) {
136
+ var etag, uri, via;
137
+ if (d.headers == null) {
138
+ return true;
139
+ }
140
+ if (typeof WebSocket === 'undefined' || WebSocket === null) {
141
+ return true;
142
+ }
143
+ etag = d.headers['etag'];
144
+ via = d.headers['updates-via'];
145
+ uri = d.uri;
146
+ if (etag && via) {
147
+ this.graph[uri] = {
148
+ etag: etag,
149
+ via: via
150
+ };
151
+ this.register(via, uri);
152
+ }
117
153
  return true;
118
154
  }
119
- etag = d.headers['etag'];
120
- via = d.headers['updates-via'];
121
- uri = d.uri;
122
- if (etag && via) {
123
- this.graph[uri] = {
124
- etag: etag,
125
- via: via
126
- };
127
- this.register(via, uri);
155
+ }, {
156
+ key: "onUpdate",
157
+ value: function onUpdate(uri, d) {
158
+ return this.fetcher.refresh(DataFactory.namedNode(uri));
128
159
  }
129
- return true;
130
- }
131
- onUpdate(uri, d) {
132
- return this.fetcher.refresh(DataFactory.namedNode(uri));
133
- }
134
- register(via, uri) {
135
- if (this.via[via] == null) {
136
- this.via[via] = new UpdatesSocket(this, via);
160
+ }, {
161
+ key: "register",
162
+ value: function register(via, uri) {
163
+ if (this.via[via] == null) {
164
+ this.via[via] = new UpdatesSocket(this, via);
165
+ }
166
+ return this.via[via].subscribe(uri);
137
167
  }
138
- return this.via[via].subscribe(uri);
139
- }
140
- }
168
+ }]);
169
+ return UpdatesVia;
170
+ }();
package/esm/uri.js CHANGED
@@ -124,7 +124,7 @@ export function join(given, base) {
124
124
  * @param uri The URI
125
125
  */
126
126
  export function protocol(uri) {
127
- const i = uri.indexOf(':');
127
+ var i = uri.indexOf(':');
128
128
  if (i < 0) {
129
129
  return null;
130
130
  } else {
@@ -147,8 +147,8 @@ export function refTo(base, uri) {
147
147
  return '';
148
148
  }
149
149
  for (i = o = 0, len = uri.length; o < len; i = ++o) {
150
- const c = uri[i];
151
- if (c !== base[i]) {
150
+ var _c = uri[i];
151
+ if (_c !== base[i]) {
152
152
  break;
153
153
  }
154
154
  }
@@ -1,5 +1,5 @@
1
1
  // Prevents circular dependencies between data-factory-internal and statement
2
2
 
3
3
  import NamedNode from '../named-node';
4
- export const defaultGraphURI = 'chrome:theSession';
5
- export const defaultGraphNode = new NamedNode(defaultGraphURI);
4
+ export var defaultGraphURI = 'chrome:theSession';
5
+ export var defaultGraphNode = new NamedNode(defaultGraphURI);
@@ -1,12 +1,13 @@
1
+ import _typeof from "@babel/runtime/helpers/typeof";
1
2
  import { CollectionTermType, NamedNodeTermType, VariableTermType, BlankNodeTermType, LiteralTermType, GraphTermType, DefaultGraphTermType } from '../types';
2
3
  /** TypeGuard for RDFLib Statements */
3
4
  export function isStatement(obj) {
4
- return typeof obj === 'object' && obj !== null && 'subject' in obj;
5
+ return _typeof(obj) === 'object' && obj !== null && 'subject' in obj;
5
6
  }
6
7
 
7
8
  /** TypeGuard for RDFlib Stores */
8
9
  export function isStore(obj) {
9
- return typeof obj === 'object' && obj !== null && 'statements' in obj;
10
+ return _typeof(obj) === 'object' && obj !== null && 'statements' in obj;
10
11
  }
11
12
 
12
13
  /** TypeGuard for RDFLib Collections */
@@ -37,7 +38,7 @@ export function isVariable(obj) {
37
38
 
38
39
  /** TypeGuard for RDF/JS spec Terms */
39
40
  export function isTerm(obj) {
40
- return typeof obj === 'object' && obj !== null && 'termType' in obj;
41
+ return _typeof(obj) === 'object' && obj !== null && 'termType' in obj;
41
42
  }
42
43
 
43
44
  /** TypeGuard for RDF/JS spec Literals */
@@ -47,7 +48,7 @@ export function isLiteral(value) {
47
48
 
48
49
  /** TypeGuard for RDF/JS spec Quads */
49
50
  export function isQuad(obj) {
50
- return typeof obj === "object" && obj !== null && 'subject' in obj && 'predicate' in obj && 'object' in obj;
51
+ return _typeof(obj) === "object" && obj !== null && 'subject' in obj && 'predicate' in obj && 'object' in obj;
51
52
  }
52
53
 
53
54
  /** TypeGuard for RDF/JS spec NamedNodes */
package/esm/utils-js.js CHANGED
@@ -6,7 +6,7 @@ import { docpart } from './uri';
6
6
  import log from './log';
7
7
  import * as uri from './uri';
8
8
  import NamedNode from './named-node';
9
- const string = {
9
+ var string = {
10
10
  template: stringTemplate
11
11
  };
12
12
  export { log, uri, string };
@@ -56,7 +56,7 @@ export function callbackify(obj, callbacks) {
56
56
  var replaceCallbacks = [];
57
57
  var len = obj.callbacks[hook].length;
58
58
  var x;
59
- let callback;
59
+ var callback;
60
60
 
61
61
  // log.info('!@$ Firing '+hook+' call back with length'+len)
62
62
  for (x = len - 1; x >= 0; x--) {
@@ -182,10 +182,10 @@ export function dtstamp() {
182
182
  * Compares statements (heavy comparison for repeatable canonical ordering)
183
183
  */
184
184
  export function heavyCompare(x, y, g, uriMap) {
185
- var nonBlank = function (x) {
185
+ var nonBlank = function nonBlank(x) {
186
186
  return x.termType === 'BlankNode' ? null : x;
187
187
  };
188
- var signature = function (x) {
188
+ var signature = function signature(x) {
189
189
  var lis = g.statementsMatching(x).map(function (st) {
190
190
  return '' + nonBlank(st.subject) + ' ' + nonBlank(st.predicate) + ' ' + nonBlank(st.object);
191
191
  }).concat(g.statementsMatching(undefined, undefined, x).map(function (st) {
@@ -194,7 +194,7 @@ export function heavyCompare(x, y, g, uriMap) {
194
194
  lis.sort();
195
195
  return lis.join('\n');
196
196
  };
197
- const comparison = Object.prototype.hasOwnProperty.call(g, "compareTerms") ? g.compareTerms(x, y) : x.compareTerm(y);
197
+ var comparison = Object.prototype.hasOwnProperty.call(g, "compareTerms") ? g.compareTerms(x, y) : x.compareTerm(y);
198
198
  if (x.termType === 'BlankNode' && y.termType === 'BlankNode') {
199
199
  if (comparison === 0) return 0; // Same
200
200
  if (signature(x) > signature(y)) return +1;
package/esm/utils.js CHANGED
@@ -50,8 +50,8 @@ export function AJAR_handleNewTerm(kb, p, requestedBy) {
50
50
  referringTerm: requestedBy
51
51
  });
52
52
  }
53
- export const appliedFactoryMethods = ['blankNode', 'defaultGraph', 'literal', 'namedNode', 'quad', 'variable', 'supports'];
54
- const rdf = {
53
+ export var appliedFactoryMethods = ['blankNode', 'defaultGraph', 'literal', 'namedNode', 'quad', 'variable', 'supports'];
54
+ var rdf = {
55
55
  first: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first',
56
56
  rest: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest',
57
57
  nil: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'
@@ -65,10 +65,10 @@ const rdf = {
65
65
  * @return The {data} as a set of statements.
66
66
  */
67
67
  export function arrayToStatements(rdfFactory, subject, data) {
68
- const statements = [];
69
- data.reduce((id, _listObj, i, listData) => {
68
+ var statements = [];
69
+ data.reduce(function (id, _listObj, i, listData) {
70
70
  statements.push(rdfFactory.quad(id, rdfFactory.namedNode(rdf.first), listData[i]));
71
- let nextNode;
71
+ var nextNode;
72
72
  if (i < listData.length - 1) {
73
73
  nextNode = rdfFactory.blankNode();
74
74
  statements.push(rdfFactory.quad(id, rdfFactory.namedNode(rdf.rest), nextNode));
@@ -80,7 +80,7 @@ export function arrayToStatements(rdfFactory, subject, data) {
80
80
  return statements;
81
81
  }
82
82
  export function ArrayIndexOf(arr, item) {
83
- let i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
83
+ var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
84
84
  var length = arr.length;
85
85
  if (i < 0) i = length + i;
86
86
  for (; i < length; i++) {
package/esm/variable.js CHANGED
@@ -1,4 +1,12 @@
1
+ import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
+ import _createClass from "@babel/runtime/helpers/createClass";
3
+ import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
+ import _inherits from "@babel/runtime/helpers/inherits";
5
+ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
+ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
1
7
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
9
+ 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; } }
2
10
  import ClassOrder from './class-order';
3
11
  import Node from './node-internal';
4
12
  import { VariableTermType } from './types';
@@ -10,7 +18,9 @@ import * as Uri from './uri';
10
18
  * a common special base URI for variables. Their names are uris,
11
19
  * but the ? notation has an implicit base uri of 'varid:'
12
20
  */
13
- export default class Variable extends Node {
21
+ var Variable = /*#__PURE__*/function (_Node) {
22
+ _inherits(Variable, _Node);
23
+ var _super = _createSuper(Variable);
14
24
  /** The base string for a variable's name */
15
25
 
16
26
  /** The unique identifier of this variable */
@@ -19,37 +29,53 @@ export default class Variable extends Node {
19
29
  * Initializes this variable
20
30
  * @param name The variable's name
21
31
  */
22
- constructor() {
23
- let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
24
- super(name);
25
- _defineProperty(this, "termType", VariableTermType);
26
- _defineProperty(this, "base", 'varid:');
27
- _defineProperty(this, "classOrder", ClassOrder.Variable);
28
- _defineProperty(this, "isVar", 1);
29
- _defineProperty(this, "uri", void 0);
30
- this.base = 'varid:';
31
- this.uri = Uri.join(name, this.base);
32
+ function Variable() {
33
+ var _this;
34
+ var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
35
+ _classCallCheck(this, Variable);
36
+ _this = _super.call(this, name);
37
+ _defineProperty(_assertThisInitialized(_this), "termType", VariableTermType);
38
+ _defineProperty(_assertThisInitialized(_this), "base", 'varid:');
39
+ _defineProperty(_assertThisInitialized(_this), "classOrder", ClassOrder.Variable);
40
+ _defineProperty(_assertThisInitialized(_this), "isVar", 1);
41
+ _defineProperty(_assertThisInitialized(_this), "uri", void 0);
42
+ _this.base = 'varid:';
43
+ _this.uri = Uri.join(name, _this.base);
44
+ return _this;
32
45
  }
33
- equals(other) {
34
- if (!other) {
35
- return false;
46
+ _createClass(Variable, [{
47
+ key: "equals",
48
+ value: function equals(other) {
49
+ if (!other) {
50
+ return false;
51
+ }
52
+ return this.termType === other.termType && this.value === other.value;
36
53
  }
37
- return this.termType === other.termType && this.value === other.value;
38
- }
39
- hashString() {
40
- return this.toString();
41
- }
42
- substitute(bindings) {
43
- var ref;
44
- return (ref = bindings[this.toNT()]) != null ? ref : this;
45
- }
46
- toString() {
47
- return Variable.toString(this);
48
- }
49
- static toString(variable) {
50
- if (variable.uri.slice(0, variable.base.length) === variable.base) {
51
- return `?${variable.uri.slice(variable.base.length)}`;
54
+ }, {
55
+ key: "hashString",
56
+ value: function hashString() {
57
+ return this.toString();
52
58
  }
53
- return `?${variable.uri}`;
54
- }
55
- }
59
+ }, {
60
+ key: "substitute",
61
+ value: function substitute(bindings) {
62
+ var ref;
63
+ return (ref = bindings[this.toNT()]) != null ? ref : this;
64
+ }
65
+ }, {
66
+ key: "toString",
67
+ value: function toString() {
68
+ return Variable.toString(this);
69
+ }
70
+ }], [{
71
+ key: "toString",
72
+ value: function toString(variable) {
73
+ if (variable.uri.slice(0, variable.base.length) === variable.base) {
74
+ return "?".concat(variable.uri.slice(variable.base.length));
75
+ }
76
+ return "?".concat(variable.uri);
77
+ }
78
+ }]);
79
+ return Variable;
80
+ }(Node);
81
+ export { Variable as default };
package/esm/xsd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import CanonicalDataFactory from "./factories/canonical-data-factory";
2
2
  export function createXSD() {
3
- let localFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : CanonicalDataFactory;
3
+ var localFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : CanonicalDataFactory;
4
4
  return {
5
5
  boolean: localFactory.namedNode("http://www.w3.org/2001/XMLSchema#boolean"),
6
6
  dateTime: localFactory.namedNode("http://www.w3.org/2001/XMLSchema#dateTime"),
@@ -11,5 +11,5 @@ export function createXSD() {
11
11
  string: localFactory.namedNode("http://www.w3.org/2001/XMLSchema#string")
12
12
  };
13
13
  }
14
- const defaultXSD = createXSD(CanonicalDataFactory);
14
+ var defaultXSD = createXSD(CanonicalDataFactory);
15
15
  export default defaultXSD;