Getting Started with DSP-API
Running DSP-API locally or on a server requires Docker, which can be freely downloaded. Please follow the instructions for installing Docker Desktop.
Additional software:
- Apple Xcode
- git
- expect
- sbt
- java 11
These can be easily installed on macOS using Homebrew:
$ brew install git
$ brew install expect
$ brew install sbt
To install Adoptopenjdk Java 11 with Homebrew:
$ brew tap AdoptOpenJDK/openjdk
$ brew cask install AdoptOpenJDK/openjdk/adoptopenjdk11
To pin the version of Java, please add this environment variable to you startup script (bashrc, etc.):
export JAVA_HOME=`/usr/libexec/java_home -v 11`
Choosing a Triplestore
DSP-API requires a standards-compliant RDF triplestore. A number of triplestore implementations are available, including free software as well as proprietary options.
DSP-API is designed to work with any standards-compliant triplestore. It is primarily tested with Apache Jena Fuseki, an open source triplestore.
Other triplestores are planned.
Running the DSP-Stack
Use git
to clone the DSP-API repository from Github.
The following environment variables are optional:
KNORA_DB_HOME
: sets the path to the folder where the triplestore will store the database filesKNORA_DB_IMPORT
: sets the path to the import directory accessible from inside the docker image
$ export KNORA_DB_IMPORT=/path/to/some/folder
$ export KNORA_DB_HOME=/path/to/some/other_folder
Then from inside the cloned DSP-API
repository folder, run:
$ make stack-up
Creating Repositories and Loading Test Data
To create a test repository called knora-test
and load test data, run:
$ make init-db-test
The scripts called by make
can be found under webapi/scripts
. You can
create your own scripts based on these scripts, to create new
repositories and optionally to load existing DSP-compliant RDF data
into them.
If you need to reload the test data, you need to stop and delete the running Apache Fuseki instance. Make sure you don't delete important data. To stop the instance and delete the repository, run the following command:
$ make stack-down-delete-volumes
after which you can start the stack again with make stack-up
, recreate
the repository and load the data with make init-db-test
.