rdflib 2.2.21 → 2.2.22-b51259b5

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 (106) hide show
  1. package/dist/rdflib.min.js +1 -1
  2. package/dist/rdflib.min.js.LICENSE.txt +9 -1
  3. package/dist/rdflib.min.js.map +1 -1
  4. package/esm/blank-node.js +61 -114
  5. package/esm/class-order.js +1 -1
  6. package/esm/collection.js +70 -128
  7. package/esm/convert.js +1 -2
  8. package/esm/default-graph.js +14 -48
  9. package/esm/empty.js +8 -39
  10. package/esm/factories/canonical-data-factory.js +33 -65
  11. package/esm/factories/extended-term-factory.js +18 -25
  12. package/esm/factories/factory-types.js +3 -2
  13. package/esm/factories/rdflib-data-factory.js +9 -19
  14. package/esm/fetcher.js +1341 -1854
  15. package/esm/formula.js +639 -846
  16. package/esm/index.js +40 -76
  17. package/esm/jsonldparser.js +24 -49
  18. package/esm/jsonparser.js +1 -8
  19. package/esm/lists.js +47 -110
  20. package/esm/literal.js +120 -189
  21. package/esm/log.js +7 -7
  22. package/esm/n3parser.js +1015 -1412
  23. package/esm/named-node.js +70 -119
  24. package/esm/namespace.js +2 -5
  25. package/esm/node-internal.js +73 -110
  26. package/esm/node.js +2 -7
  27. package/esm/parse.js +12 -19
  28. package/esm/patch-parser.js +10 -30
  29. package/esm/query-to-sparql.js +0 -18
  30. package/esm/query.js +63 -147
  31. package/esm/rdfaparser.js +794 -997
  32. package/esm/rdfxmlparser.js +347 -461
  33. package/esm/serialize.js +9 -27
  34. package/esm/serializer.js +820 -1049
  35. package/esm/sparql-to-query.js +44 -134
  36. package/esm/statement.js +54 -85
  37. package/esm/store.js +830 -1103
  38. package/esm/types.js +22 -21
  39. package/esm/update-manager.js +869 -1106
  40. package/esm/updates-via.js +104 -161
  41. package/esm/uri.js +9 -53
  42. package/esm/utils/default-graph-uri.js +3 -2
  43. package/esm/utils/termValue.js +0 -1
  44. package/esm/utils/terms.js +19 -21
  45. package/esm/utils-js.js +20 -61
  46. package/esm/utils.js +10 -21
  47. package/esm/variable.js +32 -78
  48. package/esm/xsd.js +2 -2
  49. package/lib/blank-node.js +60 -113
  50. package/lib/class-order.js +1 -2
  51. package/lib/collection.js +69 -131
  52. package/lib/convert.js +3 -9
  53. package/lib/default-graph.js +13 -52
  54. package/lib/empty.js +8 -43
  55. package/lib/factories/canonical-data-factory.js +35 -79
  56. package/lib/factories/extended-term-factory.js +18 -32
  57. package/lib/factories/factory-types.d.ts +6 -6
  58. package/lib/factories/factory-types.js +1 -4
  59. package/lib/factories/rdflib-data-factory.js +9 -23
  60. package/lib/fetcher.d.ts +6 -6
  61. package/lib/fetcher.js +1370 -1843
  62. package/lib/formula.js +640 -855
  63. package/lib/index.js +66 -152
  64. package/lib/jsonldparser.js +23 -53
  65. package/lib/jsonparser.js +1 -10
  66. package/lib/lists.js +55 -112
  67. package/lib/literal.js +120 -195
  68. package/lib/log.d.ts +0 -6
  69. package/lib/log.js +7 -8
  70. package/lib/n3parser.js +1030 -1436
  71. package/lib/named-node.js +69 -126
  72. package/lib/namespace.js +2 -7
  73. package/lib/node-internal.js +74 -107
  74. package/lib/node.js +2 -12
  75. package/lib/parse.d.ts +1 -1
  76. package/lib/parse.js +12 -32
  77. package/lib/patch-parser.js +11 -34
  78. package/lib/query-to-sparql.js +0 -23
  79. package/lib/query.js +62 -167
  80. package/lib/rdfaparser.js +796 -1009
  81. package/lib/rdfxmlparser.js +349 -466
  82. package/lib/serialize.js +11 -37
  83. package/lib/serializer.js +823 -1064
  84. package/lib/sparql-to-query.js +42 -167
  85. package/lib/statement.js +55 -91
  86. package/lib/store.d.ts +1 -1
  87. package/lib/store.js +850 -1112
  88. package/lib/tf-types.d.ts +4 -4
  89. package/lib/types.d.ts +8 -8
  90. package/lib/types.js +23 -23
  91. package/lib/update-manager.d.ts +1 -1
  92. package/lib/update-manager.js +865 -1103
  93. package/lib/updates-via.js +105 -164
  94. package/lib/uri.js +8 -61
  95. package/lib/utils/default-graph-uri.js +3 -5
  96. package/lib/utils/termValue.js +0 -2
  97. package/lib/utils/terms.js +19 -40
  98. package/lib/utils-js.js +23 -88
  99. package/lib/utils.js +10 -27
  100. package/lib/variable.js +34 -85
  101. package/lib/xsd-internal.js +0 -3
  102. package/lib/xsd.js +2 -6
  103. package/package.json +35 -35
  104. package/src/fetcher.ts +2 -2
  105. package/src/update-manager.ts +12 -7
  106. package/changes.txt +0 -59
