Complex Cypher:匹配引用结果的相互关联的问题
Complex Cypher: Match interconnected questions referencing a result
我正在尝试编写一些疯狂的密码,感谢您的帮助。
我的图表中有问题节点、答案关系和结果节点。答案关系有一个名为文本的字段,可以是 'yes' 或 'no'。
我想找到由 'No' 链接的所有问题节点,它们的所有 'yes' 都指向同一个结果节点。任何人都可以让我走上正轨吗?我现在只有这个微不足道的起点:
MATCH n-[:Answer]->(m:Result {id: "DesiredResultId"}) RETURN n,m
初步推荐:
match (r:result)<-[:answer{text:"yes"}]-(n:question)-[:answer{text:"no"}]-(m:question)-[:answer{text:"yes"}]->(r)
return n, m
修改后的推荐(发现no值也可以是"not sure"):
match (r:result)<-[:answer{text:"yes"}]-(n:question)-[a:answer]-(m:question)-[:answer{text:"yes"}]->(r)
where a.text = "no" or a.text = "not sure"
return n, m
我正在尝试编写一些疯狂的密码,感谢您的帮助。
我的图表中有问题节点、答案关系和结果节点。答案关系有一个名为文本的字段,可以是 'yes' 或 'no'。
我想找到由 'No' 链接的所有问题节点,它们的所有 'yes' 都指向同一个结果节点。任何人都可以让我走上正轨吗?我现在只有这个微不足道的起点:
MATCH n-[:Answer]->(m:Result {id: "DesiredResultId"}) RETURN n,m
初步推荐:
match (r:result)<-[:answer{text:"yes"}]-(n:question)-[:answer{text:"no"}]-(m:question)-[:answer{text:"yes"}]->(r)
return n, m
修改后的推荐(发现no值也可以是"not sure"):
match (r:result)<-[:answer{text:"yes"}]-(n:question)-[a:answer]-(m:question)-[:answer{text:"yes"}]->(r)
where a.text = "no" or a.text = "not sure"
return n, m