Manage graphs¶
Create or delete graphs, manage indexes, and inspect graph statistics in NebulaGraph Studio.
Prerequisites¶
- NebulaGraph Studio is connected to the Graph service of a NebulaGraph Database Developer Edition service group. For more information, see Connect to NebulaGraph Database Developer Edition.
- 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 Confirm. 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 then click 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 and deleting 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 based on its type:
- Index Type: The type of the index. NebulaGraph Studio allows you to create indexes of the following types: Normal Index, Vertex-Centric Index, Vector Index, Spatial Index, and Fulltext Index.
- Index Name: The name of the index.
- ON: The node type or edge type on which the index is created.
-
For a normal index, set Index Properties to the list of properties based on which the normal 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.
-
For a vertex-centric index, set ON to an edge type and configure the following information:
- Index Anchor Node: Select the source or target node of the edge as the index anchor node. Based on your selection, the system uses
_srcor_dstinternally as the prefix key. -
Index Properties: Optional. You can set the sort order of each property to ASC or DESC.
Note
- Vertex-centric indexes support only edge types.
- Undirected edges do not support vertex-centric indexes.
- If the direction of the current edge type cannot be parsed, you cannot create a vertex-centric index.
- Index Anchor Node: Select the source or target node of the edge as the index anchor node. Based on your selection, the system uses
-
For a vector index, set Property Name to the
VECTORproperty based on which the vector index is created and can configure the following settings: -
For a spatial index, set Property Name to the
GEOGRAPHYproperty based on which the spatial index is created and configure the following settings: -
For a full-text index, set Property Name to the
STRINGproperty based on which the full-text index is created. - Click Create to create the index.
For more information about the GQL syntax for creating indexes, see Indexes overview.
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.
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.
