File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -81,6 +81,23 @@ myParser.write(`}}`);
8181myParser .end ();
8282```
8383
84+ ### Convert a JSON-LD string to an RDF/JS dataset
85+
86+ ``` javascript
87+ import { Store } from ' n3' ;
88+ import { JsonLdParser } from ' jsonld-streaming-parser' ;
89+ import { promisifyEventEmitter } from ' event-emitter-promisify' ;
90+
91+ const store = new Store ();
92+ const parser = new JsonLdParser ();
93+ parser .write (' {"@id": "http://example.org/jesse", "@type": "http://example.org/Thing"}' );
94+ parser .end ();
95+ await promisifyEventEmitter (store .import (parser));
96+
97+ // Logs all the quads in the store
98+ console .log (... store);
99+ ```
100+
84101### Import streams
85102
86103This parser implements the RDFJS [ Sink interface] ( https://rdf.js.org/#sink-interface ) ,
You can’t perform that action at this time.
0 commit comments