rdflib 2.2.35 → 2.2.36

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 (90) hide show
  1. package/dist/rdflib.min.js +1 -1
  2. package/dist/rdflib.min.js.LICENSE.txt +0 -2
  3. package/dist/rdflib.min.js.map +1 -1
  4. package/esm/blank-node.js +57 -82
  5. package/esm/class-order.js +1 -1
  6. package/esm/collection.js +70 -103
  7. package/esm/default-graph.js +13 -30
  8. package/esm/empty.js +8 -23
  9. package/esm/factories/canonical-data-factory.js +33 -29
  10. package/esm/factories/extended-term-factory.js +18 -13
  11. package/esm/factories/factory-types.js +1 -1
  12. package/esm/factories/rdflib-data-factory.js +9 -11
  13. package/esm/fetcher.js +1366 -1651
  14. package/esm/formula.js +631 -736
  15. package/esm/index.js +31 -48
  16. package/esm/jsonldparser.js +19 -26
  17. package/esm/jsonparser.js +1 -1
  18. package/esm/lists.js +38 -86
  19. package/esm/literal.js +120 -154
  20. package/esm/log.js +7 -7
  21. package/esm/n3parser.js +1009 -1086
  22. package/esm/named-node.js +69 -96
  23. package/esm/namespace.js +2 -4
  24. package/esm/node-internal.js +73 -96
  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 +15 -16
  29. package/esm/rdfaparser.js +775 -841
  30. package/esm/rdfxmlparser.js +348 -364
  31. package/esm/serialize.js +2 -2
  32. package/esm/serializer.js +835 -877
  33. package/esm/statement.js +52 -71
  34. package/esm/store.js +853 -957
  35. package/esm/types.js +21 -21
  36. package/esm/update-manager.js +965 -1100
  37. package/esm/updates-via.js +104 -132
  38. package/esm/uri.js +3 -3
  39. package/esm/utils/default-graph-uri.js +2 -2
  40. package/esm/utils/terms.js +4 -5
  41. package/esm/utils-js.js +5 -5
  42. package/esm/utils.js +6 -6
  43. package/esm/variable.js +32 -55
  44. package/esm/xsd.js +2 -2
  45. package/lib/blank-node.js +57 -80
  46. package/lib/class-order.js +1 -1
  47. package/lib/collection.js +70 -101
  48. package/lib/default-graph.js +14 -29
  49. package/lib/empty.js +9 -22
  50. package/lib/factories/canonical-data-factory.js +35 -31
  51. package/lib/factories/extended-term-factory.js +18 -13
  52. package/lib/factories/factory-types.js +1 -1
  53. package/lib/factories/rdflib-data-factory.js +9 -11
  54. package/lib/fetcher.js +1375 -1654
  55. package/lib/formula.js +632 -735
  56. package/lib/index.js +80 -84
  57. package/lib/jsonldparser.js +21 -32
  58. package/lib/jsonparser.js +1 -1
  59. package/lib/lists.js +47 -87
  60. package/lib/literal.js +121 -153
  61. package/lib/log.js +7 -7
  62. package/lib/n3parser.js +1012 -1090
  63. package/lib/named-node.js +70 -95
  64. package/lib/namespace.js +2 -4
  65. package/lib/node-internal.js +73 -94
  66. package/lib/node.js +1 -1
  67. package/lib/parse.js +5 -6
  68. package/lib/patch-parser.js +1 -1
  69. package/lib/query.js +20 -18
  70. package/lib/rdfaparser.js +778 -843
  71. package/lib/rdfxmlparser.js +351 -365
  72. package/lib/serialize.js +2 -2
  73. package/lib/serializer.js +840 -880
  74. package/lib/statement.js +55 -73
  75. package/lib/store.js +860 -958
  76. package/lib/types.js +21 -21
  77. package/lib/update-manager.js +970 -1102
  78. package/lib/updates-via.js +107 -132
  79. package/lib/uri.js +3 -3
  80. package/lib/utils/default-graph-uri.js +2 -2
  81. package/lib/utils/terms.js +4 -6
  82. package/lib/utils-js.js +8 -9
  83. package/lib/utils.js +6 -6
  84. package/lib/variable.js +35 -57
  85. package/lib/xsd.js +2 -2
  86. package/package.json +2 -2
  87. package/src/n3parser.js +1 -1
  88. package/src/serializer.js +1 -1
  89. package/src/update-manager.ts +2 -1
  90. package/.babelrc +0 -20
@@ -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,146 +20,121 @@ export var UpdatesSocket = /*#__PURE__*/function () {
23
20
  this.onError(error);
24
21
  }
25
22
  }
