Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add-STEP-in-syntax #2429

Merged
merged 3 commits into from
Dec 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs-2.0/2.quick-start/6.cheatsheet-for-ngql-command.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@
* [GO](../3.ngql-guide/7.general-query-statements/3.go.md)

```
GO [[<M> TO] <N> STEPS ] FROM <vertex_list>
GO [[<M> TO] <N> {STEP|STEPS} ] FROM <vertex_list>
OVER <edge_type_list> [{REVERSELY | BIDIRECT}]
[ WHERE <conditions> ]
YIELD [DISTINCT] <return_list>
Expand Down Expand Up @@ -420,8 +420,8 @@
| 类型 | 语法 | 示例 | 说明 |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| [子图](../3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md) | `GET SUBGRAPH [WITH PROP] [<step_count> STEPS] FROM {<vid>, <vid>...} [{IN | OUT | BOTH} <edge_type>, <edge_type>...] YIELD [VERTICES AS <vertex_alias>] [,EDGES AS <edge_alias>] ` | `GET SUBGRAPH 1 STEPS FROM "player100" YIELD VERTICES AS nodes, EDGES AS relationships` | 指定 Edge type 的起始点可以到达的点和边的信息,返回子图信息。 |
| [路径](../3.ngql-guide/16.subgraph-and-path/2.find-path.md) | `FIND { SHORTEST | ALL | NOLOOP } PATH [WITH PROP] FROM <vertex_id_list> TO <vertex_id_list> OVER <edge_type_list> [REVERSELY | BIDIRECT] [<WHERE clause>] [UPTO <N> STEPS] YIELD path as <alias> [| ORDER BY $-.path] [| LIMIT <M>]` | `FIND SHORTEST PATH FROM "player102" TO "team204" OVER * YIELD path as p` | 查找指定起始点和目的点之间的路径。返回的路径格式类似于`(<vertex_id>)-[:<edge_type_name>@<rank>]->(<vertex_id)`。 |
| [子图](../3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md) | `GET SUBGRAPH [WITH PROP] [<step_count> {STEP|STEPS}] FROM {<vid>, <vid>...} [{IN | OUT | BOTH} <edge_type>, <edge_type>...] YIELD [VERTICES AS <vertex_alias>] [,EDGES AS <edge_alias>] ` | `GET SUBGRAPH 1 STEPS FROM "player100" YIELD VERTICES AS nodes, EDGES AS relationships` | 指定 Edge type 的起始点可以到达的点和边的信息,返回子图信息。 |
| [路径](../3.ngql-guide/16.subgraph-and-path/2.find-path.md) | `FIND { SHORTEST | ALL | NOLOOP } PATH [WITH PROP] FROM <vertex_id_list> TO <vertex_id_list> OVER <edge_type_list> [REVERSELY | BIDIRECT] [<WHERE clause>] [UPTO <N> {STEP|STEPS}] YIELD path as <alias> [| ORDER BY $-.path] [| LIMIT <M>]` | `FIND SHORTEST PATH FROM "player102" TO "team204" OVER * YIELD path as p` | 查找指定起始点和目的点之间的路径。返回的路径格式类似于`(<vertex_id>)-[:<edge_type_name>@<rank>]->(<vertex_id)`。 |
## 查询调优
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
## 语法

```ngql
GET SUBGRAPH [WITH PROP] [<step_count> STEPS] FROM {<vid>, <vid>...}
GET SUBGRAPH [WITH PROP] [<step_count> {STEP|STEPS}] FROM {<vid>, <vid>...}
[{IN | OUT | BOTH} <edge_type>, <edge_type>...]
[WHERE <expression> [AND <expression> ...]]
YIELD [VERTICES AS <vertex_alias>] [, EDGES AS <edge_alias>];
Expand Down
2 changes: 1 addition & 1 deletion docs-2.0/3.ngql-guide/16.subgraph-and-path/2.find-path.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
```ngql
FIND { SHORTEST | ALL | NOLOOP } PATH [WITH PROP] FROM <vertex_id_list> TO <vertex_id_list>
OVER <edge_type_list> [REVERSELY | BIDIRECT]
[<WHERE clause>] [UPTO <N> STEPS]
[<WHERE clause>] [UPTO <N> {STEP|STEPS}]
YIELD path as <alias>
[| ORDER BY $-.path] [| LIMIT <M>];

Expand Down
6 changes: 3 additions & 3 deletions docs-2.0/3.ngql-guide/7.general-query-statements/3.go.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
## 语法

```ngql
GO [[<M> TO] <N> STEPS ] FROM <vertex_list>
GO [[<M> TO] <N> {STEP|STEPS} ] FROM <vertex_list>
OVER <edge_type_list> [{REVERSELY | BIDIRECT}]
[ WHERE <conditions> ]
YIELD [DISTINCT] <return_list>
Expand All @@ -29,9 +29,9 @@ YIELD [DISTINCT] <return_list>
<col_name> [AS <col_alias>] [, <col_name> [AS <col_alias>] ...]
```

- `<N> STEPS`:指定跳数。如果没有指定跳数,默认值`N`为`1`。如果`N`为`0`,NebulaGraph 不会检索任何边。
- `<N> {STEP|STEPS}`:指定跳数。如果没有指定跳数,默认值`N`为`1`。如果`N`为`0`,NebulaGraph 不会检索任何边。

- `M TO N STEPS`:遍历`M~N`跳的边。如果`M`为`0`,输出结果和`M`为`1`相同,即`GO 0 TO 2`和`GO 1 TO 2`是相同的。
- `M TO N {STEP|STEPS}`:遍历`M~N`跳的边。如果`M`为`0`,输出结果和`M`为`1`相同,即`GO 0 TO 2`和`GO 1 TO 2`是相同的。

- `<vertex_list>`:用逗号分隔的点 ID 列表,或特殊的引用符`$-.id`。详情参见[管道符](../5.operators/4.pipe.md)。

Expand Down
2 changes: 1 addition & 1 deletion docs-2.0/reuse/source_ngql_for_quick_start.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ nebula> CREATE EDGE serve(start_year int, end_year int);
- `GO`

```ngql
GO [[<M> TO] <N> STEPS ] FROM <vertex_list>
GO [[<M> TO] <N> {STEP|STEPS}] FROM <vertex_list>
OVER <edge_type_list> [{REVERSELY | BIDIRECT}]
[ WHERE <conditions> ]
YIELD [DISTINCT] <return_list>
Expand Down