Understanding the Data Model

Movie data model

In the course, Graph Data Modeling Fundamentals, you learned that the stakeholders of your application must agree upon the important use cases for the application and design the graph data model to optimize the key queries of the application.

For this course we will use this already-designed graph data model:

Movie Data Model

Here we see the node labels that will be created:

  • Person

  • Actor

  • Director

  • Movie

  • Genre

  • User

And we have the relationships:

  • ACTED_IN (with a role property)

  • DIRECTED (with role property)

  • RATED (with rating and timestamp properties)

  • IN_GENRE

Also notice that the nodes have a number of properties, along with the type of data that will be used for each property. It is important that you adhere to the property types defined in the data model.

Each node with a given label has a property that uniquely identifies the node.

  • Movie nodes use movieId.

  • Person nodes use tmdbId.

  • User nodes use userId.

  • Genre nodes use name.

In the next module, you will be loading data into an empty graph from the CSV files to conform to this data model.

Check your understanding

1. Relationship properties

Given the graph data model you will be using to load the CSV data, what relationships have properties?

  • ✓ DIRECTED

  • ✓ ACTED_IN

  • ❏ IN_GENRE

  • ✓ RATED

Hint

These three relationships will be created with properties per the graph data model.

Solution

These are the relationships in the graph data model that could have properties:

  1. DIRECTED

  2. ACTED_IN

  3. RATED

2. Person nodes in the graph data model

A Person node in the graph can also have what labels?

  • ❏ Genre

  • ✓ Actor

  • ✓ Director

  • ❏ User

Hint

These nodes will have an ACTED_IN and/or DIRECTED relationship to Movie nodes.

Solution

A Person node, can also have these labels:

Actor

Director

Summary

In this lesson, you learned about the already-designed graph data model you will use for loading the CSV data in this course. In the next module, you will learn how to import CSV data with the Neo4j Data Importer.

Chatbot

Hi, I am an Educational Learning Assistant for Intelligent Network Exploration. You can call me E.L.A.I.N.E.

How can I help you today?