n3 2.11.2 → 3.0.0-alpha.2
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.
- package/README.md +10 -9
- package/browser/n3.esm.min.js +12 -12
- package/browser/n3.min.js +12 -12
- package/lib/N3Lexer.js +133 -148
- package/lib/N3Parser.js +5 -4
- package/package.json +29 -2
- package/src/N3Lexer.js +142 -162
- package/src/N3Parser.js +5 -4
package/src/N3Parser.js
CHANGED
|
@@ -37,10 +37,11 @@ export default class N3Parser {
|
|
|
37
37
|
// Whether the log:isImpliedBy predicate is supported
|
|
38
38
|
this._isImpliedBy = options.isImpliedBy;
|
|
39
39
|
// Whether an undeclared empty prefix resolves against the document IRI
|
|
40
|
-
|
|
40
|
+
// (enabled unless explicitly disabled)
|
|
41
|
+
this._implicitEmptyPrefix = options.implicitEmptyPrefix !== false;
|
|
41
42
|
// Whether an empty formula is read as the boolean literal true,
|
|
42
|
-
// as in the N3 spec tests (
|
|
43
|
-
this._emptyFormulaAsTrue =
|
|
43
|
+
// as in the N3 spec tests (enabled unless explicitly disabled)
|
|
44
|
+
this._emptyFormulaAsTrue = options.emptyFormulaAsTrue !== false;
|
|
44
45
|
// Disable relative IRIs in N-Triples or N-Quads mode
|
|
45
46
|
if (isLineMode)
|
|
46
47
|
this._resolveRelativeIRI = iri => { return null; };
|
|
@@ -941,7 +942,7 @@ export default class N3Parser {
|
|
|
941
942
|
// Restore the parent context containing this formula
|
|
942
943
|
this._restoreContext('formula', token);
|
|
943
944
|
|
|
944
|
-
//
|
|
945
|
+
// Unless the emptyFormulaAsTrue option is false, an empty formula
|
|
945
946
|
// is read as the boolean literal true, following the N3 spec tests
|
|
946
947
|
// and the direction discussed in https://github.com/w3c-cg/N3/issues/185
|
|
947
948
|
if (empty && this._emptyFormulaAsTrue) {
|