每个人
我有两个节点(S1,S2)。
S1
USING PERIODIC COMMIT
LOAD CSV with HEADERS FROM "file:/S1.csv" AS line
CREATE (a:S1 {ID: TOINT (line.ID)})
set a.Depth_m =TOINT (line.depth );
S1节点属性值为:
ID Depth_m
1 100.06
2 100.20
3 100.37
4 101.29
5 101.50
6 101.88
7 102.42
8 102.70
9 102.92
S2是
USING PERIODIC COMMIT
LOAD CSV with HEADERS FROM "file:/S2.csv" AS line
CREATE (b:S2 {ID: TOINT (line.ID)})
set b.Depth_m =TOINT (line.depth );
S2节点属性值为:
ID Depth_m
1 100.25
2 101.55
3 102.75
所以,我想建立两个节点的值之间的关系,其中S1和S2的值(Depth_m)大致相同(差异小〜0.5)。
例如,结果应该是:
S1 S2
ID Depth_m ID Depth_m
1 100.20 =======>> 1 100.25
2 101.50 =======>> 2 101.55
3 102.70 =======>> 3 102.75
ROUND可以解决这个问题吗?如果它可以做某事,我该如何使用它?
谢谢)
答案 0 :(得分:0)
此查询(用于处理S2.csv
文件)应该执行您想要的操作:
USING PERIODIC COMMIT
LOAD CSV with HEADERS FROM "file:/S2.csv" AS line
CREATE (b:S2 {ID: TOINT(line.ID), Depth: TOINT(line.depth)})
WITH b
MATCH (a:S1) WHERE ABS(a.Depth-b.Depth) <= 0.5
CREATE (a)-[:SIMILAR]->(b);