stain / jena-docker

Docker image for Apache Jena riot
Apache License 2.0
99 stars 86 forks source link

Creating a dataset and loading data into it from command line #46

Closed davidsbatista closed 4 years ago

davidsbatista commented 4 years ago

I want to integrate the creation of a dataset and loading of data into the dataset using this Docker image:

Is there a simple and easy way to achieve something this?

./fuseki-server --file=../staging/my_triples.ttl /my_dataset

(NOTE: assuming that /staging is a mounted to a dir on the host)

This requires stopping the server and restarting it again. I would like to start it already with the command above.

Alternatively is there single command that creates a dataset and loads data into it, while the server is already running?

Thanks!

eslavco commented 2 years ago

Hi @davidsbatista , did you manage to do it with one command?

davidsbatista commented 2 years ago

Makefile like this

docker build -t fuseki-docker fuseki-docker
docker run -dit -p 127.0.0.1:3030:3030 fuseki-docker /init.sh  # --tdb2 # --config=/fuseki/config.ttl

and my init.sh looks like this:

#!/bin/bash

/jena/bin/tdbloader2 -d -l /fuseki/wikidata /usr/share/data/<dataset>.ttl.bz2
/jena-fuseki/fuseki-server -v --config=/fuseki/config.ttl

hope it helps :)