Link Search Menu Expand Document

OntoDocker

Table of Contents

Description

OntoDocker is a Flask application-prototype to access a Blazegraph and Jena instance via a GUI and an API.

API authentication via JWT and OIDC. Allowed Content-Types to upload are “text/turtle” and “application/rdf+xml” as .ttl/.rdf files

Setup

Requirements

  • working directory is base directory of the PMD-Server repo as described under PMD-S Core
  • Running reverse proxy as described under - Reverse Proxy

1. Clone the repository

1
2
git clone https://git.material-digital.de/apps/ontodocker.git
cd ontodocker

2. Connect to SSO Identity Provider (IDP)

Note: If you have a valid client_secrets.json already, place it in ./data/oidc/

In order to connect OntoDocker to the IDP you might need an initial access token (IAT), which you will receive from the maintainer of the IDP, or generate one, if you want to connect it to your local Instance. (see “Initial Access Token” section of the Keycloak manual)

Replace INITIAL_ACCESS_TOKEN in provider_info.json with the requested Initial Access Token.

Replace KEYCLOAK_URL and REALM_NAME in provider_info.json accordingly to the IDPs properties

Set the APPLICATION_URL to the url where your instance is supposed to be accessible at

Copy the customized provider_info.json files to ./data/oidc/

1
2
# Build the containers
docker-compose build

3. Start OntoDocker

After successful build you can start OntoDocker:

1
2
3
4
5
# Start onto-docker after rebuild to ensure `client_secrets.json` is added to the image
docker-compose up -d --build

# verify onto-docker and blazegraph are running properly
docker-compose ps

5. Connect onto-docker to the reverse proxy

Note: This example assumes you chose the reverse proxy with certbot.

Add nginx configuration

1
2
3
4
5
6
7
8
9
# save OntoDocker URL to shell variable
# ! Replace "ontodocker.domain.de" with the actual URL for the service
export ONTODOCKER_URL=ontodocker.domain.de

# change to pmd-server directory
cd ..

# add the nginx configuration from the template
sed "s/\[URL\]/${ONTODOCKER_URL}/" ontodocker/nginx/prod.conf > data/nginx/ontodocker.conf

Retrieve Let’s Encrypt certificate

1
2
docker-compose exec certbot certbot certonly --webroot -w /var/www/certbot -d ${ONTODOCKER_URL}

Test and load the configuration

1
2
3
4
5
# Test the new configuration
docker-compose exec nginx nginx -t

# Reload nginx
docker-compose exec nginx nginx -s reload

6. Test Installation

Open your browser and navigate to the URL of your OntoDocker installation. If the installation succeeded you should now be redirected to the SSO Login Screen and after successful authentication see the OntoDocker landing page:

Usage

Refer to api_usage_examples.py for examples on how to use the API.

Graph visualization via WebVOWL 1.1.7

If the visualization doesn’t load, clear the browsers cache and refresh the page.

Next

tags: PMD Deployment guide

Back to top

Copyright © BMBF Plattform MaterialDigital, 2021.