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 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, the parser by default rescopes blank node labels
229
- in lists and blank node property lists, in addition to formulas,
230
- so `_:a` inside a list does not co-reference `_:a` outside of it.
231
- The `formulaScopedBlankNodes` flag scopes blank node labels to formulas only,
232
- matching N3's formula-scoped blank node semantics
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: true });
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/TriG serializations. Pass `writeBase: true` to also write the base as an `@base` directive at the top of the document (N-Triples and N-Quads remain directive-free).
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: true });
335
+ const writer = new N3.Writer({ baseIRI: 'http://example.org/', writeBase: false });
337
336
  ```
338
337
 
339
338
  ### From quads to an RDF stream