Skip to content

Highly versatile SPARQL client for modern age

Notifications You must be signed in to change notification settings

DataBorg/client

Repository files navigation

@databorg/client


Highly versatile SPARQL client for modern age

Features

While SPARQL is an great language, client libraries today typically come with a limited set of features and offload the additional work to developers who are using them.
We aim to create a more powerful and developer-friendly out-of-the-box experience instead.

Installation

npm install @databorg/client

Basic usage

import { DataborgClient, url } from '@databorg/client';

// create new client
const client = new DataborgClient({
  queryEndpoint: 'https://dbpedia.org/sparql',
});

// execute a query
const result = await client.query({
  query: `SELECT ?p ?o WHERE { ?uri ?p ?label } LIMIT 5`,
  variables: {
    uri: url`http://dbpedia.org/ontology/deathDate`,
    label: 'Hello world!',
  },
});

// execute an update
const result = await client.update({
  query: `INSERT DATA { var:uri a dbpedia:Resource . }`,
  variables: { uri: url`http://dbpedia.org/Test` },
});

Documentation

The documentation contains everything you need to know about @databorg/client:

  • Basics — contains the "Getting Started" guide and all you need to know when first using @databorg/client.

License

Licensed under MIT.