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

Get Subgraph filter #2242

Merged
merged 4 commits into from
Oct 28, 2022
Merged
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
16 changes: 12 additions & 4 deletions docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
```ngql
GET SUBGRAPH [WITH PROP] [<step_count> 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 All @@ -18,17 +19,24 @@ YIELD [VERTICES AS <vertex_alias>] [, EDGES AS <edge_alias>];

- `edge_type`:指定 Edge type。可以用`IN`、`OUT`和`BOTH`来指定起始点上该 Edge type 的方向。默认为`BOTH`。

- `YIELD`:定义需要返回的输出。可以仅返回点或边。必须设置别名。

!!! caution
- `WHERE`:指定遍历的过滤条件,可以结合布尔运算符 AND 使用。

`GET SUBGRAPH`语句不支持使用`WHERE`子句
- `YIELD`:定义需要返回的输出。可以仅返回点或边。必须设置别名

!!! note

`GET SUBGRAPH`语句检索的路径类型为`trail`,即检索的路径只有点可以重复,边不可以重复。详情请参见[路径](../../1.introduction/2.1.path.md)。

## WHERE 语句限制

在`GET SUBGRAPH`语句中使用`WHERE`子句,注意以下限制:

- **仅支持** `AND` 算法符。
abby-cyber marked this conversation as resolved.
Show resolved Hide resolved
- **仅支持**过滤目的点,点的格式为`$$.tagName.propName`。
- **支持**数学函数、聚合函数、字符串函数、日期时间函数、列表函数中的通用函数和类型转化函数。
- **不支持**聚合函数、Schema 函数、条件表达式函数、谓词函数、geo 函数和自定义函数,列表函数中除通用函数以外的函数。


## 示例

以下面的示例图进行演示。
Expand Down