From 7be1ee2d18be6c199fcc2a4c4eb88c6c923c6993 Mon Sep 17 00:00:00 2001 From: cooper-lzy <78672629+cooper-lzy@users.noreply.github.com> Date: Wed, 28 Sep 2022 16:01:55 +0800 Subject: [PATCH] explorer add template (#1637) --- .../db-management/ngql-template.md | 43 +++++++++++++++++++ .../nebula-explorer/ex-ug-page-overview.md | 1 + .../graph-explorer/ex-ug-query-exploration.md | 12 +++++- mkdocs.yml | 1 + 4 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 docs-2.0/nebula-explorer/db-management/ngql-template.md diff --git a/docs-2.0/nebula-explorer/db-management/ngql-template.md b/docs-2.0/nebula-explorer/db-management/ngql-template.md new file mode 100644 index 00000000000..4c110a54481 --- /dev/null +++ b/docs-2.0/nebula-explorer/db-management/ngql-template.md @@ -0,0 +1,43 @@ +# nGQL template + +NebulaGraph Explorer supports saving the commonly nGQL statement as a template for yourself or others. The text in the nGQL statement supports parameterization, and parameter values can be filled in as needed. + +## Prerequisites + +The schema has been created in the NebulaGraph database. + +## Entry + +At the top navigation bar, click ![Template](https://docs-cdn.nebula-graph.com.cn/figures/icon-navbar-queryTemplate.png) . + +## Create new template + +1. Click **+ New Template**, and set the parameters as follows. + + ![new template](https://docs-cdn.nebula-graph.com.cn/figures/ex-template-220916-en.png) + + |Parameter|Example|Description| + |:---|:---|:---| + |Template name|`test`|The name of the template.| + |Space|`basketballplayer`|The graph space to which the template applies.| + |Description|`Returns the neighbor name of the specified player`| Describes the function of the template.| + |Query template|`MATCH (v:player{name:"${name}"})--(v2:player) RETURN v2.player.name AS Name;`|nGQL template. You can select the text you want to parameterize, click **+ parameterize selected content** on the right, and set the parameter name and description. In the example, `${name}` is parameterized text. In actual use, you can fill in a name such as `Tim Duncan`.| + |Input|-|Displays parameterized text content. You can edit or delete it.| + + !!! note + + Click **+ Save as template** on the upper left corner of the console page to use the entered query statement as a template statement automatically. + +2. Click **Save as template**. + +## Other Operations + +- Click ![setup](https://docs-cdn.nebula-graph.com.cn/figures/setup-220916.png) on the right of the target template to modify the template context. +- Click ![console](https://docs-cdn.nebula-graph.com.cn/figures/nav-console2.png) on the right of the target template to automatically jump to the console and enter the template. +- Click ![delete](https://docs-cdn.nebula-graph.com.cn/figures/alert-delete.png) on the right of the target template to delete the template. +- The filter box in the upper right corner allows you to filter templates for a specified graph space. +- The search box in the upper right corner allows you to search the template name. + +## Use template + +In addition to clicking ![console](https://docs-cdn.nebula-graph.com.cn/figures/nav-console2.png) on the template list page to automatically jump to the console and enter the template, templates can also be used on the graph exploration page. For details, see [Start querying](../graph-explorer/ex-ug-query-exploration.md). \ No newline at end of file diff --git a/docs-2.0/nebula-explorer/ex-ug-page-overview.md b/docs-2.0/nebula-explorer/ex-ug-page-overview.md index 85ef8ff780c..c6e7f1e6fdb 100644 --- a/docs-2.0/nebula-explorer/ex-ug-page-overview.md +++ b/docs-2.0/nebula-explorer/ex-ug-page-overview.md @@ -16,6 +16,7 @@ The NebulaGraph Explorer page consists of three modules top navigation bar, left | ![create_schema](https://docs-cdn.nebula-graph.com.cn/figures/studio-nav-schema.png) | Manage NebulaGraph database graph spaces. For more information, see [Create a schema](db-management/10.create-schema.md). | | ![import_data](https://docs-cdn.nebula-graph.com.cn/figures/studio-btn-download.png) | Bulk import of data into NebulaGraph. For more information, see [Import data](db-management/11.import-data.md). | | ![Console](https://docs-cdn.nebula-graph.com.cn/figures/nav-console2.png) | Query the NebulaGraph data with nGQL statements. For more information, see [Console](db-management/explorer-console.md). | +| ![Template](https://docs-cdn.nebula-graph.com.cn/figures/icon-navbar-queryTemplate.png)| The template of the nGQL. For details, see [nGQL template](db-management/ngql-template.md).| | ![language](https://docs-cdn.nebula-graph.com.cn/figures/navbar-language.png) | Select the language of NebulaGraph Explorer page. Chinese and English are supported. | | ![help](https://docs-cdn.nebula-graph.com.cn/figures/navbar-help.png) | Guide and help you in using NebulaGraph. | | ![clear_connection](https://docs-cdn.nebula-graph.com.cn/figures/image-icon10.png) | Show the NebulaGraph version and allow you to disconnect from NebulaGraph Explorer. | diff --git a/docs-2.0/nebula-explorer/graph-explorer/ex-ug-query-exploration.md b/docs-2.0/nebula-explorer/graph-explorer/ex-ug-query-exploration.md index 59265c1d5a5..1c393804c69 100644 --- a/docs-2.0/nebula-explorer/graph-explorer/ex-ug-query-exploration.md +++ b/docs-2.0/nebula-explorer/graph-explorer/ex-ug-query-exploration.md @@ -17,6 +17,7 @@ Click the **Start** ![query](https://docs-cdn.nebula-graph.com.cn/figures/nav-qu - Query by VID - Query by Tag - Query Subgraph +- Query by template ### Query by VID @@ -54,4 +55,13 @@ When querying subgraphs, you can specify the number of steps, edge types, and th The following is an example of VIDs `Kings` and `Suns`, step number `2`, and incoming edge types with a VID value of 101, the number of steps of 4, and edge types of `server` and `like`. -![tag](https://docs-cdn.nebula-graph.com.cn/figures/query_subgraph.png) \ No newline at end of file +![tag](https://docs-cdn.nebula-graph.com.cn/figures/query_subgraph.png) + +### Query by template + +You can select the created nGQL template, and set the parameter value. + +- When the returned result is vertices, they will be displayed on the canvas. +- When the returned result is not vertices, they will be displayed in table format. For example, return player name, age, etc. + +For more information, see [nGQL template](../db-management/ngql-template.md). \ No newline at end of file diff --git a/mkdocs.yml b/mkdocs.yml index d3eb505d7bb..9337dcd157c 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -601,6 +601,7 @@ nav: - Schema management: nebula-explorer/db-management/10.create-schema.md - Data import: nebula-explorer/db-management/11.import-data.md - Console: nebula-explorer/db-management/explorer-console.md + - nGQL template: nebula-explorer/db-management/ngql-template.md - Graph explorer: - Choose graph space: nebula-explorer/graph-explorer/13.choose-graphspace.md - Start querying: nebula-explorer/graph-explorer/ex-ug-query-exploration.md