rdflib 2.2.34 → 2.2.35-0ebb696c

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/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 +964 -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 +973 -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/src/update-manager.ts +2 -1
  97. package/.babelrc +0 -20
  98. package/dist/670.rdflib.min.js +0 -1
  99. package/dist/730.rdflib.min.js +0 -3
  100. package/dist/730.rdflib.min.js.map +0 -1
  101. /package/dist/{730.rdflib.min.js.LICENSE.txt → 515.rdflib.min.js.LICENSE.txt} +0 -0
@@ -1,12 +1,9 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
1
  /*
4
2
  * Updates-Via
5
3
  */
6
4
  import DataFactory from './factories/rdflib-data-factory';
7
- export var UpdatesSocket = /*#__PURE__*/function () {
8
- function UpdatesSocket(parent, via) {
9
- _classCallCheck(this, UpdatesSocket);
5
+ export class UpdatesSocket {
6
+ constructor(parent, via) {
10
7
  this.parent = parent;
11
8
  this.via = via;
12
9
  this.connected = false;
@@ -23,148 +20,121 @@ export var UpdatesSocket = /*#__PURE__*/function () {
23
20
  this.onError(error);
24
21
  }
25
22
  }
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);
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('='));
56
39
  }
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;
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] = [];
80
49
  }
81
- this.subscribed = {};
82
- return this.subscribed;
50
+ r[k].push(v);
83
51
  }
84
- }, {
85
- key: "onError",
86
- value: function onError(e) {
87
- throw new Error('onError' + e);
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;
88
69
  }
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
- }
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]));
99
83
  }
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;
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));
111
92
  }
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
- }
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];
121
101
  }
122
- }]);
123
- return UpdatesSocket;
124
- }();
125
- export var UpdatesVia = /*#__PURE__*/function () {
126
- function UpdatesVia(fetcher) {
127
- _classCallCheck(this, UpdatesVia);
102
+ }
103
+ }
104
+ export class UpdatesVia {
105
+ constructor(fetcher) {
128
106
  this.fetcher = fetcher;
129
107
  this.graph = {};
130
108
  this.via = {};
131
109
  this.fetcher.addCallback('headers', this.onHeaders);
132
110
  }
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
- }
111
+ onHeaders(d) {
112
+ var etag, uri, via;
113
+ if (d.headers == null) {
153
114
  return true;
154
115
  }
155
- }, {
156
- key: "onUpdate",
157
- value: function onUpdate(uri, d) {
158
- return this.fetcher.refresh(DataFactory.namedNode(uri));
116
+ if (typeof WebSocket === 'undefined' || WebSocket === null) {
117
+ return true;
159
118
  }
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);
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);
167
128
  }
