Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
07-27-2022 01:32 AM
Angela Thompson interacts with Braveheart movie. Recommend her a Movie based on other users who have also seen Braveheart.
Hello,
I've been trying to code the above from the MovieLens database but i dont get it right. This is what i did so far, can someone help please?
MATCH (u1:User{name:"Angela Thompson"})
MATCH(m1:Movie {title: "Braveheart"})
MATCH (u1:User{name:"Angela Thompson"})-[:RATED]->(m1:Movie)-[:IN_GENRE]->(g:Genre)<-[:IN_GENRE]-(m2:Movie)<-[:RATED]-(m1:Movie {title: "Braveheart"})
WITH COUNT(*) AS usersWhoAlsoWatched
RETURN *;
07-27-2022 03:17 AM
What is your database model?
07-27-2022 03:23 AM
Hello glilienfield,
I am using the MovieLens database
07-27-2022 03:43 AM
Execute this command in Neo4j Browser:
CALL db.schema.visualization();
and upload the result here.
07-27-2022 03:51 AM
07-27-2022 04:32 AM
This query should do what you want:
MATCH (u:User {name: "Angela Thompson"})-[:RATED]->(:Movie {title: "Braveheart"})<-[:RATED]-(:User)-[:RATED]->(m:Movie)
RETURN m.title AS movie, count(*) AS count
07-27-2022 05:05 AM
07-27-2022 05:07 AM
What graph do you want? If you want to see Movie nodes, just do:
RETURN m, count(*) AS count
07-27-2022 05:15 AM
All the sessions of the conference are now available online