splunk
splunk

Reputation: 6779

import dataset into neo4j

I'm trying to import a dataset (csv file) in Neo4J. I'm on Ubuntu 16 and I'm following this guide:

When I do this:

neo4j_home$ ./bin/neo4j-import --into path_to_target_directory --nodes movies.csv --nodes actors.csv --relationships roles.csv

I get (in ubuntu terminal) this error:

Input error: Directoy '<my target directory here>' not writable: No such file or directory

Can you help me? This is my following structure under usr/share/neo4j (folder name are in bold):

- bin
  - neo4j
  - neo4j-admin
  - neo4j-import // what I use for importing
  - neo4j-shared.sh
  - neo4j-shell 

- import (I created this directory which holds the file to import)
  - MyTestDir
    - first.csv
    - second.csv
    - third.csv

for completeness: I also have these 2 folders
- lib (some jar files here) 
- tools 
  - config-migrator.jar

How do I import first.csv, second.csv and third.csv into neo4j?

I tried with (note i'm inside bin folder): ./neo4j-import --into <dont know what write here> --nodes ../import/MyTestDir/first.csv ../import/MyTestDir/second.csv ../import/MyTestDir/third.csv

Upvotes: 0

Views: 346

Answers (2)

Arezoo
Arezoo

Reputation: 472

The --into refers to your database directory which is /var/lib/neo4j/data/databases/MY_GRAPH in Linux. Make sure you have full permission on usr/share/neo4j directory. So your import should be like this :

sudo neo4j-import --into /var/lib/neo4j/data/databases/MY_GRAPH  --stacktrace --nodes "/usr/share/neo4j/import/MyTestDir/first.csv,/usr/share/neo4j/import/MyTestDir/second.csv,/usr/share/neo4j/import/MyTestDir/third.csv"

Upvotes: 0

Mattias Finn&#233;
Mattias Finn&#233;

Reputation: 3054

Perhaps the user you're executing neo4j-import as doesn't have write access to the folder you're importing into? Have you tried --into /usr/share/neo4j/data/graph.db or similar?

Upvotes: 1

Related Questions