In this module, you design the data model for your recommendation engine.
Graph databases may be different than databases you have used in the past, such as relational databases. There are a few key terms you should know with a graph database:
- Graph: This refers to the entire database as a whole. It can be similar to a ‘table’ in other databases.
- Vertex: A vertex (also called a node) represents an item in the graph. It is generally used to represent nouns or concepts -- people, places, terms, etc. The plural of vertex is vertices and you will see that term used below.
- Edge: An edge is a connection between two vertices. Edges often represent relationships between entities. For example, two people who work together might be connected by a WorksWith edge.
- Label: A label can be used to indicate the type of vertex or edge being added. For example, you may have vertices with the label User to indicate users in your application, as well as vertices with the label Interest to indicate a particular interest that people can follow.
- Property: You can add key-value pairs to your vertices and edges. These are known as properties. For example, your user vertices will have a username property.
When querying a graph, you often start at a particular vertex and traverse the edges to find relationships to that original vertex. In your use case, to find all the people that a particular user follows, you start at the given user and traverse all edges with the label Follow out from that user.
In the following steps, you complete some basic graph queries. First, you load some sample data into your cluster. Then, you see how to query to find a user’s current interests. Finally, you see a query to generate recommendations for a particular user.
Time to Complete Module: 30 Minutes