n3 2.13.6 → 2.13.8

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.
@@ -53,8 +53,9 @@ class Term {
53
53
  // ### Returns whether this object represents the same term as the other
54
54
  equals(other) {
55
55
  // If both terms were created by this library,
56
- // equality can be computed through ids
57
- if (other instanceof Term) return this.id === other.id;
56
+ // equality can be computed through ids of the same term type,
57
+ // since IRIs such as `?x` have the same id as other terms
58
+ if (other instanceof Term) return this.id === other.id && this.termType === other.termType;
58
59
  // Otherwise, compare term type and value
59
60
  return !!other && this.termType === other.termType && this.value === other.value;
60
61
  }
package/lib/N3Lexer.js CHANGED
@@ -218,7 +218,7 @@ class N3Lexer {
218
218
  this._blank = /_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:!\^\s#()\[\]\{\}"'<>]))/y;
219
219
  this._number = /[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?\d+|(?=\.?\d)\d*(?:(\.)\d+)?)(?=\.?[,;:!\^\s#()\[\]\{\}"'<>])/y;
220
220
  this._boolean = /(?:true|false)(?=[.,;!\^\s#()\[\]\{\}"'<>])/y;
221
- this._atKeyword = /@[a-z]+(?=[\s#<:"'])/iy;
221
+ this._atKeyword = /@[a-z]+(?=[\s#<:"'.])/iy;
222
222
  this._keyword = /(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<"'])/iy;
223
223
  this._n3Verb = /(?:has|is|of)(?=[\s#()\[\]\{\}"'<>?_+\-0-9])/y;
224
224
  this._n3Id = /id(?=[\s#<])/y;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n3",
3
- "version": "2.13.6",
3
+ "version": "2.13.8",
4
4
  "description": "Lightning fast, asynchronous, streaming Turtle / N3 / RDF library.",
5
5
  "author": "Ruben Verborgh <ruben.verborgh@gmail.com>",
6
6
  "keywords": [
@@ -41,9 +41,10 @@ export class Term {
41
41
  // ### Returns whether this object represents the same term as the other
42
42
  equals(other) {
43
43
  // If both terms were created by this library,
44
- // equality can be computed through ids
44
+ // equality can be computed through ids of the same term type,
45
+ // since IRIs such as `?x` have the same id as other terms
45
46
  if (other instanceof Term)
46
- return this.id === other.id;
47
+ return this.id === other.id && this.termType === other.termType;
47
48
  // Otherwise, compare term type and value
48
49
  return !!other && this.termType === other.termType &&
49
50
  this.value === other.value;
package/src/N3Lexer.js CHANGED
@@ -203,7 +203,7 @@ export default class N3Lexer {
203
203
  this._blank = /_:((?:[0-9A-Z_a-z\xc0-\xd6\xd8-\xf6\xf8-\u02ff\u0370-\u037d\u037f-\u1fff\u200c\u200d\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])(?:\.?[\-0-9A-Z_a-z\xb7\xc0-\xd6\xd8-\xf6\xf8-\u037d\u037f-\u1fff\u200c\u200d\u203f\u2040\u2070-\u218f\u2c00-\u2fef\u3001-\ud7ff\uf900-\ufdcf\ufdf0-\ufffd]|[\ud800-\udb7f][\udc00-\udfff])*)(?:[ \t]+|(?=\.?[,;:!\^\s#()\[\]\{\}"'<>]))/y;
204
204
  this._number = /[\-+]?(?:(\d+\.\d*|\.?\d+)[eE][\-+]?\d+|(?=\.?\d)\d*(?:(\.)\d+)?)(?=\.?[,;:!\^\s#()\[\]\{\}"'<>])/y;
205
205
  this._boolean = /(?:true|false)(?=[.,;!\^\s#()\[\]\{\}"'<>])/y;
206
- this._atKeyword = /@[a-z]+(?=[\s#<:"'])/iy;
206
+ this._atKeyword = /@[a-z]+(?=[\s#<:"'.])/iy;
207
207
  this._keyword = /(?:PREFIX|BASE|VERSION|GRAPH)(?=[\s#<"'])/iy;
208
208
  this._n3Verb = /(?:has|is|of)(?=[\s#()\[\]\{\}"'<>?_+\-0-9])/y;
209
209
  this._n3Id = /id(?=[\s#<])/y;