0.9.8 • Published 6 years ago

dbpedia-sparql-client v0.9.8

Weekly downloads
12
License
MIT
Repository
github
Last release
6 years ago

dbpedia-sparql-client

A promisified DBpedia SPARQL client that keeps it simple.

Install

npm install dbpedia-sparql-client

Note:

Requires fetch when running in a browser. If fetch is not available, install a fetch polyfill

Use

ES2015

import dps from 'dbpedia-sparql-client';
const query = `SELECT DISTINCT ?Concept WHERE {[] a ?Concept} LIMIT 10`;

dps
  .client() 
  .query(query)
  .timeout(15000) // optional, defaults to 10000
  .asJson()       // or asXml()
  .then(r => { /* handle success */})
  .catch(e => { /* handle error */});

ES5

var dps = require('dbpedia-sparql-client').default;
var query = 'SELECT DISTINCT ?Concept WHERE {[] a ?Concept} LIMIT 10';

dps.client()
  .query(query)
  .timeout(15000) // optional, defaults to 10000
  .asJson() // or asXml()
  .then(function(r) { /* handle success */ })
  .catch(function(e) { /* handle error */ });

License

MIT

0.9.8

6 years ago

0.9.7

6 years ago

0.9.6

7 years ago

0.9.4

8 years ago

0.9.3

8 years ago

0.9.2

8 years ago

0.9.1

8 years ago

0.8.8

8 years ago

0.8.7

8 years ago

0.8.6

8 years ago

0.8.5

8 years ago

0.8.4

8 years ago

0.8.3

8 years ago

0.8.2

8 years ago

0.8.1

8 years ago