rdflib 2.2.21 → 2.2.22-0de51c50

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