rdf-dereference-store
Version:
Dereference RDF to a store
33 lines (24 loc) • 1.66 kB
Markdown
using [rdf-dereference](https://www.npmjs.com/package/rdf-dereference).
[](https://github.com/jeswr/rdf-dereference-store.js/blob/master/LICENSE)
[](https://www.npmjs.com/package/rdf-dereference-store)
[](https://github.com/jeswr/rdf-dereference-store.js/tree/main/)
[](https://dependabot.com/)
[](https://github.com/semantic-release/semantic-release)
```ts
import fs from 'fs';
import dereference, { parse } from 'rdf-dereference-store';
// Fetch store from a remote document
const { store } = await dereference('https://www.jeswr.org/#me');
// Fetch store from a local document
const { store } = await dereference('/path/to/file.ttl', { localFiles: true });
// Fetch store from an input stream
const { store } = await parse(fs.createReadStream('/path/to/file.ttl'), { contentType: 'text/turtle' });
// Fetch store from an input string
const { store } = await parse(fs.readFileSync('/path/to/file.ttl').toString(), { contentType: 'text/turtle' });
```
©2024–present
[ ](https://github.com/jeswr),
[ ](https://github.com/jeswr/rdf-dereference-store.js/blob/master/LICENSE).
Dereference a remote dataset to a store