6.0.1 • Public • Published


quadstore-http exposes quadstore's features via HTTP endpoints.

Current version

Current version: v6.0.1 [See on NPM].

quadstore-http is maintained alongside quadstore and versioned accordingly. Equal major version numbers imply compatibility between the two modules.


  • Uses Semantic Versioning. Pre-releases are tagged accordingly.
  • The master branch is kept in sync with NPM and all development work happens on the devel branch and/or issue-specific branches.
  • Requires Node.js >= 8.0.0.



The exported HttpServer class extends http.Server and requires instances of both quadstore.RdfStore and quadstore-sparql:

  const memdown = require('memdown');
  const quadstore = require('quadstore');
  const SparqlEngine = require('quadstore-sparql');
  const HttpServer = require('quadstore-http');

  const db = memdown();
  const rdfStore = new quadstore.RdfStore(db);
  const sparqlEngine = new SparqlEngine(rdfStore);
  const opts = {
    baseUrl: ''
  const server = new HttpServer(rdfStore, sparqlEngine, opts);

  server.listen(8080, '', (err) => {
    if (err) throw err;

GET /match

Mirrors RDF/JS's Source.match() method. Returns quads serialized either in application/n-quads or application/trig matching the specified query parameters.

Supported parameters are subject, predicate, object, graph, offset and limit.


Values for the subject, predicate, object and graph parameters must be serialized using Ruben Verborgh's N3 library and must be urlencoded.

POST /import

Mirrors RDF/JS's Sink.import() method. Accepts a payload of quads serialized either in application/n-quads or application/trig and imports them into the store.


This endpoint parses RDF payloads using the N3 library. N3's default behaviour is to prefix blank node labels with a b{digit}_ prefix, with the {digit} part being a positive number that grows with each new import. This is done to prevent naming collisions of unrelated blank nodes and can be disabled by setting the blank-node-prefix query parameter to an empty string:


POST /delete

Mirrors RDF/JS's Store.delete() method. Accepts a payload of quads serialized either in application/n-quads or application/trig and deletes them from the store.


GET /ldf

Provides a Linked Data Fragments endpoint implementing the Triple Pattern Fragments (TPF) interface for use with suitable clients.


In order to support quads instead of triples, this endpoint is tested using our own fork of the Client.js library. The fork tracks the feature-qpf-latest branch of the upstream repository and merges in fixes from other branches. We will switch to the NPM version of Client.js (ldf-client) in the near future.

GET,POST /sparql

Provides a SPARQL 1.1 Protocol endpoint be used with suitable clients.

Package Sidebar


npm i quadstore-http

Weekly Downloads






Unpacked Size

30.1 kB

Total Files


Last publish


  • jacoscaz