From 3f8d406b0f44afc2d6928a44e103d613031c3f48 Mon Sep 17 00:00:00 2001 From: Ivan Subotic <400790+subotic@users.noreply.github.com> Date: Fri, 3 Jul 2020 00:51:26 +0200 Subject: [PATCH] fix: loading of data (DSP-445) (#1669) --- KnoraBuild.sbt | 3 +- Makefile | 8 +- webapi/scripts/fuseki-ci-prepare.sh | 1 - webapi/scripts/fuseki-dump-repository.sh | 2 +- webapi/scripts/fuseki-functions.sh | 94 +++++++++++++++++++ .../scripts/fuseki-init-knora-test-minimal.sh | 85 +---------------- .../fuseki-init-knora-test-unit-minimal.sh | 85 +---------------- webapi/scripts/fuseki-init-knora-test-unit.sh | 86 +---------------- webapi/scripts/fuseki-init-knora-test.sh | 86 +---------------- .../fuseki-knora-test-repository-config.ttl | 54 ----------- ... => fuseki-repository-config.ttl.template} | 9 +- .../http/HttpTriplestoreConnector.scala | 4 +- 12 files changed, 119 insertions(+), 398 deletions(-) delete mode 100755 webapi/scripts/fuseki-ci-prepare.sh create mode 100644 webapi/scripts/fuseki-functions.sh delete mode 100644 webapi/scripts/fuseki-knora-test-repository-config.ttl rename webapi/scripts/{fuseki-knora-test-unit-repository-config.ttl => fuseki-repository-config.ttl.template} (92%) diff --git a/KnoraBuild.sbt b/KnoraBuild.sbt index 32bc45fd1c..489e7b4a11 100644 --- a/KnoraBuild.sbt +++ b/KnoraBuild.sbt @@ -415,8 +415,7 @@ lazy val webapi = knoraModule("webapi") (rootBaseDir.value / "knora-ontologies" / "salsah-gui.ttl") -> "knora-ontologies/salsah-gui.ttl", (rootBaseDir.value / "knora-ontologies" / "standoff-data.ttl") -> "knora-ontologies/standoff-data.ttl", (rootBaseDir.value / "knora-ontologies" / "standoff-onto.ttl") -> "knora-ontologies/standoff-onto.ttl", - (rootBaseDir.value / "webapi" / "scripts" / "fuseki-knora-test-repository-config.ttl") -> "webapi/scripts/fuseki-knora-test-repository-config.ttl", - (rootBaseDir.value / "webapi" / "scripts" / "fuseki-knora-test-unit-repository-config.ttl") -> "webapi/scripts/fuseki-knora-test-unit-repository-config.ttl", + (rootBaseDir.value / "webapi" / "scripts" / "fuseki-repository-config.ttl.template") -> "webapi/scripts/fuseki-repository-config.ttl.template" ), // contentOf("salsah1/src/main/resources").toMap.mapValues("config/" + _) // (rootBaseDir.value / "knora-ontologies") -> "knora-ontologies", diff --git a/Makefile b/Makefile index bfe0421b26..2e3efb38ea 100644 --- a/Makefile +++ b/Makefile @@ -232,14 +232,12 @@ test: build-all-images ## runs all tests. sbt webapi/test webapi/it:test .PHONY: test-repository-update -test-repository-update: stack-down-delete-volumes stack-without-api - @sleep 15 - @$(MAKE) -f $(THIS_FILE) init-db-test-minimal +test-repository-update: init-db-test-minimal @rm -rf /tmp/knora-test-data/v7.0.0/ @mkdir -p /tmp/knora-test-data/v7.0.0/ @unzip $(CURRENT_DIR)/test-data/v7.0.0/v7.0.0-knora-test.trig.zip -d /tmp/knora-test-data/v7.0.0/ - $(CURRENT_DIR)/webapi/scripts/fuseki-empty-repository.sh -r knora-test -u gaga -p gaga -h localhost:3030 - $(CURRENT_DIR)/webapi/scripts/fuseki-upload-repository.sh -r knora-test -u gaga -p gaga -h localhost:3030 /tmp/knora-test-data/v7.0.0/v7.0.0-knora-test.trig + $(CURRENT_DIR)/webapi/scripts/fuseki-empty-repository.sh -r knora-test -u admin -p test -h localhost:3030 + $(CURRENT_DIR)/webapi/scripts/fuseki-upload-repository.sh -r knora-test -u admin -p test -h localhost:3030 /tmp/knora-test-data/v7.0.0/v7.0.0-knora-test.trig @$(MAKE) -f $(THIS_FILE) stack-restart-api @$(MAKE) -f $(THIS_FILE) stack-logs-api-no-follow diff --git a/webapi/scripts/fuseki-ci-prepare.sh b/webapi/scripts/fuseki-ci-prepare.sh deleted file mode 100755 index f1f641af19..0000000000 --- a/webapi/scripts/fuseki-ci-prepare.sh +++ /dev/null @@ -1 +0,0 @@ -#!/usr/bin/env bash diff --git a/webapi/scripts/fuseki-dump-repository.sh b/webapi/scripts/fuseki-dump-repository.sh index 08a6d73440..5adc702003 100755 --- a/webapi/scripts/fuseki-dump-repository.sh +++ b/webapi/scripts/fuseki-dump-repository.sh @@ -53,4 +53,4 @@ if [[ -z "${HOST}" ]]; then HOST="localhost:8080" fi -curl -sS -X GET -H "Accept: application/trig" -u "${USERNAME}:${PASSWORD}" "http://${HOST}/fuseki/${REPOSITORY}" > "${FILE}" +curl -sS -X GET -H "Accept: application/trig" -u "${USERNAME}:${PASSWORD}" "http://${HOST}/${REPOSITORY}" > "${FILE}" diff --git a/webapi/scripts/fuseki-functions.sh b/webapi/scripts/fuseki-functions.sh new file mode 100644 index 0000000000..a3ebd12957 --- /dev/null +++ b/webapi/scripts/fuseki-functions.sh @@ -0,0 +1,94 @@ +#!/usr/bin/env bash + +#set -x + +POSITIONAL=() +while [[ $# -gt 0 ]]; do + key="$1" + + case $key in + -r | --repository) + REPOSITORY="$2" + shift # past argument + shift # past value + ;; + -u | --username) + USERNAME="$2" + shift # past argument + shift # past value + ;; + -p | --password) + PASSWORD="$2" + shift # past argument + shift # past value + ;; + -h | --host) + HOST="$2" + shift # past argument + shift # past value + ;; + *) # unknown option + POSITIONAL+=("$1") # save it in an array for later + shift # past argument + ;; + esac +done +set -- "${POSITIONAL[@]}" # restore positional parameters + +FILE="$1" + +if [[ -z "${REPOSITORY}" ]]; then + REPOSITORY="knora-test" +fi + +if [[ -z "${HOST}" ]]; then + HOST="localhost:3030" +fi + +if [[ -z "${USERNAME}" ]]; then + USERNAME="admin" +fi + +if [[ -z "${PASSWORD}" ]]; then + PASSWORD="test" +fi + +delete-repository() { + STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -X DELETE http://${HOST}/\$/datasets/${REPOSITORY}) + + if [ "${STATUS}" -eq 200 ]; then + echo "==> delete repository done" + return 0 + else + echo "==> delete repository failed" + return 1 + fi +} + +create-repository() { + REPOSITORY_CONFIG=$(sed "s/@REPOSITORY@/${REPOSITORY}/g" ./fuseki-repository-config.ttl.template) + STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -H "Content-Type:text/turtle; charset=utf-8" --data-raw "${REPOSITORY_CONFIG}" -X POST http://${HOST}/\$/datasets) + + if [ "${STATUS}" -eq 200 ]; then + echo "==> create repository done" + return 0 + else + echo "==> create repository failed" + return 1 + fi +} + +upload-graph() { + STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -H "Content-Type:text/turtle; charset=utf-8" --data-binary @$1 -X PUT http://${HOST}/${REPOSITORY}\?graph\="$2") + + if [ "${STATUS}" -eq 201 ]; then + echo "==> 201 Created: $1 -> $2" + return 0 + elif [ "${STATUS}" -eq 200 ]; then + echo "==> 200 OK: $1 -> $2" + return 0 + else + echo "==> failed with status code ${STATUS}: $1 -> $2" + return 1 + fi +} diff --git a/webapi/scripts/fuseki-init-knora-test-minimal.sh b/webapi/scripts/fuseki-init-knora-test-minimal.sh index e4a9bfda31..f6e94cbe7b 100755 --- a/webapi/scripts/fuseki-init-knora-test-minimal.sh +++ b/webapi/scripts/fuseki-init-knora-test-minimal.sh @@ -1,90 +1,11 @@ #!/usr/bin/env bash -#set -x - -POSITIONAL=() -while [[ $# -gt 0 ]]; do - key="$1" - - case $key in - -u | --username) - USERNAME="$2" - shift # past argument - shift # past value - ;; - -p | --password) - PASSWORD="$2" - shift # past argument - shift # past value - ;; - -h | --host) - HOST="$2" - shift # past argument - shift # past value - ;; - *) # unknown option - POSITIONAL+=("$1") # save it in an array for later - shift # past argument - ;; - esac -done -set -- "${POSITIONAL[@]}" # restore positional parameters - -FILE="$1" +# Including fuseki-funcions.sh implementing delete, create, and upload. +source fuseki-functions.sh +# Name of the repository REPOSITORY="knora-test" -if [[ -z "${HOST}" ]]; then - HOST="localhost:3030" -fi - -if [[ -z "${USERNAME}" ]]; then - USERNAME="admin" -fi - -if [[ -z "${PASSWORD}" ]]; then - PASSWORD="test" -fi - -delete-repository() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -X DELETE http://${HOST}/\$/datasets/${REPOSITORY}) - - if [ "${STATUS}" -eq 200 ]; then - echo "==> delete repository done" - return 0 - else - echo "==> delete repository failed" - return 1 - fi -} - -create-repository() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -F data=@./fuseki-knora-test-repository-config.ttl http://${HOST}/\$/datasets) - - if [ "${STATUS}" -eq 200 ]; then - echo "==> create repository done" - return 0 - else - echo "==> create repository failed" - return 1 - fi -} - -upload-graph() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -H "Content-Type:text/turtle" -d @$1 -X PUT http://${HOST}/${REPOSITORY}\?graph\="$2") - - if [ "${STATUS}" -eq 201 ]; then - echo "==> 201 Created: $1 -> $2" - return 0 - elif [ "${STATUS}" -eq 200 ]; then - echo "==> 200 OK: $1 -> $2" - return 0 - else - echo "==> failed with status code ${STATUS}: $1 -> $2" - return 1 - fi -} - # delete-repository // delete dos not work correctly. need to delete database manually. create-repository upload-graph ../../knora-ontologies/knora-admin.ttl http://www.knora.org/ontology/knora-admin diff --git a/webapi/scripts/fuseki-init-knora-test-unit-minimal.sh b/webapi/scripts/fuseki-init-knora-test-unit-minimal.sh index e7eac0b06d..faaa760364 100755 --- a/webapi/scripts/fuseki-init-knora-test-unit-minimal.sh +++ b/webapi/scripts/fuseki-init-knora-test-unit-minimal.sh @@ -1,90 +1,11 @@ #!/usr/bin/env bash -#set -x - -POSITIONAL=() -while [[ $# -gt 0 ]]; do - key="$1" - - case $key in - -u | --username) - USERNAME="$2" - shift # past argument - shift # past value - ;; - -p | --password) - PASSWORD="$2" - shift # past argument - shift # past value - ;; - -h | --host) - HOST="$2" - shift # past argument - shift # past value - ;; - *) # unknown option - POSITIONAL+=("$1") # save it in an array for later - shift # past argument - ;; - esac -done -set -- "${POSITIONAL[@]}" # restore positional parameters - -FILE="$1" +# Including fuseki-funcions.sh implementing delete, create, and upload. +source fuseki-functions.sh +# Name of the repository REPOSITORY="knora-test-unit" -if [[ -z "${HOST}" ]]; then - HOST="localhost:3030" -fi - -if [[ -z "${USERNAME}" ]]; then - USERNAME="admin" -fi - -if [[ -z "${PASSWORD}" ]]; then - PASSWORD="test" -fi - -delete-repository() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -X DELETE http://${HOST}/\$/datasets/${REPOSITORY}) - - if [ "${STATUS}" -eq 200 ]; then - echo "==> delete repository done" - return 0 - else - echo "==> delete repository failed" - return 1 - fi -} - -create-repository() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -F data=@./fuseki-knora-test-unit-repository-config.ttl http://${HOST}/\$/datasets) - - if [ "${STATUS}" -eq 200 ]; then - echo "==> create repository done" - return 0 - else - echo "==> create repository failed" - return 1 - fi -} - -upload-graph() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -H "Content-Type:text/turtle" -d @$1 -X PUT http://${HOST}/${REPOSITORY}\?graph\="$2") - - if [ "${STATUS}" -eq 201 ]; then - echo "==> 201 Created: $1 -> $2" - return 0 - elif [ "${STATUS}" -eq 200 ]; then - echo "==> 200 OK: $1 -> $2" - return 0 - else - echo "==> failed with status code ${STATUS}: $1 -> $2" - return 1 - fi -} - # delete-repository // delete dos not work correctly. need to delete database manually. create-repository upload-graph ../../knora-ontologies/knora-admin.ttl http://www.knora.org/ontology/knora-admin diff --git a/webapi/scripts/fuseki-init-knora-test-unit.sh b/webapi/scripts/fuseki-init-knora-test-unit.sh index 35ba00bb2e..d835f18adb 100755 --- a/webapi/scripts/fuseki-init-knora-test-unit.sh +++ b/webapi/scripts/fuseki-init-knora-test-unit.sh @@ -1,90 +1,11 @@ #!/usr/bin/env bash -#set -x - -POSITIONAL=() -while [[ $# -gt 0 ]]; do - key="$1" - - case $key in - -u | --username) - USERNAME="$2" - shift # past argument - shift # past value - ;; - -p | --password) - PASSWORD="$2" - shift # past argument - shift # past value - ;; - -h | --host) - HOST="$2" - shift # past argument - shift # past value - ;; - *) # unknown option - POSITIONAL+=("$1") # save it in an array for later - shift # past argument - ;; - esac -done -set -- "${POSITIONAL[@]}" # restore positional parameters - -FILE="$1" +# Including fuseki-funcions.sh implementing delete, create, and upload. +source fuseki-functions.sh +# Name of the repository REPOSITORY="knora-test-unit" -if [[ -z "${HOST}" ]]; then - HOST="localhost:3030" -fi - -if [[ -z "${USERNAME}" ]]; then - USERNAME="admin" -fi - -if [[ -z "${PASSWORD}" ]]; then - PASSWORD="test" -fi - -delete-repository() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -X DELETE http://${HOST}/\$/datasets/${REPOSITORY}) - - if [ "${STATUS}" -eq 200 ]; then - echo "==> delete repository done" - return 0 - else - echo "==> delete repository failed" - return 1 - fi -} - -create-repository() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -F data=@./fuseki-knora-test-unit-repository-config.ttl http://${HOST}/\$/datasets) - - if [ "${STATUS}" -eq 200 ]; then - echo "==> create repository done" - return 0 - else - echo "==> create repository failed" - return 1 - fi -} - -upload-graph() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -H "Content-Type:text/turtle" -d @$1 -X PUT http://${HOST}/${REPOSITORY}\?graph\="$2") - - if [ "${STATUS}" -eq 201 ]; then - echo "==> 201 Created: $1 -> $2" - return 0 - elif [ "${STATUS}" -eq 200 ]; then - echo "==> 200 OK: $1 -> $2" - return 0 - else - echo "==> failed with status code ${STATUS}: $1 -> $2" - return 1 - fi -} - # delete-repository // delete dos not work correctly. need to delete database manually. create-repository upload-graph ../../knora-ontologies/knora-admin.ttl http://www.knora.org/ontology/knora-admin @@ -102,6 +23,7 @@ upload-graph ../_test_data/ontologies/images-onto.ttl http://www.knora.org/ontol upload-graph ../_test_data/demo_data/images-demo-data.ttl http://www.knora.org/data/00FF/images upload-graph ../_test_data/ontologies/anything-onto.ttl http://www.knora.org/ontology/0001/anything upload-graph ../_test_data/all_data/anything-data.ttl http://www.knora.org/data/0001/anything +upload-graph ../_test_data/ontologies/minimal-onto.ttl http://www.knora.org/ontology/0001/minimal upload-graph ../_test_data/ontologies/something-onto.ttl http://www.knora.org/ontology/0001/something upload-graph ../_test_data/ontologies/beol-onto.ttl http://www.knora.org/ontology/0801/beol upload-graph ../_test_data/ontologies/biblio-onto.ttl http://www.knora.org/ontology/0801/biblio diff --git a/webapi/scripts/fuseki-init-knora-test.sh b/webapi/scripts/fuseki-init-knora-test.sh index 0c3ec0ef8f..32e8929788 100755 --- a/webapi/scripts/fuseki-init-knora-test.sh +++ b/webapi/scripts/fuseki-init-knora-test.sh @@ -1,90 +1,11 @@ #!/usr/bin/env bash -#set -x - -POSITIONAL=() -while [[ $# -gt 0 ]]; do - key="$1" - - case $key in - -u | --username) - USERNAME="$2" - shift # past argument - shift # past value - ;; - -p | --password) - PASSWORD="$2" - shift # past argument - shift # past value - ;; - -h | --host) - HOST="$2" - shift # past argument - shift # past value - ;; - *) # unknown option - POSITIONAL+=("$1") # save it in an array for later - shift # past argument - ;; - esac -done -set -- "${POSITIONAL[@]}" # restore positional parameters - -FILE="$1" +# Including fuseki-funcions.sh implementing delete, create, and upload. +source fuseki-functions.sh +# Name of the repository REPOSITORY="knora-test" -if [[ -z "${HOST}" ]]; then - HOST="localhost:3030" -fi - -if [[ -z "${USERNAME}" ]]; then - USERNAME="admin" -fi - -if [[ -z "${PASSWORD}" ]]; then - PASSWORD="test" -fi - -delete-repository() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -X DELETE http://${HOST}/\$/datasets/${REPOSITORY}) - - if [ "${STATUS}" -eq 200 ]; then - echo "==> delete repository done" - return 0 - else - echo "==> delete repository failed" - return 1 - fi -} - -create-repository() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -F data=@./fuseki-knora-test-repository-config.ttl http://${HOST}/\$/datasets) - - if [ "${STATUS}" -eq 200 ]; then - echo "==> create repository done" - return 0 - else - echo "==> create repository failed" - return 1 - fi -} - -upload-graph() { - STATUS=$(curl -s -o /dev/null -w '%{http_code}' -u ${USERNAME}:${PASSWORD} -H "Content-Type:text/turtle" -d @$1 -X PUT http://${HOST}/${REPOSITORY}\?graph\="$2") - - if [ "${STATUS}" -eq 201 ]; then - echo "==> 201 Created: $1 -> $2" - return 0 - elif [ "${STATUS}" -eq 200 ]; then - echo "==> 200 OK: $1 -> $2" - return 0 - else - echo "==> failed with status code ${STATUS}: $1 -> $2" - return 1 - fi -} - # delete-repository // delete dos not work correctly. need to delete database manually. create-repository upload-graph ../../knora-ontologies/knora-admin.ttl http://www.knora.org/ontology/knora-admin @@ -102,6 +23,7 @@ upload-graph ../_test_data/ontologies/images-onto.ttl http://www.knora.org/ontol upload-graph ../_test_data/demo_data/images-demo-data.ttl http://www.knora.org/data/00FF/images upload-graph ../_test_data/ontologies/anything-onto.ttl http://www.knora.org/ontology/0001/anything upload-graph ../_test_data/all_data/anything-data.ttl http://www.knora.org/data/0001/anything +upload-graph ../_test_data/ontologies/minimal-onto.ttl http://www.knora.org/ontology/0001/minimal upload-graph ../_test_data/ontologies/something-onto.ttl http://www.knora.org/ontology/0001/something upload-graph ../_test_data/ontologies/beol-onto.ttl http://www.knora.org/ontology/0801/beol upload-graph ../_test_data/ontologies/biblio-onto.ttl http://www.knora.org/ontology/0801/biblio diff --git a/webapi/scripts/fuseki-knora-test-repository-config.ttl b/webapi/scripts/fuseki-knora-test-repository-config.ttl deleted file mode 100644 index 54cf472a4d..0000000000 --- a/webapi/scripts/fuseki-knora-test-repository-config.ttl +++ /dev/null @@ -1,54 +0,0 @@ -@prefix : . -@prefix fuseki: . -@prefix ja: . -@prefix tdb2: . -@prefix rdf: . -@prefix rdfs: . -@prefix text: . -@prefix knora-base: . - -[] rdf:type fuseki:Server ; - fuseki:services :service_tdb_all ; - ja:loadClass "org.apache.jena.query.text.TextQuery" . - -:service_tdb_all a fuseki:Service ; - rdfs:label "TDB2 knora-test" ; - fuseki:dataset :text_dataset ; - fuseki:name "knora-test" ; - fuseki:serviceQuery "query" , "sparql" ; - fuseki:serviceReadGraphStore "get" ; - fuseki:serviceReadWriteGraphStore "data" ; - fuseki:serviceUpdate "update" ; - fuseki:serviceUpload "upload" . - -## --------------------------------------------------------------- -## This URI must be fixed - it's used to assemble the text dataset. - -:text_dataset rdf:type text:TextDataset ; - text:dataset :tdb_dataset_readwrite ; - text:index :indexLucene . - -# A TDB datset used for RDF storage -:tdb_dataset_readwrite a tdb2:DatasetTDB2 ; - tdb2:unionDefaultGraph true ; - tdb2:location "/fuseki/databases/knora-test" . - -# Text index description -:indexLucene a text:TextIndexLucene ; - text:directory "/fuseki/lucene/knora-test" ; -##text:directory "mem" ; - text:entityMap :entMap . - -# Mapping in the index -# URI stored in field "uri" -# knora-base:valueHasString is mapped to field "text" -:entMap a text:EntityMap ; - text:entityField "uri" ; - text:defaultField "text" ; - text:uidField "uid" ; - text:map ( - [ text:field "text" ; text:predicate rdfs:label ] - [ text:field "text" ; text:predicate knora-base:valueHasString ] - [ text:field "text" ; text:predicate knora-base:valueHasComment ] - - ) . \ No newline at end of file diff --git a/webapi/scripts/fuseki-knora-test-unit-repository-config.ttl b/webapi/scripts/fuseki-repository-config.ttl.template similarity index 92% rename from webapi/scripts/fuseki-knora-test-unit-repository-config.ttl rename to webapi/scripts/fuseki-repository-config.ttl.template index f3eac89986..82e72fdc67 100644 --- a/webapi/scripts/fuseki-knora-test-unit-repository-config.ttl +++ b/webapi/scripts/fuseki-repository-config.ttl.template @@ -13,9 +13,9 @@ :service_tdb_all a fuseki:Service ; - rdfs:label "TDB2 knora-test-unit" ; + rdfs:label "TDB2 @REPOSITORY@" ; fuseki:dataset :text_dataset ; - fuseki:name "knora-test-unit" ; + fuseki:name "@REPOSITORY@" ; fuseki:serviceQuery "query" , "sparql" ; fuseki:serviceReadGraphStore "get" ; fuseki:serviceReadWriteGraphStore "data" ; @@ -32,12 +32,11 @@ # A TDB datset used for RDF storage :tdb_dataset_readwrite a tdb2:DatasetTDB2 ; tdb2:unionDefaultGraph true ; - tdb2:location "/fuseki/databases/knora-test-unit" . + tdb2:location "/fuseki/databases/@REPOSITORY@" . # Text index description :indexLucene a text:TextIndexLucene ; - text:directory "/fuseki/lucene/knora-test-unit" ; - ##text:directory "mem" ; + text:directory "/fuseki/lucene/@REPOSITORY@" ; text:entityMap :entMap . # Mapping in the index diff --git a/webapi/src/main/scala/org/knora/webapi/store/triplestore/http/HttpTriplestoreConnector.scala b/webapi/src/main/scala/org/knora/webapi/store/triplestore/http/HttpTriplestoreConnector.scala index d1bb652f11..8d15ac6254 100644 --- a/webapi/src/main/scala/org/knora/webapi/store/triplestore/http/HttpTriplestoreConnector.scala +++ b/webapi/src/main/scala/org/knora/webapi/store/triplestore/http/HttpTriplestoreConnector.scala @@ -609,11 +609,11 @@ class HttpTriplestoreConnector extends Actor with ActorLogging with Instrumentat */ private def initJenaFusekiTriplestore(): Try[CheckTriplestoreResponse] = { - val configFileName = s"webapi/scripts/fuseki-${settings.triplestoreDatabaseName}-repository-config.ttl" + val configFileName = s"webapi/scripts/fuseki-repository-config.ttl.template" try { // take config from the classpath and write to triplestore - val triplestoreConfig: String = FileUtil.readTextResource(configFileName) + val triplestoreConfig: String = FileUtil.readTextResource(configFileName).replace("@REPOSITORY@", settings.triplestoreDatabaseName) val authCache: AuthCache = new BasicAuthCache val basicAuth: BasicScheme = new BasicScheme