This is what I think you're looking for:
Given a user John, find all movies B such that there exists a movie A, a user Simon, and a genre G where:
- John rated movie A a 5
- Simon rated movie A a 5
- Simon is not John
- Simon rated movie B a 5
- movie A is of genre G
- movie B is of genre G
Phrased this way, I think it's pretty easy to come up with a query:
select B.*
from user John
join rating JohnA on JohnA.userid = John.id and JohnA.value = 5
join movie A on A.id = JohnA.movieid
join rating ASimon on ASimon.movieid = A.id and ASimon.value = 5
join user Simon on Simon.id = ASimon.userid and Simon.id <> John.id
join rating SimonB on SimonB.userid = Simon.id and SimonB.value =5
join movie B on B.id = SimonB.movieid
join movie_genre Agenre on Agrenre.movieID = A.id
join genre G on G.id = Agenre.genreid
join movie_genre Bgenre on Bgenre.genreid = G.id and Bgenre.movieid = B.id
Your database of choice would probably optimize this to remove some joins, but we only really need the relationships (ratings) and not the intermediate objects (movie A, user Simon, and genre G):
select B.*
from user John
join rating JohnA on JohnA.userid = John.id and JohnA.value = 5
join rating ASimon on ASimon.movieid = JohnA.movieid and ASimon.value = 5 and ASimon.userid <> John.id
join rating SimonB on SimonB.userid = ASimon.userid and SimonB.value =5
join movie B on B.id = SimonB.movieid
join movie_genre Agenre on Agrenre.movieID = A.id
join movie_genre Bgenre on Bgenre.genreid = Agenre.genreid and Bgenre.movieid = B.id