Create a schema¶
Explorer allows you to create a schema by using GUI.
Note
- Users can use the Schema drafting function to design schema visually. For more information, see Schema drafting.
- Users can directly execute nGQL commands on the console to manage the schema.
Prerequisites¶
- Your account has the privilege of GOD, ADMIN, or DBA. For more information, see Roles and privileges .
- The schema is designed.
Note
If no graph space exists and your account has the GOD privilege, you can create a graph space on the Console page.
Entry¶
At the top navigation bar, click .
Create graph space¶
- Click Create Space.
- Set parameters. For descriptions of the parameters, see CREATE SPACE.
- Click Create.
Create Tag or Edge type¶
- In the Graph Space List page, find a graph space and then click its name or click Schema in the Operations column.
- Click the Tag or Edge Type tab and click the Create button.
-
Set parameters. For descriptions of the parameters, see CREATE TAG or CREATE EDGE.
Note
If no index is set for the tag, you can set the TTL configuration. For more information, see TTL configuration.
-
Click Create.
In the Tag and Edge Type lists, you can perform modification and deletion operations.
Create index¶
Note
- Before creating an index, ensure that the associated Tag or Edge type has been created.
- The index can decrease the write speed during data import. We recommend that you import data first and then create and rebuild an index. For more information, see Index overview.
- In the Graph Space List page, find a graph space and then click its name or click Schema in the Operations column.
- Click the Index tab and click the Create button.
-
Set parameters. For descriptions of the parameters, see CREATE INDEX.
Note
The order of the indexed properties has an effect on the result of the
LOOKUP
statement. For more information, see LOOKUP. -
Click Create.
In the Index list, you can rebuild or delete the index.
View statistics¶
- In the Graph Space List page, find a graph space and then click its name or click Schema in the Operations column.
- Click Statistics tab and click the Refresh button.
View schema¶
Note
To display this function, you need to enable View Schema in .
- In the Graph Space List page, find a graph space and then click its name or click Schema in the Operations column.
- Click View Schema tab and click the Refresh button.
Other operations¶
In the Graph Space List page, find a graph space and then perform the following operations in the Operations column:
- View Schema DDL: Displays schema creation statements for the graph space, including graph spaces, tags, edge types, and indexes.
- Clone Graph Space: Clone the schema of the graph space to a new graph space.
- Delete Graph pace: Delete the graph space, including the schema and all vertices and edges.