Skip to content

Commit

Permalink
Merge pull request #43 from EDAO-Project/tdb2
Browse files Browse the repository at this point in the history
Add support for TDB2
  • Loading branch information
stain authored Feb 11, 2021
2 parents 76e04ec + c5cff21 commit f5ca755
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 1 deletion.
18 changes: 18 additions & 0 deletions jena-fuseki/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,15 @@ To restart a named container (it will remember the volume and port config)

docker restart fuseki

### Using TDB 2

To use [TDB v2](https://jena.apache.org/documentation/tdb2/) you can pass the environment variable with `-e TDB=2`

docker run -p 3030:3030 -e TDB=2 stain/jena-fuseki

If you do so, then you need to use the appropriate `tdbloader2` for your data, see below for more details.


## Upgrading Fuseki

If you want to upgrade the Fuseki container named `fuseki` which use the data
Expand Down Expand Up @@ -173,6 +182,15 @@ You can either check the output of the data loading, or later override the
password using `-e ADMIN_PASSWORD=pw123`.


### Using the `tdbloader2` for TDB2

Assume you have already the container running named `fuseki` you can execute

docker exec -it fuseki /bin/bash -c 'tdbloader2 --loc chembl19 /staging/{cco.ttl.gz,void.ttl.gz}'




## Recognizing the dataset in Fuseki

If you loaded into an existing dataset, Fuseki should find the data after
Expand Down
9 changes: 8 additions & 1 deletion jena-fuseki/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ fi

exec "$@" &

TDB_VERSION=''
if [ ! -z ${TDB+x} ] && [ "${TDB}" = "2" ] ; then
TDB_VERSION='tdb2'
else
TDB_VERSION='tdb'
fi

# Wait until server is up
while [[ $(curl -I http://localhost:3030 2>/dev/null | head -n 1 | cut -d$' ' -f2) != '200' ]]; do
sleep 1s
Expand All @@ -51,7 +58,7 @@ do
curl -s 'http://localhost:3030/$/datasets'\
-H "Authorization: Basic $(echo -n admin:${ADMIN_PASSWORD} | base64)" \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8'\
--data "dbName=${dataset}&dbType=tdb"
--data "dbName=${dataset}&dbType=${TDB_VERSION}"
done

wait
17 changes: 17 additions & 0 deletions jena-fuseki/tdbloader2
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/bash
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
JVM_ARGS=${JVM_ARGS:--Xmx1200M}
exec java $JVM_ARGS -cp $FUSEKI_HOME/fuseki-server.jar tdb2.tdbloader $@

0 comments on commit f5ca755

Please sign in to comment.