Skip to content

Commit

Permalink
add-STEP-in-syntax (#1835)
Browse files Browse the repository at this point in the history
  • Loading branch information
abby-cyber authored Jan 5, 2023
1 parent 551ee2e commit c4f32da
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion docs-2.0/2.quick-start/4.nebula-graph-crud.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ You can use the `INSERT` statement to insert vertices or edges based on existing
* `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
6 changes: 3 additions & 3 deletions docs-2.0/2.quick-start/6.cheatsheet-for-ngql.md
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,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 @@ -418,8 +418,8 @@
| Type | Syntax | Example | Description |
| ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ | ------------------------------------------------------------ |
| [GET SUBGRAPH](../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` | Retrieves information of vertices and edges reachable from the source vertices of the specified edge types and returns information of the subgraph. |
| [FIND PATH](../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` | Finds the paths between the selected source vertices and destination vertices. A returned path is like `(<vertex_id>)-[:<edge_type_name>@<rank>]->(<vertex_id)`. |
| [GET SUBGRAPH](../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` | Retrieves information of vertices and edges reachable from the source vertices of the specified edge types and returns information of the subgraph. |
| [FIND PATH](../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` | Finds the paths between the selected source vertices and destination vertices. A returned path is like `(<vertex_id>)-[:<edge_type_name>@<rank>]->(<vertex_id)`. |
## Query tuning statements
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ The `GET SUBGRAPH` statement returns a subgraph that is generated by traversing
## Syntax

```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 @@ The `FIND PATH` statement finds the paths between the selected source vertices a
```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 @@ This topic applies to native nGQL only.
## Syntax

```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,13 +29,13 @@ YIELD [DISTINCT] <return_list>
<col_name> [AS <col_alias>] [, <col_name> [AS <col_alias>] ...]
```

- `<N> STEPS`: specifies the hop number. If not specified, the default value for `N` is `one`. When `N` is `zero`, NebulaGraph does not traverse any edges and returns nothing.
- `<N> {STEP|STEPS}`: specifies the hop number. If not specified, the default value for `N` is `one`. When `N` is `zero`, NebulaGraph does not traverse any edges and returns nothing.

!!! note

The path type of the `GO` statement is `walk`, which means both vertices and edges can be repeatedly visited in graph traversal. For more information, see [Path](../../1.introduction/2.1.path.md).

- `M TO N STEPS`: traverses `from M to N` hops. When `M` is `zero`, the output is the same as that of `M` is `one`. That is, the output of `GO 0 TO 2` and `GO 1 TO 2` are the same.
- `M TO N {STEP|STEPS}`: traverses `from M to N` hops. When `M` is `zero`, the output is the same as that of `M` is `one`. That is, the output of `GO 0 TO 2` and `GO 1 TO 2` are the same.

- `<vertex_list>`: represents a list of vertex IDs separated by commas, or a special place holder `$-.id`. For more information, see [Pipe](../5.operators/4.pipe.md).

Expand Down

0 comments on commit c4f32da

Please sign in to comment.