我试图在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
答案 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"