n3 1.17.4 → 1.17.5
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 +12 -5
- package/browser/n3.min.js +1 -1
- package/lib/N3DataFactory.js +1 -1
- package/lib/N3Lexer.js +1 -1
- package/lib/N3Parser.js +6 -6
- package/lib/N3Store.js +78 -70
- package/lib/N3StreamParser.js +1 -1
- package/lib/N3StreamWriter.js +1 -1
- package/lib/N3Util.js +1 -1
- package/lib/N3Writer.js +3 -3
- package/lib/index.js +9 -3
- package/package.json +1 -1
- package/src/N3Parser.js +5 -5
- package/src/N3Store.js +68 -74
- package/src/N3Writer.js +1 -1
- package/src/index.js +2 -1
package/README.md
CHANGED
|
@@ -12,14 +12,14 @@ It offers:
|
|
|
12
12
|
[TriG](https://www.w3.org/TR/trig/),
|
|
13
13
|
[N-Triples](https://www.w3.org/TR/n-triples/),
|
|
14
14
|
[N-Quads](https://www.w3.org/TR/n-quads/),
|
|
15
|
-
[RDF
|
|
15
|
+
[RDF-star](https://www.w3.org/2021/12/rdf-star.html)
|
|
16
16
|
and [Notation3 (N3)](https://www.w3.org/TeamSubmission/n3/)
|
|
17
17
|
- [**Writing**](#writing) triples/quads to
|
|
18
18
|
[Turtle](https://www.w3.org/TR/turtle/),
|
|
19
19
|
[TriG](https://www.w3.org/TR/trig/),
|
|
20
20
|
[N-Triples](https://www.w3.org/TR/n-triples/),
|
|
21
21
|
[N-Quads](https://www.w3.org/TR/n-quads/)
|
|
22
|
-
and [RDF
|
|
22
|
+
and [RDF-star](https://www.w3.org/2021/12/rdf-star.html)
|
|
23
23
|
- [**Storage**](#storing) of triples/quads in memory
|
|
24
24
|
|
|
25
25
|
Parsing and writing is:
|
|
@@ -304,6 +304,13 @@ for (const quad of store.match(namedNode('http://ex.org/Mickey'), null, null))
|
|
|
304
304
|
console.log(quad);
|
|
305
305
|
```
|
|
306
306
|
|
|
307
|
+
If you are using multiple stores, you can reduce memory consumption by allowing them to share an entity index:
|
|
308
|
+
```JavaScript
|
|
309
|
+
const entityIndex = new N3.EntityIndex();
|
|
310
|
+
const store1 = new N3.Store([], { entityIndex });
|
|
311
|
+
const store2 = new N3.Store([], { entityIndex });
|
|
312
|
+
```
|
|
313
|
+
|
|
307
314
|
### [`DatasetCore` Interface](https://rdf.js.org/dataset-spec/#datasetcore-interface)
|
|
308
315
|
This store adheres to the `DatasetCore` interface which exposes the following properties
|
|
309
316
|
|
|
@@ -362,16 +369,16 @@ The N3.js parser and writer is fully compatible with the following W3C specifica
|
|
|
362
369
|
|
|
363
370
|
In addition, the N3.js parser also supports [Notation3 (N3)](https://www.w3.org/TeamSubmission/n3/) (no official specification yet).
|
|
364
371
|
|
|
365
|
-
The N3.js parser and writer are also fully compatible with the RDF
|
|
372
|
+
The N3.js parser and writer are also fully compatible with the RDF-star variants
|
|
366
373
|
of the W3C specifications.
|
|
367
374
|
|
|
368
375
|
The default mode is permissive
|
|
369
|
-
and allows a mixture of different syntaxes, including RDF
|
|
376
|
+
and allows a mixture of different syntaxes, including RDF-star.
|
|
370
377
|
Pass a `format` option to the constructor with the name or MIME type of a format
|
|
371
378
|
for strict, fault-intolerant behavior.
|
|
372
379
|
If a format string contains `star` or `*`
|
|
373
380
|
(e.g., `turtlestar` or `TriG*`),
|
|
374
|
-
RDF
|
|
381
|
+
RDF-star support for that format will be enabled.
|
|
375
382
|
|
|
376
383
|
### Interface specifications
|
|
377
384
|
The N3.js submodules are compatible with the following [RDF.js](http://rdf.js.org) interfaces:
|