-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GITBOOK-23: change request with no subject merged in GitBook
- Loading branch information
1 parent
b6d6052
commit ea27216
Showing
10 changed files
with
164 additions
and
153 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
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
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,20 +1,25 @@ | ||
# Usage | ||
|
||
## Download Queries | ||
## Databus Client Parameters | ||
|
||
Various datasets are registered on the DBpedia Databus in the form of files. A download query specifies an exact selection of these records of the [DBpedia Databus](https://databus.dbpedia.org/) to be processed by the Databus Client. Therefore, the download query is one of, if not the most important parameter of the client. | ||
<table><thead><tr><th width="322.3333333333333">Option</th><th>Description</th><th>Default</th></tr></thead><tbody><tr><td>-s, --source</td><td>Set the source you want to convert. A source can either be a <code>[file/directory]</code> to convert already existing files, or a <code>[query file/query string/collection URI]</code> to convert queried files. Notice that query files must have <code>.sparql</code>/<code>.query</code> as extension to be recognized.</td><td></td></tr><tr><td>-e, --endpoint</td><td>Set the sparql endpoint, where the query should be fired to. If you use a collection you don't need this parameter, because its detected automatically. Otherwise its mandatory.</td><td></td></tr><tr><td>-t, --target</td><td>Set the target directory for converted files</td><td><code>./files/</code></td></tr><tr><td>-c, --compression</td><td>Set the compression format of the output file</td><td><code>same</code></td></tr><tr><td>-f, --format</td><td>Set the file format of the output file</td><td><code>same</code></td></tr><tr><td>-m, --mapping</td><td>Set the mapping file for format-conversion to different format equivalence class</td><td></td></tr><tr><td>-d, --delimiter</td><td>Set the delimiter (only necessary for some formats)</td><td>,</td></tr><tr><td>-q, --quotation</td><td>Set the quotation (only necessary for some formats)</td><td>"</td></tr><tr><td>--createMapping</td><td>Do you want to create mapping files for mapped sources?</td><td>false</td></tr><tr><td>-g, --graphURI</td><td>Set the graph uri for mapping from rdf triples to rdf quads</td><td></td></tr><tr><td>-b, --baseURI</td><td>set the base URI to resolve relative URIs</td><td></td></tr><tr><td>-o, --overwrite</td><td>true -> overwrite files in cache, false -> use cache</td><td><code>true</code></td></tr><tr><td>--clear</td><td>true -> clear Cache</td><td><code>false</code></td></tr><tr><td>--help</td><td>Show this message</td><td></td></tr></tbody></table> | ||
|
||
## Queries | ||
|
||
Various datasets are registered on the DBpedia Databus in the form of files. A query specifies an exact selection of these records of the [DBpedia Databus](https://databus.dbpedia.org/) to be processed by the Databus Client. Therefore, the query is one of, if not the most important parameter of the client. | ||
|
||
### Possible queries | ||
|
||
You can pass any query that selects the object of the predicate `dcat:downloadURL`, the name of the variable does not matter. The query should look like.\ | ||
`SELECT ?o WHERE { ?s dcat:downloadURL ?o}` | ||
You can pass any query that selects the object of the predicate `databus:file`, the name of the variable does not matter. The query should look like.\ | ||
`SELECT ?o WHERE { ?s databus:file ?o}` | ||
|
||
### How to pass queries | ||
|
||
There are three different ways to pass a query to the Databus Client: | ||
|
||
1. Pass the query string directly as a parameter. | ||
* **Note:** this option does not work for [cli.md](cli.md "mention") | ||
2. Save the query in a file and pass the file path as a parameter. | ||
* The file extension of the query file must be `.sparql` or `.query`. | ||
3. Collection URIs are also supported. The client receives the associated query itself. | ||
* e.g. `https://databus.dbpedia.org/jfrey/collections/id-management_links` | ||
* e.g. [https://dev.databus.dbpedia.org/testuser/collections/testcollection/](https://dev.databus.dbpedia.org/testuser/collections/testcollection/) |
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
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,12 +1,44 @@ | ||
# JAR | ||
|
||
Instead of cloning the whole repository, you can only download the`databus-client.jar` of the latest [Databus Client release](https://github.com/dbpedia/databus-client/releases/latest).  | ||
Instead of cloning the whole repository, you can only download the `databus-client.jar` of the latest [Databus Client release](https://github.com/dbpedia/databus-client/releases/latest).  | ||
|
||
The parameter options are similar to these ones shown in [#cli-options](cli.md#cli-options "mention") | ||
The parameter options are shown in [#databus-client-parameters](./#databus-client-parameters "mention") | ||
|
||
### Execution example | ||
### Requirements | ||
|
||
* **Java:** `JDK 11` | ||
|
||
## Execution example | ||
|
||
### Select Data | ||
|
||
First we need to specify, the data we want to download. | ||
|
||
**Note:** _It is best practice to write a query to a file and pass this file as source, instead of passing the query directly as a string._ | ||
|
||
``` | ||
java -jar databus-client-1.0-SNAPSHOT.jar -s "https://databus.dbpedia.org/rogargon/collections/browsable_core" | ||
echo "PREFIX dcat: <http://www.w3.org/ns/dcat#> | ||
PREFIX databus: <https://dataid.dbpedia.org/databus#> | ||
SELECT ?file WHERE | ||
{ | ||
GRAPH ?g | ||
{ | ||
?dataset databus:artifact <https://dev.databus.dbpedia.org/tester/testgroup/testartifact> . | ||
{ ?distribution <http://purl.org/dc/terms/hasVersion> '2023-06-23' . } | ||
?dataset dcat:distribution ?distribution . | ||
?distribution databus:file ?file . | ||
} | ||
}" > query.sparql | ||
``` | ||
|
||
### Download and Convert Data | ||
|
||
Then we can download the selected data, and convert it to ntriple files. | ||
|
||
``` | ||
java -jar databus-client.jar \ | ||
-s "query.sparql" \ | ||
-e "https://dev.databus.dbpedia.org/sparql" \ | ||
-f nt | ||
``` |
Oops, something went wrong.