我正尝试使用apoc.do.case创建某种关系,具体取决于在阅读CSV后使用WITH是否存在文件中的行
但是,似乎无法将“行”传递到案例中
我的尝试:
LOAD CSV WITH HEADERS FROM 'url' AS row
MERGE (i:Investor {Name: row.Investor_Name})
MERGE (ir:Investment_Round {id: row.Deal_ID})
WITH row, i, ir
CALL apoc.do.case([
row.Funds_Used IS NULL,
'MERGE (i)-[r:INVESTED_IN]->(ir) SET r.Investment_Size_million_GBP=toFloat(row.Investment_Size_million_GBP), r.Investment_Size_million_EUR=toFloat(row.Investment_Size_million_EUR)',
row.Funds_Used IS NOT NULL, 'MERGE (f:Fund {Name: row.Funds_Used}) WITH row, f, i, ir MERGE (i)-[r:HAS_FUND]->(f) MERGE (f)-[r2:INVESTED_IN]->(ir) SET r2.Investment_Size_million_GBP = row.Investment_Size_million_GBP, r2.Investment_Size_million_EUR = row.Investment_Size_million_EUR;'])
YIELD value RETURN value;
错误:
Failed to invoke procedure `apoc.do.case`: Caused by: org.neo4j.exceptions.SyntaxException: Variable `row` not defined (line 1, column 75 (offset: 74))
"MERGE (i)-[r:INVESTED_IN]->(ir) SET r.Investment_Size_million_GBP=toFloat(row.Investment_Size_million_GBP), r.Investment_Size_million_EUR=toFloat(row.Investment_Size_million_EUR)"
1条答案
按热度按时间gab6jxml1#
您没有将
row
变量作为参数传递。请尝试以下操作: