I have 3 nodes:
- Users (
id
,age
). - Ratings (
isbn
,id
,rating
(this has a value of0
to10
)). - Books (
isbn
,title
, ...)
And the relationships:
Users - [GIVE_RATINGS]-Ratings -[BELONGS_TO]- Books
I need to create a recommendation where the input will be one or more books the reader liked, and the output will be books that users who rated positively also rated books the reader has already read.
I tried to create such a query, but it doesn't work.
MATCH (u:Users{id:'11676'})-[:GIVE_RATING]->(book)<-[:GIVE_RATING]-(person), (person)-[:GIVE_RATING]->(book2)<-[:GIVE_RATING]-(r:Ratings{rating:'9'})
WHERE NOT EXIST (book2)-[:GIVE_RATING]->(u)
RETURN book2.isbn,person.id