Skip to content

Commit 66f1c8e

Browse files
authored
Merge branch 'main' into nextcloudclient
2 parents 800256c + cfdca3b commit 66f1c8e

2 files changed

Lines changed: 136 additions & 41 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Build and push Docker image to DockerHub
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
workflow_dispatch: # allows manual trigger
7+
8+
jobs:
9+
push_to_registry:
10+
name: Push Docker image to Docker Hub
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Check out the repo
15+
uses: actions/checkout@v3
16+
17+
- name: Log in to Docker Hub
18+
uses: docker/login-action@v3
19+
with:
20+
username: ${{ secrets.DBP_DOCKERHUB_CREDENTIAL_USERNAME }}
21+
password: ${{ secrets.DBP_DOCKERHUB_CREDENTIAL_TOKEN_PUSHIMAGES }}
22+
23+
- name: Build and push Docker image
24+
uses: docker/build-push-action@v6
25+
with:
26+
context: .
27+
push: true
28+
tags: dbpedia/databus-python-client:latest

README.md

Lines changed: 108 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,62 @@
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
47+
```
48+
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
660
```
761

862
## Deploy to Databus
@@ -47,7 +101,20 @@ python deploy.py \
47101
/home/theo/Work/SCADS.AI/Projects/CSVTest/output.csv.bz2
48102

49103
```
104+
105+
## Docker Image Usage
106+
107+
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.
108+
109+
50110
## CLI Usage
111+
112+
**Installation**
113+
```bash
114+
python3 -m pip install databusclient
115+
```
116+
117+
**Running**
51118
```bash
52119
databusclient --help
53120
```
@@ -68,47 +135,7 @@ Commands:
68135
download
69136
```
70137

71-
## Docker Image Usage
72-
73-
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.
74-
75-
### Deploy command
76-
```
77-
databusclient deploy --help
78-
```
79-
```
80-
Usage: databusclient deploy [OPTIONS] DISTRIBUTIONS...
81-
82-
Arguments:
83-
DISTRIBUTIONS... distributions in the form of List[URL|CV|fileext|compression|sha256sum:contentlength] where URL is the
84-
download URL and CV the key=value pairs (_ separted)
85-
content variants of a distribution, fileExt and Compression can be set, if not they are inferred from the path [required]
86-
87-
Options:
88-
--version-id TEXT Target databus version/dataset identifier of the form <h
89-
ttps://databus.dbpedia.org/$ACCOUNT/$GROUP/$ARTIFACT/$VE
90-
RSION> [required]
91-
--title TEXT Dataset title [required]
92-
--abstract TEXT Dataset abstract max 200 chars [required]
93-
--description TEXT Dataset description [required]
94-
--license TEXT License (see dalicc.net) [required]
95-
--apikey TEXT API key [required]
96-
--help Show this message and exit.
97-
```
98-
Examples of using deploy command
99-
```
100-
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'
101-
```
102-
103-
```
104-
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'
105-
```
106138

107-
A few more notes for CLI usage:
108-
109-
* The content variants can be left out ONLY IF there is just one distribution
110-
* For complete inferred: Just use the URL with `https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml`
111-
* 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`
112139

113140
### Download command
114141
```
@@ -174,6 +201,46 @@ databusclient download https://databus.dbpedia.org/dbpedia/collections/dbpedia-s
174201
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
175202
```
176203

204+
### Deploy command
205+
```
206+
databusclient deploy --help
207+
```
208+
```
209+
Usage: databusclient deploy [OPTIONS] DISTRIBUTIONS...
210+
211+
Arguments:
212+
DISTRIBUTIONS... distributions in the form of List[URL|CV|fileext|compression|sha256sum:contentlength] where URL is the
213+
download URL and CV the key=value pairs (_ separted)
214+
content variants of a distribution, fileExt and Compression can be set, if not they are inferred from the path [required]
215+
216+
Options:
217+
--version-id TEXT Target databus version/dataset identifier of the form <h
218+
ttps://databus.dbpedia.org/$ACCOUNT/$GROUP/$ARTIFACT/$VE
219+
RSION> [required]
220+
--title TEXT Dataset title [required]
221+
--abstract TEXT Dataset abstract max 200 chars [required]
222+
--description TEXT Dataset description [required]
223+
--license TEXT License (see dalicc.net) [required]
224+
--apikey TEXT API key [required]
225+
--help Show this message and exit.
226+
```
227+
Examples of using deploy command
228+
```
229+
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'
230+
```
231+
232+
```
233+
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'
234+
```
235+
236+
A few more notes for CLI usage:
237+
238+
* The content variants can be left out ONLY IF there is just one distribution
239+
* For complete inferred: Just use the URL with `https://raw.githubusercontent.com/dbpedia/databus/master/server/app/api/swagger.yml`
240+
* 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`
241+
242+
243+
177244
#### Authentication with vault
178245

179246
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)