Add Users Ratings

Challenge

In this challenge, you will add movie ratings to the graph.

You will create a new node for each User and a RATED relationship between the User and the Movie nodes.

A graph showing the User node with userId and name properties, and the RATED relationship with rating and timestamp properties to a Movie node

Data

The data for the node and relationship is stored in a single file, ratings.csv, which contains the following columns:

  • movieId: The ID of the movie that the user rated.

  • userId: The user’s ID.

  • name: The user’s name.

  • rating: The user’s rating of the movie.

  • timestamp: The timestamp when the user created the rating.

The User node should have userId and name properties, and the RATED relationship should have rating and timestamp properties.

Process

The process is the same as importing from a single file as it is from multiple files:

  1. Upload the ratings.csv.

  2. Create the model for the data, in this case, a User node and a RATED relationship to the Movie node.

  3. Map the columns to the model. The node and the relationship will use the same ratings.csv file.

  4. Import the data.

View the data

You can check you have imported the data by running the following query to return User nodes and the RATED relationship:

cypher
MATCH (u:User)-[r:RATED]->(m:Movie)
RETURN u,r,m
LIMIT 25
A graph showing User nodes with RATED relationships to Movie nodes
Need to download a working solution?

This Data Importer model, person-movie-user-import.zip, contains a working solution for this exercise.

Download the model and open it using the Open model (with data) button in the …​ menu.

The Open model (with data) button highlighted in the menu.

Note that this will replace your existing model.

Summary

In this lesson, you learned how to import multiple nodes and relationships from a single file.

In the next lesson, you will explore the considerations for using Data Importer.