In this project we costumize a Docker image to create a graph model in Neo4j using the MovieLens dataset.
Follow the instructions at data before proceeding with the next step.
docker compose up -d
You can also specify unique constraints that guarantee uniqueness of a certain property on nodes with a specific label.
docker exec movielens-neo4j-neo4j-1 cypher-shell -u neo4j -p test 'CREATE CONSTRAINT ON (n:User) ASSERT n.userId IS UNIQUE'
docker exec movielens-neo4j-neo4j-1 cypher-shell -u neo4j -p test 'CREATE CONSTRAINT ON (n:Movie) ASSERT n.movieId IS UNIQUE'
Navigate to localhost:7474 to run queries upon the movielens graph data model. For instance, a list of movies ordered by popularity can be obtained with the following query:
MATCH p=()-->(n)
WITH n.title AS title, count(p) AS popularity
RETURN title, popularity
ORDER BY popularity DESC
LIMIT 10