diff --git a/databus-mods-server/databus-mods-server-core/template-application.yml b/databus-mods-server/databus-mods-server-core/template-application.yml new file mode 100644 index 0000000..59ea715 --- /dev/null +++ b/databus-mods-server/databus-mods-server-core/template-application.yml @@ -0,0 +1,143 @@ +# spring server configuration +server: + port: 9050 + +# spring +spring: + datasource: + driver-class-name: 'org.apache.derby.jdbc.EmbeddedDriver' + username: '' + password: '' + url: 'jdbc:derby:derby;create=true' + jpa: + hibernate: + ddl-auto: 'create-drop' +# ddl-auto: 'update' + +# configuration for the mod server +mod-server: + # storage for the raw metadata documents + volume: ./target/repo + web-base: "https://mods.tools.dbpedia.org/main/" + triple-store: + db-url: 'jdbc:virtuoso://localhost:11111/charset=UTF-8/' + db-user: 'dba' + db-password: '' + endpoint: 'http://localhost:8890/sparql' + schedule: + online-period: 604800000 + # online-check: 5000 + online-check: 86400000 + # task-updates: -1 + task-updates: 3600000 + +mods: + - name: 'filemetric' + accept: 'file' + select: 'file-metrics.ttl' + workers: + - 'http://localhost:14100-14114/modApi' + query: ' +PREFIX dataid: +PREFIX dcat: +PREFIX dct: + +SELECT DISTINCT * WHERE { + { + SELECT ?issued ?file ?downloadURL ?sha256sum { + ?d dataid:file ?file . + ?d dataid:sha256sum ?sha256sum . + ?d dct:issued ?issued . + ?d dcat:downloadURL ?downloadURL . + { + SELECT ?file { + ?s a dataid:Dataset. + ?s dcat:distribution/dataid:file ?file + } + } + } ORDER BY DESC(?issued) + } +} +' + - name: 'mimetype' + accept: 'file' + select: + workers: + - 'http://localhost:14000-14004/modApi' + query: ' +PREFIX dataid: +PREFIX dcat: +PREFIX dct: +SELECT DISTINCT * WHERE { + { + SELECT ?issued ?file ?downloadURL ?sha256sum { + ?d dataid:file ?file . + ?d dataid:sha256sum ?sha256sum . + ?d dct:issued ?issued . + ?d dcat:downloadURL ?downloadURL . + { + SELECT ?file { + ?s a dataid:Dataset. + ?s dcat:distribution/dataid:file ?file + } + } + } ORDER BY DESC(?issued) + } +} +' + - name: 'void' + accepts: + - 'file' + selects: + - 'rdfVoid.ttl' + workers: + - 'http://localhost:14200-14214/modApi' + query: ' + PREFIX dataid: + PREFIX dcat: + PREFIX dct: + +SELECT DISTINCT * WHERE { + { + SELECT ?issued ?file ?downloadURL ?sha256sum { + ?d dataid:file ?file . + ?d dataid:sha256sum ?sha256sum . + ?d dct:issued ?issued . + ?d dcat:downloadURL ?downloadURL . + { + SELECT ?file { + ?s a dataid:Dataset. + ?s dataid:account . + ?s dcat:distribution/dataid:file ?file + } + } + } ORDER BY DESC(?issued) + } + } + +' + - name: 'spo' + accept: 'file' + select: + workers: + - 'http://localhost:14300-14309/modApi' + query: ' +PREFIX xsd: +PREFIX dataid: +PREFIX dct: +PREFIX dcat: +PREFIX db: +PREFIX dataid-cv: + +SELECT ?file ?issued ?sha256sum ?downloadURL WHERE { + ?s dct:publisher . + ?s dataid:file ?file . + ?s dct:issued ?issued . + ?s dataid:sha256sum ?sha256sum . + ?s dcat:downloadURL ?downloadURL . + ?s dataid-cv:type ?cv . + FILTER( str(?cv) = "parsed") + ?s dataid:formatExtension ?ext . + FILTER( str(?ext) = "nt" ) +} +' \ No newline at end of file diff --git a/doc/server.md b/doc/server.md new file mode 100644 index 0000000..a661ce2 --- /dev/null +++ b/doc/server.md @@ -0,0 +1,54 @@ +# Quickstart Server + +Quickstart guide to configure and run Databus Mods Server. + +## Prerequisites +- Java: > 17 +- Maven: > 3.8.4 +- Storage + - RDF Store and Sparql Server + - Http Web Server + +## Setup + +The Databus Mods Server can run natively with local installed Maven and Java or inside docker. + +## Install + +```bash +git clone $THIS_REPO +cd databus-mods +mvn clean compile +``` + +## Configure + +As the server is implemented with Spring Boot, all configuration paramters are defined in a spring application configuration file `application.properties` or `application.yml`. + +```yaml +# Minimal example application yml + +``` + +## Run with Maven and Java + +## Run with Docker-Compose + +### Build Image + +```bash +docker built -t dbpedia/databus-mods-server . +``` + +### Start Containers + +```yaml +version: '3' + +services: + server: + image: + +# todo https://github.com/docker/compose/issues/1896 +``` +