/fuseki-hdt-docker

Deploy Fuseki serving RDF HDT file

Primary LanguageDockerfile

fuseki-hdt-docker

Docker image using Apache Jena's Fuseki triplestore to serve the contents of an RDF HDT file.

Deployment

To deploy the container and serve the default RDF HDT file the container includes, just use the following Docker command and Fuseki will be available on port 3030:

docker run -p 3030:3030 rogargon/fuseki-hdt-docker:latest

To serve a local file swdf-2012-11-28.hdt, which should be mounted instead of the default /opt/fuseki/dataset.hdt:

docker run -p 3030:3030 -v $(pwd)/swdf-2012-11-28.hdt:/opt/fuseki/dataset.hdt:ro rogargon/fuseki-hdt-docker:latest

Alternatively, you can also use docker-compose:

version: '3'
services:
    fuseki-hdt:
        image: 'rogargon/fuseki-hdt-docker:latest'
        ports:
            - '3030:3030'
        volumes:
            - './swdf-2012-11-28.hdt:/opt/fuseki/dataset.hdt:ro'

Usage

After successful deployment, Fuseki will be available from port 3030 providing different endpoint. For instance, if deployed on localhost:

curl -X POST localhost:3030/dataset/sparql \
     -d "query=SELECT DISTINCT ?class (COUNT(?i) AS ?count) WHERE { ?i a ?class } GROUP BY ?class ORDER BY DESC(?count)" 
curl localhost:3030/dataset/get