@databorg/client
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

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

Package Sidebar

Install

npm i @databorg/client

Weekly Downloads

2

Version

1.1.0

License

MIT

Unpacked Size

189 kB

Total Files

105

Last publish

Collaborators

  • yamalight