n3 3.0.0-alpha.2 → 3.0.0-alpha.4
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 +8 -9
- package/browser/n3.esm.min.js +3 -3
- package/browser/n3.min.js +3 -3
- package/lib/N3Parser.js +2 -2
- package/lib/N3Writer.js +5 -9
- package/package.json +1 -1
- package/src/N3Parser.js +2 -2
- package/src/N3Writer.js +5 -9
package/README.md
CHANGED
|
@@ -225,14 +225,13 @@ Setting the `emptyFormulaAsTrue` flag to `false` keeps it as a blank node graph
|
|
|
225
225
|
const parser = new N3.Parser({ format: 'text/n3', emptyFormulaAsTrue: false });
|
|
226
226
|
```
|
|
227
227
|
|
|
228
|
-
In N3 documents,
|
|
229
|
-
|
|
230
|
-
so `_:a` inside a list
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
(this will become the default in the next major version):
|
|
228
|
+
In N3 documents, blank node labels are scoped to formulas,
|
|
229
|
+
matching N3's formula-scoped blank node semantics,
|
|
230
|
+
so `_:a` inside a list or blank node property list co-references `_:a` outside of it.
|
|
231
|
+
Setting the `formulaScopedBlankNodes` flag to `false` restores the legacy behavior
|
|
232
|
+
of also rescoping blank node labels in lists and blank node property lists:
|
|
234
233
|
```JavaScript
|
|
235
|
-
const parser = new N3.Parser({ format: 'N3', formulaScopedBlankNodes:
|
|
234
|
+
const parser = new N3.Parser({ format: 'N3', formulaScopedBlankNodes: false });
|
|
236
235
|
```
|
|
237
236
|
|
|
238
237
|
### From an RDF stream to quads
|
|
@@ -330,10 +329,10 @@ const writer1 = new N3.Writer({ format: 'N-Triples' });
|
|
|
330
329
|
const writer2 = new N3.Writer({ format: 'application/trig' });
|
|
331
330
|
```
|
|
332
331
|
|
|
333
|
-
A `baseIRI` argument makes the writer abbreviate IRIs relative to that base in Turtle
|
|
332
|
+
A `baseIRI` argument makes the writer abbreviate IRIs relative to that base in Turtle, TriG and N3 serializations, and write the base as an `@base` directive at the top of the document so the output parses back to the same IRIs (N-Triples and N-Quads remain directive-free). Pass `writeBase: false` to omit the directive, for instance for a document that will be served at its base IRI:
|
|
334
333
|
|
|
335
334
|
```JavaScript
|
|
336
|
-
const writer = new N3.Writer({ baseIRI: 'http://example.org/', writeBase:
|
|
335
|
+
const writer = new N3.Writer({ baseIRI: 'http://example.org/', writeBase: false });
|
|
337
336
|
```
|
|
338
337
|
|
|
339
338
|
### From quads to an RDF stream
|