rdf-fetch

v1.0.0
Uses Fetch to send and receive RDF-Ext Graphs over HTTP
rdf rdf-ext fetch

RDF-Ext Fetch

Build Status npm version

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

npm i rdf-fetch

Metadata

  • MIT
  • Whatever
  • Thomas Bergwinkl
  • released 7/29/2017

Downloads

Maintainers