krlawrence / graph

Practical Gremlin - An Apache TinkerPop Tutorial
Apache License 2.0
830 stars 251 forks source link

Add a comment that unroll strategy is disabled if a dedup is present. #185

Open krlawrence opened 4 years ago

krlawrence commented 4 years ago

Add a short discussion of cases where the RepeatUnrollStrategy does not apply. The most important one being to understand that:

g.V().has('code','AUS').
      repeat(out().dedup()).
        times(7).
      path().
        by('code')

[AUS,YYZ,YUL,YGL,YPX,AKV,YIK,YZG]
[AUS,YYZ,CPH,SFJ,JAV,JUV,NAQ,THU]
[AUS,YYZ,YTS,YMO,YFA,ZKE,YAT,YPO]

Works for that reason. The above will not be unrolled to

out().dedup().out().dedup().out().dedup()..... etc

A forward reference should be added in section "3.27. Shortest paths (between airports) - introducing repeat" and the actual mention of the special casing of repeat steps containing dedup steps should be added in section "5.11.1. Quickly finding the hardest to get to airports". As coverage of strategies is still not included in the manuscript (see issue #11 ) rather than refer to RepeatUnrollStrategy explicitly for now while addressing this issue can just use a more generic language.