Hi,
I've been trying to code the above relationship between two users from the MOVIE Lens database and it gives me the following error. Can someone help? I just registered with the community so I hope I did't do anything wrong already Thx
CYPHER CODE:
MATCH(u1:User{name:"Angela Thompson"})
MATCH(u2:User{name:"Nicole Ramsey"})
MATCH(u1)-[r1:RATED]->(m:Movie)-[:IN_GENRE]->(g:Genre{name:"Drama"})<-[:IN_GENRE]-(m:Movie)<-[r2:RATED]-(u2)
WITH u1, avg(r1.rating) AS u1_average
WITH u2, avg(r2.rating) AS u2_average
MATCH(u1)-[r1:RATED]->(m:Movie)-[:IN_GENRE]->(g:Genre{name:"Drama"})<-[:IN_GENRE]-(m:Movie)<-[r2:RATED]-(u2)
WHERE r1.rating>1
WHERE r2.rating>1
RETURN *;
Okay, a cypher request like this should do the trick:
MATCH p=(u1:User{name:"Angela Thompson"})-[r1:RATED]->(m:Movie)-[:IN_GENRE]->(g:Genre{name:"Drama"})<-[:IN_GENRE]-(m:Movie)<-[r2:RATED]-(u2:User{name:"Nicole Ramsey"})
WITH p, avg(r1.rating) AS u1_average, avg(r2.rating) AS u2_average
WHERE u1_average > 1 AND u2_average > 1
RETURN p
MATCH (u1:User{name:"Angela Thompson"})-[r1:RATED]->(m:Movie)-[:IN_GENRE]->(g:Genre{name:"Drama"})<-[:IN_GENRE]-(m:Movie)<-[r2:RATED]-(u2:User{name:"Nicole Ramsey"})
RETURN avg(r1.rating) AS u1_average, avg(r2.rating) AS u2_average
MATCH (u1:User{name:"Angela Thompson"})-[r1:RATED]->(m:Movie)-[:IN_GENRE]->(g:Genre{name:"Drama"})<-[:IN_GENRE]-(m:Movie)<-[r2:RATED]-(u2:User{name:"Nicole Ramsey"})
RETURN r1.rating AS u1_average, r2.rating AS u2_average
and this please
MATCH (u1:User{name:"Angela Thompson"})-[r1:RATED]->(m:Movie)-[:IN_GENRE]->(g:Genre{name:"Drama"})<-[:IN_GENRE]-(m:Movie)<-[r2:RATED]-(u2:User{name:"Nicole Ramsey"})
RETURN *
Here;s the website to download the database. The big one is 3GB but there are smaller version of 5MB and 1MB. I'm not really sure which is used on the web software.