Skip to content

Commit e976cf3

Browse files
committed
updated README
1 parent d78f129 commit e976cf3

File tree

1 file changed

+107
-41
lines changed

1 file changed

+107
-41
lines changed

README.md

Lines changed: 107 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,77 @@
11
# Databus Client Python
22

3-
## Install
3+
## Quickstart Example
4+
Commands to download the DBpedia Knowledge Graphs generated by Live Fusion.
5+
DBpedia Live Fusion publishes two different kinds of KGs:
6+
7+
1. Open Core Knowledge Graphs under CC-BY-SA license, open with copyleft/share-alike, no registration needed
8+
2. Industry Knowledge Graphs under BUSL 1.1 license, unrestricted for research and experimentation, commercial license for productive use, free registration needed.
9+
10+
11+
### Registration (Access Token)
12+
13+
1. If you do not have a DBpedia Account yet (Forum/Databus), please register at https://account.dbpedia.org
14+
2. Login at https://account.dbpedia.org and create your token.
15+
3. Save the token to a file `vault-token.dat`.
16+
17+
### Docker vs. Python
18+
The databus-python-client comes as **docker** or **python** with these patterns.
19+
`$DOWNLOADTARGET` can be any Databus URI including collections OR SPARQL query (or several thereof). Details are documented below.
420
```bash
21+
# Docker
22+
docker run --rm -v $(pwd):/data dbpedia/databus-python-client download $DOWNLOADTARGET --token vault-token.dat
23+
# Python
524
python3 -m pip install databusclient
25+
databusclient download $DOWNLOADTARGET --token vault-token.dat
26+
```
27+
28+
### Download Live Fusion KG Snapshot (BUSL 1.1, registration needed)
29+
TODO One slogan sentence. [More information](https://databus.dbpedia.org/dbpedia-enterprise/live-fusion-kg-snapshot)
30+
```bash
31+
docker run --rm -v $(pwd):/data dbpedia/databus-python-client download https://databus.dbpedia.org/dbpedia-enterprise/live-fusion-kg-snapshot --token vault-token.dat
32+
```
33+
34+
### Download Enriched Knowledge Graphs (BUSL 1.1, registration needed)
35+
**DBpedia Wikipedia Extraction Enriched**
36+
TODO One slogan sentence and link
37+
Currently EN DBpedia only.
38+
39+
```bash
40+
docker run --rm -v $(pwd):/data dbpedia/databus-python-client download https://databus.dbpedia.org/dbpedia-enterprise/dbpedia-wikipedia-kg-enriched-snapshot --token vault-token.dat
41+
```
42+
**DBpedia Wikidata Extraction Enriched**
43+
TODO One slogan sentence and link
44+
45+
```bash
46+
docker run --rm -v $(pwd):/data dbpedia/databus-python-client download https://databus.dbpedia.org/dbpedia-enterprise/dbpedia-wikidata-kg-enriched-snapshot --token vault-token.dat
647
```
748

49+
### Download DBpedia Wikipedia Knowledge Graphs (CC-BY-SA, no registration needed)
50+
TODO One slogan sentence and link
51+
52+
```bash
53+
docker run --rm -v $(pwd):/data dbpedia/databus-python-client download https://databus.dbpedia.org/dbpedia/dbpedia-wikipedia-kg-snapshot
54+
```
55+
### Download DBpedia Wikidata Knowledge Graphs (CC-BY-SA, no registration needed)
56+
TODO One slogan sentence and link
57+
58+
```bash
59+
docker run --rm -v $(pwd):/data dbpedia/databus-python-client download https://databus.dbpedia.org/dbpedia/dbpedia-wikidata-kg-snapshot
60+
```
61+
62+
## Docker Image Usage
63+
64+
A docker image is available at [dbpedia/databus-python-client](https://hub.docker.com/r/dbpedia/databus-python-client). See [download section](#usage-of-docker-image) for details.
65+
66+
867
## CLI Usage
68+
69+
**Installation**
70+
```bash
71+
python3 -m pip install databusclient
72+
```
73+
74+
**Running**
975
```bash
1076
databusclient --help
1177
```
@@ -26,47 +92,7 @@ Commands:
2692
download
2793
```
2894

29-
## Docker Image Usage
30-
31-
A docker image is available at [dbpedia/databus-python-client](https://hub.docker.com/r/dbpedia/databus-python-client). See [download section](#usage-of-docker-image) for details.
32-
33-
### Deploy command
34-
```
35-
databusclient deploy --help
36-
```
37-
```
38-
Usage: databusclient deploy [OPTIONS] DISTRIBUTIONS...
3995

40-
Arguments:
41-
DISTRIBUTIONS... distributions in the form of List[URL|CV|fileext|compression|sha256sum:contentlength] where URL is the
42-
download URL and CV the key=value pairs (_ separted)
43-
content variants of a distribution, fileExt and Compression can be set, if not they are inferred from the path [required]
44-
45-
Options:
46-
--version-id TEXT Target databus version/dataset identifier of the form <h
47-
ttps://databus.dbpedia.org/$ACCOUNT/$GROUP/$ARTIFACT/$VE
48-
RSION> [required]
49-
--title TEXT Dataset title [required]
50-
--abstract TEXT Dataset abstract max 200 chars [required]
51-
--description TEXT Dataset description [required]
52-
--license TEXT License (see dalicc.net) [required]
53-
--apikey TEXT API key [required]
54-
--help Show this message and exit.
55-
```
56-
Examples of using deploy command
57-
```
58-
databusclient deploy --version-id https://databus.dbpedia.org/user1/group1/artifact1/2022-05-18 --title title1 --abstract abstract1 --description description1 --license http://dalicc.net/licenselibrary/AdaptivePublicLicense10 --apikey MYSTERIOUS 'https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml|type=swagger'
59-
```
60-
61-
```
62-
databusclient deploy --version-id https://dev.databus.dbpedia.org/denis/group1/artifact1/2022-05-18 --title "Client Testing" --abstract "Testing the client...." --description "Testing the client...." --license http://dalicc.net/licenselibrary/AdaptivePublicLicense10 --apikey MYSTERIOUS 'https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml|type=swagger'
63-
```
64-
65-
A few more notes for CLI usage:
66-
67-
* The content variants can be left out ONLY IF there is just one distribution
68-
* For complete inferred: Just use the URL with `https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml`
69-
* If other parameters are used, you need to leave them empty like `https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml||yml|7a751b6dd5eb8d73d97793c3c564c71ab7b565fa4ba619e4a8fd05a6f80ff653:367116`
7096

7197
### Download command
7298
```
@@ -132,6 +158,46 @@ databusclient download https://databus.dbpedia.org/dbpedia/collections/dbpedia-s
132158
databusclient download 'PREFIX dcat: <http://www.w3.org/ns/dcat#> SELECT ?x WHERE { ?sub dcat:downloadURL ?x . } LIMIT 10' --databus https://databus.dbpedia.org/sparql
133159
```
134160

161+
### Deploy command
162+
```
163+
databusclient deploy --help
164+
```
165+
```
166+
Usage: databusclient deploy [OPTIONS] DISTRIBUTIONS...
167+
168+
Arguments:
169+
DISTRIBUTIONS... distributions in the form of List[URL|CV|fileext|compression|sha256sum:contentlength] where URL is the
170+
download URL and CV the key=value pairs (_ separted)
171+
content variants of a distribution, fileExt and Compression can be set, if not they are inferred from the path [required]
172+
173+
Options:
174+
--version-id TEXT Target databus version/dataset identifier of the form <h
175+
ttps://databus.dbpedia.org/$ACCOUNT/$GROUP/$ARTIFACT/$VE
176+
RSION> [required]
177+
--title TEXT Dataset title [required]
178+
--abstract TEXT Dataset abstract max 200 chars [required]
179+
--description TEXT Dataset description [required]
180+
--license TEXT License (see dalicc.net) [required]
181+
--apikey TEXT API key [required]
182+
--help Show this message and exit.
183+
```
184+
Examples of using deploy command
185+
```
186+
databusclient deploy --version-id https://databus.dbpedia.org/user1/group1/artifact1/2022-05-18 --title title1 --abstract abstract1 --description description1 --license http://dalicc.net/licenselibrary/AdaptivePublicLicense10 --apikey MYSTERIOUS 'https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml|type=swagger'
187+
```
188+
189+
```
190+
databusclient deploy --version-id https://dev.databus.dbpedia.org/denis/group1/artifact1/2022-05-18 --title "Client Testing" --abstract "Testing the client...." --description "Testing the client...." --license http://dalicc.net/licenselibrary/AdaptivePublicLicense10 --apikey MYSTERIOUS 'https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml|type=swagger'
191+
```
192+
193+
A few more notes for CLI usage:
194+
195+
* The content variants can be left out ONLY IF there is just one distribution
196+
* For complete inferred: Just use the URL with `https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml`
197+
* If other parameters are used, you need to leave them empty like `https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml||yml|7a751b6dd5eb8d73d97793c3c564c71ab7b565fa4ba619e4a8fd05a6f80ff653:367116`
198+
199+
200+
135201
#### Authentication with vault
136202

137203
For downloading files from the vault, you need to provide a vault token. See [getting-the-access-refresh-token](https://github.com/dbpedia/databus-vault-access?tab=readme-ov-file#step-1-getting-the-access-refresh-token) for details. You can come back here once you have a `vault-token.dat` file. To use it, just provide the path to the file with `--token /path/to/vault-token.dat`.

0 commit comments

Comments
 (0)