- One package to get a working SPARQL client in javascript or React
- Powerful templating for queries via placeholder variables
- Client-level prefix management
- Automated results parsing
- Query validation out-of-the-box
- Fully customisable behaviour via "exchanges"
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.
npm install @databorg/client
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` },
});
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
.
Licensed under MIT.