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

local is unnecessary - Section 5.7 #105

Closed
steffan-westcott opened this issue Jun 16, 2018 · 4 comments
Closed

local is unnecessary - Section 5.7 #105

steffan-westcott opened this issue Jun 16, 2018 · 4 comments

Comments

@steffan-westcott
Copy link

steffan-westcott commented Jun 16, 2018

The text suggests local is needed for the random walk, but this query without it (and a spurious by step) appears to work also:

// Random walk with five hops
g.V().has('code','AUS').repeat(bothE('route').
      sample(1).otherV()).times(5).
      path().by('code').by('dist')

I don't understand what bearing local has on this query. If local is removed from the example, some of the explanation before this example also needs attention.

@krlawrence krlawrence self-assigned this Jun 17, 2018
@krlawrence
Copy link
Owner

krlawrence commented Jun 17, 2018

The local step assures that you always work on the current result which is important as we are taking a single walk from one vertex to the next. I'll see if I can improve the wording. The TinkerPop reference docs address this a bit as well here: http://tinkerpop.apache.org/docs/current/reference/#sample-step

Note that in your modified query you no longer inspect the 'dist' property.

@krlawrence
Copy link
Owner

krlawrence commented Jun 17, 2018

I have been thinking about this quite a bit more. I think some additional examples where local is not used, with explanations would be a good addition. I am going to think about this some more before I make any edits. Thanks for the issue.

@krlawrence
Copy link
Owner

The TinkerPop official documentation is getting an update. I will update the book to reflect these clarifications.

apache/tinkerpop@aef2f6c

@krlawrence
Copy link
Owner

Fixed in Release 280

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants