Now for a challenge.
We need to refactor the model for a new use case:
Use case #4: How many users rated a movie?
We have already identified the Person and Movie nodes for our use cases:
-
What people acted in a movie?
-
What person directed a movie?
-
What movies did a person act in?
Here is our current graph data model:
We have an additional use case that we must model for. We need to be able to differentiate rating website users from other types of people who are actors and directors.
Note: As you go through this course, you can use any technique you want to for drawing out the graph data model. Most people just use pen and paper.
Adding a new label to the model
What label should be added to nodes to identify any Users who have rated a movie?
-
❏ user
-
✓ User
-
❏ Users
-
❏ Person
Hint
Use a label that represents a user in the database.
There are already labels for Movie and Person. Use a label that differentiates a rating website user who rated movies from a person who acted in or directed movies.
You format labels as CamelCase
with the label starting with a capital letter.
Solution
The answer is User.
user
is in the wrong case. Users
is plural. Person
is already used for actors and directors.
Summary
In this challenge, you demonstrated your skills in identifying an additional label for the graph data model.
The new data model is now:
In the next challenge, you will demonstrate that you can create a node with the new label and properties in the graph.