1

我制作了一个简单的结构,但在使用 Cypher 查询它时遇到了一些问题。给定以下结构:http ://console.neo4j.org/r/p2xieh

我怎么知道我所有读过“书作者”书籍的朋友?我怎么知道我所有的朋友都读了“书作者”的书并且排名高于 4?

4

1 回答 1

2

我所有读过“书作者”书籍的朋友:

start me=node(1) 
match me-[:KNOWS]-friend-[:READ]-book-[:WRITTEN_BY]-author 
where author.name='Book Author' 
return friend.name

和我所有读过“书作者”排名高于4的书的朋友

start me=node(1) 
match me-[:KNOWS]-friend-[:READ]-book-[:WRITTEN_BY]-author 
where author.name='Book Author' and book.rank? > 4 
return friend.name
于 2012-11-27T19:51:42.850 回答