# @databorg/client

> Highly versatile SPARQL client for modern age

Latest version **1.1.0** (published 2022-05-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @databorg/client
pnpm add @databorg/client
yarn add @databorg/client
bun add @databorg/client
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.0 |
| Published | 2022-05-20 |
| First published | 2022-04-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 4 |
| Unpacked size | 184.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Tim Ermilov |
| Maintainers | yamalight |
| Keywords | sparql, rdf, client, sparql client, sparql-client, databorg |

## Links

- npm: https://www.npmjs.com/package/@databorg/client
- npm.io page: https://npm.io/package/@databorg/client

## Dependencies (4)

- [n3](https://npm.io/package/n3.md) ^1.16.2
- [jsonld](https://npm.io/package/jsonld.md) ^5.2.0
- [hash.js](https://npm.io/package/hash.js.md) ^1.1.7
- [sparqljs](https://npm.io/package/sparqljs.md) ^3.5.1

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 1.1.0 (latest) — 2022-05-20
- 1.0.0 — 2022-04-14
- 0.9.0 — 2022-04-14

## README

<div align="center">
  <h1>@databorg/client</h1>

  <br />

  <strong>
    Highly versatile SPARQL client for modern age
  </strong>
</div>

## Features

- **One package** to get a working SPARQL client in javascript or React
- Powerful **templating** for queries [via placeholder variables](./docs/Basics.md#templating)
- Client-level [prefix management](./docs/Basics.md#setting-up-the-client)
- Automated [results parsing](./docs/Basics.md#results-parsing)
- Query validation out-of-the-box
- Fully **customisable** behaviour [via "exchanges"](./docs/Basics.md#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.

## Installation

```sh
npm install @databorg/client
```

## Basic usage

```js
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](./docs/Basics.md)** — contains the "Getting Started" guide and all you need to know when first using `@databorg/client`.

## License

Licensed under MIT.

---
_Source: https://npm.io/package/@databorg/client · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
