Loading your local files in TerminusDB

We have got lot’s of feedback since we have posted our tutorial — My First TerminusDB Graph Visualisation. One of the most common questions is how to load a local CSV in the hard drive into your TerminusDB running in a local docker container. So here is how to do it.

If your container is running stop it with:

./terminusdb-container stop

Extra tip: you may want to run ./terminusdb-container rm-config now before you mount the volume. This remove old settings to advoid version conflits that may comes in later if there’s a newer version of Docker image avaliable.

set the TERMINUSDB_LOCAL environment variable to the path to the parent directory of your csv:

export TERMINUSDB_LOCAL=/home/me/somewhere

for Windows users:

export TERMINUSDB_LOCAL=c:/Users/you/somewhere

Go to Docker Desktop Settings and make sure that the Drive (i.e. ‘C’) your file on is enabled in Shared Drives

Windows setup Make sure the ‘C’ is clicked and ‘Apply’

then start your container again:

./terminusdb-container run

now, TERMINUSDB_LOCAL will be mounted as /app/local_files so, in your WOQL query, you can use: .file(/app/local_files/myfilename.csv) instead of .remote()

Hope it helps with lot’s of you who want to load csv locally. Thanks Dmytri Kleiner for figuring it out!