Add Directed relationship

Your challenge is to add the DIRECTED relationship between the Person and Movie nodes.

a graph showing the DIRECTED relationship

The directed.csv file contains the data to match the Person nodes to the Movie nodes. The file contains the following columns:

  • movieId - The unique identifier of the movie

  • person_tmdbId - the unique identifier of the person who directed the movie

You will need to:

  1. Upload the directed.csv file

  2. Create the DIRECTED relationship between the Person and Movie nodes

  3. Set the Node ID mapping

  4. Run the import

Once you have imported the data, you can run the following query to view the DIRECTED relationships:

cypher
MATCH (p:Person)-[d:DIRECTED]->(m:Movie)
RETURN p,d,m
LIMIT 25
A graph showing the DIRECTED relationship between the Person and Movie nodes

Validate Results

Once you have imported the DIRECTED relationship, click the Check Database button to verify that the task is complete.

Hint

Follow the same steps as the previous lesson, where you imported the ACTED_IN relationship from the acted_in.csv file.

Solution

This Data Importer model, person-movie-acted_in-directed-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.

Review the model; you will see that a DIRECTED relationship has been created between the Person and Movie nodes.

Run the import to add the DIRECTED relationships to the graph.

Summary

In this challenge, you used data importer to create a relationship between nodes.

In the next lesson, you will learn how to import data and nodes from a single CSV file.