Skip to content

Commit

Permalink
Prepara public v1.0 release
Browse files Browse the repository at this point in the history
  • Loading branch information
yamalight committed Apr 14, 2022
0 parents commit 80747d1
Show file tree
Hide file tree
Showing 75 changed files with 8,801 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/release.yml
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 }}
17 changes: 17 additions & 0 deletions .github/workflows/test.yml
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.swc
dist/
dist-map
coverage/
node_modules/
63 changes: 63 additions & 0 deletions README.md
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.
Loading

0 comments on commit 80747d1

Please sign in to comment.