0
我有了下面的頭和行的CSV文件拆分柱:Neo4j的LOADCSV - 在多個節點
Person,Vehicle
John,2006 Toyota Corola
Rick,2014 Honda Civic
Mary,2015 BMW 5Series
我希望能夠創建以下節點
Person: {John, Rick, Mary}
CarMaker: {Toyota, Honda, BMW}
CarModel: {"Year:2006,Name:Corola", "Year:2014, Name:Civic", "Year:2015, Name:5 Series"}
而以下關係式:
CarMaker-[:MAKES]->CarModel
Person-[:DRIVES]->CarModel
我使用下面的語句:
USING PERIODIC COMMIT 1000
LOAD CSV WITH HEADERS FROM "file:///FakeNulls.csv" AS line
MERGE (person:Person {name: line.Person})
WITH (SPLIT(line.Vehicle," ") AS words |
UNWIND words AS word |
MERGE (carMaker:CarMaker {carMakerName:word[1]})
MERGE (carModel:CarModel {carModelName:word[2], carModelYear:word[0]})
MERGE (carMaker)-[:MAKES]->(carModel)
MERGE (person)-[:DRIVES]->(carModel))
然而,當我運行它,我得到一個錯誤:什麼我做錯了
Invalid input 'S': expected 'n/N' (line 34, column 32 (offset: 1948))
"WITH (SPLIT(line.Vehicle," ") AS words |"
任何想法?
在此先感謝您的幫助。
-MD
謝謝你的答案@InverseFalcon,該訣竅。 – Cracoras