26
- return _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
- }();
124
- export var UpdatesVia = /*#__PURE__*/function () {
125
- function UpdatesVia(fetcher) {
126
- _classCallCheck(this, UpdatesVia);
102
+ }
103
+ }
104
+ export class UpdatesVia {
105
+ constructor(fetcher) {
127
106
  this.fetcher = fetcher;
128
107
  this.graph = {};
129
108
  this.via = {};
130
109
  this.fetcher.addCallback('headers', this.onHeaders);
131
110
  }
132
- return _createClass(UpdatesVia, [{
133
- key: "onHeaders",
134
- value: function onHeaders(d) {
135
- var etag, uri, via;
136
- if (d.headers == null) {
137
- return true;
138
- }
139
- if (typeof WebSocket === 'undefined' || WebSocket === null) {
140
- return true;
141
- }
142
- etag = d.headers['etag'];
143
- via = d.headers['updates-via'];
144
- uri = d.uri;
145
- if (etag && via) {
146
- this.graph[uri] = {
147
- etag: etag,
148
- via: via
149
- };
150
- this.register(via, uri);
151
- }
111
+ onHeaders(d) {
112
+ var etag, uri, via;
113
+ if (d.headers == null) {
152
114
  return true;
153
115
  }
154
- }, {
155
- key: "onUpdate",
156
- value: function onUpdate(uri, d) {
157
- return this.fetcher.refresh(DataFactory.namedNode(uri));
116
+ if (typeof WebSocket === 'undefined' || WebSocket === null) {
117
+ return true;
158
118
  }
159
- }, {
160
- key: "register",
161
- value: function register(via, uri) {
162
- if (this.via[via] == null) {
163
- this.via[via] = new UpdatesSocket(this, via);
164
- }
165
- 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);
166
128
  }
167
- }]);
168
- }();
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;
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 var appliedFactoryMethods = ['blankNode', 'defaultGraph', 'literal', 'namedNode', 'quad', 'variable', 'supports'];
54
- var rdf = {
53
+ export const appliedFactoryMethods = ['blankNode', 'defaultGraph', 'literal', 'namedNode', 'quad', 'variable', 'supports'];
54
+ const 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 @@ var rdf = {
65
65
  * @return The {data} as a set of statements.
66
66
  */
67
67
  export function arrayToStatements(rdfFactory, subject, data) {
68
- var statements = [];
69
- data.reduce(function (id, _listObj, i, listData) {
68
+ const statements = [];
69
+ data.reduce((id, _listObj, i, listData) => {
70
70
  statements.push(rdfFactory.quad(id, rdfFactory.namedNode(rdf.first), listData[i]));
71
- var nextNode;
71
+ let 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
- var i = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
83
+ let 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,11 +1,4 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
4
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
- import _inherits from "@babel/runtime/helpers/inherits";
6
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
7
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
8
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
9
2
  import ClassOrder from './class-order';
10
3
  import Node from './node-internal';
11
4
  import { VariableTermType } from './types';
@@ -17,60 +10,44 @@ import * as Uri from './uri';
17
10
  * a common special base URI for variables. Their names are uris,
18
11
  * but the ? notation has an implicit base uri of 'varid:'
19
12
  */
20
- var Variable = /*#__PURE__*/function (_Node) {
13
+ export default class Variable extends Node {
21
14
  /**
22
15
  * Initializes this variable
23
16
  * @param name The variable's name
24
17
  */
25
- function Variable() {
26
- var _this;
27
- var name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
28
- _classCallCheck(this, Variable);
29
- _this = _callSuper(this, Variable, [name]);
30
- _defineProperty(_this, "termType", VariableTermType);
18
+ constructor() {
19
+ let name = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
20
+ super(name);
21
+ _defineProperty(this, "termType", VariableTermType);
31
22
  /** The base string for a variable's name */
32
- _defineProperty(_this, "base", 'varid:');
33
- _defineProperty(_this, "classOrder", ClassOrder.Variable);
34
- _defineProperty(_this, "isVar", 1);
23
+ _defineProperty(this, "base", 'varid:');
24
+ _defineProperty(this, "classOrder", ClassOrder.Variable);
25
+ _defineProperty(this, "isVar", 1);
35
26
  /** The unique identifier of this variable */
36
- _defineProperty(_this, "uri", void 0);
37
- _this.base = 'varid:';
38
- _this.uri = Uri.join(name, _this.base);
39
- return _this;
27
+ _defineProperty(this, "uri", void 0);
28
+ this.base = 'varid:';
29
+ this.uri = Uri.join(name, this.base);
40
30
  }
41
- _inherits(Variable, _Node);
42
- return _createClass(Variable, [{
43
- key: "equals",
44
- value: function equals(other) {
45
- if (!other) {
46
- return false;
47
- }
48
- return this.termType === other.termType && this.value === other.value;
31
+ equals(other) {
32
+ if (!other) {
33
+ return false;
49
34
  }
50
- }, {
51
- key: "hashString",
52
- value: function hashString() {
53
- return this.toString();
54
- }
55
- }, {
56
- key: "substitute",
57
- value: function substitute(bindings) {
58
- var ref;
59
- return (ref = bindings[this.toNT()]) != null ? ref : this;
60
- }
61
- }, {
62
- key: "toString",
63
- value: function toString() {
64
- return Variable.toString(this);
65
- }
66
- }], [{
67
- key: "toString",
68
- value: function toString(variable) {
69
- if (variable.uri.slice(0, variable.base.length) === variable.base) {
70
- return "?".concat(variable.uri.slice(variable.base.length));
71
- }
72
- 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)}`;
73
50
  }
74
- }]);
75
- }(Node);
76
- 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;