简体   繁体   English

Neo4j加载CSV文件

[英]Neo4j Loading CSV file

I trying to upload CSV to Neo4j Desktop (Version 3.3.5 Enterprise). 我试图将CSV上传到Neo4j Desktop(版本3.3.5企业版)。 Here is my code: 这是我的代码:

LOAD CSV WITH HEADERS FROM "file///:C:/Users/dr-gouda/.Neo4jDesktop/neo4jDatabases/database-22e2ad52-6882-472b-abc6-6c1594e733f2/installation-3.3.5/import/test.csv" as types 
create (a1:Type {Label: types.Label, Name: types.Name, Age: types.Age})

I got this message as an error: 我收到此消息是错误消息:

Neo.ClientError.Statement.ExternalResourceFailed: Invalid URL 'file///:C:/Users/dr-gouda/.Neo4jDesktop/neo4jDatabases/database-22e2ad52-6882-472b-abc6-6c1594e733f2/installation-3.3.5/import/test.csv': no protocol: file///:C:/Users/dr-gouda/.Neo4jDesktop/neo4jDatabases/database-22e2ad52-6882-472b-abc6-6c1594e733f2/installation-3.3.5/import/test.csv

What is going on and what can I do? 这是怎么回事,我该怎么办?

Files for import are relative to the import directory for the db in question (otherwise a user using a load query to supply a file path to a sensitive file, which would be a huge security problem). 要导入的文件相对于相关数据库的导入目录(否则,用户使用负载查询来提供敏感文件的文件路径,这将是一个巨大的安全问题)。

Since you already have the file there, use the relative path ... FROM "file:///test.csv" ... 由于文件已经存在,请使用相对路径... FROM "file:///test.csv" ...

Also, the : was in the wrong place. 另外, :放在错误的位置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM