我正在寻找将标签从一个节点复制到另一个节点的方法。我发现了这篇文章How can we copy labels from one node to another in one cypher?。但看起来像是在谈论简单的方法。我正在寻找任何解决方案,例如迭代标签列表。我试过这个
Create (q:Label1:G2:Label2{id: 14111, t: 99999999999999})-
[r1:CONSISTS_OF{t:99999999999999}]->
(g1:Label1:G1:Label2:Label3{t: 99999999999999, name:'name1'}),
(q)-[r221:CONSISTS_OF{t:99999999999999}]->
(g2:Label1:G1:Label2:Label4{t: 99999999999999, name:'name2'}),
(q)-[r2:CONSISTS_OF{t_end:99999999999999}]->
(g2123:Label1:G1:Label2:Label3{t_end: 99999999999999, name_ru:'name2'})
return *
Match (g2:G2)-->(g1:G1) with g1
Create (g1Instance) set g1Instance = g1
FOREACH (n IN labels(g1) | set g1Instance: n) return g1Instance
但它不是标签(g1),而是设置标签" n"到g1Instance。
答案 0 :(得分:1)
如前所述[{3}}:
不幸的是,目前无法直接从数据设置标签 值。
但是你可以使用apoc程序@cybersam:
[i for i in liste2 if i[0] not in [j[0] for j in liste1]]