npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

quadstore-http

v6.0.1

Published

A http layer for quadstore

Downloads

3

Readme

quadstore-http

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.

Notes

  • 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.

Usage

HttpServer

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: 'http://127.0.0.1:8080'
  };
  const server = new HttpServer(rdfStore, sparqlEngine, opts);

  server.listen(8080, '127.0.0.1', (err) => {
    if (err) throw err;
    console.log(`Listening!`);
  });

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.

GET http://127.0.0.1:8080/match?subject=<value>&offset=10&limit=10

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.

POST http://127.0.0.1:8080/import

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 http://127.0.0.1:8080/import?blank-node-prefix=

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.

POST http://127.0.0.1:8080/delete

GET /ldf

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

GET http://127.0.0.1:8080/ldf?page=2

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.