Github user dkuppitz commented on a diff in the pull request:

    https://github.com/apache/tinkerpop/pull/921#discussion_r213148817
  
    --- Diff: docs/src/recipes/cycle-detection.asciidoc ---
    @@ -48,6 +48,31 @@ the length of the cycle is known to be three and there 
is no need to exceed that
     cycle. It returned three, because there was one for each vertex that 
started the cycle (i.e. one for `A`, one for `B`
     and one for `C`). This next line introduce deduplication to only return 
unique cycles.
     
    +Note that these traversals won't detect self-loops (vertices directly 
connected to themselves).
    +To do so, you would need to `.emit()` a Traverser before the repeat()-loop.
    +
    +[gremlin-groovy]
    +----
    +g.addV().property(id,'a').as('a').
    +  addV().property(id,'b').as('b').
    +  addV().property(id,'c').as('c').
    +  addV().property(id,'d').as('d').
    +  addE('knows').from('a').to('b').
    +  addE('knows').from('b').to('c').
    +  addE('knows').from('c').to('a').
    +  addE('knows').from('a').to('d').
    +  addE('knows').from('c').to('d').
    +  addE('self').from('a').to('a').iterate()
    +g.V().as('a').
    +    emit().
    +        repeat(outE().inV().simplePath()).
    +        times(2).
    +    outE().inV().where(eq('a')).
    +    path().
    +      by(id).
    +      by(label)
    +----
    +
    --- End diff --
    
    Cool, much better. What I didn't notice in the first place, was that the 
paragraph below really only refers to the previous code snippets. I think you 
should move it above you changes.


---

Reply via email to