@@ -1,21 +1,15 @@
1
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
- import _createClass from "@babel/runtime/helpers/createClass";
3
-
4
1
  /*
5
2
  * Updates-Via
6
3
  */
7
4
  import DataFactory from './factories/rdflib-data-factory';
8
- export var UpdatesSocket = /*#__PURE__*/function () {
9
- function UpdatesSocket(parent, via) {
10
- _classCallCheck(this, UpdatesSocket);
11
-
5
+ export class UpdatesSocket {
6
+ constructor(parent, via) {
12
7
  this.parent = parent;
13
8
  this.via = via;
14
9
  this.connected = false;
15
10
  this.pending = {};
16
11
  this.subscribed = {};
17
12
  this.socket = {};
18
-
19
13
  try {
20
14
  this.socket = new WebSocket(via);
21
15
  this.socket.onopen = this.onOpen;
@@ -26,172 +20,121 @@ export var UpdatesSocket = /*#__PURE__*/function () {
26
20
  this.onError(error);
27
21
  }
28
22
  }
29
-
30
- _createClass(UpdatesSocket, [{
31
- key: "_decode",
32
- value: function _decode(q) {
33
- var elt;
34
- var i;
35
- var k;
36
- var r;
37
- var ref;
38
- var ref1;
39
- var v;
40
- r = {};
41
-
42
- ref = function () {
43
- var j, len, ref, results;
44
- ref = q.split('&');
45
- results = [];
46
-
47
- for (j = 0, len = ref.length; j < len; j++) {
48
- elt = ref[j];
49
- results.push(elt.split('='));
50
- }
51
-
52
- return results;
53
- }();
54
-
55
- for (i in ref) {
56
- elt = ref[i];
57
- ref1 = [decodeURIComponent(elt[0]), decodeURIComponent(elt[1])];
58
- k = ref1[0];
59
- v = ref1[1];
60
-
61
- if (r[k] == null) {
62
- r[k] = [];
63
- }
64
-
65
- 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('='));
66
39
  }
67
-
68
- return r;
69
- }
70
- }, {
71
- key: "_send",
72
- value: function _send(method, uri, data) {
73
- var base, message;
74
- message = [method, uri, data].join(' ');
75
- return typeof (base = this.socket).send === 'function' ? base.send(message) : void 0;
76
- }
77
- }, {
78
- key: "_subscribe",
79
- value: function _subscribe(uri) {
80
- this._send('sub', uri, '');
81
-
82
- this.subscribed[uri] = true;
83
- return this.subscribed[uri];
84
- }
85
- }, {
86
- key: "onClose",
87
- value: function onClose(e) {
88
- var uri;
89
- this.connected = false;
90
-
91
- for (uri in this.subscribed) {
92
- 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] = [];
93
49
  }
94
-
95
- this.subscribed = {};
96
- return this.subscribed;
50
+ r[k].push(v);
97
51
  }
98
- }, {
99
- key: "onError",
100
- value: function onError(e) {
101
- 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;
102
69
  }
103
- }, {
104
- key: "onMessage",
105
- value: function onMessage(e) {
106
- var base, message;
107
- message = e.data.split(' ');
108
-
109
- if (message[0] === 'ping') {
110
- return typeof (base = this.socket).send === 'function' ? base.send('pong ' + message.slice(1).join(' ')) : void 0;
111
- } else if (message[0] === 'pub') {
112
- return this.parent.onUpdate(message[1], this._decode(message[2]));
113
- }
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]));
114
83
  }
115
- }, {
116
- key: "onOpen",
117
- value: function onOpen(e) {
118
- var results, uri;
119
- this.connected = true;
120
- results = [];
121
-
122
- for (uri in this.pending) {
123
- delete this.pending[uri];
124
- results.push(this._subscribe(uri));
125
- }
126
-
127
- 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));
128
92
  }
