Manage graphs¶
This topic introduces how to manage graphs in NebulaGraph Studio.
- On the Database page, click the name of the database that you created to view the database details.
- On the left-side navigation pane of the database details page, click Graph under Data.
- Follow the steps below to create, delete, manage indexes on graphs, and view statistics about graphs.
Prerequisites¶
A graph type is created. For more information, see Create a graph type.
Create a graph¶
- In the top navigation bar, click the SCHEMA tab.
- In the left-side navigation pane, select the schema where you want to create the graph and click Graph.
- In the upper-right corner, click the Create Graph button.
- In the dialog box that appears, select a graph type from the drop-down list and enter a name for the graph.
- Click OK. The newly created graph is displayed on the Graph List page.
Delete a graph¶
- In the top navigation bar, click the SCHEMA tab.
- In the left-side navigation pane, select the schema where the graph you want to delete is located and then click Graph.
- On the Graph List page that appears on the right, select the graph you want to delete.
- Click at the right of the graph and select Delete.
- In the confirmation dialog box that appears, click Delete.
Manage indexes on graphs¶
NebulaGraph Studio allows you to manage indexes on graphs, including creating, deleting, and rebuilding indexes.
Create an index¶
- In the top navigation bar, click the SCHEMA tab.
- In the left-side navigation pane, select the schema where the graph you want to create an index on is located and then click Graph.
- On the Graph List page that appears on the right, select and click the target graph.
- On the Index tab, click the Create Index button. For each index, specify the following information:
- Index Name: The name of the index.
- On: The node type or edge type on which the index is created.
- Index Properties: The list of properties based on which the index is created. Specify at least one property. For each property, specify the following information:
- Property Name: The name of the property.
- Sort: The sorting order of property values in the index. Valid values: ASC and DESC.
- Click OK to create the index.
For more information about the GQL syntax for creating indexes, see CREATE INDEX. (Initial password: Nebula.123)
Delete an index¶
- In the top navigation bar, click the SCHEMA tab.
- In the left-side navigation pane, select the schema where the graph you want to delete an index for is located and then click Graph.
- On the Graph List page that appears on the right, select and click the target graph.
- On the Index tab, select the index you want to delete.
- Click the delete icon at the right of the index to delete it.
Rebuild an index¶
- In the top navigation bar, click the SCHEMA tab.
- In the left-side navigation pane, select the schema where the graph you want to rebuild an index for is located and then click Graph.
- On the Graph List page that appears on the right, select and click the target graph.
- On the Index tab, select the index you want to rebuild.
- Click the Repair button to rebuild the index data.
View statistics about a graph¶
- In the top navigation bar, click the SCHEMA tab.
- In the left-side navigation pane, select the schema where the graph you want to view statistics about is located and then click Graph.
- On the Graph List page that appears on the right, select and click the target graph.
- Click the Statistic tab.
- To view the latest statistics, click the Execute Stats button to update the statistics about the graph. The statistics provide information about the number of nodes and edges in the graph.