Skip to content

Building and Running

Running the stack

With Docker installed, run the following:

$ make stack-up

Then to create a test repository and load some test data into the triplestore:

$ make init-db-test

Then we need to restart knora-api after loading the data:

$ make stack-restart-api

Then try opening http://localhost:3333/v1/resources/ in a web browser. You should see a response in JSON describing a book.

To shut down the Knora-Stack:

$ make stack-down

Running the automated tests

Run the automated tests from terminal:

$ make test

Load Testing on Mac OS X

To test Knora with many concurrent connections on Mac OS X, you will need to adjust some kernel parameters to allow more open connections, to recycle ephemeral ports more quickly, and to use a wider range of ephemeral port numbers. The script webapi/scripts/ will do this.

Continuous Integration

For continuous integration testing, we use Github CI Actions. Every commit pushed to the git repository or every pull request, triggers the build. Additionally, in Github there is a small checkmark beside every commit, signaling the status of the build (successful, unsuccessful, ongoing).

The build that is executed on Github CI Actions is defined in .github/workflows/main.yml.

Webapi Server Startup-Flags

The Webapi-Server can be started with a number of flags.

loadDemoData - Flag

When the webapi-server is started with the loadDemoData flag, then at startup, the data which is configured in application.conf under the app.triplestore.rdf-data key is loaded into the triplestore, and any data in the triplestore is removed beforehand.

allowReloadOverHTTP - Flag

When the webapi.server is started with the allowReloadOverHTTP flag (reStart -r), then the v1/store/ResetTriplestoreContent route is activated. This route accepts a POST request, with a JSON payload consisting of the following example content:

    "path": "knora-ontologies/knora-base.ttl",
    "name": ""
    "path": "knora-ontologies/salsah-gui.ttl",
    "name": ""
    "path": "test_data/ontologies/incunabula-onto.ttl",
    "name": ""
    "path": "test_data/all_data/incunabula-data.ttl",
    "name": ""

This content corresponds to the payload sent with the ResetTriplestoreContent message, defined inside the package. The path being the relative path to the ttl file which will be loaded into a named graph by the name of name.