-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 80747d1
Showing
75 changed files
with
8,801 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
name: Release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
release: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: '16.x' | ||
registry-url: 'https://registry.npmjs.org' | ||
- name: install | ||
run: npm ci | ||
- name: test | ||
run: npm run test:ci | ||
- name: build | ||
run: npm run build | ||
- name: publish | ||
run: npm publish --access public | ||
env: | ||
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
name: Build | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Use Node.js 16 | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: install | ||
run: npm ci | ||
- name: test | ||
run: npm run test:ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.swc | ||
dist/ | ||
dist-map | ||
coverage/ | ||
node_modules/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
<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. |
Oops, something went wrong.