鉴于此图:
http://console.neo4j.org/r/g3j3xo
我正在尝试返回所有影响同一 schoolTypeClass 中的哲学家的哲学家。首先,我将展示运行良好的查询。问题查询在帖子的底部。
这是上面链接中的默认查询。我的目的是证明数据是存在的。也就是说,亚里士多德和柏拉图都共享 SchoolTypeClass '运动'
MATCH p1:Philosopher-[:MEMBER_OF]->s1:School-[:TYPE_OF]->st1:SchoolType-[:SUBCLASS_OF]->stc1:SchoolTypeClass
WHERE stc1.name = 'movement'
RETURN p1.name as p1Name, s1.name as s1Name, st1.name as st1Name, stc1.name as stc1Name
这是一个运行良好的查询。它与不起作用的查询非常相似。它显示了在同一 schoolType 而不是 schoolTypeClass 中影响哲学家的哲学家
MATCH st2:SchoolType<-[:TYPE_OF]-s2:School<-[:MEMBER_OF]-p2:Philosopher<-[:INFLUENCES]-p1:Philosopher-[:MEMBER_OF]->s1:School-[:TYPE_OF]->st1:SchoolType
WHERE st2 = st1
RETURN p1.name as p1Name, s1.name as s1Name, st1.name as st1Name, p2.name as p2Name, s2.name as s2Name, st2.name as st2Name
问题查询不返回任何内容。如何在同一个 schoolTypeClass 中获得影响哲学家的哲学家?
MATCH stc2:SchoolTypeClass<-[:SUBCLASS_OF]-st2:SchoolType<-[:TYPE_OF]-s2:School<-[:MEMBER_OF]-p2:Philosopher<-[:INFLUENCES]-p1:Philosopher-[:MEMBER_OF]->s1:School-[:TYPE_OF]->st1:SchoolType-[:SUBCLASS_OF]->stc1:SchoolTypeClass
WHERE stc1 = stc2
RETURN p1.name as p1Name, s1.name as s1Name, st1.name as st1Name, stc1.name as stc1Name, p2.name as p2Name, s2.name as s2Name, st2.name as st2Name, stc2.name as stc2Name