Skip to content

Design a schema

To manipulate graph data in Nebula Graph with Studio, you must have a graph schema. This article introduces how to design a graph schema for Nebula Graph.

A graph schema for Nebula Graph must have these essential elements:

  • Tags (namely vertex types) and their properties.
  • Edge types and their properties

In this article, the Social Network: MOOC User Action Dataset and 97 distinct course names are used to introduce how to design a schema.

This table gives all the essential elements of the schema.

Element Name Property name (Data type) Description
Tag user No property. Represents users of the specified MOOC platform. The userId values are used as VIDs of user vertices.
Tag course courseId (int). Represents the courses on the specified MOOC platform. The courseName values are used as the VIDs of the course vertices.
Edge type action - actionId (int)
- duration (double): Represents the duration of an action measured in seconds from the beginning. Its values are equal to the timestamp values in the data source.
- label (bool): Represents whether a user drops out after an action. TRUE indicates a drop-out action, FALSE otherwise.
- feature0 (double)
- feature1 (double)
- feature2 (double)
- feature3 (double)
Represents actions taken by users on the specified MOOC platform. An action links a user and a course and the direction is from a user to a course. It has four features.

This figure shows the relationship (action) between a user and a course on the MOOC platform.

Users take actions on a MOOC platform


Last update: December 30, 2020
Back to top