rdf-fetch
v0.3.2 rdf rdf-ext fetch
RDF-Ext Fetch
Uses Fetch to send and receive RDFJS quad streams over HTTP.
rdf-format-commons
is used to serialize and parse the quads.
Usage
rdf-fetch
serializes the quad stream given in the body
options based on the Content-Type
header, rdfFetch.defaults.contentType
or the first serializer found in the formats bundle.
The response object contains the quadStream
methods which returns parser stream as a Promise
.
const rdfFetch = require('rdf-fetch')
rdfFetch('http://...', {method: 'post', body: requestStream}).then((response) => {
return response.quadStream()
}).then((responseStream) => {
...
})
The dataset
method of the response pipes the quad stream into a Dataset and returns it as a Promise
.
rdfFetch('http://...', {method: 'post', body: requestStream}).then((response) => {
return response.dataset()
}).then((dataset) => {
...
})
Examples
The examples folder contains examples how to send and receive quads.
Options
fetch
can be used to replace the default isomorphic-fetch Fetch library.formats
can be used to replace the default parser and serializer bundle rdf-formats-commons.
npm i [email protected]
Metadata
- MIT
- Whatever
- Thomas Bergwinkl
- released 6/19/2016