Running a HeFQUIN Service via Docker

HeFQUIN can be deployed as a web service in a Docker container, either:

In either case, after starting it up, you can interact with the service like a SPARQL endpoint.

Use a Published Docker Image

For each release of HeFQUIN, we publish a Docker image at the GitHub Container Registry. You can pull the image for the latest release by executing the following command.

docker pull ghcr.io/LiUSemWeb/hefquin:latest

Thereafter, execute the following command to start the HeFQUIN service using Docker, the -p argument specifies the port at which the HeFQUIN service shall expose its SPARQL endpoint.

docker run -p 8080:8080 hefquin:latest

Now, the HeFQUIN service should be running, which you can test by opening http://localhost:8080/ in a Web browser, and you can interact with the service like a SPARQL endpoint (the SPARQL endpoint should be exposed at http://localhost:8080/sparql).

To use the HeFQUIN service for your own federation, create a description of your federation and, then, mount the file with this description (e.g., MyFedConf.ttl) when starting the HeFQUIN service using Docker as follows.

docker run \
    -p 8080:8080 \
    -v MyFedConf.ttl:/usr/local/tomcat/webapps/ROOT/DefaultFedConf.ttl \
    hefquin:latest

Additionally, you can use a custom configuration file for the HeFQUIN engine (e.g., MyEngineConf.ttl).

docker run \
    -p 8080:8080 \
    -v MyFedConf.ttl:/usr/local/tomcat/webapps/ROOT/DefaultFedConf.ttl \
    -v MyEngineConf.ttl:/usr/local/tomcat/webapps/ROOT/DefaultEngineConf.ttl \
    hefquin:latest

Build a Docker Image Yourself

Instead of using one of our published Docker images, you may also build such an image yourself and use that one. To this end, you need a local clone of the GitHub repository of HeFQUIN.

If you have not cloned the repository already, you can clone it either by using the SSH URL:

git clone git@github.com:LiUSemWeb/HeFQUIN.git
or by using the HTTP URL:
git clone https://github.com/LiUSemWeb/HeFQUIN.git

If you have cloned the repository earlier, make sure that you pull the latest version of the source code into your local clone:

git checkout main
git pull

Within the directory into which you have cloned the repo, change into the hefquin-docker subdirectory:

cd hefquin-docker

Now, execute the following two commands to build the Docker image and to start the HeFQUIN service using this image.

docker-compose build
docker-compose up

Now, the HeFQUIN service should be running, which you can test by opening http://localhost:8080/ in a Web browser, and you can interact with the service like a SPARQL endpoint (the SPARQL endpoint should be exposed at http://localhost:8080/sparql).

If you want to build the Docker image for a specific version of HeFQUIN, specify the release tag of that version at the TAG argument in the docker-compose.yml file before running the aforementioned docker-compose commands.

  hefquin:
    build:
      context: .
      args:
        TAG: XYZ   ### replace XYZ by the tag
    ports:
      - "8080:8080"

To use the HeFQUIN service for your own federation, create a description of your federation and, then, extend the docker-compose.yml file to mount the file with this description (e.g., MyFedConf.ttl) when starting the HeFQUIN service using your Docker image.

  hefquin:
    build: .
    ports:
      - "8080:8080"
    volumes:
     - MyFedConf.ttl:/usr/local/tomcat/webapps/ROOT/DefaultFedConf.ttl

Additionally, you can use a custom configuration file for the HeFQUIN engine (e.g., MyEngineConf.ttl).

  hefquin:
    build: .
    ports:
      - "8080:8080"
    volumes:
     - MyFedConf.ttl:/usr/local/tomcat/webapps/ROOT/DefaultFedConf.ttl
     - MyEngineConf:/usr/local/tomcat/webapps/ROOT/DefaultEngineConf.ttl