将数据集导入neo4j

时间:2016-11-08 14:12:50

标签: neo4j

我试图在Neo4J中导入数据集(csv文件)。 我在Ubuntu 16上,我跟随this指南:

当我这样做时:

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

我得到(在ubuntu终端中)这个错误:

Input error: Directoy '<my target directory here>' not writable: No such file or directory
你能帮帮我吗?这是usr/share/neo4j下的以下结构(文件夹名称以粗体显示):

- 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

如何将first.csv,second.csv和third.csv导入neo4j?

我试过(注意我在bin文件夹中):./neo4j-import --into <dont know what write here> --nodes ../import/MyTestDir/first.csv ../import/MyTestDir/second.csv ../import/MyTestDir/third.csv

2 个答案:

答案 0 :(得分:1)

您执行neo4j-import的用户可能没有对您导入的文件夹的写入权限?您尝试过--into /usr/share/neo4j/data/graph.db还是类似的?

答案 1 :(得分:0)

--into指的是您的数据库目录,在Linux中为/var/lib/neo4j/data/databases/MY_GRAPH。确保您拥有usr/share/neo4j目录的完全权限。所以你的导入应该是这样的:

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"