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

2.1-rc3: $depth = count(Edge)+count(Vertex) ???? #4308

Closed
zhuobao opened this issue Jun 5, 2015 · 1 comment
Closed

2.1-rc3: $depth = count(Edge)+count(Vertex) ???? #4308

zhuobao opened this issue Jun 5, 2015 · 1 comment
Assignees
Labels

Comments

@zhuobao
Copy link

zhuobao commented Jun 5, 2015

on OpenBeer dataset:
query 0: select count(*) as total from (traverse * from #14:22 while $depth <=2)
total=16

query 1: select * from (traverse * from #14:22 while $depth <=2) where $depth=0
----+------+-------+----+----+-----

|@Rid |@Class |id |code|state

----+------+-------+----+----+-----
0 |#14:22|Brewery|23 |4103|Maine
----+------+-------+----+----+-----

query 2: select * from (traverse * from #14:22 while $depth <=2) where $depth=1
----+---------+----------+--------+------

|@Rid |@Class |out |in

----+---------+----------+--------+------
0 |#17:888 |HasBrewery|#15:1437|#14:22
1 |#17:2552 |HasBrewery|#15:1437|#14:22
2 |#17:4216 |HasBrewery|#15:1437|#14:22
3 |#17:5880 |HasBrewery|#15:1437|#14:22
4 |#17:7544 |HasBrewery|#15:1437|#14:22
5 |#17:9208 |HasBrewery|#15:1437|#14:22
6 |#17:10872|HasBrewery|#15:1437|#14:22
7 |#17:12912|HasBrewery|#15:4269|#14:22
8 |#17:14276|HasBrewery|#15:5765|#14:22
9 |#17:15204|HasBrewery|#15:1437|#14:22
10 |#17:17244|HasBrewery|#15:4269|#14:22
11 |#17:18608|HasBrewery|#15:5765|#14:22
----+---------+----------+--------+------

query 3: select * from (traverse * from #14:22 while $depth <=2) where $depth=2
----+--------+------+----+----+

|@Rid |@Class|id |abv |

----+--------+------+----+----+
0 |#15:1437|Beer |1438|0 |
1 |#15:4269|Beer |4282|5 |
2 |#15:5765|Beer |5840|8.3 |
----+--------+------+----+----+

from the query, seems the $depth are defined by count(E)+count(V). It does not fit with my personal common sense. Could you please clarify this?

@luigidellaquila
Copy link
Member

Hi,

traverse * means traversing all the fields (document model), if you use
regular edges (that is the default) traversing from a vertex to another
means traversing two fields ("out_Class" on the vertex and "in" on the
edge).
To do a correct traversal on Graph API you have to use both() instead of *:

select * from (traverse both() from #14:22 while $depth <=2) where $depth=1

2015-06-12 14:16 GMT+02:00 Luca Garulli notifications@github.com:

Assigned #4308 #4308
to @luigidellaquila https://github.com/luigidellaquila.


Reply to this email directly or view it on GitHub
#4308 (comment)
.

@lvca lvca modified the milestones: 2.1 GA, 2.1-rc4 Jun 16, 2015
@lvca lvca modified the milestone: 2.1-rc4 Aug 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

3 participants