In NebulaGraph Database, why is the number of hops of GetSubGraph in the returned result greater than step_count?

28 Views Asked by At

The number of hops in the returned result is not the same as step_count. That is by design.

1

There are 1 best solutions below

0
On

To show the completeness of the subgraph, an additional hop is made on all vertices that meet the conditions.

enter image description here

The returned paths of GET SUBGRAPH 1 STEPS FROM "A"; are A->B, B->A, and A->C. To show the completeness of the subgraph, an additional hop is made on all vertices that meet the conditions, namely B->C.

The returned path of GET SUBGRAPH 1 STEPS FROM "A" IN follow; is B->A. To show the completeness of the subgraph, an additional hop is made on all vertices that meet the conditions, namely A->B.

If you only query paths or vertices that meet the conditions, we suggest you use MATCH or GO. The example is as follows.

nebula> MATCH p= (v:player) -- (v2) WHERE id(v)=="A" RETURN p;
nebula> GO 1 STEPS FROM "A" OVER follow YIELD src(edge),dst(edge);