Skip to content

Commit 38fabbb

Browse files
committed
Merge branch '3.7-dev'
2 parents 9a7e603 + b300d63 commit 38fabbb

File tree

6 files changed

+52
-2
lines changed

6 files changed

+52
-2
lines changed

docs/src/reference/the-traversal.asciidoc

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3981,8 +3981,8 @@ an adjacent vertex's properties or edges.
39813981
39823982
*Additional References*
39833983
3984-
link:++https://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#repeat(org.apache.tinkerpop.gremlin.process.traversal.Traversal)++[`repeat(Traversal)`]
3985-
3984+
link:++https://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#repeat(org.apache.tinkerpop.gremlin.process.traversal.Traversal)++[`repeat(Traversal)`],
3985+
<<emit-step, emit>>, <<times-step, times()>>, <<until-step,until()>>,
39863986
link:++https://tinkerpop.apache.org/docs/x.y.z/recipes/#looping++[`Looping Recipes`]
39873987
39883988
[[replace-step]]
@@ -4742,6 +4742,17 @@ yield `false`.
47424742
47434743
link:++https://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#timeLimit(long)++[`timeLimit(long)`]
47444744
4745+
[[times-step]]
4746+
=== Times Step
4747+
4748+
The `times`-step is not an actual step, but is instead a step modulator for `<<repeat-step,repeat()>>` (find more
4749+
documentation on the `times()` there).
4750+
4751+
*Additional References*
4752+
4753+
link:++https://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#times(int)++[`until(Predicate)`],
4754+
`<<emit-step,emit()>>`, `<<repeat-step,repeat()>>`, `<<until-step,until()>>`
4755+
47454756
[[to-step]]
47464757
=== To Step
47474758

gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/RepeatStep.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,6 +160,9 @@ private final String emitString() {
160160

161161
@Override
162162
public RepeatStep<S> clone() {
163+
if (null == this.repeatTraversal)
164+
throw new IllegalStateException("The repeat()-traversal was not defined: " + this);
165+
163166
final RepeatStep<S> clone = (RepeatStep<S>) super.clone();
164167
clone.repeatTraversal = this.repeatTraversal.clone();
165168
if (null != this.untilTraversal)

gremlin-go/driver/cucumber/gremlin.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[
8787
"g_VX1X_repeatXrepeatXunionXout_uses_out_traversesXX_whereXloops_isX0X_timesX1X_timeX2X_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Repeat(gremlingo.T__.Repeat(gremlingo.T__.Union(gremlingo.T__.Out("uses"), gremlingo.T__.Out("traverses")).Where(gremlingo.T__.Loops().Is(0))).Times(1)).Times(2).Values("name")}},
8888
"g_V_repeatXa_outXknows_repeatXb_outXcreatedX_filterXloops_isX0XX_emit_lang": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Repeat("a", gremlingo.T__.Out("knows").Repeat("b", gremlingo.T__.Out("created").Filter(gremlingo.T__.Loops("a").Is(0))).Emit()).Emit().Values("lang")}},
8989
"g_VX6X_repeatXa_bothXcreatedX_simplePathX_emitXrepeatXb_bothXknowsXX_untilXloopsXbX_asXb_whereXloopsXaX_asXbX_hasXname_vadasXX_dedup_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).Repeat("a", gremlingo.T__.Both("created").SimplePath()).Emit(gremlingo.T__.Repeat("b", gremlingo.T__.Both("knows")).Until(gremlingo.T__.Loops("b").As("b").Where(gremlingo.T__.Loops("a").As("b"))).Has("name", "vadas")).Dedup().Values("name")}},
90+
"g_V_emit": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Emit()}},
91+
"g_V_untilXidentityX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Until(gremlingo.T__.Identity())}},
92+
"g_V_timesX5X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Times(5)}},
9093
"g_unionXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union()}},
9194
"g_unionXV_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union(gremlingo.T__.V().Values("name"))}},
9295
"g_unionXVXv1X_VX4XX_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union(gremlingo.T__.V(p["v1"]), gremlingo.T__.V(p["v4"])).Values("name")}},

gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

gremlin-python/src/main/python/radish/gremlin.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@
9090
'g_VX1X_repeatXrepeatXunionXout_uses_out_traversesXX_whereXloops_isX0X_timesX1X_timeX2X_name': [(lambda g, vid1=None:g.V(vid1).repeat(__.repeat(__.union(__.out('uses'), __.out('traverses')).where(__.loops().is_(0))).times(1)).times(2).values('name'))],
9191
'g_V_repeatXa_outXknows_repeatXb_outXcreatedX_filterXloops_isX0XX_emit_lang': [(lambda g:g.V().repeat('a', __.out('knows').repeat('b', __.out('created').filter_(__.loops('a').is_(0))).emit()).emit().values('lang'))],
9292
'g_VX6X_repeatXa_bothXcreatedX_simplePathX_emitXrepeatXb_bothXknowsXX_untilXloopsXbX_asXb_whereXloopsXaX_asXbX_hasXname_vadasXX_dedup_name': [(lambda g, vid6=None:g.V(vid6).repeat('a', __.both('created').simple_path()).emit(__.repeat('b', __.both('knows')).until(__.loops('b').as_('b').where(__.loops('a').as_('b'))).has('name', 'vadas')).dedup().values('name'))],
93+
'g_V_emit': [(lambda g:g.V().emit())],
94+
'g_V_untilXidentityX': [(lambda g:g.V().until(__.identity()))],
95+
'g_V_timesX5X': [(lambda g:g.V().times(5))],
9396
'g_unionXX': [(lambda g:g.union())],
9497
'g_unionXV_name': [(lambda g:g.union(__.V().values('name')))],
9598
'g_unionXVXv1X_VX4XX_name': [(lambda g, v1=None,v4=None:g.union(__.V(v1), __.V(v4)).values('name'))],

gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/branch/Repeat.feature

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -371,3 +371,30 @@ Feature: Step - repeat()
371371
Then the result should be unordered
372372
| result |
373373
| josh |
374+
375+
Scenario: g_V_emit
376+
Given the modern graph
377+
And the traversal of
378+
"""
379+
g.V().emit()
380+
"""
381+
When iterated to list
382+
Then the traversal will raise an error with message containing text of "The repeat()-traversal was not defined"
383+
384+
Scenario: g_V_untilXidentityX
385+
Given the modern graph
386+
And the traversal of
387+
"""
388+
g.V().until(__.identity())
389+
"""
390+
When iterated to list
391+
Then the traversal will raise an error with message containing text of "The repeat()-traversal was not defined"
392+
393+
Scenario: g_V_timesX5X
394+
Given the modern graph
395+
And the traversal of
396+
"""
397+
g.V().times(5)
398+
"""
399+
When iterated to list
400+
Then the traversal will raise an error with message containing text of "The repeat()-traversal was not defined"

0 commit comments

Comments
 (0)