ontotext/graphdb

By ontotext

Updated 17 days ago

GraphDB is an enterprise ready Semantic Graph Database, compliant with W3C Standards

Image
Data science
Databases & storage
33

500K+

ontotext/graphdb repository overview

Supported tags

Since GraphDB 10.0, there's a single docker image for all editions of GraphDB. Each version of GraphDB is its own separate tag. The tag for each version is <version>, where the version corresponds to the version of the database that you want to get the image for. The usage restrictions come from the applied license (or lack of license in case of the free version).

For example, to pull the images for GraphDB 11.0.1, use:

docker pull ontotext/graphdb:11.0.1

We support arm64 and amd64 based architectures. When pulling the image, docker will automatically pull the correct version based on your architecture.

For versions older than 10.0, the tags are separated into two groups:

  • <version>-ee
  • <version>-se

The ee and se are for the edition of the database - enterprise and standard. Currently, we provide GraphDB 9.11.2-se, 9.11.2-ee and to pull the images use:

docker pull ontotext/graphdb:9.11.2-se

or

docker pull ontotext/graphdb:9.11.2-ee

What is GraphDB?

GraphDB is an enterprise-ready Semantic Graph Database, compliant with W3C Standards. Semantic graph databases (also called RDF triplestores) provide the core infrastructure for solutions where modelling agility, data integration, relationship exploration and cross-enterprise data publishing and consumption are important.

GraphDB is the only triplestore that can perform semantic inferencing at scale allowing users to create new semantic facts from existing facts. It is proven to handles massive loads, queries and inferencing in real time.

For more information and related downloads for GraphDB Server and other GraphDB products, please visit http://graphdb.ontotext.com.

How to use this image

Start a graphdb server instance

Starting a GraphDB instance is simple:

docker run -p 127.0.0.1:7200:7200 --name graphdb-instance-name -t ontotext/graphdb:tag

where graphdb-instance-name is the name you want to assign to your container, tag is the tag specifying the GraphDB version you want. See the list above for relevant tags.

You can now go to http://localhost:7200 to see the database in action. Note that you will require a license to be able to use the database on versions under 10.0. For newer versions, the launched GraphDB instance will run in 'free' mode with limited functionality.

Container shell access and viewing GraphDB logs

The docker exec command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your graphdb container:

docker exec -it graphdb-instance-name bash

The GraphDB logs are available through Docker's container log:

docker logs graphdb-instance-name

or to monitor logs as they come

docker attach graphdb-instance-name

Passing custom options to GraphDB inside the container

The docker image makes this really easy, just pass them at the end of the run command. So for example, if you want to specify the amount of memory for the global cache, you can run

docker run -p 127.0.0.1:7200:7200 --name graphdb-instance-name -t ontotext/graphdb:tag -Dgraphdb.global.page.cache=3G

Caveats

Where to Store Data

Important note: There are several ways to store data used by applications that run in Docker containers. We encourage users of the GraphDB images to familiarize themselves with the options available, including:

  • Let Docker manage the storage of your database data by writing the database files to disk on the host system using its own internal volume management. This is the default and is easy and fairly transparent to the user. The downside is that the files may be hard to locate for tools and applications that run directly on the host system, i.e. outside containers.
  • Create a data directory on the host system (outside the container) and mount this to a directory visible from inside the container. This places the database files in a known location on the host system, and makes it easy for tools and applications on the host system to access the files. The downside is that the user needs to make sure that the directory exists and that e.g. directory permissions and other security mechanisms on the host system are set up correctly.

The Docker documentation is a good starting point for understanding the different storage options and variations, and there are multiple blogs and forum postings that discuss and give advice in this area. We will simply show the basic procedure here for the latter option above:

  1. Create a data directory on a suitable volume on your host system, e.g. /my/own/graphdb-home.

  2. Start your graphdb container like this:

        docker run -p 127.0.0.1:7200:7200 -v /my/own/graphdb-home:/opt/graphdb/home --name graphdb-instance-name -t ontotext/graphdb:tag
    
    

The -v /my/own/graphdb-home:/opt/graphdb/home part of the command mounts the /my/own/graphdb-home directory from the underlying host system as /opt/graphdb/home inside the container, where GraphDB by default will write its data files, logs and working files.

Note that users on host systems with SELinux enabled may see issues with this. The current workaround is to assign the relevant SELinux policy type to the new data directory so that the container will be allowed to access it:

chcon -Rt svirt_sandbox_file_t /my/own/graphdb-home

Give license to the images

In order to use the Standard edition or Enterprise edition features, you'll have to provide a license to the docker container. The manual way of providing the license is through the web interface after you access the database for the first time. But if you want to automate the process there are two recommended ways to do that.

  • provide the license in a virtual mounted home. On the host machine run
mkdir -p data/conf
cp <path-to-license> data/conf/graphdb.license   
now start the docker image with
docker run -p 127.0.0.1:7200:7200 -v data:/opt/graphdb/home --name graphdb-instance-name -t ontotext/graphdb:tag
  • extend the docker image and copy the license
FROM ontotext/graphdb:tag
RUN mkdir -p /opt/graphdb/home/conf
COPY <path-to-license-on-host-machine> /opt/graphdb/home/conf 
now you can build an image from the Dockerfile and run it.

Cluster mode

If you want to run GraphDB in cluster mode, there are a few additional things to consider.

  • Port 7300 (the default RPC port) should be exposed
  • A cluster secret must be provided for all cluster nodes with the property graphdb.auth.token.secret

An example command for a GraphDB node ready for cluster mode:

docker run -d -p 7200:7200 -p 7300:7300 ontotext/graphdb:11.0.1 /opt/graphdb/dist/bin/graphdb -Dgraphdb.auth.token.secret=superSecretToken

If you wish to use an external proxy with the cluster, you can launch it using Docker with the following command:

docker run -d -p 7200:7200 -p 7300:7300 --entrypoint /opt/graphdb/dist/bin/cluster-proxy ontotext/graphdb:11.0.1 -Dgraphdb.auth.token.secret=superSecretToken -g http://<hostname>:7200

Notice that:

  • The entrypoint has been overridden to execute the cluster-proxy script in /opt/graphdb/dish/bin which is used to start the external proxy mode
  • The -g parameter tells the external proxy where it can find a GraphDB instance that is part of a cluster. One instance address is enough, the other cluster nodes will be discovered automatically.
  • The external proxy still needs a graphdb.auth.token.secret in order to communicate with the cluster

The logs of the running container will inform you that GraphDB has been started in proxy mode and if it can communicate with the cluster nodes successfully

See the GraphDB external proxy documentation for more details.

Supported Docker versions

This image is officially supported on Docker version 1.13.1.

Support for older versions (down to 1.6) is provided on a best-effort basis.

Please see the Docker installation documentation for details on how to upgrade your Docker daemon.

Contributing and development

See the github repository for the images if you want to contribute to this image

Tag summary

Content type

Image

Digest

sha256:bb9499234

Size

644.2 MB

Last updated

17 days ago

docker pull ontotext/graphdb:11.3.1