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,6 +1,5 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
-
4
3
  /*
5
4
  * Updates-Via
6
5
  */
@@ -8,14 +7,12 @@ import DataFactory from './factories/rdflib-data-factory';
8
7
  export var UpdatesSocket = /*#__PURE__*/function () {
9
8
  function UpdatesSocket(parent, via) {
10
9
  _classCallCheck(this, UpdatesSocket);
11
-
12
10
  this.parent = parent;
13
11
  this.via = via;
14
12
  this.connected = false;
15
13
  this.pending = {};
16
14
  this.subscribed = {};
17
15
  this.socket = {};
18
-
19
16
  try {
20
17
  this.socket = new WebSocket(via);
21
18
  this.socket.onopen = this.onOpen;
@@ -26,7 +23,6 @@ export var UpdatesSocket = /*#__PURE__*/function () {
26
23
  this.onError(error);
27
24
  }
28
25
  }
29
-
30
26
  _createClass(UpdatesSocket, [{
31
27
  key: "_decode",
32
28
  value: function _decode(q) {
@@ -38,33 +34,26 @@ export var UpdatesSocket = /*#__PURE__*/function () {
38
34
  var ref1;
39
35
  var v;
40
36
  r = {};
41
-
42
37
  ref = function () {
43
38
  var j, len, ref, results;
44
39
  ref = q.split('&');
45
40
  results = [];
46
-
47
41
  for (j = 0, len = ref.length; j < len; j++) {
48
42
  elt = ref[j];
49
43
  results.push(elt.split('='));
50
44
  }
51
-
52
45
  return results;
53
46
  }();
54
-
55
47
  for (i in ref) {
56
48
  elt = ref[i];
57
49
  ref1 = [decodeURIComponent(elt[0]), decodeURIComponent(elt[1])];
58
50
  k = ref1[0];
59
51
  v = ref1[1];
60
-
61
52
  if (r[k] == null) {
62
53
  r[k] = [];
63
54
  }
64
-
65
55
  r[k].push(v);
66
56
  }
67
-
68
57
  return r;
69
58
  }
70
59
  }, {
@@ -78,7 +67,6 @@ export var UpdatesSocket = /*#__PURE__*/function () {
78
67
  key: "_subscribe",
79
68
  value: function _subscribe(uri) {
80
69
  this._send('sub', uri, '');
81
-
82
70
  this.subscribed[uri] = true;
83
71
  return this.subscribed[uri];
84
72
  }
@@ -87,11 +75,9 @@ export var UpdatesSocket = /*#__PURE__*/function () {
87
75
  value: function onClose(e) {
88
76
  var uri;
89
77
  this.connected = false;
90
-
91
78
  for (uri in this.subscribed) {
92
79
  this.pending[uri] = true;
93
80
  }
94
-
95
81
  this.subscribed = {};
96
82
  return this.subscribed;
97
83
  }
@@ -105,7 +91,6 @@ export var UpdatesSocket = /*#__PURE__*/function () {
105
91
  value: function onMessage(e) {
106
92
  var base, message;
107
93
  message = e.data.split(' ');
108
-
109
94
  if (message[0] === 'ping') {
110
95
  return typeof (base = this.socket).send === 'function' ? base.send('pong ' + message.slice(1).join(' ')) : void 0;
111
96
  } else if (message[0] === 'pub') {
@@ -118,12 +103,10 @@ export var UpdatesSocket = /*#__PURE__*/function () {
118
103
  var results, uri;
119
104
  this.connected = true;
120
105
  results = [];
121
-
122
106
  for (uri in this.pending) {
123
107
  delete this.pending[uri];
124
108
  results.push(this._subscribe(uri));
125
109
  }
126
-
127
110
  return results;
128
111
  }
129
112
  }, {
@@ -137,36 +120,29 @@ export var UpdatesSocket = /*#__PURE__*/function () {
137
120
  }
138
121
  }
139
122
  }]);
140
-
141
123
  return UpdatesSocket;
142
124
  }();
143
125
  export var UpdatesVia = /*#__PURE__*/function () {
144
126
  function UpdatesVia(fetcher) {
145
127
  _classCallCheck(this, UpdatesVia);
146
-
147
128
  this.fetcher = fetcher;
148
129
  this.graph = {};
149
130
  this.via = {};
150
131
  this.fetcher.addCallback('headers', this.onHeaders);
151
132
  }
152
-
153
133
  _createClass(UpdatesVia, [{
154
134
  key: "onHeaders",
155
135
  value: function onHeaders(d) {
156
136
  var etag, uri, via;
157
-
158
137
  if (d.headers == null) {
159
138
  return true;
160
139
  }
161
-
162
140
  if (typeof WebSocket === 'undefined' || WebSocket === null) {
163
141
  return true;
164
142
  }
165
-
166
143
  etag = d.headers['etag'];
167
144
  via = d.headers['updates-via'];
168
145
  uri = d.uri;
169
-
170
146
  if (etag && via) {
171
147
  this.graph[uri] = {
172
148
  etag: etag,
@@ -174,7 +150,6 @@ export var UpdatesVia = /*#__PURE__*/function () {
174
150
  };
175
151
  this.register(via, uri);
176
152
  }
177
-
178
153
  return true;
179
154
  }
180
155
  }, {
@@ -188,10 +163,8 @@ export var UpdatesVia = /*#__PURE__*/function () {
188
163
  if (this.via[via] == null) {
189
164
  this.via[via] = new UpdatesSocket(this, via);
190
165
  }
191
-
192
166
  return this.via[via].subscribe(uri);
193
167
  }
194
168
  }]);
195
-
196
169
  return UpdatesVia;
197
170
  }();
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
127
  var i = uri.indexOf(':');
150
-
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
150
  var _c = uri[i];
177
-
178
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
4
  export var defaultGraphURI = 'chrome:theSession';
4
5
  export var 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,82 @@
1
1
  import _typeof from "@babel/runtime/helpers/typeof";
2
2
  import { CollectionTermType, NamedNodeTermType, VariableTermType, BlankNodeTermType, LiteralTermType, GraphTermType, DefaultGraphTermType } from '../types';
3
-
4
3
  /** TypeGuard for RDFLib Statements */
5
4
  export function isStatement(obj) {
6
5
  return _typeof(obj) === 'object' && obj !== null && 'subject' in obj;
7
6
  }
8
- /** TypeGuard for RDFlib Stores */
9
7
 
8
+ /** TypeGuard for RDFlib Stores */
10
9
  export function isStore(obj) {
11
10
  return _typeof(obj) === 'object' && obj !== null && 'statements' in obj;
12
11
  }
13
- /** TypeGuard for RDFLib Collections */
14
12
 
13
+ /** TypeGuard for RDFLib Collections */
15
14
  export function isCollection(obj) {
16
15
  return isTerm(obj) && obj.termType === CollectionTermType;
17
16
  }
18
- /** TypeGuard for valid RDFlib Object types, also allows Collections, Graphs */
19
17
 
18
+ /** TypeGuard for valid RDFlib Object types, also allows Collections, Graphs */
20
19
  export function isRDFlibObject(obj) {
21
20
  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
21
  }
22
+
23
23
  /** TypeGuard for valid RDFlib Subject types, same as Object as RDFLib symmetrical.
24
24
  */
25
-
26
25
  export function isRDFlibSubject(obj) {
27
26
  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
27
  }
29
- /** TypeGuard for valid RDF/JS spec Predicate types */
30
28
 
29
+ /** TypeGuard for valid RDF/JS spec Predicate types */
31
30
  export function isRDFlibPredicate(obj) {
32
31
  return isTerm(obj) && (obj.termType === NamedNodeTermType || obj.termType === BlankNodeTermType || obj.termType === VariableTermType);
33
32
  }
34
- /** TypeGuard for RDFLib Variables */
35
33
 
34
+ /** TypeGuard for RDFLib Variables */
36
35
  export function isVariable(obj) {
37
36
  return isTerm(obj) && obj.termType === VariableTermType;
38
37
  }
39
- /** TypeGuard for RDF/JS spec Terms */
40
38
 
39
+ /** TypeGuard for RDF/JS spec Terms */
41
40
  export function isTerm(obj) {
42
41
  return _typeof(obj) === 'object' && obj !== null && 'termType' in obj;
43
42
  }
44
- /** TypeGuard for RDF/JS spec Literals */
45
43
 
44
+ /** TypeGuard for RDF/JS spec Literals */
46
45
  export function isLiteral(value) {
47
46
  return value.termType === LiteralTermType;
48
47
  }
49
- /** TypeGuard for RDF/JS spec Quads */
50
48
 
49
+ /** TypeGuard for RDF/JS spec Quads */
51
50
  export function isQuad(obj) {
52
51
  return _typeof(obj) === "object" && obj !== null && 'subject' in obj && 'predicate' in obj && 'object' in obj;
53
52
  }
54
- /** TypeGuard for RDF/JS spec NamedNodes */
55
53
 
54
+ /** TypeGuard for RDF/JS spec NamedNodes */
56
55
  export function isNamedNode(obj) {
57
56
  return isTerm(obj) && obj.termType === 'NamedNode';
58
57
  }
59
- /** TypeGuard for RDF/JS spec BlankNodes */
60
58
 
59
+ /** TypeGuard for RDF/JS spec BlankNodes */
61
60
  export function isBlankNode(obj) {
62
61
  return isTerm(obj) && 'termType' in obj && obj.termType === 'BlankNode';
63
62
  }
64
- /** TypeGuard for valid RDF/JS spec Subject types */
65
63
 
64
+ /** TypeGuard for valid RDF/JS spec Subject types */
66
65
  export function isSubject(obj) {
67
66
  return isTerm(obj) && (obj.termType === NamedNodeTermType || obj.termType === VariableTermType || obj.termType === BlankNodeTermType);
68
67
  }
69
- /** TypeGuard for valid RDF/JS spec Predicate types */
70
68
 
69
+ /** TypeGuard for valid RDF/JS spec Predicate types */
71
70
  export function isPredicate(obj) {
72
71
  return isTerm(obj) && (obj.termType === NamedNodeTermType || obj.termType === VariableTermType);
73
72
  }
74
- /** TypeGuard for valid RDF/JS spec Object types */
75
73
 
74
+ /** TypeGuard for valid RDF/JS spec Object types */
76
75
  export function isRDFObject(obj) {
77
76
  return isTerm(obj) && (obj.termType === NamedNodeTermType || obj.termType === VariableTermType || obj.termType === BlankNodeTermType || obj.termType === LiteralTermType);
78
77
  }
79
- /** TypeGuard for valid RDF/JS Graph types */
80
78
 
79
+ /** TypeGuard for valid RDF/JS Graph types */
81
80
  export function isGraph(obj) {
82
81
  return isTerm(obj) && (obj.termType === NamedNodeTermType || obj.termType === VariableTermType || obj.termType === BlankNodeTermType || obj.termType === DefaultGraphTermType);
83
82
  }