Describe your movie data model

Your movies dashboard will query nodes, relationships, and properties. Knowing the model helps you write Cypher and choose the right chart types. In this lesson you will learn:

  • How to describe the Movies graph model (nodes, relationships, properties)

  • How to map stakeholder questions to the data model

  • How to identify the key entities, relationships, and properties in your graph

Understanding requirements

To understand your graph data model, consider the following questions:

  • What are the main node labels and relationship types in your data?

  • What properties do nodes and relationships have? For example, movies have a title and release year; ratings have a score.

  • What insights do you want to gain from your data?

For example, the following structure can be used to describe the movie project:

  • Node labels:

    • Movie: the main entity representing films

    • Actor: people who perform in movies

    • Director: people who direct movies

    • Genre: categories that movies belong to

    • User: people who rate and review movies

  • Relationship types:

    • ACTED_IN: connects Actor or Person to Movie

    • DIRECTED: connects Director or Person to Movie

    • RATED: connects User to Movie

    • IN_GENRE: connects Movie to Genre

  • Properties:

    • Movie: title, release_year, genre

    • Actor: name, birthdate

    • Director: name, birthdate

You can view this graph model structure by running CALL db.schema.visualization in the Query tool, which you used in the previous lesson to verify your data:

Movie Graph Model

Analyzing movies project structure

Challenge:

Using the movie dataset in your instance, analyze stakeholder requirements and map them to the data model components to design a dashboard for a streaming service executive:

Step 1: Identify stakeholders and their goals

Ask questions to understand the stakeholders and their goals. For example:

  • Who is the audience for the dashboard?

  • What are the key metrics they want to track?

Consider the following use case - the stakeholders are streaming service executives, content acquisition team and marketing department, who want to track user engagement and content performance metrics, such as:

  • Genre trends over time.

  • Top-rated movies and actors.

  • Identify popular content for acquisition.

Step 2: Map requirements to data model components

Based on the stakeholders' goals, map the requirements to the data model components, by asking more specific questions:

  • What are the most popular genres?

    • Data needed: Movie nodes with genre property, and RATED relationships to User nodes.

  • Can the number of movies in each genre be counted?

    • Data needed: Movie nodes with genre property.

  • Optional: Can a query pattern be defined to find top 10 rated movies per user?

In this scenario, you would need to query Movie nodes that are rated by each User node and find the top 10 rated movies for each user.

Using the dashboard you created in the Exploring Dashboards lesson, run this Cypher query in the dashboard’s card editor to get the results:

cypher
What are top 10 movies and users that have rated those movies?
MATCH (u:User)-[r:RATED]->(m:Movie)
RETURN m.title AS movie, u.name AS user, r.rating AS rating
ORDER BY r.rating DESC
LIMIT 10
  • Which directors have the highest average movie ratings?

    • Data needed: Director nodes, DIRECTED relationships to Movie nodes, and RATED relationships.

When you add cards in the next lesson, you can run this natural language prompt to get the results: 'Which directors have the highest average movie ratings?'

Click on Generate and choose the preferred visualization type to display the results, such as a pie chart or bar chart:

Best practices for dashboard design

  • Analyze your data model before building dashboards

  • Understand your stakeholders' goals and requirements

  • Choose relevant metrics that align with business objectives

  • Be specific about the node and relationship labels

Check your understanding

Understanding your movie data model structure

You want to visualize how actors are connected to movies in the Movies graph. Which parts of the graph data model do you use to build that visualization?

  • ✓ Nodes, which represent entities such as Movie and Person

  • ✓ Relationships, such as ACTED_IN connecting Person to Movie

  • ✓ Properties, such as title on Movie nodes and name on Person nodes

  • ❏ Instances, which are database containers and not part of the model

Hint

A graph data model consists of nodes, which represent entities such as Movie and Person; relationships, which are connections such as ACTED_IN; and properties, which are attributes such as title and name. These components define what you can visualize in dashboards. Instances are where the data is stored; they are not part of the model structure.

Solution

The correct options are:

  • Nodes: Represent entities such as Movie nodes and Person nodes

  • Relationships: Define connections between nodes; for example, ACTED_IN connects actors to movies

  • Properties: Provide attributes on nodes and relationships, such as title on Movie, name on Person, and characters on ACTED_IN

These components define your data model and determine what insights you can visualize in dashboards. Instances are database containers where your data is stored, not components of the data model structure.

Summary

In this lesson you learned how to describe the graph model and map stakeholder questions to nodes, relationships, and properties.

In the next lesson you will add more cards and a filter to the dashboard you created in the previous module.

Chatbot

How can I help you today?