neo4j LOAD CSV returns Couldn't Load external resource

我的梦境 提交于 2019-12-07 22:41:20

问题


Trying CSV import to Neo4j - doesn't seem to be working.

I'm loading a local file using the syntax:

LOAD CSV WITH HEADERS FROM "file:///location/local/my.csv" AS csvDoc

Am wondering if there's something wrong with my CSV file, or if there's some syntax problem here.

If you didn't read the title, the error is:

Couldn't load the external resource at: file:/location/local/my.csv
[Neo.TransientError.Statement.ExternalResourceFailure]

回答1:


Neo4j seems to need a full path spec to get a file on the local system.

On linux or mac try

LOAD CSV FROM "file:/Users/you/location/local/my.csv"

On windows try

LOAD CSV FROM "file://c:/location/local/my.csv"

.




回答2:


In the browser interface (Neo4j 3.0.3, MacOS 10.11) it looks like Neo4j prefixes your file path with $path_to_graph_database/import. So you could move your files there. If you are using a command line tool, then see this SO question.




回答3:


Easy solution: Once you choose your database location (in my case ReactomeGraphDB60)... here I placed my ddbb ...go to that folder, and create inside a folder called "import".

Later in the cypher query write (as an example): LOAD CSV WITH HEADERS FROM "file:///ILClasiffStruct.csv" AS row CREATE (n:Interleukines) SET n = row



来源:https://stackoverflow.com/questions/25884370/neo4j-load-csv-returns-couldnt-load-external-resource

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!