使用Rik Van Bruggen的“Learning Neo4j”中的相同代码获得Neo4j语法错误

时间:2018-02-14 10:29:59

标签: neo4j cypher

我使用了Rik的book(第105页)中的以下代码: enter image description here

但是,我收到以下语法错误: enter image description here

我假设引用关系类型的符号是反引号`

请问如何纠正语法错误?

2 个答案:

答案 0 :(得分:2)

这可能只是本书中的拼写错误,也可能是旧语法风格。您应该将括号括在fromto变量中:

load csv with headers from "file:/your/path/to/rels.csv"
as rels
match (from {id: rels.From}), (to {id: rels.To})
create (from)-[:REL {type: rels.`Relationship Type`}]->(to)
return from, to

答案 1 :(得分:1)

尝试添加这样的括号: CREATE (from)-[:REL {type:rels.`Relationship type`}]->(to) 在v3.0之前,模式中的括号不是强制性的,现在它们是。