Neo4j加载CSV错误严重

时间:2019-02-22 05:45:21

标签: csv neo4j cypher load

我已经尝试了以下所有变种,并梳理并尝试了针对此处发布的类似问题提供的许多解决方案。 我尝试:

LOAD CSV WITH HEADERS 
FROM "file:///C:/neo/coordinates.csv" 
AS Line
CREATE (c:Church {id: toInteger(Line.id), name: Line.name, address: toInteger(Line.address), city: line.city, state: toInteger(Line.state) long: toInteger(Line.long), lat: toInteger(Line.lat), g: toInteger(Line.g)})

并得到这样的错误-

  

Neo.ClientError.Statement.SyntaxError:无效的输入“ l”:预期的空格,注释,“。”,节点标签,“ [”,“ =〜”,IN,STARTS,ENDS,CONTAINS,IS,'^ ','*','/','%','+','-','=','〜',“ <>”,“!=”,'<','>',“ < =“,”> =“,AND,XOR,OR,','或'}'(第4行,第140列(偏移量:209))

有帮助吗?我对此很陌生。哦,我在Windows 10上。谢谢!

1 个答案:

答案 0 :(得分:0)

在属性前加一个逗号(,)。

在这一部分:

  

state:toInteger(Line.state) long:toInteger(Line.long)

另外,将 line 更改为 Line 此处

  

city:line.city

我要在此处添加更正的查询:

LOAD CSV WITH HEADERS 
FROM "file:///C:/neo/coordinates.csv" 
AS Line
CREATE (c:Church {id: toInteger(Line.id), name: Line.name, address: toInteger(Line.address), city: Line.city, state: toInteger(Line.state), long: toInteger(Line.long), lat: toInteger(Line.lat), g: toInteger(Line.g)})