168
- }]);
169
- return UpdatesVia;
170
- }();
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);
137
+ }
138
+ return this.via[via].subscribe(uri);
139
+ }
140
+ }
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
- var i = uri.indexOf(':');
127
+ const 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
- var _c = uri[i];
151
- if (_c !== base[i]) {
150
+ const 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 var defaultGraphURI = 'chrome:theSession';
5
- export var defaultGraphNode = new NamedNode(defaultGraphURI);
4
+ export const defaultGraphURI = 'chrome:theSession';
5
+ export const defaultGraphNode = new NamedNode(defaultGraphURI);
@@ -1,13 +1,12 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
1
  import { CollectionTermType, NamedNodeTermType, VariableTermType, BlankNodeTermType, LiteralTermType, GraphTermType, DefaultGraphTermType } from '../types';
3
2
  /** TypeGuard for RDFLib Statements */
4
3
  export function isStatement(obj) {
5
- return _typeof(obj) === 'object' && obj !== null && 'subject' in obj;
4
+ return typeof obj === 'object' && obj !== null && 'subject' in obj;
6
5
  }
7
6
 
8
7
  /** TypeGuard for RDFlib Stores */
9
8
  export function isStore(obj) {
10
- return _typeof(obj) === 'object' && obj !== null && 'statements' in obj;
9
+ return typeof obj === 'object' && obj !== null && 'statements' in obj;
11
10
  }
12
11
 
13
12
  /** TypeGuard for RDFLib Collections */
@@ -38,7 +37,7 @@ export function isVariable(obj) {
38
37
 
39
38
  /** TypeGuard for RDF/JS spec Terms */
40
39
  export function isTerm(obj) {
41
- return _typeof(obj) === 'object' && obj !== null && 'termType' in obj;
40
+ return typeof obj === 'object' && obj !== null && 'termType' in obj;
42
41
  }
43
42
 
44
43
  /** TypeGuard for RDF/JS spec Literals */
@@ -48,7 +47,7 @@ export function isLiteral(value) {
48
47
 
49
48
  /** TypeGuard for RDF/JS spec Quads */
50
49
  export function isQuad(obj) {
51
- return _typeof(obj) === "object" && obj !== null && 'subject' in obj && 'predicate' in obj && 'object' in obj;
50
+ return typeof obj === "object" && obj !== null && 'subject' in obj && 'predicate' in obj && 'object' in obj;
52
51
  }
53
52
 
54
53
  /** 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
- var string = {
9
+ const 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
- var callback;
59
+ let 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 nonBlank(x) {
185
+ var nonBlank = function (x) {
186
186
  return x.termType === 'BlankNode' ? null : x;
187
187
  };
188
- var signature = function signature(x) {
188
+ var signature = function (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
- var comparison = Object.prototype.hasOwnProperty.call(g, "compareTerms") ? g.compareTerms(x, y) : x.compareTerm(y);
197
+ const 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;
@@ -241,7 +241,6 @@ export function parseXML(str, options) {
241
241
  dparser = new DOMParser(); // Doc says this works
242
242
  }
243
243
  }
244
-
245
244
  return dparser.parseFromString(str, 'application/xml');
246
245
  }
247
246
 
package/esm/utils.js CHANGED
@@ -2,6 +2,7 @@ import log from './log';
2
2
  import { docpart } from './uri';
3
3
  import { string_startswith } from './utils-js';
4
4
  /** RDF/JS spec Typeguards */
5
+
5
6
  /**
6
7
  * Loads ontologies of the data we load (this is the callback from the kb to
7
8
  * the fetcher).
@@ -49,8 +50,8 @@ export function AJAR_handleNewTerm(kb, p, requestedBy) {
49
50
  referringTerm: requestedBy
50
51
  });
51
52
  }
52
- export var appliedFactoryMethods = ['blankNode', 'defaultGraph', 'literal', 'namedNode', 'quad', 'variable', 'supports'];
53
- var rdf = {
53
+ export const appliedFactoryMethods = ['blankNode', 'defaultGraph', 'literal', 'namedNode', 'quad', 'variable', 'supports'];
54
+ const rdf = {
54
55
  first: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#first',
55
56
  rest: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#rest',
56
57
  nil: 'http://www.w3.org/1999/02/22-rdf-syntax-ns#nil'
@@ -64,10 +65,10 @@ var rdf = {
64
65
  * @return The {data} as a set of statements.
65
66
  */
66
67
  export function arrayToStatements(rdfFactory, subject, data) {
67
- var statements = [];
68
- data.reduce(function (id, _listObj, i, listData) {
68
+ const statements = [];
69
+ data.reduce((id, _listObj, i, listData) => {
69
70
  statements.push(rdfFactory.quad(id, rdfFactory.namedNode(rdf.first), listData[i]));
70
- var nextNode;
71
+ let nextNode;
71
72
  if (i < listData.length - 1) {
72
73
  nextNode = rdfFactory.blankNode();
73
74
  statements.push(rdfFactory.quad(id, rdfFactory.namedNode(rdf.rest), nextNode));
@@ -79,7 +80,7 @@ export function arrayToStatements(rdfFactory, subject, data) {
79
80
  return statements;
80
81
  }
81
82
  export function ArrayIndexOf(arr, item) {
82
- var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
83
+ let i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
83
84
  var length = arr.length;
84
85
  if (i < 0) i = length + i;
85
86
  for (; i < length; i++) {
package/esm/variable.js CHANGED
@@ -1,12 +1,4 @@
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";
7
1
  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; } }
10
2
  import ClassOrder from './class-order';
11
3
  import Node from './node-internal';
12
4
  import { VariableTermType } from './types';
@@ -18,62 +10,44 @@ import * as Uri from './uri';
18
10
  * a common special base URI for variables. Their names are uris,
19
11
  * but the ? notation has an implicit base uri of 'varid:'
20
12
  */
21
- var Variable = /*#__PURE__*/function (_Node) {
22
- _inherits(Variable, _Node);
23
- var _super = _createSuper(Variable);
13
+ export default class Variable extends Node {
24
14
  /**
25
15
  * Initializes this variable
26
16
  * @param name The variable's name
27
17
  */
28
- function Variable() {
29
- var _this;
30
- var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
31
- _classCallCheck(this, Variable);
32
- _this = _super.call(this, name);
33
- _defineProperty(_assertThisInitialized(_this), "termType", VariableTermType);
18
+ constructor() {
19
+ let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
20
+ super(name);
21
+ _defineProperty(this, "termType", VariableTermType);
34
22
  /** The base string for a variable's name */
35
- _defineProperty(_assertThisInitialized(_this), "base", 'varid:');
36
- _defineProperty(_assertThisInitialized(_this), "classOrder", ClassOrder.Variable);
37
- _defineProperty(_assertThisInitialized(_this), "isVar", 1);
23
+ _defineProperty(this, "base", 'varid:');
24
+ _defineProperty(this, "classOrder", ClassOrder.Variable);
25
+ _defineProperty(this, "isVar", 1);
38
26
  /** The unique identifier of this variable */
39
- _defineProperty(_assertThisInitialized(_this), "uri", void 0);
40
- _this.base = 'varid:';
41
- _this.uri = Uri.join(name, _this.base);
42
- return _this;
27
+ _defineProperty(this, "uri", void 0);
28
+ this.base = 'varid:';
29
+ this.uri = Uri.join(name, this.base);
43
30
  }
44
- _createClass(Variable, [{
45
- key: "equals",
46
- value: function equals(other) {
47
- if (!other) {
48
- return false;
49
- }
50
- return this.termType === other.termType && this.value === other.value;
31
+ equals(other) {
32
+ if (!other) {
33
+ return false;
51
34
  }
52
- }, {
53
- key: "hashString",
54
- value: function hashString() {
55
- return this.toString();
56
- }
57
- }, {
58
- key: "substitute",
59
- value: function substitute(bindings) {
60
- var ref;
61
- return (ref = bindings[this.toNT()]) != null ? ref : this;
62
- }
63
- }, {
64
- key: "toString",
65
- value: function toString() {
66
- return Variable.toString(this);
67
- }
68
- }], [{
69
- key: "toString",
70
- value: function toString(variable) {
71
- if (variable.uri.slice(0, variable.base.length) === variable.base) {
72
- return "?".concat(variable.uri.slice(variable.base.length));
73
- }
74
- return "?".concat(variable.uri);
35
+ return this.termType === other.termType && this.value === other.value;
36
+ }
37
+ hashString() {
38
+ return this.toString();
39
+ }
40
+ substitute(bindings) {
41
+ var ref;
42
+ return (ref = bindings[this.toNT()]) != null ? ref : this;
43
+ }
44
+ toString() {
45
+ return Variable.toString(this);
46
+ }
47
+ static toString(variable) {
48
+ if (variable.uri.slice(0, variable.base.length) === variable.base) {
49
+ return `?${variable.uri.slice(variable.base.length)}`;
75
50
  }
76
- }]);
77
- return Variable;
78
- }(Node);
79
- export { Variable as default };
51
+ return `?${variable.uri}`;
52
+ }
53
+ }
package/esm/xsd.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import CanonicalDataFactory from "./factories/canonical-data-factory";
2
2
  export function createXSD() {
3
- var localFactory = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : CanonicalDataFactory;
3
+ let 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
- var defaultXSD = createXSD(CanonicalDataFactory);
14
+ const defaultXSD = createXSD(CanonicalDataFactory);
15
15
  export default defaultXSD;