简体   繁体   English

密码查询复合关系匹配

[英]cypher query composite relationship match

with a graph successfully matching 图成功匹配

MATCH (a:A)-[x:X]-(b:B)-[y:Y]-(c:C) RETURN *

is it possible to return something like 是否有可能返回类似的东西

(a:A)-[z:Z]-(c:C)

which has a 'new' relationship z (let's call it 'linked via a B') that does not exist in the graph database, and that in effect represents a collapsing of 图表数据库中不存在的z具有“新”关系z(我们称其为“通过B链接”),实际上代表着z的折叠

-[x:X]-(b:B)-[y:Y]- 

to

-[z:Z]-

Note, that the relationship -[z:Z]- does not exist in the graph. 请注意,关系-[z:Z]-在图中不存在。

Possible? 可能? What would the cypher look like? 密码是什么样的?

thanks 谢谢

This is possible with virtual relationships via APOC Procedures : 通过APOC程序通过虚拟关系可以做到这一点:

MATCH (a:A)-[x:X]-(b:B)-[y:Y]-(c:C)
CALL apoc.create.vRelationship(a,'Z',{}, c) YIELD rel
RETURN a, rel, c

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM