Open in Explore¶
With the Open in Explore function, you can run nGQL statements on the Console page to query vertex or edge data and then view the result on the Explore page in a visualized way.
Supported versions¶
Studio of v3.2.5 or later versions supports this function. For more information, see check updates.
Prerequisites¶
To use the Open in Explore function, you must do a check of these:
- Studio is connected to NebulaGraph. For more information, see Connect to NebulaGraph.
- A dataset exists in the database. For more information, see Import data.
Query and visualize edge data¶
To query edge data on the Console page and then view the result on the Explore page, follow these steps:
-
In the toolbar, click the Console tab.
-
In the Current Graph Space field, choose a graph space name. In this example, basketballplayer is chosen.
-
In the input box, enter an nGQL statement and click the button .
Note
The query result must contain the VIDs of the source vertex and the destination vertex of an edge.
Here is an nGQL statement example.
nebula> GO FROM "player102" OVER serve YIELD src(edge),dst(edge);
In the query result, you can see the start year and end year of the service team for the player whose playerId is
palyer102
. As shown below. -
Click the Open in Explore button.
-
In the dialog box, configure as follows:
a. Click Edge Type.b. In the Edge Type field, enter an edge type name. In this example,
serve
is used.c. In the Src ID field, choose a column name from the result table representing the VIDs of the source vertices. In this example,
serve._src
is chosen.d. In the Dst ID field, choose a column name from the result table representing the VIDs of the destination vertices. In this example,
serve._dst
is chosen.e. (Optional) If the result table contains the ranking information of the edges, in the Rank field, choose a column name representing the
rank
of the edges. If no ranking information exists in the result, leave the Rank field blank.f. When the configuration is done, click the Import button.
-
If some data exists on the board of Explore, choose a method to insert data:
- Incremental Insertion: Click this button to add the result to the existing data on the board.
- Insert After Clear: Click this button to clear the existing data from the board and then add the data to the board.
When the data is inserted, you can view the visualized representation of the edge data.
Query and visualize vertex data¶
To query vertex data on the Console page and then view the result on the Explore page, follow these steps:
-
In the toolbar, click the Console tab.
-
In the Current Graph Space field, choose a graph space name. In this example, basketballplayer is chosen.
-
In the input box, enter an nGQL statement and click the button .
Note
The query result must contain the VIDs of the vertices.
Here is an nGQL statement example.
nebula> FETCH PROP ON player "player100" YIELD properties(vertex).name;
The query result gives the information of the player whose
playerId
isplayer100
, as shown in this figure. -
Click the Open in Explore button.
-
In the dialog box, configure as follows:
a. Click Vertex.b. In the Vertex ID field, choose a column name from the result table representing the VIDs of the vertices. In this example,
VertexID
is chosen.c. When the configuration is done, click the Import button.
-
If some data exists on the board of Explore, choose a method to insert data:
- Incremental Insertion: Click this button to add the queried result to the existing data on the board.
- Insert After Clear: Click this button to clear the existing data from the board and then add the data.
When the data is inserted, you can view the visualized representation of the vertex data.
Next to do¶
On the Explore page, you can expand the board to explore and analyze graph data.