From 06682c5ce70470dfc6aa5070260a58a91d54feac Mon Sep 17 00:00:00 2001 From: Wey Gu Date: Fri, 11 Nov 2022 12:03:53 +0800 Subject: [PATCH 1/3] subgraph: add filter condition example --- .../16.subgraph-and-path/1.get-subgraph.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md b/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md index 53a95dd4091..c2af48a2898 100644 --- a/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md +++ b/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md @@ -107,6 +107,18 @@ nebula> INSERT EDGE serve(start_year, end_year) VALUES "player101" -> "team204": ![GET SUBGRAPH FROM "101" OUT serve](https://docs-cdn.nebula-graph.com.cn/figures/subgraph-2-22-5-7.png) +- 查询从点`player101`开始、0~2 跳、`follow`类型边`degree`大于90,年龄大于30的子图,同时展示边的属性。 + + ```ngql + nebula> GET SUBGRAPH WITH PROP 2 STEPS FROM "player101" WHERE follow.degree > 90 AND $$.player.age > 30 YIELD VERTICES AS nodes, EDGES AS relationships; + +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | nodes | relationships | + +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ + | [("player101" :player{age: 36, name: "Tony Parker"})] | [[:follow "player101"->"player100" @0 {degree: 95}], [:follow "player101"->"player125" @0 {degree: 95}], [:follow "player100"->"player101" @0 {degree: 95}]] | + | [("player125" :player{age: 41, name: "Manu Ginobili"}), ("player100" :player{age: 42, name: "Tim Duncan"})] | [[:follow "player100"->"player125" @0 {degree: 95}]] | + +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ + ``` + ## FAQ ### 为什么返回结果中会出现超出`step_count`跳数之外的关系? From 91431d6bb771f7e379b4398f336d265a0566edf7 Mon Sep 17 00:00:00 2001 From: Wey Gu Date: Fri, 11 Nov 2022 12:05:52 +0800 Subject: [PATCH 2/3] chore: spacing fix --- docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md b/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md index c2af48a2898..1d28cd1b7a1 100644 --- a/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md +++ b/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md @@ -107,7 +107,7 @@ nebula> INSERT EDGE serve(start_year, end_year) VALUES "player101" -> "team204": ![GET SUBGRAPH FROM "101" OUT serve](https://docs-cdn.nebula-graph.com.cn/figures/subgraph-2-22-5-7.png) -- 查询从点`player101`开始、0~2 跳、`follow`类型边`degree`大于90,年龄大于30的子图,同时展示边的属性。 +- 查询从点`player101`开始、0~2 跳、`follow`类型边`degree`大于 90,年龄大于 30 的子图,同时展示边的属性。 ```ngql nebula> GET SUBGRAPH WITH PROP 2 STEPS FROM "player101" WHERE follow.degree > 90 AND $$.player.age > 30 YIELD VERTICES AS nodes, EDGES AS relationships; From 75f183bdc832ac2da12bade61ae9fefddd9f6303 Mon Sep 17 00:00:00 2001 From: Wey Gu Date: Fri, 11 Nov 2022 12:07:58 +0800 Subject: [PATCH 3/3] format: line break added --- docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md b/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md index 1d28cd1b7a1..a1fc458f5ba 100644 --- a/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md +++ b/docs-2.0/3.ngql-guide/16.subgraph-and-path/1.get-subgraph.md @@ -110,7 +110,9 @@ nebula> INSERT EDGE serve(start_year, end_year) VALUES "player101" -> "team204": - 查询从点`player101`开始、0~2 跳、`follow`类型边`degree`大于 90,年龄大于 30 的子图,同时展示边的属性。 ```ngql - nebula> GET SUBGRAPH WITH PROP 2 STEPS FROM "player101" WHERE follow.degree > 90 AND $$.player.age > 30 YIELD VERTICES AS nodes, EDGES AS relationships; + nebula> GET SUBGRAPH WITH PROP 2 STEPS FROM "player101" \ + WHERE follow.degree > 90 AND $$.player.age > 30 \ + YIELD VERTICES AS nodes, EDGES AS relationships; +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+ | nodes | relationships | +-------------------------------------------------------------------------------------------------------------+--------------------------------------------------------------------------------------------------------------------------------------------------------------+