Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The code doesn't match the schema #64

Open
alastair1970 opened this issue Dec 30, 2021 · 0 comments
Open

The code doesn't match the schema #64

alastair1970 opened this issue Dec 30, 2021 · 0 comments

Comments

@alastair1970
Copy link

The readme suggests to use this database: Go to https://sandbox.neo4j.com/?usecase=recommendations&ref=movie-app-tutorial, pick "Recommendations", and press play to start the database.

The recommendations database has relationships: DIRECTED, ACTED_IN, RATED, IN_GENRE
However the code expects these relationships: DIRECTED, ACTED_IN, RATED, IN_GENRE, PRODUCED, WRITER_OF

Also the code has looks for "tmdbId" in the below cypher. tmdbId should be imdbId:

MATCH (movie:Movie {tmdbId: $movieId})
OPTIONAL MATCH (movie)<-[my_rated:RATED]-(me:User {id: null})
OPTIONAL MATCH (movie)<-[r:ACTED_IN]-(a:Person)
OPTIONAL MATCH (related:Movie)<--(a:Person) WHERE related <> movie
OPTIONAL MATCH (movie)-[:IN_GENRE]->(genre:Genre)
OPTIONAL MATCH (movie)<-[:DIRECTED]-(d:Person)
OPTIONAL MATCH (movie)<-[:PRODUCED]-(p:Person)
OPTIONAL MATCH (movie)<-[:WRITER_OF]-(w:Person)
WITH DISTINCT movie,
my_rated,
genre, d, p, w, a, r, related, count(related) AS countRelated
ORDER BY countRelated DESC
RETURN DISTINCT movie,
my_rated.rating AS my_rating,
collect(DISTINCT d) AS directors,
collect(DISTINCT p) AS producers,
collect(DISTINCT w) AS writers,
collect(DISTINCT{ name:a.name, id:a.tmdbId, poster_image:a.poster, role:r.role}) AS actors,
collect(DISTINCT related) AS related,
collect(DISTINCT genre) AS genres
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant