10
votes

So I've been trying to import an external CSV file into my graphdb. My neo4j is stored in a Docker container. I placed the file in NEO_HOME/import, as implied. I called the LOAD CSV command with "file:///mycsv.csv" as an argument, and got the followng in return

Couldn't load the external resource at: file:/var/lib/neo4j/import/mycsv.csv

Since I'm running the Docker container on a Windows environment, I don't see where the /var directory should be. Even when browsing the container itself via the Docker Quickstart Terminal. I still cannot find /var/lib...

When trying to change the .conf file to a different import directory, it didn't help as well.

Did somebody have this before?

2

2 Answers

12
votes

You have to explicitly mount your import folder when invoking docker:

docker run -e NEO4J_AUTH=none -p 7474:7474 -p 7687:7687 -v $PWD/plugins:/plugins -v $PWD/import:/var/lib/neo4j/import neo4j:3.1.3-enterprise
0
votes

When you run this command:

   docker run \
     --name testneo4j \
     -p7474:7474 -p7687:7687 \
     -d \
     -v $HOME/neo4j/data:/data \
     -v $HOME/neo4j/logs:/logs \
     -v $HOME/neo4j/import:/var/lib/neo4j/import \
     -v $HOME/neo4j/plugins:/plugins \
     --env NEO4J_AUTH=neo4j/test \
     neo4j:latest

The physical directory on Windows will be probably located in C:\Users\<your user>\neo4j like this:

  C:\Users\<your user>\neo4j data;C import;C logs;C plugins;C

https://i.stack.imgur.com/VuW46.png