From 18c4957e30aded411c7753601cbe40957e6c72e5 Mon Sep 17 00:00:00 2001 From: Tom Wiesing Date: Mon, 11 Jul 2022 15:29:07 +0200 Subject: [PATCH] graphdb: Update api usage for 10.x This commit updates the usage of the GraphDB API for version 10.0 or later. --- README.md | 2 +- distillery/provision.sh | 5 ++--- distillery/purge.sh | 2 +- distillery/resources/templates/repository/graphdb-repo.ttl | 6 +++--- distillery/resources/templates/repository/graphdb-user.json | 3 ++- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 630d7b2..4f29f14 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ These are: - A [phpmyadmin](https://www.phpmyadmin.net/) is started on `127.0.0.1:8080`. - See [distillery/resources/compose/sql](distillery/resources/compose/sql) for implementation details. -- [GraphDB](http://graphdb.ontotext.com/) - a SPARQL backend for WissKI +- [GraphDB](http://graphdb.ontotext.com/) - a SPARQL backend for WissKI (Version 10.0 or later) - It is configured to run inside a docker container. - The Workbench API is started on `127.0.0.1:7200`. diff --git a/distillery/provision.sh b/distillery/provision.sh index 2e872eb..655b767 100755 --- a/distillery/provision.sh +++ b/distillery/provision.sh @@ -44,12 +44,11 @@ GRAPHDB_PASSWORD="$(randompw)" # Create the user and grant them access to the creatd database. log_info " => Creating GraphDB user '$GRAPHDB_USER'" -load_template "repository/graphdb-user.json" "GRAPHDB_USER" "${GRAPHDB_USER}" "GRAPHDB_REPO" "${GRAPHDB_REPO}" | \ +load_template "repository/graphdb-user.json" "GRAPHDB_USER" "${GRAPHDB_USER}" "GRAPHDB_REPO" "${GRAPHDB_REPO}" "GRAPHDB_PASSWORD" "${GRAPHDB_PASSWORD}" | \ curl -X POST $GRAPHDB_AUTH_FLAGS \ - "http://127.0.0.1:7200/rest/security/user/${GRAPHDB_USER}" \ + "http://127.0.0.1:7200/rest/security/users/${GRAPHDB_USER}" \ --header 'Content-Type: application/json' \ --header 'Accept: text/plain' \ - --header "X-GraphDB-Password: $GRAPHDB_PASSWORD" \ -d @- log_info " => Creating local directory structure at '$INSTANCE_BASE_DIR'" diff --git a/distillery/purge.sh b/distillery/purge.sh index 6d5a09d..c19d0b0 100755 --- a/distillery/purge.sh +++ b/distillery/purge.sh @@ -55,7 +55,7 @@ log_info " => Deleting GraphDB repository '$GRAPHDB_REPO'" curl $GRAPHDB_AUTH_FLAGS -X DELETE http://127.0.0.1:7200/rest/repositories/$GRAPHDB_REPO log_info " => Deleting GraphDB user '$GRAPHDB_USER'" -curl $GRAPHDB_AUTH_FLAGS -X DELETE http://127.0.0.1:7200/rest/security/user/$GRAPHDB_USER +curl $GRAPHDB_AUTH_FLAGS -X DELETE http://127.0.0.1:7200/rest/security/users/$GRAPHDB_USER # Delete the directory diff --git a/distillery/resources/templates/repository/graphdb-repo.ttl b/distillery/resources/templates/repository/graphdb-repo.ttl index 86b78ae..88c96ae 100644 --- a/distillery/resources/templates/repository/graphdb-repo.ttl +++ b/distillery/resources/templates/repository/graphdb-repo.ttl @@ -12,13 +12,13 @@ rep:repositoryID "${GRAPHDB_REPO}" ; rdfs:label "${INSTANCE_DOMAIN}" ; rep:repositoryImpl [ - rep:repositoryType "graphdb:FreeSailRepository" ; + rep:repositoryType "graphdb:SailRepository" ; sr:sailImpl [ - sail:sailType "graphdb:FreeSail" ; + sail:sailType "graphdb:Sail" ; owlim:owlim-license "" ; - owlim:base-URL "http://${INSTANCE_DOMAIN}/#" ; + owlim:base-URL "http://${INSTANCE_DOMAIN}/" ; owlim:defaultNS "" ; owlim:entity-index-size "10000000" ; owlim:entity-id-size "32" ; diff --git a/distillery/resources/templates/repository/graphdb-user.json b/distillery/resources/templates/repository/graphdb-user.json index 50e498f..e0fd8f5 100644 --- a/distillery/resources/templates/repository/graphdb-user.json +++ b/distillery/resources/templates/repository/graphdb-user.json @@ -4,5 +4,6 @@ "ROLE_USER", "READ_REPO_${GRAPHDB_REPO}", "WRITE_REPO_${GRAPHDB_REPO}" - ] + ], + "password": "${GRAPHDB_PASSWORD}" }