This package has been deprecated

Author message:

This package is deprecated and got replaced by @rdfjs/fetch

rdf-fetch

1.0.0 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i rdf-fetch

Weekly Downloads

19

Version

1.0.0

License

MIT

Last publish

Collaborators

  • bergos