129
- }, {
130
- key: "subscribe",
131
- value: function subscribe(uri) {
132
- if (this.connected) {
133
- return this._subscribe(uri);
134
- } else {
135
- this.pending[uri] = true;
136
- return this.pending[uri];
137
- }
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];
138
101
  }
139
- }]);
140
-
141
- return UpdatesSocket;
142
- }();
143
- export var UpdatesVia = /*#__PURE__*/function () {
144
- function UpdatesVia(fetcher) {
145
- _classCallCheck(this, UpdatesVia);
146
-
102
+ }
103
+ }
104
+ export class UpdatesVia {
105
+ constructor(fetcher) {
147
106
  this.fetcher = fetcher;
148
107
  this.graph = {};
149
108
  this.via = {};
150
109
  this.fetcher.addCallback('headers', this.onHeaders);
151
110
  }
152
-
153
- _createClass(UpdatesVia, [{
154
- key: "onHeaders",
155
- value: function onHeaders(d) {
156
- var etag, uri, via;
157
-
158
- if (d.headers == null) {
159
- return true;
160
- }
161
-
162
- if (typeof WebSocket === 'undefined' || WebSocket === null) {
163
- return true;
164
- }
165
-
166
- etag = d.headers['etag'];
167
- via = d.headers['updates-via'];
168
- uri = d.uri;
169
-
170
- if (etag && via) {
171
- this.graph[uri] = {
172
- etag: etag,
173
- via: via
174
- };
175
- this.register(via, uri);
176
- }
177
-
111
+ onHeaders(d) {
112
+ var etag, uri, via;
113
+ if (d.headers == null) {
178
114
  return true;
179
115
  }
180
- }, {
181
- key: "onUpdate",
182
- value: function onUpdate(uri, d) {
183
- return this.fetcher.refresh(DataFactory.namedNode(uri));
116
+ if (typeof WebSocket === 'undefined' || WebSocket === null) {
117
+ return true;
184
118
  }
185
- }, {
186
- key: "register",
187
- value: function register(via, uri) {
188
- if (this.via[via] == null) {
189
- this.via[via] = new UpdatesSocket(this, via);
190
- }
191
-
192
- 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);
193
128
  }
194
- }]);
195
-
196
- return UpdatesVia;
197
- }();
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
@@ -10,92 +10,78 @@
10
10
  */
11
11
  var alert = alert || console.log;
12
12
  import RDFlibNamedNode from './named-node';
13
+
13
14
  /**
14
15
  * Gets the document part of an URI
15
16
  * @param uri The URI
16
17
  */
17
-
18
18
  export function docpart(uri) {
19
19
  var i;
20
20
  i = uri.indexOf('#');
21
-
22
21
  if (i < 0) {
23
22
  return uri;
24
23
  } else {
25
24
  return uri.slice(0, i);
26
25
  }
27
26
  }
27
+
28
28
  /**
29
29
  * Gets the document part of an URI as a named node
30
30
  * @param x - The URI
31
31
  */
32
-
33
32
  export function document(x) {
34
33
  return new RDFlibNamedNode(docpart(x));
35
34
  }
35
+
36
36
  /**
37
37
  * Gets the hostname in an URI
38
38
  * @param u The URI
39
39
  */
40
-
41
40
  export function hostpart(u) {
42
41
  var m = /[^\/]*\/\/([^\/]*)\//.exec(u);
43
-
44
42
  if (m) {
45
43
  return m[1];
46
44
  } else {
47
45
  return '';
48
46
  }
49
47
  }
48
+
50
49
  /**
51
50
  * Joins an URI with a base
52
51
  * @param given - The relative part
53
52
  * @param base - The base URI
54
53
  */
55
-
56
54
  export function join(given, base) {
57
55
  var baseColon, baseScheme, baseSingle;
58
56
  var colon, lastSlash, path;
59
57
  var baseHash = base.indexOf('#');
60
-
61
58
  if (baseHash > 0) {
62
59
  base = base.slice(0, baseHash);
63
60
  }
64
-
65
61
  if (given.length === 0) {
66
62
  return base;
67
63
  }
68
-
69
64
  if (given.indexOf('#') === 0) {
70
65
  return base + given;
71
66
  }
72
-
73
67
  colon = given.indexOf(':');
74
-
75
68
  if (colon >= 0) {
76
69
  return given;
77
70
  }
78
-
79
71
  baseColon = base.indexOf(':');
80
-
81
72
  if (base.length === 0) {
82
73
  return given;
83
74
  }
84
-
85
75
  if (baseColon < 0) {
86
76
  alert('Invalid base: ' + base + ' in join with given: ' + given);
87
77
  return given;
88
78
  }
89
-
90
79
  baseScheme = base.slice(0, +baseColon + 1 || 9e9);
91
-
92
80
  if (given.indexOf('//') === 0) {
93
81
  return baseScheme + given;
94
82
  }
95
-
96
83
  if (base.indexOf('//', baseColon) === baseColon + 1) {
97
84
  baseSingle = base.indexOf('/', baseColon + 3);
98
-
99
85
  if (baseSingle < 0) {
100
86
  if (base.length - baseColon - 3 > 0) {
101
87
  return base + '/' + given;
@@ -105,7 +91,6 @@ export function join(given, base) {
105
91
  }
106
92
  } else {
107
93
  baseSingle = base.indexOf('/', baseColon + 1);
108
-
109
94
  if (baseSingle < 0) {
110
95
  if (base.length - baseColon - 1 > 0) {
111
96
  return base + '/' + given;
@@ -114,132 +99,103 @@ export function join(given, base) {
114
99
  }
115
100
  }
116
101
  }
117
-
118
102
  if (given.indexOf('/') === 0) {
119
103
  return base.slice(0, baseSingle) + given;
120
104
  }
121
-
122
105
  path = base.slice(baseSingle);
123
106
  lastSlash = path.lastIndexOf('/');
124
-
125
107
  if (lastSlash < 0) {
126
108
  return baseScheme + given;
127
109
  }
128
-
129
110
  if (lastSlash >= 0 && lastSlash < path.length - 1) {
130
111
  path = path.slice(0, +lastSlash + 1 || 9e9);
131
112
  }
132
-
133
113
  path += given;
134
-
135
114
  while (path.match(/[^\/]*\/\.\.\//)) {
136
115
  path = path.replace(/[^\/]*\/\.\.\//, '');
137
116
  }
138
-
139
117
  path = path.replace(/\.\//g, '');
140
118
  path = path.replace(/\/\.$/, '/');
141
119
  return base.slice(0, baseSingle) + path;
142
120
  }
121
+
143
122
  /**
144
123
  * Gets the protocol part of an URI
145
124
  * @param uri The URI
146
125
  */
147
-
148
126
  export function protocol(uri) {
149
- var i = uri.indexOf(':');
150
-
127
+ const i = uri.indexOf(':');
151
128
  if (i < 0) {
152
129
  return null;
153
130
  } else {
154
131
  return uri.slice(0, i);
155
132
  }
156
133
  }
134
+
157
135
  /**
158
136
  * Gets a relative uri
159
137
  * @param base The base URI
160
138
  * @param uri The absolute URI
161
139
  */
162
-
163
140
  export function refTo(base, uri) {
164
141
  var c, i, k, l, len, len1, n, o, p, q, ref, ref1, s;
165
142
  var commonHost = new RegExp('^[-_a-zA-Z0-9.]+:(//[^/]*)?/[^/]*$');
166
-
167
143
  if (!base) {
168
144
  return uri;
169
145
  }
170
-
171
146
  if (base === uri) {
172
147
  return '';
173
148
  }
174
-
175
149
  for (i = o = 0, len = uri.length; o < len; i = ++o) {
176
- var _c = uri[i];
177
-
178
- if (_c !== base[i]) {
150
+ const c = uri[i];
151
+ if (c !== base[i]) {
179
152
  break;
180
153
  }
181
154
  }
182
-
183
155
  if (base.slice(0, i).match(commonHost)) {
184
156
  k = uri.indexOf('//');
185
-
186
157
  if (k < 0) {
187
158
  k = -2;
188
159
  }
189
-
190
160
  l = uri.indexOf('/', k + 2);
191
-
192
161
  if (uri[l + 1] !== '/' && base[l + 1] !== '/' && uri.slice(0, l) === base.slice(0, l)) {
193
162
  return uri.slice(l);
194
163
  }
195
164
  }
196
-
197
165
  if (uri[i] === '#' && base.length === i) {
198
166
  return uri.slice(i);
199
167
  }
200
-
201
168
  while (i > 0 && uri[i - 1] !== '/') {
202
169
  i--;
203
170
  }
204
-
205
171
  if (i < 3) {
206
172
  return uri;
207
173
  }
208
-
209
174
  if (base.indexOf('//', i - 2) > 0 || uri.indexOf('//', i - 2) > 0) {
210
175
  return uri;
211
176
  }
212
-
213
177
  if (base.indexOf(':', i) > 0) {
214
178
  return uri;
215
179
  }
216
-
217
180
  n = 0;
218
181
  ref = base.slice(i);
219
-
220
182
  for (p = 0, len1 = ref.length; p < len1; p++) {
221
183
  c = ref[p];
222
-
223
184
  if (c === '/') {
224
185
  n++;
225
186
  }
226
187
  }
227
-
228
188
  if (n === 0 && i < uri.length && uri[i] === '#') {
229
189
  return './' + uri.slice(i);
230
190
  }
231
-
232
191
  if (n === 0 && i === uri.length) {
233
192
  return './';
234
193
  }
235
-
236
194
  s = '';
237
-
238
195
  if (n > 0) {
239
196
  for (q = 1, ref1 = n; ref1 >= 1 ? q <= ref1 : q >= ref1; ref1 >= 1 ? ++q : --q) {
240
197
  s += '../';
241
198
  }
242
199
  }
243
-
244
200
  return s + uri.slice(i);
245
201
  }
@@ -1,4 +1,5 @@
1
1
  // Prevents circular dependencies between data-factory-internal and statement
2
+
2
3
  import NamedNode from '../named-node';
3
- export var defaultGraphURI = 'chrome:theSession';
4
- export var defaultGraphNode = new NamedNode(defaultGraphURI);
4
+ export const defaultGraphURI = 'chrome:theSession';
5
+ export const defaultGraphNode = new NamedNode(defaultGraphURI);
@@ -3,6 +3,5 @@ export function termValue(node) {
3
3
  if (typeof node === 'string') {
4
4
  return node;
5
5
  }
6
-
7
6
  return node.value;
8
7
  }
@@ -1,83 +1,81 @@
1
- import _typeof from "@babel/runtime/helpers/typeof";
2
1
  import { CollectionTermType, NamedNodeTermType, VariableTermType, BlankNodeTermType, LiteralTermType, GraphTermType, DefaultGraphTermType } from '../types';
3
-
4
2
  /** TypeGuard for RDFLib Statements */
5
3
  export function isStatement(obj) {
6
- return _typeof(obj) === 'object' && obj !== null && 'subject' in obj;
4
+ return typeof obj === 'object' && obj !== null && 'subject' in obj;
7
5
  }
8
- /** TypeGuard for RDFlib Stores */
9
6
 
7
+ /** TypeGuard for RDFlib Stores */
10
8
  export function isStore(obj) {
11
- return _typeof(obj) === 'object' && obj !== null && 'statements' in obj;
9
+ return typeof obj === 'object' && obj !== null && 'statements' in obj;
12
10
  }
13
- /** TypeGuard for RDFLib Collections */
14
11
 
12
+ /** TypeGuard for RDFLib Collections */
15
13
  export function isCollection(obj) {
16
14
  return isTerm(obj) && obj.termType === CollectionTermType;
17
15
  }
18
- /** TypeGuard for valid RDFlib Object types, also allows Collections, Graphs */
19
16
 
17
+ /** TypeGuard for valid RDFlib Object types, also allows Collections, Graphs */
20
18
  export function isRDFlibObject(obj) {
21
19
  return obj && Object.prototype.hasOwnProperty.call(obj, 'termType') && (obj.termType === NamedNodeTermType || obj.termType === VariableTermType || obj.termType === BlankNodeTermType || obj.termType === CollectionTermType || obj.termType === LiteralTermType || obj.termType === GraphTermType);
22
20
  }
21
+
23
22
  /** TypeGuard for valid RDFlib Subject types, same as Object as RDFLib symmetrical.
24
23
  */
25
-
26
24
  export function isRDFlibSubject(obj) {
27
25
  return obj && Object.prototype.hasOwnProperty.call(obj, 'termType') && (obj.termType === NamedNodeTermType || obj.termType === VariableTermType || obj.termType === BlankNodeTermType || obj.termType === CollectionTermType || obj.termType === LiteralTermType || obj.termType === GraphTermType);
28
26
  }
29
- /** TypeGuard for valid RDF/JS spec Predicate types */
30
27
 
28
+ /** TypeGuard for valid RDF/JS spec Predicate types */
31
29
  export function isRDFlibPredicate(obj) {
32
30
  return isTerm(obj) && (obj.termType === NamedNodeTermType || obj.termType === BlankNodeTermType || obj.termType === VariableTermType);
33
31
  }
34
- /** TypeGuard for RDFLib Variables */
35
32
 
33
+ /** TypeGuard for RDFLib Variables */
36
34
  export function isVariable(obj) {
37
35
  return isTerm(obj) && obj.termType === VariableTermType;
38
36
  }
39
- /** TypeGuard for RDF/JS spec Terms */
40
37
 
38
+ /** TypeGuard for RDF/JS spec Terms */
41
39
  export function isTerm(obj) {
42
- return _typeof(obj) === 'object' && obj !== null && 'termType' in obj;
40
+ return typeof obj === 'object' && obj !== null && 'termType' in obj;
43
41
  }
44
- /** TypeGuard for RDF/JS spec Literals */
45
42
 
43
+ /** TypeGuard for RDF/JS spec Literals */
46
44
  export function isLiteral(value) {
47
45
  return value.termType === LiteralTermType;
48
46
  }
49
- /** TypeGuard for RDF/JS spec Quads */
50
47
 
48
+ /** TypeGuard for RDF/JS spec Quads */
51
49
  export function isQuad(obj) {
52
- 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;
53
51
  }
54
- /** TypeGuard for RDF/JS spec NamedNodes */
55
52
 
53
+ /** TypeGuard for RDF/JS spec NamedNodes */
56
54
  export function isNamedNode(obj) {
57
55
  return isTerm(obj) && obj.termType === 'NamedNode';
58
56
  }
59
- /** TypeGuard for RDF/JS spec BlankNodes */
60
57
 
58
+ /** TypeGuard for RDF/JS spec BlankNodes */
61
59
  export function isBlankNode(obj) {
62
60
  return isTerm(obj) && 'termType' in obj && obj.termType === 'BlankNode';
63
61
  }
64
- /** TypeGuard for valid RDF/JS spec Subject types */
65
62
 
63
+ /** TypeGuard for valid RDF/JS spec Subject types */
66
64
  export function isSubject(obj) {
67
65
  return isTerm(obj) && (obj.termType === NamedNodeTermType || obj.termType === VariableTermType || obj.termType === BlankNodeTermType);
68
66
  }
69
- /** TypeGuard for valid RDF/JS spec Predicate types */
70
67
 
68
+ /** TypeGuard for valid RDF/JS spec Predicate types */
71
69
  export function isPredicate(obj) {
72
70
  return isTerm(obj) && (obj.termType === NamedNodeTermType || obj.termType === VariableTermType);
73
71
  }
74
- /** TypeGuard for valid RDF/JS spec Object types */
75
72
 
73
+ /** TypeGuard for valid RDF/JS spec Object types */
76
74
  export function isRDFObject(obj) {
77
75
  return isTerm(obj) && (obj.termType === NamedNodeTermType || obj.termType === VariableTermType || obj.termType === BlankNodeTermType || obj.termType === LiteralTermType);
78
76
  }
79
- /** TypeGuard for valid RDF/JS Graph types */
80
77
 
78
+ /** TypeGuard for valid RDF/JS Graph types */
81
79
  export function isGraph(obj) {
82
80
  return isTerm(obj) && (obj.termType === NamedNodeTermType || obj.termType === VariableTermType || obj.termType === BlankNodeTermType || obj.termType === DefaultGraphTermType);
83
81
  }