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 statements of fetch all edges by a starting vertex&minor changes #2380

Merged
merged 3 commits into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ NebulaGraph stores data in the form of vertices and edges. Each vertex can have
The primary query statements in NebulaGraph fall into the following categories:
<!-- no toc -->
- [FETCH PROP ON](#fetch_prop_on)
- [LOOKUP ON](#lookup_on_id)
- [LOOKUP ON](#lookup_on)
- [GO](#go)
- [MATCH](#match)
- [FIND PATH](#find_path)
Expand Down
20 changes: 20 additions & 0 deletions docs-2.0-en/3.ngql-guide/7.general-query-statements/3.go.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,26 @@ nebula> GO FROM "player100", "player102" OVER serve \
+-----------------+------------+---------------------+
```

### To query all edges

Case: To query all edges that are connected to the starting vertex.

```ngql
# Return all edges that are connected to the player102 vertex.
nebula> GO FROM "player102" OVER * BIDIRECT YIELD edge AS e;
+-----------------------------------------------------------------------+
| e |
+-----------------------------------------------------------------------+
| [:follow "player101"->"player102" @0 {degree: 90}] |
| [:follow "player103"->"player102" @0 {degree: 70}] |
| [:follow "player135"->"player102" @0 {degree: 80}] |
| [:follow "player102"->"player100" @0 {degree: 75}] |
| [:follow "player102"->"player101" @0 {degree: 75}] |
| [:serve "player102"->"team203" @0 {end_year: 2015, start_year: 2006}] |
| [:serve "player102"->"team204" @0 {end_year: 2019, start_year: 2015}] |
+-----------------------------------------------------------------------+
```

### To query multiple edge types

Case: To query multiple edge types that are connected to the starting vertex. You can specify multiple edge types or the `*` symbol to query multiple edge types.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{{nebula.name}} 的核心查询语句可分为:
<!-- no toc -->
- [FETCH PROP ON](#fetch_prop_on)
- [LOOKUP ON](#lookup_on_id)
- [LOOKUP ON](#lookup_on)
- [GO](#go)
- [MATCH](#match)
- [FIND PATH](#find_path)
Expand Down Expand Up @@ -48,7 +48,7 @@ FETCH PROP ON player "player100" YIELD properties(vertex);
└─────────────────────────── 获取 player 这个 TAG 下的属性
```

更多信息,请参见[FETCH PROP ON](4.fetch.md)。
更多信息,请参见 [FETCH PROP ON](4.fetch.md)。

### LOOKUP ON

Expand Down Expand Up @@ -76,7 +76,7 @@ LOOKUP ON player WHERE player.name == "Tony Parker" YIELD id(vertex);
└─────────────────────────────────── 根据点的 TAG player 查询
```

更多信息,请参见[LOOKUP ON](5.lookup.md)。
更多信息,请参见 [LOOKUP ON](5.lookup.md)。

### GO

Expand Down Expand Up @@ -106,7 +106,7 @@ GO 3 STEPS FROM "player102" OVER follow YIELD dst(edge);
└────────────────────────────────── 探索 3 步
```

更多信息,请参见[GO](3.go.md)。
更多信息,请参见 [GO](3.go.md)。

### MATCH

Expand All @@ -133,7 +133,7 @@ MATCH (v:player{name:"Tim Duncan"})--(v2:player) \
RETURN v2.player.name AS Name;
```

更多信息,请参见[MATCH](2.match.md)。
更多信息,请参见 [MATCH](2.match.md)。

### FIND PATH

Expand All @@ -147,11 +147,11 @@ MATCH (v:player{name:"Tim Duncan"})--(v2:player) \

```ngql
FIND SHORTEST PATH FROM "player102" TO "team204" OVER * YIELD path AS p;
──┬───── ───────────┬────────── ───┬─── ────┬────
│ ┌────────────────┘
│ │ ┌─────────────────────────┘ │
──┬───── ───────────┬────────── ───┬─── ────┬────
│ ┌────────────────┘   │ 
│ │ ┌─────────────────────────┘ │
│ │ │ │
│ │ └───────── 经由所有类型的边出向探索   └──── 返回路径为 p 列
│ │ └───────── 经由所有类型的边出向探索 └───── 返回路径为 p 列
│ │
│ └─────────────── 从给定的起点、终点 VID
Expand All @@ -160,7 +160,7 @@ FIND SHORTEST PATH FROM "player102" TO "team204" OVER * YIELD path AS p;
└─────────────────────────── 查找最短路径
```

更多信息,请参见[FIND PATH](6.find-path.md)。
更多信息,请参见 [FIND PATH](6.find-path.md)。

### GET SUBGRAPH

Expand All @@ -183,7 +183,7 @@ GET SUBGRAPH 5 STEPS FROM "player101" YIELD VERTICES AS nodes, EDGES AS relation

```

更多信息,请参见[GET SUBGRAPH](7.get-subgraph.md)。
更多信息,请参见 [GET SUBGRAPH](7.get-subgraph.md)。

### SHOW

Expand Down
20 changes: 20 additions & 0 deletions docs-2.0-zh/3.ngql-guide/7.general-query-statements/3.go.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,26 @@ nebula> GO FROM "player100", "player102" OVER serve \
+-----------------+------------+---------------------+
```

### 查询所有边

场景:查询起始点关联的所有边。

```ngql
# 返回 player102 关联的所有边。
nebula> GO FROM "player102" OVER * BIDIRECT YIELD edge AS e;
+-----------------------------------------------------------------------+
| e |
+-----------------------------------------------------------------------+
| [:follow "player101"->"player102" @0 {degree: 90}] |
| [:follow "player103"->"player102" @0 {degree: 70}] |
| [:follow "player135"->"player102" @0 {degree: 80}] |
| [:follow "player102"->"player100" @0 {degree: 75}] |
| [:follow "player102"->"player101" @0 {degree: 75}] |
| [:serve "player102"->"team203" @0 {end_year: 2015, start_year: 2006}] |
| [:serve "player102"->"team204" @0 {end_year: 2019, start_year: 2015}] |
+-----------------------------------------------------------------------+
```

### 查询多个 Edge type

场景:查询起始点关联的多个边类型可以通过设置多个Edge Type实现,也可以通过设置`*`关联所有的边类型。
Expand Down