Skip to content

jruizvar/movielens-neo4j

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

About

In this project we costumize a Docker image to create a graph model in Neo4j using the MovieLens dataset.

Download and prepare the data

Follow the instructions at data before proceeding with the next step.

Build and run Docker image

docker compose up -d

Using constrains

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

About

Graph model for the dataset MovieLens in Neo4j

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published