我正在导入从关系数据库导出的.CSV文件 . 导入正常,但是当我尝试使用指定的标签在创建的节点之间创建关系时,它会为关系创建新节点,而不是使用现有标签 . 我已经连续3天撞到这头了 - 任何想法?
码:
USING PERIODIC COMMIT
LOAD CSV WITH HEADERS FROM "file:///seshatdata/sellable_unit_features.csv" AS line
WITH line, SPLIT(line.ship_dt, '-') AS date
CREATE (sellableunit:SellableUnit {sellable_unit_id: line.sellable_unit_id, sellable_unit_nm: line.sellable_unit_nm, sellable_unit_version_id: line.sellable_unit_version_id})
MERGE (feature:Feature {Feature_id:line.feature_id, feature_nm: line.feature_nm})
CREATE (SellableUnit)-[r:CONTAINS]->(Feature)
SET r.start_year = TOINT(date[0]);
显然,这是 CREATE (SellableUnit)-[r:CONTAINS]->(Feature)
知道原因 .
1 回答
您的Cypher查询存在拼写错误 . Cypher对variable declarations区分大小写 .
试试吧:
您正在将节点存储到名为
sellableUnit
(小写s)的变量中,但在CREATE
语句中使用名为SellableUnit
(大写S)的变量 .feature
也一样 .