dbpedia / virtuoso-sparql-endpoint-quickstart

creates a docker image with Virtuoso preloaded with the latest DBpedia dataset
Other
120 stars 36 forks source link
dbpedia docker linked-open-data rdf sparql

Virtuoso SPARQL Endpoint Quickstart

Creates and runs a Virtuoso Open Source instance including a SPARQL endpoint preloaded with a Databus Collection and the VOS DBpedia Plugin installed.

Quickstart

Running the Virtuoso SPARQL Endpoint Quickstart requires Docker and Docker Compose installed on your system. If you do not have those installed, please follow the install instructions for here and here. Once you have both Docker and Docker Compose installed, run

git clone https://github.com/dbpedia/virtuoso-sparql-endpoint-quickstart.git
cd virtuoso-sparql-endpoint-quickstart
COLLECTION_URI=https://databus.dbpedia.org/dbpedia/collections/dbpedia-snapshot-2022-03 VIRTUOSO_ADMIN_PASSWD=YourSecretPassword docker-compose up

After a short delay your SPARQL endpoint will be running at localhost:8890/sparql.

Note that loading huge datasets to the Virtuoso triple store takes some time. Even though the SPARQL endpoint is up and running, the loading process might still take up to several hours depending on the amount of data you are trying to load.

In order to verify your setup more quickly you can use the following collection URI instead: https://databus.dbpedia.org/dbpedia/collections/virtuoso-sparql-endpoint-quickstart-preview

Note that this collection is only a collection of RDF data to test drive the docker compose network and not a DBpedia release. After a short delay the resource http://localhost:8890/page/Berlin should be accessible.

Troubleshooting

Documentation

The Virtuoso SPARQL Endpoint Quickstart is a network of three different docker containers which are launched with docker-compose. The following containers are being run:

Once the loading process has been completed, only the OpenLink VOS Instance will keep running. The other two containers will shut down once their job is done. By running docker ps you can see whether the download and loader container are still running. If there is only the OpenLink VOS Instance remaining, all your data has been loaded to the triple store.

The possible configurations for all containers are documented below. The repository includes an .env file containing all configurable environment parameters for the network.

Environment Variables

Running docker-compose up will use the environment variables specified in the .env file next to the docker-compose.yml. The available variables are:

Container Configurations

You can configure the containers in the network even further by adjusting the docker-compose.yml file. The following section lists all the environment variables that can only be set in the docker-compose.yml for each of the containers.

Only change the docker-compose.yml if you know what you are doing. For most users the .env file is sufficient.

Container 1: OpenLink VOS Instance

You can read the full documentation of the docker image here. The image requires one environment variable to set the admin password of the database:

This password is only set when a new database is created. The example docker-compose mounts a folder to the internal database directory for persistence. Note that this folder needs to be cleared in order to change the password via docker-compose.

The second volume specified in the docker-compose file connects the downloads folder to a directory in the container that is accessible by the virtuoso load script. Accessible paths are set in the internal virtuoso.ini file (DirsAllowed). As the docker-compose uses the vanilla settings of the image the local ./downloads folder is mounted to /usr/share/proj inside of the container which is in the DirsAllowed per default.

Container 2: DBpedia Databus Collection Downloader

This project uses the DBpedia Databus Collection Downloader. You can find the documentation here. If you haven't already, download and build the download client docker image. The required environment variables are:

Container 3: Loader/Installer

The loader/installer container is being pulled from (dbpedia/virtuoso-sparql-endpoint-quickstart).

Alternatively, you could potentially modify and then build the loader/installer docker image by running

cd ./dbpedia-loader
docker build -t dbpedia-virtuoso-loader .

You can configure the container with the following environment variables:

Instructions for DBpedia Chapters

In case of emergency or confusion please visit this forum thread. Feel free to ask and answer questions as it will help future chapter deployments!

In order to use the Virtuoso SPARQL Endpoint Quickstart docker network to host your own DBpedia instance you need to create a chapter collection on the DBpedia Databus. You can learn about the Databus and Databus Collections in the DBpedia Stack Tutorial on Youtube

Alternatively you can download the required data to your local machine and supply the files manually. It is however recommended to use Collections as it makes updating to future version much easier.

Set the COLLECTION_URI variable to your chapter collection URI and adjust the DOMAIN variable to match the domain of your resource identifiers. Alternatively (not recommended) copy your files into the directory specified in DATA_DIR and remove the download container section from the docker-compose.yml)

Once all variables are set in the .env file run

docker-compose up

Enabling Federated Queries

Federated queries can be enabled by granting the roles SPARQL_LOAD_SERVICE_DATA and SPARQL_SPONGE to the SPARQL user.

docker exec -it [virtuoso_docker_name] /bin/bash
isql-v -U dba -P [virtuoso_admin_password]
grant SPARQL_LOAD_SERVICE_DATA to "SPARQL";
grant SPARQL_SPONGE to "SPARQL";