2.3.0 • Published 2 years ago

sparql-proxy v2.3.0

Weekly downloads
15
License
MIT
Repository
github
Last release
2 years ago

sparql-proxy

This middleware forwards SPARQL queries to a SPARQL endpoint. It supports GET and POST (direct and URL-encoded) query requests and basic authentication.

Usage

The module exports a function to build a middleware. The function must be called with a single options object. The following options are supported:

  • endpointUrl: The URL of the SPARQL endpoint
  • authentication: Credentials for basic authentication (object with user and password property)
  • queryOperation: The query operation which will be used to access the SPARQL endpoint (default: postQueryDirect)
  • fetchOptions: an object that will be merged (and potentially override) with node-fetch options used for the request from the proxy to the SPARQL endpoint. It can be used to override fetch headers: fetchOptions.headers

Example

// load the module
const sparqlProxy = require('sparql-proxy')

// create a middleware instance and add it to the routing
app.use(sparqlProxy({
  endpointUrl: 'https://dbpedia.org/sparql'
})

Debug

This package uses debug, you can get debug logging via: DEBUG=sparql-proxy.
Since Trifid makes heavy use of this package, using DEBUG=trifid:* also enables logging in this package.

2.3.0

2 years ago

2.2.2

5 years ago

2.2.1

5 years ago

2.2.0

5 years ago

2.1.1

5 years ago

2.1.0

5 years ago

2.0.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago