diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 063e1efb50c..2f5d1ddf144 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -28,6 +28,8 @@ This release also includes changes from <>. * Added a Gremln MCP server. * Added the Air Routes dataset to the set of available samples packaged with distributions. * Added a minimal distribution for `tinkergraph-gremlin` using the `min` classifier that doesn't include the sample datasets. +* Removed `AggregateLocalStep` and `aggregate(Scope, String)`, and renamed `AggregateGlobalStep` to `AggregateStep`. +* Removed `store()` in favor of using `local(aggregate())`. * Removed Vertex/ReferenceVertex from grammar. Use vertex id in traversals now instead. * Removed `has(key, traversal)` option for `has()` step. * Fixed bug where `InlineFilterStrategy` could add an empty `has()`. diff --git a/docs/src/dev/provider/gremlin-semantics.asciidoc b/docs/src/dev/provider/gremlin-semantics.asciidoc index 858326eaac9..a760c850595 100644 --- a/docs/src/dev/provider/gremlin-semantics.asciidoc +++ b/docs/src/dev/provider/gremlin-semantics.asciidoc @@ -616,7 +616,7 @@ link:https://tinkerpop.apache.org/docs/x.y.z/reference/#all-step[reference] *Description:* Collects all objects in the traversal into a collection. -*Syntax:* `aggregate(String sideEffectKey)` | `aggregate(Scope scope, String sideEffectKey)` +*Syntax:* `aggregate(String sideEffectKey)` [width="100%",options="header"] |========================================================= @@ -626,8 +626,6 @@ link:https://tinkerpop.apache.org/docs/x.y.z/reference/#all-step[reference] *Arguments:* -* `scope` - Determines the scope in which `aggregate` is applied. The `global` scope will collect all objects across the -traversal. The `local` scope will collect objects within the current object (if it's a collection). * `sideEffectKey` - The name of the side-effect key that will hold the aggregated objects. *Modulation:* @@ -643,8 +641,7 @@ The aggregated objects can be accessed later using the `cap()` step. None -See: link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateGlobalStep.java[source], -link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateLocalStep.java[source (local)], +See: link:https://github.com/apache/tinkerpop/tree/x.y.z/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateStep.java[source], link:https://tinkerpop.apache.org/docs/x.y.z/reference/#aggregate-step[reference] [[and-step]] diff --git a/docs/src/recipes/appendix.asciidoc b/docs/src/recipes/appendix.asciidoc index 49a79161d80..d891947b97e 100644 --- a/docs/src/recipes/appendix.asciidoc +++ b/docs/src/recipes/appendix.asciidoc @@ -142,7 +142,7 @@ The following example assumes that the edges point in the `OUT` direction. Assum ---- g.V().where(without("x")).as("a"). outE().as("e").inV().as("b"). - filter(bothE().where(neq("e")).otherV().where(eq("a"))).aggregate(local, "x"). + filter(bothE().where(neq("e")).otherV().where(eq("a"))).local(aggregate("x")). select("a","b").dedup() ---- diff --git a/docs/src/recipes/centrality.asciidoc b/docs/src/recipes/centrality.asciidoc index 2a482ba495a..70a55284689 100644 --- a/docs/src/recipes/centrality.asciidoc +++ b/docs/src/recipes/centrality.asciidoc @@ -85,7 +85,7 @@ g.V().as("v"). select("triples").unfold().as("t"). select("x","y").where(eq("a")). select("t"), - aggregate(local,"triples")). <5> + local(aggregate("triples"))). <5> select("z").as("length"). select("triple").select("z").where(eq("length"))). <6> select(all, "v").unfold(). <7> @@ -124,7 +124,7 @@ g.withSack(1f).V().as("v"). select("triples").unfold().as("t"). select("x","y").where(eq("a")). select("t"), - aggregate(local,"triples")). <5> + local(aggregate("triples"))). <5> select("z").as("length"). select("triple").select("z").where(eq("length"))). <6> group().by(select(first, "v")). <7> diff --git a/docs/src/recipes/collections.asciidoc b/docs/src/recipes/collections.asciidoc index 67bfcd1b1be..6b9dfad5e3b 100644 --- a/docs/src/recipes/collections.asciidoc +++ b/docs/src/recipes/collections.asciidoc @@ -39,7 +39,7 @@ appear by way of some side-effect steps like `aggregate()`: [gremlin-groovy,modern] ---- g.V().fold() -g.V().aggregate(local, 'a').cap('a') +g.V().local(aggregate('a')).cap('a') ---- It is worth noting that while a `Path` is not technically a `List` it does present like one and can be manipulated in @@ -61,7 +61,7 @@ It may seem simple, but the most obvious choice to modifying what is in a list i [gremlin-groovy,modern] ---- g.V().fold().unfold().values('name') -g.V().aggregate(local,'a').cap('a').unfold().values('name') +g.V().local(aggregate('a')).cap('a').unfold().values('name') ---- The above examples show that `unfold()` works quite well when you don't want to preserve the `List` structure of the @@ -164,8 +164,8 @@ the use of `aggregate()` to aid in construction of this `List`: [gremlin-groovy,modern] ---- g.V().has('name','marko').as('v'). <1> - aggregate(local,'a'). <2> - by('age'). + local(aggregate('a'). <2> + by('age')). repeat(outE().as('e').inV().as('v')). <3> until(has('lang','java')). aggregate('b'). <4> @@ -173,10 +173,10 @@ g.V().has('name','marko').as('v'). <1> aggregate('c'). <5> by(select(all,'e').unfold().values('weight').mean()). fold(). <6> - aggregate(local,'a'). <7> - by(cap('b')). - aggregate(local,'a'). <8> - by(cap('c')). + local(aggregate('a'). <7> + by(cap('b'))). + local(aggregate('a'). <8> + by(cap('c'))). cap('a') ---- @@ -190,9 +190,9 @@ of "java"). Note however that the `by()` modulator overrides that traverser comp the list of vertices in "v". Those vertices are unfolded to retrieve the name property from each and then are reduced with `fold()` back into a list to be stored in the side-effected named "b". <5> A similar use of `aggregate()` as the previous step, though this one turns "e" into a stream of edges to calculate -the `mean()` to store in a `List` called "c". Note that `aggregate()` (short form for `aggregate(global)`) was used -here instead of `aggregate(local)`, as the former is an eager collection of the elements in the stream -(`aggregate(local)` is lazy) and will force the traversal to be iterated up to that point before moving forward. +the `mean()` to store in a `List` called "c". Note that `aggregate()` with `local()` was used +here instead of `aggregate()`, as the latter is an eager collection of the elements in the stream +(`local(aggregate())` is lazy) and will force the traversal to be iterated up to that point before moving forward. Without that eager collection, "v" and "e" would not contain the complete information required for the production of "b" and "c". <6> Adding `fold()`-step here is a bit of a trick. To see the trick, copy and paste all lines of Gremlin up to but @@ -203,11 +203,11 @@ when traversing away from "marko"). The `aggregate()`-steps are side-effects and through them unchanged. The `fold()` obviously converts those three traversers to a single `List` to make one traverser with a `List` inside. That means that the remaining steps following the `fold()` will only be executed one time each instead of three, which, as will be shown, is critical to the proper result. -<7> The single traverser with the `List` of three vertices in it passes to `aggregate(local)`. The `by()` modulator +<7> The single traverser with the `List` of three vertices in it passes to `local(aggregate())`. The `by()` modulator presents an override telling Gremlin to ignore the `List` of three vertices and simply grab the "b" side effect created earlier and stick that into "a" as part of the result. The `List` with three vertices passes out unchanged as -`aggregate(local)` is a side-effect step. -<8> Again, the single traverser with the `List` of three vertices passes to `aggregate(local)` and again, the `by()` +`local(aggregate())` is a side-effect step. +<8> Again, the single traverser with the `List` of three vertices passes to `local(aggregate())` and again, the `by()` modulator presents an override to include "c" into the result. All of the above code and explanation show that `aggregate()` can be used to construct `List` objects as side-effects @@ -236,11 +236,11 @@ g.V(). bothE().count()). fold()) g.V(). - aggregate(local, 'x'). + local(aggregate('x'). by(union(select('x').count(local), <2> identity(), bothE().count()). - fold()). + fold())). cap('x') ---- diff --git a/docs/src/recipes/connected-components.asciidoc b/docs/src/recipes/connected-components.asciidoc index ced0f84effa..bc361e7248f 100644 --- a/docs/src/recipes/connected-components.asciidoc +++ b/docs/src/recipes/connected-components.asciidoc @@ -77,7 +77,7 @@ A straightforward way to detect the various subgraphs with an OLTP traversal is [gremlin-groovy,existing] ---- g.V().emit(cyclicPath().or().not(both())). <1> - repeat(__.where(without('a')).aggregate(local,'a').both()).until(cyclicPath()). <2> + repeat(__.where(without('a')).local(aggregate('a')).both()).until(cyclicPath()). <2> group().by(path().unfold().limit(1)). <3> by(path().unfold().dedup().fold()). <4> select(values).unfold() <5> diff --git a/docs/src/recipes/shortest-path.asciidoc b/docs/src/recipes/shortest-path.asciidoc index d2d9067bf8b..e3dc2fe71b4 100644 --- a/docs/src/recipes/shortest-path.asciidoc +++ b/docs/src/recipes/shortest-path.asciidoc @@ -186,7 +186,7 @@ g.withSideEffect('v', []). <1> inject(result.toArray()).as('kv').select(values). unfold(). map(unfold().as('v_or_e'). - coalesce(V().where(eq('v_or_e')).aggregate(local,'v'), + coalesce(V().where(eq('v_or_e')).local(aggregate('v')), select('v').tail(local, 1).unfold().bothE().where(eq('v_or_e'))). values('name','weight'). fold()). diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index bdba989e3f2..6b7f1ffe7e7 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -454,8 +454,8 @@ image:side-effect-lambda.png[width=175,float=right] [gremlin-groovy,modern] ---- g.V().hasLabel('person').sideEffect(System.out.&println) <1> -g.V().sideEffect(outE().count().aggregate(local,"o")). - sideEffect(inE().count().aggregate(local,"i")).cap("o","i") <2> +g.V().sideEffect(outE().count().local(aggregate("o"))). + sideEffect(inE().count().local(aggregate("i"))).cap("o","i") <2> ---- <1> Whatever enters `sideEffect()` is passed to the next step, but some intervening process can occur. @@ -596,26 +596,22 @@ link:++https://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gre image::aggregate-step.png[width=800] The `aggregate()`-step (*sideEffect*) is used to aggregate all the objects at a particular point of traversal into a -`Collection`. The step is uses `Scope` to help determine the aggregating behavior. For `global` scope this means that -the step will use link:http://en.wikipedia.org/wiki/Eager_evaluation[eager evaluation] in that no objects continue on -until all previous objects have been fully aggregated. The eager evaluation model is crucial in situations -where everything at a particular point is required for future computation. By default, when the overload of -`aggregate()` is called without a `Scope`, the default is `global`. An example is provided below. +`Collection`. By default, the step will use link:http://en.wikipedia.org/wiki/Eager_evaluation[eager evaluation] in that +no objects continue on until all previous objects have been fully aggregated. The eager evaluation model is crucial in situations +where everything at a particular point is required for future computation. [gremlin-groovy,modern] ---- g.V(1).out('created') <1> g.V(1).out('created').aggregate('x') <2> -g.V(1).out('created').aggregate(global, 'x') <3> -g.V(1).out('created').aggregate('x').in('created') <4> -g.V(1).out('created').aggregate('x').in('created').out('created') <5> +g.V(1).out('created').aggregate('x').in('created') <3> +g.V(1).out('created').aggregate('x').in('created').out('created') <4> g.V(1).out('created').aggregate('x').in('created').out('created'). - where(without('x')).values('name') <6> + where(without('x')).values('name') <5> ---- <1> What has marko created? <2> Aggregate all his creations. -<3> Identical to the previous line. <3> Who are marko's collaborators? <4> What have marko's collaborators created? <5> What have marko's collaborators created that he hasn't created? @@ -635,31 +631,23 @@ g.V().out('knows').aggregate('x').by('age').cap('x') <1> <1> The "age" property is not <> for all vertices and therefore those values are not included in the aggregation. -For `local` scope the aggregation will occur in a link:http://en.wikipedia.org/wiki/Lazy_evaluation[lazy] fashion. - -NOTE: Prior to 3.4.3, `local` aggregation (i.e. lazy) evaluation was handled by `store()`-step. +Aggregation can be controlled to occur in a link:http://en.wikipedia.org/wiki/Lazy_evaluation[lazy] fashion by using +the step inside `local()`. [gremlin-groovy,modern] ---- -g.V().aggregate(global, 'x').limit(1).cap('x') -g.V().aggregate(local, 'x').limit(1).cap('x') -g.withoutStrategies(EarlyLimitStrategy).V().aggregate(local,'x').limit(1).cap('x') +g.V().aggregate('x').limit(1).cap('x') +g.V().local(aggregate('x')).limit(1).cap('x') ---- -It is important to note that `EarlyLimitStrategy` introduced in 3.3.5 alters the behavior of `aggregate(local)`. -Without that strategy (which is installed by default), there are two results in the `aggregate()` side-effect even -though the interval selection is for 1 object. Realize that when the second object is on its way to the `range()` -filter (i.e. `[0..1]`), it passes through `aggregate()` and thus, stored before filtered. - [gremlin-groovy,modern] ---- -g.E().aggregate(local,'x').by('weight').cap('x') +g.E().local(aggregate('x')).by('weight').cap('x') ---- *Additional References* link:++https://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#aggregate(java.lang.String)++[`aggregate(String)`], -link:++https://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#aggregate(org.apache.tinkerpop.gremlin.process.traversal.Scope,java.lang.String)++[`aggregate(Scope,String)`] [[all-step]] === All Step diff --git a/docs/src/upgrade/release-3.8.x.asciidoc b/docs/src/upgrade/release-3.8.x.asciidoc index e1a06cb74f0..fe3dc2f0bf2 100644 --- a/docs/src/upgrade/release-3.8.x.asciidoc +++ b/docs/src/upgrade/release-3.8.x.asciidoc @@ -423,6 +423,96 @@ The properties file in the above example can either point to a remote configurat See: link:https://issues.apache.org/jira/browse/TINKERPOP-3017[TINKERPOP-3017] +==== `aggregate()` with `Scope` Removed + +The meaning of `Scope` parameters in `aggregate()` have always been unique compared to all other "scopable" steps. +`aggregate(global)` is a `Barrier`, which blocks the traversal until all traversers have been aggregated into the side +effect, where `aggregate(local)` is non-blocking, and will allow traversers to pass before the side effect has been +fully aggregated. This is inconsistent with the semantics of `Scope` in all other steps. For example `dedup(global)` +filters duplicates across the entire traversal stream, while `dedup(local)` filters duplicates within individual `List` +traversers. + +The `Scope` parameter is being removed from `aggregate()` to fix inconsistency between the two different use cases: flow +control vs. per-element application. This change aligns all side effect steps (none of the others have scope arguments) +and reserves the `Scope` parameter exclusively for "traverser-local" application patterns, eliminating confusion about +its contextual meanings. + +This makes the `AggregateStep` globally scoped by default with eager aggregation. The Lazy evaluation with `aggregate()` is +achieved by wrapping the step in `local()`. + +[source,text] +---- +// 3.7.x - scope is still supported +gremlin> g.V().aggregate(local, "x").by("age").select("x") +==>[29] +==>[29,27] +==>[29,27] +==>[29,27,32] +==>[29,27,32] +==>[29,27,32,35] + +// 3.8.0 - must use aggregate() within local() to achieve lazy aggregation +gremlin> g.V().local(aggregate("x").by("age")).select("x") +==>[29] +==>[29,27] +==>[29,27] +==>[29,27,32] +==>[29,27,32] +==>[29,27,32,35] +---- + +An slight behavioral difference exists between the removed `aggregate(local)` and its replacement `local(aggregate())` +with respect to handling of bulked traversers. In 3.8.0, `local()` changed from traverser-local to object-local processing, +always debulking incoming traversers into individual objects. This causes `local(aggregate())` to show true lazy, 1 object +at a time aggregation, differing from the original `aggregate(local)`, which always consumed bulked traversers atomically. +There is no workaround to preserve the old "traverser-local" semantics. + +[source,text] +---- +// 3.7.x - both local() and local scope will preserve bulked traversers +gremlin> g.V().out().barrier().aggregate(local, "x").select("x") +==>[v[3],v[3],v[3]] +==>[v[3],v[3],v[3]] +==>[v[3],v[3],v[3]] +==>[v[3],v[3],v[3],v[2]] +==>[v[3],v[3],v[3],v[2],v[4]] +==>[v[3],v[3],v[3],v[2],v[4],v[5]] +gremlin> g.V().out().barrier().local(aggregate("x")).select("x") +==>[v[3],v[3],v[3]] +==>[v[3],v[3],v[3]] +==>[v[3],v[3],v[3]] +==>[v[3],v[3],v[3],v[2]] +==>[v[3],v[3],v[3],v[2],v[4]] +==>[v[3],v[3],v[3],v[2],v[4],v[5]] + +// 3.8.0 - bulked traversers are now split to be processed per-object, this affects local aggregation +gremlin> g.V().out().barrier().local(aggregate("x")).select("x") +==>[v[3]] +==>[v[3],v[3]] +==>[v[3],v[3],v[3]] +==>[v[3],v[3],v[3],v[2]] +==>[v[3],v[3],v[3],v[2],v[4]] +==>[v[3],v[3],v[3],v[2],v[4],v[5]] +---- + +See: link:https://github.com/apache/tinkerpop/blob/master/docs/src/dev/future/proposal-scoping-5.asciidoc[Lazy vs. Eager Evaluation] + +==== Removal of `store()` Step + +The `store()` step was a legacy name for `aggregate(local)` that has been deprecated since 3.4.3, and is now removed along +with `aggregate(local)`. To achieve lazy aggregation, use `aggregate()` within `local()`. + +[source,text] +---- +// 3.7.x - store() is still allowed +gremlin> g.V().store("x").by("age").cap("x") +==>[29,27,32,35] + +// 3.8.0 - store() removed, use local(aggregate()) to achieve lazy aggregation +gremlin> g.V().local(aggregate("x").by("age")).cap("x") +==>[29,27,32,35] +---- + ==== split() on Empty String The `split()` step will now split a string into a list of its characters if the given separator is an empty string. diff --git a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiTraversalVisualizationStrategy.groovy b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiTraversalVisualizationStrategy.groovy index 4cb8ffd5914..5e44800af1a 100644 --- a/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiTraversalVisualizationStrategy.groovy +++ b/gremlin-console/src/main/groovy/org/apache/tinkerpop/gremlin/console/jsr223/GephiTraversalVisualizationStrategy.groovy @@ -28,7 +28,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeOtherVertexSt import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeVertexStep import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep -import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateGlobalStep +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.LambdaSideEffectStep import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy @@ -91,7 +91,7 @@ class GephiTraversalVisualizationStrategy extends AbstractTraversalStrategy subgraph(final String sideEffectKey) { } /** - * Eagerly collects objects up to this step into a side-effect. Same as calling {@link #aggregate(Scope, String)} - * with a {@link Scope#global}. + * Eagerly collects objects up to this step into a side-effect. * * @param sideEffectKey the name of the side-effect key that will hold the aggregated objects - * @return the traversal with an appended {@link AggregateGlobalStep} + * @return the traversal with an appended {@link AggregateStep} * @see Reference Documentation - Aggregate Step * @since 3.0.0-incubating */ public default GraphTraversal aggregate(final String sideEffectKey) { this.asAdmin().getBytecode().addStep(Symbols.aggregate, sideEffectKey); - return this.asAdmin().addStep(new AggregateGlobalStep<>(this.asAdmin(), sideEffectKey)); - } - - /** - * Collects objects in a list using the {@link Scope} argument to determine whether it should be lazy - * {@link Scope#local} or eager ({@link Scope#global} while gathering those objects. - * - * @param sideEffectKey the name of the side-effect key that will hold the aggregated objects - * @return the traversal with an appended {@link AggregateGlobalStep} - * @see Reference Documentation - Aggregate Step - * @since 3.4.3 - */ - public default GraphTraversal aggregate(final Scope scope, final String sideEffectKey) { - this.asAdmin().getBytecode().addStep(Symbols.aggregate, scope, sideEffectKey); - return this.asAdmin().addStep(scope == Scope.global ? - new AggregateGlobalStep<>(this.asAdmin(), sideEffectKey) : new AggregateLocalStep<>(this.asAdmin(), sideEffectKey)); + return this.asAdmin().addStep(new AggregateStep<>(this.asAdmin(), sideEffectKey)); } /** @@ -3654,21 +3637,6 @@ public default GraphTraversal sack(final BiFunction sackOp return this.asAdmin().addStep(new SackValueStep<>(this.asAdmin(), sackOperator)); } - /** - * Lazily aggregates objects in the stream into a side-effect collection. - * - * @param sideEffectKey the name of the side-effect key that will hold the aggregate - * @return the traversal with an appended {@link AggregateLocalStep} - * @see Reference Documentation - Store Step - * @since 3.0.0-incubating - * @deprecated As of release 3.4.3, replaced by {@link #aggregate(Scope, String)} using {@link Scope#local}. - */ - @Deprecated - public default GraphTraversal store(final String sideEffectKey) { - this.asAdmin().getBytecode().addStep(Symbols.store, sideEffectKey); - return this.asAdmin().addStep(new AggregateLocalStep<>(this.asAdmin(), sideEffectKey)); - } - /** * Allows developers to examine statistical information about a traversal providing data like execution times, * counts, etc. @@ -4882,8 +4850,6 @@ private Symbols() { /** * @deprecated As of release 3.4.3, replaced by {@link Symbols#aggregate} with a {@link Scope#local}. */ - @Deprecated - public static final String store = "store"; public static final String aggregate = "aggregate"; public static final String fail = "fail"; public static final String subgraph = "subgraph"; diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java index 00fc3b64d89..27f078b71cb 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/__.java @@ -1473,13 +1473,6 @@ public static GraphTraversal aggregate(final String sideEffectKey) { return __.start().aggregate(sideEffectKey); } - /** - * @see GraphTraversal#aggregate(Scope, String) - */ - public static GraphTraversal aggregate(final Scope scope, final String sideEffectKey) { - return __.start().aggregate(scope, sideEffectKey); - } - /** * @see GraphTraversal#fail() */ @@ -1529,15 +1522,6 @@ public static GraphTraversal sack(final BiFunction sack return __.start().sack(sackOperator); } - /** - * @see GraphTraversal#store(String) - * @deprecated As of release 3.4.3, replaced by {@link #aggregate(Scope, String)} using {@link Scope#local}. - */ - @Deprecated - public static GraphTraversal store(final String sideEffectKey) { - return __.start().store(sideEffectKey); - } - /** * @see GraphTraversal#property(Object, Object, Object...) */ diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateLocalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateLocalStep.java deleted file mode 100644 index 2d37bece448..00000000000 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateLocalStep.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect; - -import org.apache.tinkerpop.gremlin.process.traversal.Operator; -import org.apache.tinkerpop.gremlin.process.traversal.Traversal; -import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects; -import org.apache.tinkerpop.gremlin.process.traversal.Traverser; -import org.apache.tinkerpop.gremlin.process.traversal.step.ByModulating; -import org.apache.tinkerpop.gremlin.process.traversal.step.SideEffectCapable; -import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent; -import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet; -import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; -import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalUtil; -import org.apache.tinkerpop.gremlin.structure.util.StringFactory; -import org.apache.tinkerpop.gremlin.util.function.BulkSetSupplier; - -import java.util.Collection; -import java.util.Collections; -import java.util.List; -import java.util.Set; -import java.util.function.Supplier; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -public final class AggregateLocalStep extends SideEffectStep implements SideEffectCapable, TraversalParent, ByModulating { - - private Traversal.Admin storeTraversal = null; - private String sideEffectKey; - - public AggregateLocalStep(final Traversal.Admin traversal, final String sideEffectKey) { - super(traversal); - this.sideEffectKey = sideEffectKey; - this.getTraversal().getSideEffects().registerIfAbsent(this.sideEffectKey, (Supplier) BulkSetSupplier.instance(), Operator.addAll); - } - - @Override - protected void sideEffect(final Traverser.Admin traverser) { - final TraversalSideEffects sideEffects = this.getTraversal().getSideEffects(); - // addAll and assign operator collect solutions as a BulkSet. And addAll merges them with an existing - // sideEffect value which is expected to be Collection. assign replaces the existing value with the new BulkSet. - // Therefore, they need a different treatment how they gather inputs. - final boolean isOperatorForBulkSet = sideEffects.getReducer(sideEffectKey) == Operator.addAll || - sideEffects.getReducer(sideEffectKey) == Operator.assign; - - final BulkSet bulkSet = new BulkSet<>(); - TraversalUtil.produce(traverser, this.storeTraversal).ifProductive(p -> bulkSet.add(p, traverser.bulk())); - - if (isOperatorForBulkSet) { - sideEffects.add(this.sideEffectKey, bulkSet); - } else { - bulkSet.forEach(p -> sideEffects.add(sideEffectKey, p)); - } - } - - @Override - public String getSideEffectKey() { - return this.sideEffectKey; - } - - @Override - public String toString() { - return StringFactory.stepString(this, this.sideEffectKey, this.storeTraversal); - } - - @Override - public List> getLocalChildren() { - return null == this.storeTraversal ? Collections.emptyList() : Collections.singletonList(this.storeTraversal); - } - - @Override - public void modulateBy(final Traversal.Admin storeTraversal) { - if (this.storeTraversal != null) - throw new IllegalStateException("Aggregate step can only have one by modulator"); - this.storeTraversal = this.integrateChild(storeTraversal); - } - - @Override - public void replaceLocalChild(final Traversal.Admin oldTraversal, final Traversal.Admin newTraversal) { - if (null != this.storeTraversal && this.storeTraversal.equals(oldTraversal)) - this.storeTraversal = this.integrateChild(newTraversal); - } - - @Override - public Set getRequirements() { - return this.getSelfAndChildRequirements(TraverserRequirement.SIDE_EFFECTS, TraverserRequirement.BULK); - } - - @Override - public AggregateLocalStep clone() { - final AggregateLocalStep clone = (AggregateLocalStep) super.clone(); - if (null != this.storeTraversal) - clone.storeTraversal = this.storeTraversal.clone(); - return clone; - } - - @Override - public void setTraversal(final Traversal.Admin parentTraversal) { - super.setTraversal(parentTraversal); - this.integrateChild(this.storeTraversal); - } - - @Override - public int hashCode() { - int result = super.hashCode() ^ this.sideEffectKey.hashCode(); - if (this.storeTraversal != null) - result ^= this.storeTraversal.hashCode(); - return result; - } -} diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateGlobalStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateStep.java similarity index 94% rename from gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateGlobalStep.java rename to gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateStep.java index 486814fdd93..fa30155034a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateGlobalStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateStep.java @@ -44,13 +44,13 @@ /** * @author Marko A. Rodriguez (http://markorodriguez.com) */ -public final class AggregateGlobalStep extends AbstractStep implements SideEffectCapable, TraversalParent, ByModulating, LocalBarrier { +public final class AggregateStep extends AbstractStep implements SideEffectCapable, TraversalParent, ByModulating, LocalBarrier { private Traversal.Admin aggregateTraversal = null; private String sideEffectKey; private TraverserSet barrier; - public AggregateGlobalStep(final Traversal.Admin traversal, final String sideEffectKey) { + public AggregateStep(final Traversal.Admin traversal, final String sideEffectKey) { super(traversal); this.sideEffectKey = sideEffectKey; this.barrier = (TraverserSet) this.traversal.getTraverserSetSupplier().get(); @@ -91,8 +91,8 @@ public Set getRequirements() { } @Override - public AggregateGlobalStep clone() { - final AggregateGlobalStep clone = (AggregateGlobalStep) super.clone(); + public AggregateStep clone() { + final AggregateStep clone = (AggregateStep) super.clone(); clone.barrier = (TraverserSet) this.traversal.getTraverserSetSupplier().get(); if (null != this.aggregateTraversal) clone.aggregateTraversal = this.aggregateTraversal.clone(); diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/BytecodeHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/BytecodeHelper.java index 1bea420177f..c9d93f88141 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/BytecodeHelper.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/util/BytecodeHelper.java @@ -152,8 +152,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.UnfoldStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AddPropertyStep; -import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateGlobalStep; -import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateLocalStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.FailStep; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupCountSideEffectStep; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.GroupSideEffectStep; @@ -303,8 +302,7 @@ public final class BytecodeHelper { put(GraphTraversal.Symbols.sideEffect, Arrays.asList(LambdaSideEffectStep.class, TraversalSideEffectStep.class)); put(GraphTraversal.Symbols.cap, Collections.singletonList(SideEffectCapStep.class)); put(GraphTraversal.Symbols.property, Collections.singletonList(AddPropertyStep.class)); - put(GraphTraversal.Symbols.store, Collections.singletonList(AggregateLocalStep.class)); - put(GraphTraversal.Symbols.aggregate, Arrays.asList(AggregateLocalStep.class, AggregateGlobalStep.class)); + put(GraphTraversal.Symbols.aggregate, Collections.singletonList(AggregateStep.class)); put(GraphTraversal.Symbols.fail, Collections.singletonList(FailStep.class)); put(GraphTraversal.Symbols.subgraph, Collections.singletonList(SubgraphStep.class)); put(GraphTraversal.Symbols.barrier, Arrays.asList(NoOpBarrierStep.class, LambdaCollectingBarrierStep.class)); diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitorTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitorTest.java index b66b83734db..95d262de943 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitorTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitorTest.java @@ -112,12 +112,6 @@ public void shouldParseTraversalMethod_aggregate() throws Exception { compare(g.V().aggregate("test"), eval("g.V().aggregate('test')")); } - @Test - public void shouldParseTraversalMethod_aggregate_Scope() throws Exception { - compare(g.V().aggregate(global, "test"), eval("g.V().aggregate(global, 'test')")); - compare(g.V().aggregate(Scope.local, "test"), eval("g.V().aggregate(Scope.local, 'test')")); - } - @Test public void shouldParseTraversalMethod_all_P() throws Exception { compare(g.V().id().fold().all(gt(1)), eval("g.V().id().fold().all(gt(1))")); @@ -906,11 +900,6 @@ public void shouldParseTraversalMethod_skip_long() throws Exception { compare(g.V().skip(8), eval("g.V().skip(8)")); } - @Test - public void shouldParseTraversalMethod_store() throws Exception { - compare(g.V().store("asd"), eval("g.V().store(\"asd\")")); - } - @Test public void shouldParseTraversalMethod_subgraph() throws Exception { compare(g.V().subgraph("asd"), eval("g.V().subgraph('asd')")); diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalRootVisitorTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalRootVisitorTest.java index 1b54e15e8ca..34a9465b4d1 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalRootVisitorTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalRootVisitorTest.java @@ -175,12 +175,6 @@ public void shouldParseTraversalMethod_aggregate() { compare(g.V().map(__.aggregate("test")), eval("g.V().map(__.aggregate('test'))")); } - @Test - public void shouldParseTraversalMethod_aggregate_Scope() { - compare(g.V().map(__.aggregate(global, "test")), eval("g.V().map(__.aggregate(global, 'test'))")); - compare(g.V().map(__.aggregate(Scope.local, "test")), eval("g.V().map(__.aggregate(Scope.local, 'test'))")); - } - @Test public void shouldParseTraversalMethod_all_P() { compare(g.V().map(__.id().fold().all(gt(1))), eval("g.V().map(__.id().fold().all(gt(1)))")); @@ -1027,11 +1021,6 @@ public void shouldParseTraversalMethod_skip_long() { compare(g.V().map(__.skip(8)), eval("g.V().map(__.skip(8))")); } - @Test - public void shouldParseTraversalMethod_store() { - compare(g.V().map(__.store("asd")), eval("g.V().map(__.store(\"asd\"))")); - } - @Test public void shouldParseTraversalMethod_subgraph() { compare(g.V().map(__.subgraph("asd")), eval("g.V().map(__.subgraph('asd'))")); diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java index ed0a8cdf097..194e53c832f 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java @@ -44,6 +44,7 @@ import java.util.function.Consumer; import static org.apache.tinkerpop.gremlin.process.traversal.AnonymousTraversalSource.traversal; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.aggregate; import static org.junit.Assert.assertEquals; /** @@ -210,7 +211,7 @@ else if (String[].class.isAssignableFrom(type)) { else if (Traversal[].class.isAssignableFrom(type)) { arguments[i] = new Traversal[random.nextInt(5) + 1]; for (int j = 0; j < ((Traversal[]) arguments[i]).length; j++) { - list.add(((Traversal[]) arguments[i])[j] = __.as(randomString(random)).out(randomString(random)).both(randomString(random)).has(randomString(random)).store(randomString(random))); + list.add(((Traversal[]) arguments[i])[j] = __.as(randomString(random)).out(randomString(random)).both(randomString(random)).has(randomString(random)).local(aggregate(randomString(random)))); } } else if (P.class.isAssignableFrom(type)) list.add(arguments[i] = P.gte(stepMethod.getName().contains("where") ? randomString(random) : random.nextInt())); diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/TraversalParentTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/TraversalParentTest.java index c422f18b816..1ed4d14bcd1 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/TraversalParentTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/TraversalParentTest.java @@ -45,8 +45,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.CallStepContract; import org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeStepContract; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AddPropertyStepContract; -import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateGlobalStep; -import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateLocalStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.AndStep; import org.apache.tinkerpop.gremlin.process.traversal.step.filter.OrStep; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchStep; @@ -378,42 +377,24 @@ public static Iterable data() { List.of(__.constant(Map.of(T.label, "knows")), __.constant(Map.of("weight", 0.5)), __.constant(Map.of("updated", true))), null, null }, - {AggregateGlobalStep.class, + {AggregateStep.class, g.V().aggregate("x"), List.of(), List.of(), null, null }, - {AggregateGlobalStep.class, + {AggregateStep.class, g.V().aggregate("x").by("name"), List.of(), List.of(new ValueTraversal<>("name")), null, null }, - {AggregateGlobalStep.class, + {AggregateStep.class, g.V().aggregate("x").by(__.constant("value")), List.of(), List.of(__.constant("value")), null, null }, - {AggregateLocalStep.class, - g.V().aggregate(Scope.local, "x"), - List.of(), - List.of(), - null, null - }, - {AggregateLocalStep.class, - g.V().aggregate(Scope.local, "x").by("name"), - List.of(), - List.of(new ValueTraversal<>("name")), - null, null - }, - {AggregateLocalStep.class, - g.V().aggregate(Scope.local, "x").by(__.constant("value")), - List.of(), - List.of(__.constant("value")), - null, null - }, {AndStep.class, g.V().and(__.outE(), __.has("age", P.gte(32))), List.of(), diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateLocalStepTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateLocalStepTest.java deleted file mode 100644 index 912829245c9..00000000000 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateLocalStepTest.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect; - -import org.apache.tinkerpop.gremlin.process.traversal.Traversal; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; -import org.apache.tinkerpop.gremlin.process.traversal.step.StepTest; - -import java.util.Arrays; -import java.util.List; - -/** - * @author Daniel Kuppitz (http://gremlin.guru) - */ -public class AggregateLocalStepTest extends StepTest { - - @Override - protected List getTraversals() { - return Arrays.asList( - __.store("x"), - __.store("x").by("name"), - __.store("x").by("age")); - } -} diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateGlobalStepTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateStepTest.java similarity index 96% rename from gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateGlobalStepTest.java rename to gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateStepTest.java index f34f420cc03..2c0101cb6e8 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateGlobalStepTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateStepTest.java @@ -28,7 +28,7 @@ /** * @author Daniel Kuppitz (http://gremlin.guru) */ -public class AggregateGlobalStepTest extends StepTest { +public class AggregateStepTest extends StepTest { @Override protected List getTraversals() { diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/ByModulatorOptimizationStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/ByModulatorOptimizationStrategyTest.java index 6d60205f8d3..47aefa8b64b 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/ByModulatorOptimizationStrategyTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/ByModulatorOptimizationStrategyTest.java @@ -72,7 +72,6 @@ public static Iterable generateTestParameters() { __.sample(10), __.select("a"), __.select("a", "b"), - __.store("x"), __.tree(), __.tree("x"), __.where(P.eq("a")), diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategyTest.java index 26dfa4b10b1..9d9fdc1c7c0 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategyTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/CountStrategyTest.java @@ -45,6 +45,7 @@ import static org.apache.tinkerpop.gremlin.process.traversal.P.outside; import static org.apache.tinkerpop.gremlin.process.traversal.P.within; import static org.apache.tinkerpop.gremlin.process.traversal.P.without; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.aggregate; import static org.junit.Assert.assertEquals; /** @@ -84,7 +85,7 @@ public static Iterable generateTestParameters() { {__.filter(__.outE().count().is(lt(1))), __.not(__.outE())}, {__.filter(__.both().count().is(lte(0))), __.not(__.both())}, {__.filter(__.out().out().count().is(0)), __.not(__.out().out())}, - {__.store("x").count().is(0).as("a"), __.store("x").limit(1).count().is(0).as("a")}, + {__.local(aggregate("x")).count().is(0).as("a"), __.local(aggregate("x")).limit(1).count().is(0).as("a")}, {__.out().count().as("a").is(0), __.out().limit(1).count().as("a").is(0)}, {__.out().count().is(neq(4)), __.out().limit(5).count().is(neq(4))}, {__.out().count().is(lte(3)), __.out().limit(4).count().is(lte(3))}, @@ -102,14 +103,14 @@ public static Iterable generateTestParameters() { {__.filter(__.count().is(0)), __.not(__.identity())}, {__.sideEffect(__.count().is(0)), __.sideEffect(__.not(__.identity()))}, {__.branch(__.count().is(0)), __.branch(__.limit(1).count().is(0))}, - {__.count().is(0).store("x"), __.limit(1).count().is(0).store("x")}, + {__.count().is(0).local(aggregate("x")), __.limit(1).count().is(0).local(aggregate("x"))}, {__.repeat(__.out()).until(__.outE().count().is(0)), __.repeat(__.out()).until(__.not(__.outE()))}, {__.repeat(__.out()).until(__.out().out().values("name").count().is(0)), __.repeat(__.out()).until(__.out().out().not(__.values("name")))}, {__.repeat(__.out()).until(__.out().out().properties("age").has("x").count().is(0)), __.repeat(__.out()).until(__.out().out().not(__.properties("age").has("x")))}, {__.repeat(__.out()).emit(__.outE().count().is(0)), __.repeat(__.out()).emit(__.not(__.outE()))}, {__.where(__.outE().hasLabel("created").count().is(0)), __.not(__.outE().hasLabel("created"))}, {__.where(__.out().outE().hasLabel("created").count().is(0)), __.not(__.out().outE().hasLabel("created"))}, - {__.where(__.out().outE().hasLabel("created").count().is(0).store("x")), __.where(__.out().outE().hasLabel("created").limit(1).count().is(0).store("x"))}, + {__.where(__.out().outE().hasLabel("created").count().is(0).local(aggregate("x"))), __.where(__.out().outE().hasLabel("created").limit(1).count().is(0).local(aggregate("x")))}, {__.where(__.or(__.out("none").out().count().is(0), __.has("none"))), __.where(__.or(__.not(__.out("none").out()), __.has("none"))) }, {__.where(__.or(__.out("none").out().count().is(0), __.has("none").count().is(0))), __.where(__.or(__.not(__.out("none").out()), __.not(__.has("none")))) }, {__.where(__.or(__.out("none").out(), __.has("none").count().is(0))), __.where(__.or(__.out("none").out(), __.not(__.has("none")))) }, @@ -205,7 +206,7 @@ public static Iterable generateTestParameters() { {__.filter(__.outE().count().is(lt(GValue.ofInteger("x", 1))))}, {__.filter(__.both().count().is(lte(GValue.ofInteger("x", 0))))}, {__.filter(__.out().out().count().is(GValue.of("x", 0)))}, - {__.store("x").count().is(GValue.of("x", 0)).as("a")}, + {__.local(aggregate("x")).count().is(GValue.of("x", 0)).as("a")}, {__.out().count().as("a").is(GValue.of("x", 0))}, {__.out().count().is(neq(GValue.ofInteger("x", 4)))}, {__.out().count().is(lte(GValue.ofInteger("x", 3)))}, @@ -222,14 +223,14 @@ public static Iterable generateTestParameters() { {__.filter(__.count().is(GValue.of("x", 0)))}, {__.sideEffect(__.count().is(GValue.of("x", 0)))}, {__.branch(__.count().is(GValue.of("x", 0)))}, - {__.count().is(GValue.of("x", 0)).store("x")}, + {__.count().is(GValue.of("x", 0)).local(aggregate("x"))}, {__.repeat(__.out()).until(__.outE().count().is(GValue.of("x", 0)))}, {__.repeat(__.out()).until(__.out().out().values("name").count().is(GValue.of("x", 0)))}, {__.repeat(__.out()).until(__.out().out().properties("age").has("x").count().is(GValue.of("x", 0)))}, {__.repeat(__.out()).emit(__.outE().count().is(GValue.of("x", 0)))}, {__.where(__.outE().hasLabel("created").count().is(GValue.of("x", 0)))}, {__.where(__.out().outE().hasLabel("created").count().is(GValue.of("x", 0)))}, - {__.where(__.out().outE().hasLabel("created").count().is(GValue.of("x", 0)).store("x"))}, + {__.where(__.out().outE().hasLabel("created").count().is(GValue.of("x", 0)).local(aggregate("x")))}, {__.where(__.or(__.out("none").out().count().is(GValue.of("x", 0)), __.has("none")))}, {__.where(__.or(__.out("none").out().count().is(GValue.of("x", 0)), __.has("none").count().is(GValue.of("x", 0))))}, {__.where(__.or(__.out("none").out(), __.has("none").count().is(GValue.of("x", 0))))}, diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/EarlyLimitStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/EarlyLimitStrategyTest.java index a33dc1dcc49..28e5463d9a0 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/EarlyLimitStrategyTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/EarlyLimitStrategyTest.java @@ -47,6 +47,7 @@ import java.util.Optional; import java.util.Set; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.aggregate; import static org.hamcrest.MatcherAssert.assertThat; import static org.hamcrest.core.Is.is; import static org.junit.Assert.assertEquals; @@ -91,10 +92,7 @@ public static Iterable generateTestParameters() { {__.out().map(__.identity()).map(__.identity()).range(50, 100).map(__.identity()).map(__.identity()).range(50, -1), __.out().discard(), Collections.emptyList()}, {__.out().map(__.identity()).map(__.identity()).range(50, 100).map(__.identity()).map(__.identity()).range(60, -1), __.out().discard(), Collections.emptyList()}, {__.out().map(__.identity()).map(__.identity()).range(50, 100).as("a").map(__.identity()).map(__.identity()).range(60, -1).as("b"), __.out().discard(), Collections.emptyList()}, - {__.out().range(50, 100).store("a").range(50, -1), __.out().range(50, 100).store("a").discard(), Collections.emptyList()}, - {__.out().range(50, 100).store("a").range(50, -1).cap("a"), ((GraphTraversal) __.out().range(50, 100).store("a").discard()).cap("a"), Collections.emptyList()}, {__.out().range(50, 100).map(__.identity()).range(50, -1).profile(), __.out().discard().profile(), Collections.singleton(ProfileStrategy.instance())}, - {__.out().store("a").limit(10), __.out().limit(10).store("a"), Collections.emptyList()}, {__.out().aggregate("a").limit(10), __.out().aggregate("a").limit(10), Collections.emptyList()}, {__.V().branch(__.label()).option("person", __.out("knows").valueMap().limit(1)).option("software", __.out("created").valueMap().limit(2).fold()), __.V().branch(__.label()).option("person", __.out("knows").limit(1).valueMap()).option("software", __.out("created").limit(2).valueMap().fold()), Collections.emptyList()} diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java index 80ee82d6967..0553bf953e7 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/PathRetractionStrategyTest.java @@ -49,13 +49,13 @@ import static org.apache.tinkerpop.gremlin.process.traversal.P.gte; import static org.apache.tinkerpop.gremlin.process.traversal.P.neq; import static org.apache.tinkerpop.gremlin.process.traversal.P.without; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.aggregate; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.as; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.bothE; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.limit; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.out; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.project; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.select; -import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.store; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.values; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.where; import static org.junit.Assert.assertEquals; @@ -223,10 +223,10 @@ public static Iterable generateTestParameters() { {__.V().select("a").map(select("b").repeat(select("c"))).select("a"), "[[a, b, c], [[a, c], [[a, c]]], []]", null}, {__.V().out("created").project("a", "b").by("name").by(__.in("created").count()).order().by(select("b")).select("a"), "[[[a]], []]", null}, - {__.order().by("weight", Order.desc).store("w").by("weight").filter(values("weight").as("cw"). + {__.order().by("weight", Order.desc).local(aggregate("w").by("weight")).filter(values("weight").as("cw"). select("w").by(limit(Scope.local, 1)).as("mw").where("cw", eq("mw"))).project("from", "to", "weight").by(__.outV()).by(__.inV()).by("weight"), "[[[cw, mw], []]]", null}, - {__.V().limit(1).as("z").out().repeat(store("seen").out().where(without("seen"))).until(where(eq("z"))), + {__.V().limit(1).as("z").out().repeat(__.local(aggregate("seen")).out().where(without("seen"))).until(where(eq("z"))), "[[[z, seen]], [[z, seen]]]", null}, {__.V().as("a").optional(bothE().dedup().as("b")). choose(select("b"), select("a","b"), project("a").by(select("a"))), diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/ProductiveByStrategyTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/ProductiveByStrategyTest.java index 30e7683a963..cadf710fdfb 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/ProductiveByStrategyTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/optimization/ProductiveByStrategyTest.java @@ -84,12 +84,6 @@ public static Iterable generateTestParameters() { {__.aggregate("a").by("name"), __.aggregate("a").by(new ValueTraversal<>("name", coalesce(nameValueTraversal, nullTraversal).asAdmin())), Collections.emptySet()}, - {__.aggregate(Scope.local,"a").by("name"), - __.aggregate(Scope.local, "a").by(new ValueTraversal<>("name", coalesce(nameValueTraversal, nullTraversal).asAdmin())), - Collections.emptySet()}, - {__.aggregate(Scope.local,"a").by("name"), - __.aggregate(Scope.local,"a").by("name"), - keys("name")}, {__.aggregate("a").by(values("age").is(P.gt(29))), __.aggregate("a").by(coalesce(values("age").is(P.gt(29)), nullTraversal)), Collections.emptySet()}, diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs index d26d500a0dd..a34665fd498 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs @@ -161,15 +161,6 @@ public GraphTraversal AddV (ITraversal vertexLabelTraversal) return Wrap(this); } - /// - /// Adds the aggregate step to this . - /// - public GraphTraversal Aggregate (Scope scope, string sideEffectKey) - { - Bytecode.AddStep("aggregate", scope, sideEffectKey); - return Wrap(this); - } - /// /// Adds the aggregate step to this . /// @@ -2082,15 +2073,6 @@ public GraphTraversal Skip (long skip) return Wrap?>(this); } - /// - /// Adds the store step to this . - /// - public GraphTraversal Store (string sideEffectKey) - { - Bytecode.AddStep("store", sideEffectKey); - return Wrap(this); - } - /// /// Adds the subgraph step to this . /// diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs index cfcb2267469..0f1032fa371 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/__.cs @@ -100,14 +100,6 @@ public static GraphTraversal AddV(ITraversal vertexLabelTraversa return new GraphTraversal().AddV(vertexLabelTraversal); } - /// - /// Spawns a and adds the aggregate step to that traversal. - /// - public static GraphTraversal Aggregate(Scope scope, string sideEffectKey) - { - return new GraphTraversal().Aggregate(scope, sideEffectKey); - } - /// /// Spawns a and adds the aggregate step to that traversal. /// @@ -1490,14 +1482,6 @@ public static GraphTraversal Skip(long skip) return new GraphTraversal?>().Split(scope, splitChar); } - /// - /// Spawns a and adds the store step to that traversal. - /// - public static GraphTraversal Store(string sideEffectKey) - { - return new GraphTraversal().Store(sideEffectKey); - } - /// /// Spawns a and adds the subgraph step to that traversal. /// diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs index 42721988e84..b85468c14c9 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs @@ -294,7 +294,7 @@ private static IDictionary, ITraversal>> {(g,p) =>g.AddV("data").Property("int", 25), (g,p) =>g.V().Values("int").AsNumber(GType.Short).Is(P.TypeOf(GType.Short)).Is(P.Between(20, 30))}}, {"g_V_valuesXintX_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_minX", new List, ITraversal>> {(g,p) =>g.AddV("data").Property("int", 10).AddV("data").Property("int", 20).AddV("data").Property("int", 30), (g,p) =>g.V().Values("int").AsNumber(GType.Short).Is(P.TypeOf(GType.Short)).Min()}}, {"g_V_valuesXintX_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_maxX", new List, ITraversal>> {(g,p) =>g.AddV("data").Property("int", 15).AddV("data").Property("int", 25).AddV("data").Property("int", 35), (g,p) =>g.V().Values("int").AsNumber(GType.Short).Is(P.TypeOf(GType.Short)).Max()}}, - {"g_injectX42X_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_storeXaX_capXaX", new List, ITraversal>> {(g,p) =>g.Inject(42).AsNumber(GType.Short).Is(P.TypeOf(GType.Short)).Store("a").Cap("a")}}, + {"g_injectX42X_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_storeXaX_capXaX", new List, ITraversal>> {(g,p) =>g.Inject(42).AsNumber(GType.Short).Is(P.TypeOf(GType.Short))}}, {"g_V_valuesXageX_isXtypeOfXGType_SHORTXX", new List, ITraversal>> {(g,p) =>g.V().Values("age").Is(P.TypeOf(GType.Short))}}, {"g_V_valuesXuuidX_isXtypeOfXGType_UUIDXX", new List, ITraversal>> {(g,p) =>g.AddV("data").Property("uuid", Guid.Parse("f47af10b-58cc-4372-a567-0f02b2f3d479")), (g,p) =>g.V().Values("uuid").Is(P.TypeOf(GType.UUID))}}, {"g_V_hasXuuid_typeOfXGType_UUIDXX_valuesXnameX", new List, ITraversal>> {(g,p) =>g.AddV("data").Property("name", "test").Property("uuid", Guid.Parse("f47af10b-58cc-4372-a567-0f02b2f3d479")), (g,p) =>g.V().Has("uuid", P.TypeOf(GType.UUID)).Values("name")}}, @@ -307,7 +307,7 @@ private static IDictionary, ITraversal>> {(g,p) =>g.Inject(Guid.Parse("f47af10b-58cc-4372-a567-0f02b2f3d479"))}}, {"g_injectXUUIDXXX", new List, ITraversal>> {(g,p) =>g.Inject(Guid.NewGuid())}}, {"g_V_aggregateXxX_byXnameX_byXageX_capXxX", new List, ITraversal>> {(g,p) =>g.V().Aggregate("x").By("name").By("age").Cap("x")}}, - {"g_V_aggregateXScope_local_xX_byXnameX_byXageX_capXxX", new List, ITraversal>> {(g,p) =>g.V().Aggregate(Scope.Local, "x").By("name").By("age").Cap("x")}}, + {"g_V_localXaggregateXxX_byXnameXX_byXageX_capXxX", new List, ITraversal>> {(g,p) =>g.V().Local(__.Aggregate("x").By("name").By("age")).Cap("x")}}, {"g_V_valuesXageX_allXgtX32XX", new List, ITraversal>> {(g,p) =>g.V().Values("age").All(P.Gt(32))}}, {"g_V_valuesXageX_whereXisXP_gtX33XXX_fold_allXgtX33XX", new List, ITraversal>> {(g,p) =>g.V().Values("age").Where(__.Is(P.Gt(33))).Fold().All(P.Gt(33))}}, {"g_V_valuesXageX_order_byXdescX_fold_allXgtX10XX", new List, ITraversal>> {(g,p) =>g.V().Values("age").Order().By(Order.Desc).Fold().All(P.Gt(10))}}, @@ -766,8 +766,8 @@ private static IDictionary, ITraversal>> {(g,p) =>g.WithStrategies(new ReadOnlyStrategy()).V().AddE("link").From(__.V(p["vid1"]))}}, {"g_withStrategiesXReadOnlyStrategyX_V_propertyXname_joshX", new List, ITraversal>> {(g,p) =>g.WithStrategies(new ReadOnlyStrategy()).V().Property("name", "josh")}}, {"g_withStrategiesXReadOnlyStrategyX_E_propertyXweight_0X", new List, ITraversal>> {(g,p) =>g.WithStrategies(new ReadOnlyStrategy()).E().Property("weight", 0)}}, - {"g_V_classic_recommendation", new List, ITraversal>> {(g,p) =>g.V().Has("name", "DARK STAR").As("a").Out("followedBy").Aggregate("stash").In("followedBy").Where(P.Neq("a").And(P.Not(P.Within("stash")))).GroupCount().Unfold().Project("x", "y", "z").By(__.Select(Column.Keys).Values("name")).By(__.Select(Column.Keys).Values("performances")).By(__.Select(Column.Values)).Order().By(__.Select("z"), Order.Desc).By(__.Select("y"), Order.Asc).Limit(5).Aggregate(Scope.Local, "m").Select("x")}}, - {"g_V_classic_recommendation_ranked", new List, ITraversal>> {(g,p) =>g.V().Has("name", "DARK STAR").As("a").Out("followedBy").Aggregate("stash").In("followedBy").Where(P.Neq("a").And(P.Not(P.Within("stash")))).GroupCount().Unfold().Project("x", "y", "z").By(__.Select(Column.Keys).Values("name")).By(__.Select(Column.Keys).Values("performances")).By(__.Select(Column.Values)).Order().By(__.Select("z"), Order.Desc).By(__.Select("y"), Order.Asc).Limit(5).Aggregate(Scope.Local, "m")}}, + {"g_V_classic_recommendation", new List, ITraversal>> {(g,p) =>g.V().Has("name", "DARK STAR").As("a").Out("followedBy").Aggregate("stash").In("followedBy").Where(P.Neq("a").And(P.Not(P.Within("stash")))).GroupCount().Unfold().Project("x", "y", "z").By(__.Select(Column.Keys).Values("name")).By(__.Select(Column.Keys).Values("performances")).By(__.Select(Column.Values)).Order().By(__.Select("z"), Order.Desc).By(__.Select("y"), Order.Asc).Limit(5).Local(__.Aggregate("m")).Select("x")}}, + {"g_V_classic_recommendation_ranked", new List, ITraversal>> {(g,p) =>g.V().Has("name", "DARK STAR").As("a").Out("followedBy").Aggregate("stash").In("followedBy").Where(P.Neq("a").And(P.Not(P.Within("stash")))).GroupCount().Unfold().Project("x", "y", "z").By(__.Select(Column.Keys).Values("name")).By(__.Select(Column.Keys).Values("performances")).By(__.Select(Column.Values)).Order().By(__.Select("z"), Order.Desc).By(__.Select("y"), Order.Asc).Limit(5).Local(__.Aggregate("m"))}}, {"g_withStrategiesXReferenceElementStrategyX_V", new List, ITraversal>> {(g,p) =>g.WithStrategies(new ReferenceElementStrategy()).V()}}, {"g_withoutStrategiesXReferenceElementStrategyX_V", new List, ITraversal>> {(g,p) =>g.WithoutStrategies(typeof(ReferenceElementStrategy)).V()}}, {"g_withStrategiesXRepeatUnrollStrategyX_V_repeatXoutX_timesX2X", new List, ITraversal>> {(g,p) =>g.WithStrategies(new RepeatUnrollStrategy()).V().Repeat(__.Out()).Times(2)}}, @@ -1612,7 +1612,7 @@ private static IDictionary, ITraversal>> {(g,p) =>g.WithStrategies(new ProductiveByStrategy()).V().As("a").Select("a").By("age")}}, {"g_withSideEffectXk_nullX_injectXxX_selectXkX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("k", null).Inject("x").Select("k")}}, {"g_V_out_in_selectXall_a_a_aX_byXunfold_name_foldX", new List, ITraversal>> {(g,p) =>g.AddV("A").Property("name", "a1").As("a1").AddV("B").Property("name", "b1").As("b1").AddE("ab").From("a1").To("b1"), (g,p) =>g.V().As("a").Out().As("a").In().As("a").Select(Pop.All, "a", "a", "a").By(__.Unfold().Values("name").Fold())}}, - {"g_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX", new List, ITraversal>> {(g,p) =>g.V().As("label").Aggregate(Scope.Local, "x").Barrier().Select("x").Select("label")}}, + {"g_V_asXlabelX_localXaggregateXxX_selectXxX_selectXlabelX", new List, ITraversal>> {(g,p) =>g.V().As("label").Local(__.Aggregate("x")).Barrier().Select("x").Select("label")}}, {"g_V_name_asXaX_selectXfirst_aX", new List, ITraversal>> {(g,p) =>g.V().Values("name").As("a").Select(Pop.First, "a")}}, {"g_V_name_asXaX_selectXlast_aX", new List, ITraversal>> {(g,p) =>g.V().Values("name").As("a").Select(Pop.Last, "a")}}, {"g_V_name_asXaX_selectXmixed_aX", new List, ITraversal>> {(g,p) =>g.V().Values("name").As("a").Select(Pop.Mixed, "a")}}, @@ -1872,47 +1872,59 @@ private static IDictionary, ITraversal>> {(g,p) =>g.V().Out().Out().Values().As("head").Path().Order().By(Order.Asc).Select("head")}}, {"g_V_out_out_values_asXheadX_path_order_byXdescX_selectXheadX", new List, ITraversal>> {(g,p) =>g.V().Out().Out().Values().As("head").Path().Order().By(Order.Desc).Select("head")}}, {"g_V_valueXnameX_aggregateXxX_capXxX", new List, ITraversal>> {(g,p) =>g.V().Values("name").Aggregate("x").Cap("x")}}, - {"g_V_valueXnameX_aggregateXglobal_xX_capXxX", new List, ITraversal>> {(g,p) =>g.V().Values("name").Aggregate(Scope.Global, "x").Cap("x")}}, {"g_V_aggregateXxX_byXnameX_capXxX", new List, ITraversal>> {(g,p) =>g.V().Aggregate("x").By("name").Cap("x")}}, {"g_V_out_aggregateXaX_path", new List, ITraversal>> {(g,p) =>g.V().Out().Aggregate("a").Path()}}, {"g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX", new List, ITraversal>> {(g,p) =>g.V().HasLabel("person").Aggregate("x").By("age").Cap("x").As("y").Select("y")}}, {"g_V_aggregateXxX_byXageX_capXxX", new List, ITraversal>> {(g,p) =>g.V().Aggregate("x").By("age").Cap("x")}}, - {"g_V_aggregateXlocal_xX_byXageX_capXxX", new List, ITraversal>> {(g,p) =>g.V().Aggregate(Scope.Local, "x").By("age").Cap("x")}}, - {"g_withStrategiesXProductiveByStrategyX_V_aggregateXlocal_xX_byXageX_capXxX", new List, ITraversal>> {(g,p) =>g.WithStrategies(new ProductiveByStrategy()).V().Aggregate(Scope.Local, "x").By("age").Cap("x")}}, - {"g_V_aggregateXlocal_a_nameX_out_capXaX", new List, ITraversal>> {(g,p) =>g.V().Aggregate(Scope.Local, "a").By("name").Out().Cap("a")}}, - {"g_VX1X_aggregateXlocal_aX_byXnameX_out_aggregateXlocal_aX_byXnameX_name_capXaX", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Aggregate(Scope.Local, "a").By("name").Out().Aggregate(Scope.Local, "a").By("name").Values("name").Cap("a")}}, - {"g_withSideEffectXa_setX_V_both_name_aggregateXlocal_aX_capXaX", new List, ITraversal>> {(g,p) =>g.V().Both().Values("name").Aggregate(Scope.Local, "a").Cap("a")}}, - {"g_withSideEffectXa_set_inlineX_V_both_name_aggregateXlocal_aX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", new HashSet { "alice" }).V().Both().Values("name").Aggregate(Scope.Local, "a").Cap("a")}}, - {"g_V_aggregateXlocal_aX_byXoutEXcreatedX_countX_out_out_aggregateXlocal_aX_byXinEXcreatedX_weight_sumX", new List, ITraversal>> {(g,p) =>g.V().Aggregate(Scope.Local, "a").By(__.OutE("created").Count()).Out().Out().Aggregate(Scope.Local, "a").By(__.InE("created").Values("weight").Sum()).Cap("a")}}, + {"g_V_localXaggregateXxX_byXageXX_capXxX", new List, ITraversal>> {(g,p) =>g.V().Local(__.Aggregate("x").By("age")).Cap("x")}}, + {"g_withStrategiesXProductiveByStrategyX_V_localXaggregateXxX_byXageXX_capXxX", new List, ITraversal>> {(g,p) =>g.WithStrategies(new ProductiveByStrategy()).V().Local(__.Aggregate("x").By("age")).Cap("x")}}, + {"g_V_localX_aggregateXa_byXnameXX_out_capXaX", new List, ITraversal>> {(g,p) =>g.V().Local(__.Aggregate("a").By("name")).Out().Cap("a")}}, + {"g_VX1X_localXaggregateXaX_byXnameXX_out_localXaggregateXaX_byXnameXX_name_capXaX", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Local(__.Aggregate("a").By("name")).Out().Local(__.Aggregate("a").By("name")).Values("name").Cap("a")}}, + {"g_withSideEffectXa_setX_V_both_name_localXaggregateX_aXX_capXaX", new List, ITraversal>> {(g,p) =>g.V().Both().Values("name").Local(__.Aggregate("a")).Cap("a")}}, + {"g_withSideEffectXa_set_inlineX_V_both_name_localXaggregateXaXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", new HashSet { "alice" }).V().Both().Values("name").Local(__.Aggregate("a")).Cap("a")}}, + {"g_V_localXaggregateXaX_byXoutEXcreatedX_countXX_out_out_localXaggregateXaX_byXinEXcreatedX_weight_sumXX_capXaX", new List, ITraversal>> {(g,p) =>g.V().Local(__.Aggregate("a").By(__.OutE("created").Count())).Out().Out().Local(__.Aggregate("a").By(__.InE("created").Values("weight").Sum())).Cap("a")}}, {"g_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX", new List, ITraversal>> {(g,p) =>g.V().Aggregate("x").By(__.Values("age").Is(P.Gt(29))).Cap("x")}}, {"g_withStrategiesXProductiveByStrategyX_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX", new List, ITraversal>> {(g,p) =>g.WithStrategies(new ProductiveByStrategy()).V().Aggregate("x").By(__.Values("age").Is(P.Gt(29))).Cap("x")}}, {"g_V_aggregateXxX_byXout_order_byXnameXX_capXxX", new List, ITraversal>> {(g,p) =>g.V().Aggregate("x").By(__.Out().Order().By("name")).Cap("x")}}, {"g_withStrategiesXProductiveByStrategyX_V_aggregateXxX_byXout_order_byXnameXX_capXxX", new List, ITraversal>> {(g,p) =>g.WithStrategies(new ProductiveByStrategy()).V().Aggregate("x").By(__.Out().Order().By("name")).Cap("x")}}, {"g_V_aggregateXaX_hasXperson_age_gteX30XXX_capXaX_unfold_valuesXnameX", new List, ITraversal>> {(g,p) =>g.V().Aggregate("a").Has("person", "age", P.Gte(30)).Cap("a").Unfold().Values("name")}}, {"g_withSideEffectXa_1_sumX_V_aggregateXaX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 1, Operator.Sum).V().Aggregate("a").By("age").Cap("a")}}, - {"g_withSideEffectXa_1_sumX_V_aggregateXlocal_aX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 1, Operator.Sum).V().Aggregate(Scope.Local, "a").By("age").Cap("a")}}, + {"g_withSideEffectXa_1_sumX_V_localXaggregateX_aX_byXageXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 1, Operator.Sum).V().Local(__.Aggregate("a").By("age")).Cap("a")}}, {"g_withSideEffectXa_123_minusX_V_aggregateXaX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 123, Operator.Minus).V().Aggregate("a").By("age").Cap("a")}}, - {"g_withSideEffectXa_123_minusX_V_aggregateXlocal_aX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 123, Operator.Minus).V().Aggregate(Scope.Local, "a").By("age").Cap("a")}}, + {"g_withSideEffectXa_123_minusX_V_localXaggregateX_aX_byXageXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 123, Operator.Minus).V().Local(__.Aggregate("a").By("age")).Cap("a")}}, {"g_withSideEffectXa_2_multX_V_aggregateXaX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 2, Operator.Mult).V().Aggregate("a").By("age").Cap("a")}}, - {"g_withSideEffectXa_2_multX_V_aggregateXlocal_aX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 2, Operator.Mult).V().Aggregate(Scope.Local, "a").By("age").Cap("a")}}, + {"g_withSideEffectXa_2_multX_V_localXaggregateX_aX_byXageXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 2, Operator.Mult).V().Local(__.Aggregate("a").By("age")).Cap("a")}}, {"g_withSideEffectXa_876960_divX_V_aggregateXaX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 876960, Operator.Div).V().Aggregate("a").By("age").Cap("a")}}, - {"g_withSideEffectXa_876960_divX_V_aggregateXlocal_aX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 876960, Operator.Div).V().Aggregate(Scope.Local, "a").By("age").Cap("a")}}, + {"g_withSideEffectXa_876960_divX_V_localXaggregateX_aX_byXageXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 876960, Operator.Div).V().Local(__.Aggregate("a").By("age")).Cap("a")}}, {"g_withSideEffectXa_1_minX_V_aggregateXaX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 1, Operator.Min).V().Aggregate("a").By("age").Cap("a")}}, - {"g_withSideEffectXa_1_minX_V_aggregateXlocal_aX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 1, Operator.Min).V().Aggregate(Scope.Local, "a").By("age").Cap("a")}}, + {"g_withSideEffectXa_1_minX_V_localXaggregateX_aX_byXageXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 1, Operator.Min).V().Local(__.Aggregate("a").By("age")).Cap("a")}}, {"g_withSideEffectXa_100_minX_V_aggregateXaX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 100, Operator.Min).V().Aggregate("a").By("age").Cap("a")}}, - {"g_withSideEffectXa_100_minX_V_aggregateXlocal_aX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 100, Operator.Min).V().Aggregate(Scope.Local, "a").By("age").Cap("a")}}, + {"g_withSideEffectXa_100_minX_V_localXaggregateX_aX_byXageXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 100, Operator.Min).V().Local(__.Aggregate("a").By("age")).Cap("a")}}, {"g_withSideEffectXa_1_maxX_V_aggregateXaX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 1, Operator.Max).V().Aggregate("a").By("age").Cap("a")}}, - {"g_withSideEffectXa_1_maxX_V_aggregateXlocal_aX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 1, Operator.Max).V().Aggregate(Scope.Local, "a").By("age").Cap("a")}}, + {"g_withSideEffectXa_1_maxX_V_localXaggregateX_aX_byXageXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 1, Operator.Max).V().Local(__.Aggregate("a").By("age")).Cap("a")}}, {"g_withSideEffectXa_100_maxX_V_aggregateXaX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 100, Operator.Max).V().Aggregate("a").By("age").Cap("a")}}, - {"g_withSideEffectXa_100_maxX_V_aggregateXlocal_aX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 100, Operator.Max).V().Aggregate(Scope.Local, "a").By("age").Cap("a")}}, + {"g_withSideEffectXa_100_maxX_V_localXaggregateX_aX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", 100, Operator.Max).V().Local(__.Aggregate("a").By("age")).Cap("a")}}, {"g_withSideEffectXa_true_andX_V_constantXfalseX_aggregateXaX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", true, Operator.And).V().Constant(false).Aggregate("a").Cap("a")}}, - {"g_withSideEffectXa_true_andX_V_constantXfalseX_aggregateXlocal_aX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", true, Operator.And).V().Constant(false).Aggregate(Scope.Local, "a").Cap("a")}}, + {"g_withSideEffectXa_true_andX_V_constantXfalseX_localXaggregateX_aXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", true, Operator.And).V().Constant(false).Local(__.Aggregate("a")).Cap("a")}}, {"g_withSideEffectXa_true_orX_V_constantXfalseX_aggregateXaX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", true, Operator.Or).V().Constant(false).Aggregate("a").Cap("a")}}, - {"g_withSideEffectXa_true_orX_V_constantXfalseX_aggregateXlocal_aX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", true, Operator.Or).V().Constant(false).Aggregate(Scope.Local, "a").Cap("a")}}, + {"g_withSideEffectXa_true_orX_V_constantXfalseX_localXaggregateX_aXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", true, Operator.Or).V().Constant(false).Local(__.Aggregate("a")).Cap("a")}}, {"g_withSideEffectXa_1_2_3_addAllX_V_aggregateXaX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", new List { 1, 2, 3 }, Operator.AddAll).V().Aggregate("a").By("age").Cap("a")}}, - {"g_withSideEffectXa_1_2_3_addAllX_V_aggregateXlocal_aX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", new List { 1, 2, 3 }, Operator.AddAll).V().Aggregate(Scope.Local, "a").By("age").Cap("a")}}, + {"g_withSideEffectXa_1_2_3_addAllX_V_localXaggregateX_aX_byXageXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", new List { 1, 2, 3 }, Operator.AddAll).V().Local(__.Aggregate("a").By("age")).Cap("a")}}, {"g_withSideEffectXa_1_2_3_assignX_V_aggregateXaX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", new List { 1, 2, 3 }, Operator.Assign).V().Aggregate("a").By("age").Cap("a")}}, - {"g_withSideEffectXa_1_2_3_assignX_V_order_byXageX_aggregateXlocal_aX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", new List { 1, 2, 3 }, Operator.Assign).V().Order().By("age").Aggregate(Scope.Local, "a").By("age").Cap("a")}}, + {"g_withSideEffectXa_1_2_3_assignX_V_order_byXageX_localXaggregateX_aX_byXageXX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", new List { 1, 2, 3 }, Operator.Assign).V().Order().By("age").Local(__.Aggregate("a").By("age")).Cap("a")}}, + {"g_V_localXaggregateXa_nameXX_out_capXaX", new List, ITraversal>> {(g,p) =>g.V().Local(__.Aggregate("a").By("name")).Out().Cap("a")}}, + {"g_withSideEffectXa_setX_V_both_name_localXaggregateXaXX_capXaX", new List, ITraversal>> {(g,p) =>g.V().Both().Values("name").Local(__.Aggregate("a")).Cap("a")}}, + {"g_V_localXaggregateXaXX_outE_inV_localXaggregateXaXX_capXaX_unfold_dedup", new List, ITraversal>> {(g,p) =>g.V().Local(__.Aggregate("a")).OutE().InV().Local(__.Aggregate("a")).Cap("a").Unfold().Dedup()}}, + {"g_V_hasLabelXpersonX_localXaggregateXaXX_outXcreatedX_localXaggregateXaXX_capXaX", new List, ITraversal>> {(g,p) =>g.V().HasLabel("person").Local(__.Aggregate("a")).Out("created").Local(__.Aggregate("a")).Cap("a")}}, + {"g_V_localXaggregateXaXX_repeatXout_localXaggregateXaXXX_timesX2X_capXaX_unfold_groupCount", new List, ITraversal>> {(g,p) =>g.V().Local(__.Aggregate("a")).Repeat(__.Out().Local(__.Aggregate("a"))).Times(2).Cap("a").Unfold().Values("name").GroupCount()}}, + {"g_V_hasXname_markoX_localXaggregateXaXX_outXknowsX_localXaggregateXaXX_outXcreatedX_localXaggregateXaXX_capXaX", new List, ITraversal>> {(g,p) =>g.V().Has("name", "marko").Local(__.Aggregate("a")).Out("knows").Local(__.Aggregate("a")).Out("created").Local(__.Aggregate("a")).Cap("a")}}, + {"g_V_hasLabelXsoftwareX_localXaggregateXaXX_inXcreatedX_localXaggregateXaXX_outXknowsX_localXaggregateXaXX_capXaX", new List, ITraversal>> {(g,p) =>g.V().HasLabel("software").Local(__.Aggregate("a")).In("created").Local(__.Aggregate("a")).Out("knows").Local(__.Aggregate("a")).Cap("a")}}, + {"g_V_localXaggregateXaXX_outE_hasXweight_lgtX0_5XX_inV_localXaggregateXaXX_capXaX_unfold_path", new List, ITraversal>> {(g,p) =>g.V().Local(__.Aggregate("a")).OutE().Has("weight", P.Gt(0.5)).InV().Local(__.Aggregate("a")).Cap("a").Unfold().Path()}}, + {"g_V_localXaggregateXaXX_bothE_sampleX1X_otherV_localXaggregateXaXX_capXaX_unfold_groupCount_byXlabelX", new List, ITraversal>> {(g,p) =>g.V().Local(__.Aggregate("a")).BothE().Sample(1).OtherV().Local(__.Aggregate("a")).Cap("a").Unfold().GroupCount().By(T.Label)}}, + {"g_V_hasLabelXpersonX_localXaggregateXaXX_outE_inV_simplePath_localXaggregateXaXX_capXaX_unfold_hasLabelXsoftwareX_count", new List, ITraversal>> {(g,p) =>g.V().HasLabel("person").Local(__.Aggregate("a")).OutE().InV().SimplePath().Local(__.Aggregate("a")).Cap("a").Unfold().HasLabel("software").Count()}}, + {"g_V_localXaggregateXaXX_unionXout_inX_localXaggregateXaXX_capXaX_unfold_dedup_valuesXnameX", new List, ITraversal>> {(g,p) =>g.V().Local(__.Aggregate("a")).Union(__.Out(), __.In()).Local(__.Aggregate("a")).Cap("a").Unfold().Dedup().Values("name")}}, + {"g_V_hasXname_joshX_localXaggregateXaXX_outE_hasXweight_ltX1_0XX_inV_localXaggregateXaXX_outE_inV_localXaggregateXaXX_capXaX", new List, ITraversal>> {(g,p) =>g.V().Has("name", "josh").Local(__.Aggregate("a")).OutE().Has("weight", P.Lt(1.0)).InV().Local(__.Aggregate("a")).OutE().InV().Local(__.Aggregate("a")).Cap("a")}}, + {"g_V_hasLabelXpersonX_localXaggregateXaXX_outE_order_byXweightX_limitX1X_inV_localXaggregateXaXX_capXaX", new List, ITraversal>> {(g,p) =>g.V().HasLabel("person").Local(__.Aggregate("a")).OutE().Order().By("weight").Limit(1).InV().Local(__.Aggregate("a")).Cap("a")}}, {"g_V_fail", new List, ITraversal>> {(g,p) =>g.V().Fail()}}, {"g_V_failXmsgX", new List, ITraversal>> {(g,p) =>g.V().Fail("msg")}}, {"g_V_unionXout_failX", new List, ITraversal>> {(g,p) =>g.V().Union(__.Out(), __.Fail())}}, @@ -2013,7 +2025,7 @@ private static IDictionary, ITraversal>> {(g,p) =>g.V().SideEffect(__.Identity().Values("name"))}}, {"g_V_sideEffectXpropertyXage_22X", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("age", 21), (g,p) =>g.V().SideEffect(__.Property("age", 22)), (g,p) =>g.V().Has("age", 21), (g,p) =>g.V().Has("age", 22)}}, {"g_V_group_byXvaluesXnameX_sideEffectXconstantXzyxXX_substringX1XX_byXconstantX1X_sideEffectXconstantXxyzXXX", new List, ITraversal>> {(g,p) =>g.V().Group().By(__.Values("name").SideEffect(__.Constant("zyx")).Substring(0, 1)).By(__.Constant(1).SideEffect(__.Constant("xyz")))}}, - {"g_withSideEffectXx_setX_V_both_both_sideEffectXstoreXxX_byXnameXX_capXxX_unfold", new List, ITraversal>> {(g,p) =>g.WithSideEffect("x", new HashSet { }).V().Both().Both().SideEffect(__.Store("x").By("name")).Cap("x").Unfold()}}, + {"g_withSideEffectXx_setX_V_both_both_sideEffectXlocalXaggregateXxX_byXnameXX_capXxX_unfold", new List, ITraversal>> {(g,p) =>g.WithSideEffect("x", new HashSet { }).V().Both().Both().SideEffect(__.Local(__.Aggregate("x").By("name"))).Cap("x").Unfold()}}, {"g_V_hasXageX_groupCountXaX_byXnameX_out_capXaX", new List, ITraversal>> {(g,p) =>g.V().Has("age").GroupCount("a").By("name").Out().Cap("a")}}, {"g_V_groupXaX_byXageX_capXaX", new List, ITraversal>> {(g,p) =>g.V().Group("a").By("age").Cap("a")}}, {"g_V_groupXaX_byXnameX_capXaX", new List, ITraversal>> {(g,p) =>g.V().Group("a").By("name").Cap("a")}}, @@ -2035,11 +2047,6 @@ private static IDictionary, ITraversal>> {(g,p) =>g.V().Group("a").By().By(__.Out().Label().Limit(0).Fold()).Cap("a").Select(Column.Values).Unfold()}}, {"g_V_groupXaX_by_byXout_label_limitX10X_foldX_capXaX_selectXvaluesX_unfold_orderXlocalX", new List, ITraversal>> {(g,p) =>g.V().Group("a").By().By(__.Out().Label().Limit(10).Fold()).Cap("a").Select(Column.Values).Unfold().Order(Scope.Local)}}, {"g_V_groupXaX_by_byXout_label_tailX10X_foldX_capXaX_selectXvaluesX_unfold_orderXlocalX", new List, ITraversal>> {(g,p) =>g.V().Group("a").By().By(__.Out().Label().Tail(10).Fold()).Cap("a").Select(Column.Values).Unfold().Order(Scope.Local)}}, - {"g_V_storeXa_nameX_out_capXaX", new List, ITraversal>> {(g,p) =>g.V().Store("a").By("name").Out().Cap("a")}}, - {"g_VX1X_storeXaX_byXnameX_out_storeXaX_byXnameX_name_capXaX", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Store("a").By("name").Out().Store("a").By("name").Values("name").Cap("a")}}, - {"g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX", new List, ITraversal>> {(g,p) =>g.V().Both().Values("name").Store("a").Cap("a")}}, - {"g_withSideEffectXa_set_inlineX_V_both_name_storeXaX_capXaX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", new HashSet { "alice" }).V().Both().Values("name").Store("a").Cap("a")}}, - {"g_V_storeXaX_byXoutEXcreatedX_countX_out_out_storeXaX_byXinEXcreatedX_weight_sumX", new List, ITraversal>> {(g,p) =>g.V().Store("a").By(__.OutE("created").Count()).Out().Out().Store("a").By(__.InE("created").Values("weight").Sum()).Cap("a")}}, {"g_VX1X_outEXknowsX_subgraphXsgX_name_capXsgX", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).OutE("knows").Subgraph("sg").Values("name").Cap("sg")}}, {"g_V_repeatXbothEXcreatedX_subgraphXsgX_outVX_timesX5X_name_dedup_capXsgX", new List, ITraversal>> {(g,p) =>g.V().Repeat(__.BothE("created").Subgraph("sg").OutV()).Times(5).Values("name").Dedup().Cap("sg")}}, {"g_V_outEXnoexistX_subgraphXsgXcapXsgX", new List, ITraversal>> {(g,p) =>g.V().OutE("noexist").Subgraph("sg").Cap("sg")}}, diff --git a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/Translator/GroovyTranslatorTests.cs b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/Translator/GroovyTranslatorTests.cs index c7b7a6a4db6..262b0e7705e 100644 --- a/gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/Translator/GroovyTranslatorTests.cs +++ b/gremlin-dotnet/test/Gremlin.Net.UnitTest/Process/Traversal/Translator/GroovyTranslatorTests.cs @@ -1,506 +1,500 @@ -#region License - -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - -#endregion - -using System; -using System.Collections.Generic; -using Gremlin.Net.Process.Traversal; -using Gremlin.Net.Process.Traversal.Strategy.Decoration; -using Gremlin.Net.Process.Traversal.Strategy.Verification; -using Gremlin.Net.Process.Traversal.Translator; -using Gremlin.Net.Structure; -using Xunit; - -namespace Gremlin.Net.UnitTest.Process.Traversal.Translator; - -public class GroovyTranslatorTests -{ - private readonly GraphTraversalSource _g = AnonymousTraversalSource.Traversal().With(null); - - [Fact] - public void ShouldTranslateStepsWithSingleArguments() - { - var translator = GroovyTranslator.Of("g"); - - var translated = translator.Translate(_g.V().Values("name").Bytecode); - - Assert.Equal("g.V().values('name')", translated); - } - - [Fact] - public void ShouldTranslateStepsWithMultipleArguments() - { - var translator = GroovyTranslator.Of("g"); - - var translated = translator.Translate(_g.V().Values("name", "age").Bytecode); - - Assert.Equal("g.V().values('name', 'age')", translated); - } - - [Fact] - public void ShouldTranslateNullArgument() - { - AssertTranslation("null", null); - } - - [Theory] - [InlineData("3, 5", 3, 5)] - [InlineData("3.2, 5.1", 3.2, 5.1)] - [InlineData("'c'", 'c')] - [InlineData("true", true)] - [InlineData("false", false)] - public void ShouldTranslateSimpleTypes(string expectedGroovy, params object[] simpleTypes) - { - AssertTranslation(expectedGroovy, simpleTypes); - } - - [Fact] - public void ShouldTranslateDateTimeOffsetArgument() - { - AssertTranslation("new Date(122, 11, 30, 12, 0, 1)", DateTimeOffset.Parse("2022-12-30T12:00:01Z")); - } - - [Fact] - public void ShouldTranslateDateTimeArgument() - { - AssertTranslation("new Date(122, 11, 30, 12, 0, 1)", DateTime.Parse("2022-12-30T12:00:01")); - } - - [Fact] - public void ShouldTranslateGuid() - { - AssertTranslation("UUID.fromString('ffffffff-fd49-1e4b-0000-00000d4b8a1d')", - Guid.Parse("ffffffff-fd49-1e4b-0000-00000d4b8a1d")); - } - - [Fact] - public void ShouldTranslateCollection() - { - AssertTranslation("['test1', 'test2']", new List{"test1", "test2"}); - } - - [Fact] - public void ShouldTranslateDictionary() - { - var dictionary = new Dictionary - { - { "key1", "value1" }, - { 1, "value2" } - }; - AssertTranslation("['key1': 'value1', 1: 'value2']", dictionary); - } - - [Fact] - public void ShouldTranslateColumn() - { - AssertTranslation("Column.keys", Column.Keys); - } - - [Fact] - public void ShouldTranslateDirection() - { - AssertTranslation("Direction.BOTH", Direction.Both); - } - - [Fact] - public void ShouldTranslateOrder() - { - AssertTranslation("Order.desc", Order.Desc); - } - - [Fact] - public void ShouldTranslatePop() - { - AssertTranslation("Pop.last", Pop.Last); - } - - [Fact] - public void ShouldTranslateScope() - { - AssertTranslation("Scope.local", Scope.Local); - } - - [Fact] - public void ShouldTranslateP() - { - AssertTranslation("P.and(P.gt(20), P.lt(30))", P.Gt(20).And(P.Lt(30))); - } - - [Fact] - public void ShouldTranslatePBetween() - { - AssertTranslation("P.between([20, 30])", P.Between(20, 30)); - } - - [Fact] - public void ShouldTranslateValueMapOptions() - { - AssertTraversalTranslation("g.V().valueMap().with(WithOptions.tokens, WithOptions.all).V()", - _g.V().ValueMap().With(WithOptions.Tokens, WithOptions.All).V()); - } - - [Fact] - public void ShouldTranslateIndexerOptions() - { - AssertTraversalTranslation("g.V().index().with(WithOptions.indexer, WithOptions.list)", - _g.V().Index().With(WithOptions.Indexer, WithOptions.List)); - } - - [Fact] - public void ShouldTranslateGraphTraversalSourceOptions() - { - AssertTraversalTranslation("g.withStrategies(new OptionsStrategy('~tinkerpop.valueMap.tokens': true)).V()", - _g.With(WithOptions.Tokens).V()); - } - - [Fact] - public void TranslationTest() - { - var expectedGroovyScriptByTraversal = new Dictionary - { - { _g.V(), "g.V()" }, - { _g.V("1", "2", "3", "4"), "g.V('1', '2', '3', '4')" }, - { _g.V("3").ValueMap(true), "g.V('3').valueMap(true)" }, - { _g.V().Constant(5), "g.V().constant(5)" }, - { _g.V().Constant(1.5), "g.V().constant(1.5)" }, - { _g.V().Constant("Hello"), "g.V().constant('Hello')" }, - { _g.V().HasLabel("airport").Limit(5), "g.V().hasLabel('airport').limit(5)" }, - { - _g.V().HasLabel(P.Within(new List { "a", "b", "c" })), - "g.V().hasLabel(P.within(['a', 'b', 'c']))" - }, - { - _g.V().HasLabel("airport", "continent").Out().Limit(5), - "g.V().hasLabel('airport', 'continent').out().limit(5)" - }, - { - _g.V().HasLabel("airport").Out().Values("code").Limit(5), - "g.V().hasLabel('airport').out().values('code').limit(5)" - }, - { - _g.V("3").As("a").Out("route").Limit(10).Where(P.Eq("a")).By("region"), - "g.V('3').as('a').out('route').limit(10).where(P.eq('a')).by('region')" - }, - { - _g.V("3").Repeat(__.Out("route").SimplePath()).Times(2).Path().By("code"), - "g.V('3').repeat(__.out('route').simplePath()).times(2).path().by('code')" - }, - { - _g.V().HasLabel("airport").Out().Has("region", "US-TX").Values("code").Limit(5), - "g.V().hasLabel('airport').out().has('region', 'US-TX').values('code').limit(5)" - }, - { - _g.V().HasLabel("airport").Union(__.Values("city"), __.Values("region")) - .Limit(5), - "g.V().hasLabel('airport').union(__.values('city'), __.values('region')).limit(5)" - }, - { _g.V("3").As("a").Out("route", "routes"), "g.V('3').as('a').out('route', 'routes')" }, - { _g.V().Where(__.Values("runways").Is(5)), "g.V().where(__.values('runways').is(5))" }, - { - _g.V("3").Repeat(__.Out().SimplePath()).Until(__.Has("code", "AGR")).Path().By("code").Limit(5), - "g.V('3').repeat(__.out().simplePath()).until(__.has('code', 'AGR')).path().by('code').limit(5)" - }, - { _g.V().HasLabel("airport").Order().By(__.Id()), "g.V().hasLabel('airport').order().by(__.id())" }, - { _g.V().HasLabel("airport").Order().By(T.Id), "g.V().hasLabel('airport').order().by(T.id)" }, - { - _g.V().HasLabel("airport").Order().By(__.Id(), Order.Desc), - "g.V().hasLabel('airport').order().by(__.id(), Order.desc)" - }, - { - _g.V().HasLabel("airport").Order().By("code", Order.Desc), - "g.V().hasLabel('airport').order().by('code', Order.desc)" - }, - { - _g.V("1", "2", "3").Local(__.Out().Out().Dedup().Fold()), - "g.V('1', '2', '3').local(__.out().out().dedup().fold())" - }, - { _g.V("3").Out().Path().Count(Scope.Local), "g.V('3').out().path().count(Scope.local)" }, - { _g.E().Count(), "g.E().count()" }, - { _g.V('5').OutE("route").InV().Path().Limit(10), "g.V('5').outE('route').inV().path().limit(10)" }, - { - _g.V('5').PropertyMap().Select(Column.Keys), - "g.V('5').propertyMap().select(Column.keys)" - }, - { - _g.V('5').PropertyMap().Select(Column.Values), - "g.V('5').propertyMap().select(Column.values)" - }, - { _g.V("3").Values("runways").Math("_ + 1"), "g.V('3').values('runways').math('_ + 1')" }, - { - _g.V("3").Emit().Repeat(__.Out().SimplePath()).Times(3).Limit(5).Path(), - "g.V('3').emit().repeat(__.out().simplePath()).times(3).limit(5).path()" - }, - { - _g.V().Match(__.As("a").Has("code", "LHR").As("b")).Select("b").By("code"), - "g.V().match(__.as('a').has('code', 'LHR').as('b')).select('b').by('code')" - }, - { - _g.V().Has("test-using-keyword-as-property", "repeat"), - "g.V().has('test-using-keyword-as-property', 'repeat')" - }, - { _g.V('1').AddE("test").To(__.V('4')), "g.V('1').addE('test').to(__.V('4'))" }, - { _g.V().Values("runways").Max(), "g.V().values('runways').max()" }, - { _g.V().Values("runways").Min(), "g.V().values('runways').min()" }, - { _g.V().Values("runways").Sum(), "g.V().values('runways').sum()" }, - { _g.V().Values("runways").Mean(), "g.V().values('runways').mean()" }, - { - _g.WithSack(0).V('3', '5').Sack(Operator.Sum).By("runways").Sack(), - "g.withSack(0).V('3', '5').sack(Operator.sum).by('runways').sack()" - }, - { - _g.V("3").Values("runways").Store("x").V('4').Values("runways").Store("x") - .By(__.Constant(1)).V('6').Store("x").By(__.Constant(1)).Select("x").Unfold() - .Sum(), - "g.V('3').values('runways').store('x').V('4').values('runways').store('x').by(__.constant(1)).V('6').store('x').by(__.constant(1)).select('x').unfold().sum()" - }, - { _g.Inject(3, 4, 5), "g.inject(3, 4, 5)" }, - { _g.Inject(new List { 3, 4, 5 }), "g.inject([3, 4, 5])" }, - { _g.Inject(3, 4, 5).Count(), "g.inject(3, 4, 5).count()" }, - { _g.V().Has("runways", P.Gt(5)).Count(), "g.V().has('runways', P.gt(5)).count()" }, - { _g.V().Has("runways", P.Lte(5.3)).Count(), "g.V().has('runways', P.lte(5.3)).count()" }, - { _g.V().Has("code", P.Within(new List { 123, 124 })), "g.V().has('code', P.within([123, 124]))" }, - { - _g.V('1', '2').Has("region", P.Within(new List { "US-TX", "US-GA" })), - "g.V('1', '2').has('region', P.within(['US-TX', 'US-GA']))" - }, - { - _g.V().And(__.Has("runways", P.Gt(5)), __.Has("region", "US-TX")), - "g.V().and(__.has('runways', P.gt(5)), __.has('region', 'US-TX'))" - }, - { - _g.V().Union(__.Has("runways", P.Gt(5)), __.Has("region", "US-TX")), - "g.V().union(__.has('runways', P.gt(5)), __.has('region', 'US-TX'))" - }, - { - _g.V("3").Choose(__.Values("runways").Is(3), __.Constant("three"), - __.Constant("not three")), - "g.V('3').choose(__.values('runways').is(3), __.constant('three'), __.constant('not three'))" - }, - { - _g.V("3").Choose(__.Values("runways")).Option(1, __.Constant("three")) - .Option(2, __.Constant("not three")), - "g.V('3').choose(__.values('runways')).option(1, __.constant('three')).option(2, __.constant('not three'))" - }, - { - _g.V("3").Choose(__.Values("runways")).Option(1.5, __.Constant("one and a half")) - .Option(2, __.Constant("not three")), - "g.V('3').choose(__.values('runways')).option(1.5, __.constant('one and a half')).option(2, __.constant('not three'))" - }, - { - _g.V("3").Repeat(__.Out().SimplePath()).Until(__.Loops().Is(1)).Count(), - "g.V('3').repeat(__.out().simplePath()).until(__.loops().is(1)).count()" - }, - { - _g.V().HasLabel("airport").Limit(20).Group().By("region").By("code") - .Order(Scope.Local).By(Column.Keys), - "g.V().hasLabel('airport').limit(20).group().by('region').by('code').order(Scope.local).by(Column.keys)" - }, - { - _g.V('1').As("a").V("2").As("a").Select(Pop.All, "a"), - "g.V('1').as('a').V('2').as('a').select(Pop.all, 'a')" - }, - { - _g.AddV("test").Property(Cardinality.Set, "p1", 10), - "g.addV('test').property(Cardinality.set, 'p1', 10)" - }, - { - _g.AddV("test").Property(Cardinality.List, "p1", 10), - "g.addV('test').property(Cardinality.list, 'p1', 10)" - }, - - { - _g.AddV("test").Property(Cardinality.Single, "p1", 10), - "g.addV('test').property(Cardinality.single, 'p1', 10)" - }, - { _g.V().Limit(5).Order().By(T.Label), "g.V().limit(5).order().by(T.label)" }, - - { _g.V().Range(1, 5), "g.V().range(1, 5)" }, - - { _g.AddV("test").Property("p1", 123), "g.addV('test').property('p1', 123)" }, - - { - _g.AddV("test").Property("date", new DateTime(2021, 3, 1, 9, 30, 0)), - "g.addV('test').property('date', new Date(121, 2, 1, 9, 30, 0))" - }, - { - _g.AddV("test").Property("date", new DateTime(2021, 3, 1, 0, 0, 0)), - "g.addV('test').property('date', new Date(121, 2, 1, 0, 0, 0))" - }, - { _g.AddE("route").From(__.V('1')).To(__.V('2')), "g.addE('route').from(__.V('1')).to(__.V('2'))" }, - { - _g.WithSideEffect("a", new List { 1, 2 }).V('3').Select("a"), - "g.withSideEffect('a', [1, 2]).V('3').select('a')" - }, - { _g.WithSideEffect("a", 1).V('3').Select("a"), "g.withSideEffect('a', 1).V('3').select('a')" }, - { - _g.WithSideEffect("a", "abc").V("3").Select("a"), - "g.withSideEffect('a', 'abc').V('3').select('a')" - }, - { - _g.V().Has("airport", "region", "US-NM").Limit(3).Values("elev").Fold().Index(), - "g.V().has('airport', 'region', 'US-NM').limit(3).values('elev').fold().index()" - }, - { - _g.V("3").Repeat(__.TimeLimit(1000).Out().SimplePath()).Until(__.Has("code", "AGR")).Path(), - "g.V('3').repeat(__.timeLimit(1000).out().simplePath()).until(__.has('code', 'AGR')).path()" - }, - { - _g.V().HasLabel("airport").Where(__.Values("elev").Is(P.Gt(14000))), - "g.V().hasLabel('airport').where(__.values('elev').is(P.gt(14000)))" - }, - { - _g.V().HasLabel("airport").Where(__.Out().Count().Is(P.Gt(250))).Values("code"), - "g.V().hasLabel('airport').where(__.out().count().is(P.gt(250))).values('code')" - }, - { - _g.V().HasLabel("airport").Filter(__.Out().Count().Is(P.Gt(250))).Values("code"), - "g.V().hasLabel('airport').filter(__.out().count().is(P.gt(250))).values('code')" - }, - { - _g.WithSack(0).V('3').Repeat(__.OutE("route").Sack(Operator.Sum).By("dist").InV()) - .Until(__.Has("code", "AGR").Or().Loops().Is(4)).Has("code", "AGR") - .Local(__.Union(__.Path().By("code").By("dist"), __.Sack()).Fold()) - .Limit(10), - "g.withSack(0).V('3').repeat(__.outE('route').sack(Operator.sum).by('dist').inV()).until(__.has('code', 'AGR').or().loops().is(4)).has('code', 'AGR').local(__.union(__.path().by('code').by('dist'), __.sack()).fold()).limit(10)" - }, - { - _g.AddV().As("a").AddV().As("b").AddE("knows").From("a").To("b"), - "g.addV().as('a').addV().as('b').addE('knows').from('a').to('b')" - }, - { - _g.AddV("Person").As("a").AddV("Person").As("b").AddE("knows").From("a").To("b"), - "g.addV('Person').as('a').addV('Person').as('b').addE('knows').from('a').to('b')" - }, - { - _g.V("3").Project("Out", "In").By(__.Out().Count()).By(__.In().Count()), - "g.V('3').project('Out', 'In').by(__.out().count()).by(__.in().count())" - }, - { - _g.V("44").Out().Aggregate("a").Out().Where(P.Within(new List { "a" })).Path(), - "g.V('44').out().aggregate('a').out().where(P.within(['a'])).path()" - }, - { _g.V().Has("date", new DateTime(2021, 3, 22)), "g.V().has('date', new Date(121, 2, 22, 0, 0, 0))" }, - { - _g.V().Has("date", P.Within(new DateTime(2021, 3, 22, 0, 0, 0), new DateTime(2021, 2, 1, 0, 0, 0))), - "g.V().has('date', P.within([new Date(121, 2, 22, 0, 0, 0), new Date(121, 1, 1, 0, 0, 0)]))" - }, - { - _g.V().Has("date", P.Between(new DateTime(2021, 2, 1, 0, 0, 0), new DateTime(2021, 3, 22, 0, 0, 0))), - "g.V().has('date', P.between([new Date(121, 1, 1, 0, 0, 0), new Date(121, 2, 22, 0, 0, 0)]))" - }, - { - _g.V().Has("date", P.Inside(new DateTime(2021, 2, 1, 0, 0, 0), new DateTime(2021, 3, 22, 0, 0, 0))), - "g.V().has('date', P.inside([new Date(121, 1, 1, 0, 0, 0), new Date(121, 2, 22, 0, 0, 0)]))" - }, - { - _g.V().Has("date", P.Gt(new DateTime(2021, 2, 1, 9, 30, 0))), - "g.V().has('date', P.gt(new Date(121, 1, 1, 9, 30, 0)))" - }, - { _g.V().Has("runways", P.Between(3, 5)), "g.V().has('runways', P.between([3, 5]))" }, - { _g.V().Has("runways", P.Inside(3, 5)), "g.V().has('runways', P.inside([3, 5]))" }, - { _g.V("44").OutE().ElementMap(), "g.V('44').outE().elementMap()" }, - { _g.V("44").ValueMap().By(__.Unfold()), "g.V('44').valueMap().by(__.unfold())" }, - { - _g.V().Property(new Dictionary { { "name", "test" }, { "age", 30 } }), - "g.V().property(['name': 'test', 'age': 30])" - }, - { _g.V().E("1"), "g.V().E('1')" }, - - // TODO: Support WithOptions - { - _g.V("44").ValueMap().With(WithOptions.Tokens, WithOptions.Labels), - "g.V('44').valueMap().with(WithOptions.tokens, WithOptions.labels)" - }, - { - _g.V("44").ValueMap().With(WithOptions.Tokens), - "g.V('44').valueMap().with(WithOptions.tokens)" - }, - { - _g.WithStrategies(new ReadOnlyStrategy()).AddV("test"), - "g.withStrategies(new ReadOnlyStrategy()).addV('test')" - }, - { - _g.WithStrategies( - new SubgraphStrategy(vertices: __.Has("region", "US-TX"), edges: __.HasLabel("route"))).V().Count(), - "g.withStrategies(new SubgraphStrategy(vertices: __.has('region', 'US-TX'), edges: __.hasLabel('route'))).V().count()" - }, - { - _g.WithStrategies(new SubgraphStrategy(vertexProperties: __.HasNot("runways"))).V().Count(), - "g.withStrategies(new SubgraphStrategy(vertexProperties: __.hasNot('runways'))).V().count()" - }, - { - _g.WithStrategies(new SubgraphStrategy(vertices: __.Has("region", "US-TX"), - vertexProperties: __.HasNot("runways"))).V().Count(), - "g.withStrategies(new SubgraphStrategy(vertices: __.has('region', 'US-TX'), vertexProperties: __.hasNot('runways'))).V().count()" - }, - { - _g.WithStrategies(new ReadOnlyStrategy(), - new SubgraphStrategy(vertices: __.Has("region", "US-TX"), edges: __.HasLabel("route"))).V().Count(), - "g.withStrategies(new ReadOnlyStrategy(), new SubgraphStrategy(vertices: __.has('region', 'US-TX'), edges: __.hasLabel('route'))).V().count()" - }, - { - _g.WithStrategies(new ReadOnlyStrategy(), - new SubgraphStrategy(vertices: __.Has("region", "US-TX"), checkAdjacentVertices: true)).V() - .Count(), - "g.withStrategies(new ReadOnlyStrategy(), new SubgraphStrategy(vertices: __.has('region', 'US-TX'), checkAdjacentVertices: true)).V().count()" - }, - { - _g.With("evaluationTimeout", 500).V().Count(), - "g.withStrategies(new OptionsStrategy('evaluationTimeout': 500)).V().count()" - }, - { - _g.WithStrategies(new OptionsStrategy(new Dictionary { { "evaluationTimeout", 500 } })) - .V().Count(), - "g.withStrategies(new OptionsStrategy('evaluationTimeout': 500)).V().count()" - }, - { - _g.WithStrategies(new PartitionStrategy(partitionKey: "partition", writePartition: "a", - readPartitions: new List { "a" })).AddV("test"), - "g.withStrategies(new PartitionStrategy(partitionKey: 'partition', writePartition: 'a', readPartitions: ['a'])).addV('test')" - }, - { - _g.WithStrategies(new VertexProgramStrategy()).V().ShortestPath() - .With(ShortestPath.target, __.Has("name", "peter")), - "g.withStrategies(new VertexProgramStrategy()).V().shortestPath().with('~tinkerpop.shortestPath.target', __.has('name', 'peter'))" - } - }; - - foreach (var ( traversal, expectedGroovyScript) in expectedGroovyScriptByTraversal) - { - AssertTraversalTranslation(expectedGroovyScript, traversal); - } - } - - private void AssertTranslation(string expectedTranslation, params object?[]? objs) - { - AssertTraversalTranslation($"g.inject({expectedTranslation})", _g.Inject(objs)); - } - - private static void AssertTraversalTranslation(string expectedTranslation, ITraversal traversal) - { - var translator = GroovyTranslator.Of("g"); - - var translated = translator.Translate(traversal); - - Assert.Equal(expectedTranslation, translated); - } +#region License + +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +#endregion + +using System; +using System.Collections.Generic; +using Gremlin.Net.Process.Traversal; +using Gremlin.Net.Process.Traversal.Strategy.Decoration; +using Gremlin.Net.Process.Traversal.Strategy.Verification; +using Gremlin.Net.Process.Traversal.Translator; +using Gremlin.Net.Structure; +using Xunit; + +namespace Gremlin.Net.UnitTest.Process.Traversal.Translator; + +public class GroovyTranslatorTests +{ + private readonly GraphTraversalSource _g = AnonymousTraversalSource.Traversal().With(null); + + [Fact] + public void ShouldTranslateStepsWithSingleArguments() + { + var translator = GroovyTranslator.Of("g"); + + var translated = translator.Translate(_g.V().Values("name").Bytecode); + + Assert.Equal("g.V().values('name')", translated); + } + + [Fact] + public void ShouldTranslateStepsWithMultipleArguments() + { + var translator = GroovyTranslator.Of("g"); + + var translated = translator.Translate(_g.V().Values("name", "age").Bytecode); + + Assert.Equal("g.V().values('name', 'age')", translated); + } + + [Fact] + public void ShouldTranslateNullArgument() + { + AssertTranslation("null", null); + } + + [Theory] + [InlineData("3, 5", 3, 5)] + [InlineData("3.2, 5.1", 3.2, 5.1)] + [InlineData("'c'", 'c')] + [InlineData("true", true)] + [InlineData("false", false)] + public void ShouldTranslateSimpleTypes(string expectedGroovy, params object[] simpleTypes) + { + AssertTranslation(expectedGroovy, simpleTypes); + } + + [Fact] + public void ShouldTranslateDateTimeOffsetArgument() + { + AssertTranslation("new Date(122, 11, 30, 12, 0, 1)", DateTimeOffset.Parse("2022-12-30T12:00:01Z")); + } + + [Fact] + public void ShouldTranslateDateTimeArgument() + { + AssertTranslation("new Date(122, 11, 30, 12, 0, 1)", DateTime.Parse("2022-12-30T12:00:01")); + } + + [Fact] + public void ShouldTranslateGuid() + { + AssertTranslation("UUID.fromString('ffffffff-fd49-1e4b-0000-00000d4b8a1d')", + Guid.Parse("ffffffff-fd49-1e4b-0000-00000d4b8a1d")); + } + + [Fact] + public void ShouldTranslateCollection() + { + AssertTranslation("['test1', 'test2']", new List{"test1", "test2"}); + } + + [Fact] + public void ShouldTranslateDictionary() + { + var dictionary = new Dictionary + { + { "key1", "value1" }, + { 1, "value2" } + }; + AssertTranslation("['key1': 'value1', 1: 'value2']", dictionary); + } + + [Fact] + public void ShouldTranslateColumn() + { + AssertTranslation("Column.keys", Column.Keys); + } + + [Fact] + public void ShouldTranslateDirection() + { + AssertTranslation("Direction.BOTH", Direction.Both); + } + + [Fact] + public void ShouldTranslateOrder() + { + AssertTranslation("Order.desc", Order.Desc); + } + + [Fact] + public void ShouldTranslatePop() + { + AssertTranslation("Pop.last", Pop.Last); + } + + [Fact] + public void ShouldTranslateScope() + { + AssertTranslation("Scope.local", Scope.Local); + } + + [Fact] + public void ShouldTranslateP() + { + AssertTranslation("P.and(P.gt(20), P.lt(30))", P.Gt(20).And(P.Lt(30))); + } + + [Fact] + public void ShouldTranslatePBetween() + { + AssertTranslation("P.between([20, 30])", P.Between(20, 30)); + } + + [Fact] + public void ShouldTranslateValueMapOptions() + { + AssertTraversalTranslation("g.V().valueMap().with(WithOptions.tokens, WithOptions.all).V()", + _g.V().ValueMap().With(WithOptions.Tokens, WithOptions.All).V()); + } + + [Fact] + public void ShouldTranslateIndexerOptions() + { + AssertTraversalTranslation("g.V().index().with(WithOptions.indexer, WithOptions.list)", + _g.V().Index().With(WithOptions.Indexer, WithOptions.List)); + } + + [Fact] + public void ShouldTranslateGraphTraversalSourceOptions() + { + AssertTraversalTranslation("g.withStrategies(new OptionsStrategy('~tinkerpop.valueMap.tokens': true)).V()", + _g.With(WithOptions.Tokens).V()); + } + + [Fact] + public void TranslationTest() + { + var expectedGroovyScriptByTraversal = new Dictionary + { + { _g.V(), "g.V()" }, + { _g.V("1", "2", "3", "4"), "g.V('1', '2', '3', '4')" }, + { _g.V("3").ValueMap(true), "g.V('3').valueMap(true)" }, + { _g.V().Constant(5), "g.V().constant(5)" }, + { _g.V().Constant(1.5), "g.V().constant(1.5)" }, + { _g.V().Constant("Hello"), "g.V().constant('Hello')" }, + { _g.V().HasLabel("airport").Limit(5), "g.V().hasLabel('airport').limit(5)" }, + { + _g.V().HasLabel(P.Within(new List { "a", "b", "c" })), + "g.V().hasLabel(P.within(['a', 'b', 'c']))" + }, + { + _g.V().HasLabel("airport", "continent").Out().Limit(5), + "g.V().hasLabel('airport', 'continent').out().limit(5)" + }, + { + _g.V().HasLabel("airport").Out().Values("code").Limit(5), + "g.V().hasLabel('airport').out().values('code').limit(5)" + }, + { + _g.V("3").As("a").Out("route").Limit(10).Where(P.Eq("a")).By("region"), + "g.V('3').as('a').out('route').limit(10).where(P.eq('a')).by('region')" + }, + { + _g.V("3").Repeat(__.Out("route").SimplePath()).Times(2).Path().By("code"), + "g.V('3').repeat(__.out('route').simplePath()).times(2).path().by('code')" + }, + { + _g.V().HasLabel("airport").Out().Has("region", "US-TX").Values("code").Limit(5), + "g.V().hasLabel('airport').out().has('region', 'US-TX').values('code').limit(5)" + }, + { + _g.V().HasLabel("airport").Union(__.Values("city"), __.Values("region")) + .Limit(5), + "g.V().hasLabel('airport').union(__.values('city'), __.values('region')).limit(5)" + }, + { _g.V("3").As("a").Out("route", "routes"), "g.V('3').as('a').out('route', 'routes')" }, + { _g.V().Where(__.Values("runways").Is(5)), "g.V().where(__.values('runways').is(5))" }, + { + _g.V("3").Repeat(__.Out().SimplePath()).Until(__.Has("code", "AGR")).Path().By("code").Limit(5), + "g.V('3').repeat(__.out().simplePath()).until(__.has('code', 'AGR')).path().by('code').limit(5)" + }, + { _g.V().HasLabel("airport").Order().By(__.Id()), "g.V().hasLabel('airport').order().by(__.id())" }, + { _g.V().HasLabel("airport").Order().By(T.Id), "g.V().hasLabel('airport').order().by(T.id)" }, + { + _g.V().HasLabel("airport").Order().By(__.Id(), Order.Desc), + "g.V().hasLabel('airport').order().by(__.id(), Order.desc)" + }, + { + _g.V().HasLabel("airport").Order().By("code", Order.Desc), + "g.V().hasLabel('airport').order().by('code', Order.desc)" + }, + { + _g.V("1", "2", "3").Local(__.Out().Out().Dedup().Fold()), + "g.V('1', '2', '3').local(__.out().out().dedup().fold())" + }, + { _g.V("3").Out().Path().Count(Scope.Local), "g.V('3').out().path().count(Scope.local)" }, + { _g.E().Count(), "g.E().count()" }, + { _g.V('5').OutE("route").InV().Path().Limit(10), "g.V('5').outE('route').inV().path().limit(10)" }, + { + _g.V('5').PropertyMap().Select(Column.Keys), + "g.V('5').propertyMap().select(Column.keys)" + }, + { + _g.V('5').PropertyMap().Select(Column.Values), + "g.V('5').propertyMap().select(Column.values)" + }, + { _g.V("3").Values("runways").Math("_ + 1"), "g.V('3').values('runways').math('_ + 1')" }, + { + _g.V("3").Emit().Repeat(__.Out().SimplePath()).Times(3).Limit(5).Path(), + "g.V('3').emit().repeat(__.out().simplePath()).times(3).limit(5).path()" + }, + { + _g.V().Match(__.As("a").Has("code", "LHR").As("b")).Select("b").By("code"), + "g.V().match(__.as('a').has('code', 'LHR').as('b')).select('b').by('code')" + }, + { + _g.V().Has("test-using-keyword-as-property", "repeat"), + "g.V().has('test-using-keyword-as-property', 'repeat')" + }, + { _g.V('1').AddE("test").To(__.V('4')), "g.V('1').addE('test').to(__.V('4'))" }, + { _g.V().Values("runways").Max(), "g.V().values('runways').max()" }, + { _g.V().Values("runways").Min(), "g.V().values('runways').min()" }, + { _g.V().Values("runways").Sum(), "g.V().values('runways').sum()" }, + { _g.V().Values("runways").Mean(), "g.V().values('runways').mean()" }, + { + _g.WithSack(0).V('3', '5').Sack(Operator.Sum).By("runways").Sack(), + "g.withSack(0).V('3', '5').sack(Operator.sum).by('runways').sack()" + }, + { _g.Inject(3, 4, 5), "g.inject(3, 4, 5)" }, + { _g.Inject(new List { 3, 4, 5 }), "g.inject([3, 4, 5])" }, + { _g.Inject(3, 4, 5).Count(), "g.inject(3, 4, 5).count()" }, + { _g.V().Has("runways", P.Gt(5)).Count(), "g.V().has('runways', P.gt(5)).count()" }, + { _g.V().Has("runways", P.Lte(5.3)).Count(), "g.V().has('runways', P.lte(5.3)).count()" }, + { _g.V().Has("code", P.Within(new List { 123, 124 })), "g.V().has('code', P.within([123, 124]))" }, + { + _g.V('1', '2').Has("region", P.Within(new List { "US-TX", "US-GA" })), + "g.V('1', '2').has('region', P.within(['US-TX', 'US-GA']))" + }, + { + _g.V().And(__.Has("runways", P.Gt(5)), __.Has("region", "US-TX")), + "g.V().and(__.has('runways', P.gt(5)), __.has('region', 'US-TX'))" + }, + { + _g.V().Union(__.Has("runways", P.Gt(5)), __.Has("region", "US-TX")), + "g.V().union(__.has('runways', P.gt(5)), __.has('region', 'US-TX'))" + }, + { + _g.V("3").Choose(__.Values("runways").Is(3), __.Constant("three"), + __.Constant("not three")), + "g.V('3').choose(__.values('runways').is(3), __.constant('three'), __.constant('not three'))" + }, + { + _g.V("3").Choose(__.Values("runways")).Option(1, __.Constant("three")) + .Option(2, __.Constant("not three")), + "g.V('3').choose(__.values('runways')).option(1, __.constant('three')).option(2, __.constant('not three'))" + }, + { + _g.V("3").Choose(__.Values("runways")).Option(1.5, __.Constant("one and a half")) + .Option(2, __.Constant("not three")), + "g.V('3').choose(__.values('runways')).option(1.5, __.constant('one and a half')).option(2, __.constant('not three'))" + }, + { + _g.V("3").Repeat(__.Out().SimplePath()).Until(__.Loops().Is(1)).Count(), + "g.V('3').repeat(__.out().simplePath()).until(__.loops().is(1)).count()" + }, + { + _g.V().HasLabel("airport").Limit(20).Group().By("region").By("code") + .Order(Scope.Local).By(Column.Keys), + "g.V().hasLabel('airport').limit(20).group().by('region').by('code').order(Scope.local).by(Column.keys)" + }, + { + _g.V('1').As("a").V("2").As("a").Select(Pop.All, "a"), + "g.V('1').as('a').V('2').as('a').select(Pop.all, 'a')" + }, + { + _g.AddV("test").Property(Cardinality.Set, "p1", 10), + "g.addV('test').property(Cardinality.set, 'p1', 10)" + }, + { + _g.AddV("test").Property(Cardinality.List, "p1", 10), + "g.addV('test').property(Cardinality.list, 'p1', 10)" + }, + + { + _g.AddV("test").Property(Cardinality.Single, "p1", 10), + "g.addV('test').property(Cardinality.single, 'p1', 10)" + }, + { _g.V().Limit(5).Order().By(T.Label), "g.V().limit(5).order().by(T.label)" }, + + { _g.V().Range(1, 5), "g.V().range(1, 5)" }, + + { _g.AddV("test").Property("p1", 123), "g.addV('test').property('p1', 123)" }, + + { + _g.AddV("test").Property("date", new DateTime(2021, 3, 1, 9, 30, 0)), + "g.addV('test').property('date', new Date(121, 2, 1, 9, 30, 0))" + }, + { + _g.AddV("test").Property("date", new DateTime(2021, 3, 1, 0, 0, 0)), + "g.addV('test').property('date', new Date(121, 2, 1, 0, 0, 0))" + }, + { _g.AddE("route").From(__.V('1')).To(__.V('2')), "g.addE('route').from(__.V('1')).to(__.V('2'))" }, + { + _g.WithSideEffect("a", new List { 1, 2 }).V('3').Select("a"), + "g.withSideEffect('a', [1, 2]).V('3').select('a')" + }, + { _g.WithSideEffect("a", 1).V('3').Select("a"), "g.withSideEffect('a', 1).V('3').select('a')" }, + { + _g.WithSideEffect("a", "abc").V("3").Select("a"), + "g.withSideEffect('a', 'abc').V('3').select('a')" + }, + { + _g.V().Has("airport", "region", "US-NM").Limit(3).Values("elev").Fold().Index(), + "g.V().has('airport', 'region', 'US-NM').limit(3).values('elev').fold().index()" + }, + { + _g.V("3").Repeat(__.TimeLimit(1000).Out().SimplePath()).Until(__.Has("code", "AGR")).Path(), + "g.V('3').repeat(__.timeLimit(1000).out().simplePath()).until(__.has('code', 'AGR')).path()" + }, + { + _g.V().HasLabel("airport").Where(__.Values("elev").Is(P.Gt(14000))), + "g.V().hasLabel('airport').where(__.values('elev').is(P.gt(14000)))" + }, + { + _g.V().HasLabel("airport").Where(__.Out().Count().Is(P.Gt(250))).Values("code"), + "g.V().hasLabel('airport').where(__.out().count().is(P.gt(250))).values('code')" + }, + { + _g.V().HasLabel("airport").Filter(__.Out().Count().Is(P.Gt(250))).Values("code"), + "g.V().hasLabel('airport').filter(__.out().count().is(P.gt(250))).values('code')" + }, + { + _g.WithSack(0).V('3').Repeat(__.OutE("route").Sack(Operator.Sum).By("dist").InV()) + .Until(__.Has("code", "AGR").Or().Loops().Is(4)).Has("code", "AGR") + .Local(__.Union(__.Path().By("code").By("dist"), __.Sack()).Fold()) + .Limit(10), + "g.withSack(0).V('3').repeat(__.outE('route').sack(Operator.sum).by('dist').inV()).until(__.has('code', 'AGR').or().loops().is(4)).has('code', 'AGR').local(__.union(__.path().by('code').by('dist'), __.sack()).fold()).limit(10)" + }, + { + _g.AddV().As("a").AddV().As("b").AddE("knows").From("a").To("b"), + "g.addV().as('a').addV().as('b').addE('knows').from('a').to('b')" + }, + { + _g.AddV("Person").As("a").AddV("Person").As("b").AddE("knows").From("a").To("b"), + "g.addV('Person').as('a').addV('Person').as('b').addE('knows').from('a').to('b')" + }, + { + _g.V("3").Project("Out", "In").By(__.Out().Count()).By(__.In().Count()), + "g.V('3').project('Out', 'In').by(__.out().count()).by(__.in().count())" + }, + { + _g.V("44").Out().Aggregate("a").Out().Where(P.Within(new List { "a" })).Path(), + "g.V('44').out().aggregate('a').out().where(P.within(['a'])).path()" + }, + { _g.V().Has("date", new DateTime(2021, 3, 22)), "g.V().has('date', new Date(121, 2, 22, 0, 0, 0))" }, + { + _g.V().Has("date", P.Within(new DateTime(2021, 3, 22, 0, 0, 0), new DateTime(2021, 2, 1, 0, 0, 0))), + "g.V().has('date', P.within([new Date(121, 2, 22, 0, 0, 0), new Date(121, 1, 1, 0, 0, 0)]))" + }, + { + _g.V().Has("date", P.Between(new DateTime(2021, 2, 1, 0, 0, 0), new DateTime(2021, 3, 22, 0, 0, 0))), + "g.V().has('date', P.between([new Date(121, 1, 1, 0, 0, 0), new Date(121, 2, 22, 0, 0, 0)]))" + }, + { + _g.V().Has("date", P.Inside(new DateTime(2021, 2, 1, 0, 0, 0), new DateTime(2021, 3, 22, 0, 0, 0))), + "g.V().has('date', P.inside([new Date(121, 1, 1, 0, 0, 0), new Date(121, 2, 22, 0, 0, 0)]))" + }, + { + _g.V().Has("date", P.Gt(new DateTime(2021, 2, 1, 9, 30, 0))), + "g.V().has('date', P.gt(new Date(121, 1, 1, 9, 30, 0)))" + }, + { _g.V().Has("runways", P.Between(3, 5)), "g.V().has('runways', P.between([3, 5]))" }, + { _g.V().Has("runways", P.Inside(3, 5)), "g.V().has('runways', P.inside([3, 5]))" }, + { _g.V("44").OutE().ElementMap(), "g.V('44').outE().elementMap()" }, + { _g.V("44").ValueMap().By(__.Unfold()), "g.V('44').valueMap().by(__.unfold())" }, + { + _g.V().Property(new Dictionary { { "name", "test" }, { "age", 30 } }), + "g.V().property(['name': 'test', 'age': 30])" + }, + { _g.V().E("1"), "g.V().E('1')" }, + + // TODO: Support WithOptions + { + _g.V("44").ValueMap().With(WithOptions.Tokens, WithOptions.Labels), + "g.V('44').valueMap().with(WithOptions.tokens, WithOptions.labels)" + }, + { + _g.V("44").ValueMap().With(WithOptions.Tokens), + "g.V('44').valueMap().with(WithOptions.tokens)" + }, + { + _g.WithStrategies(new ReadOnlyStrategy()).AddV("test"), + "g.withStrategies(new ReadOnlyStrategy()).addV('test')" + }, + { + _g.WithStrategies( + new SubgraphStrategy(vertices: __.Has("region", "US-TX"), edges: __.HasLabel("route"))).V().Count(), + "g.withStrategies(new SubgraphStrategy(vertices: __.has('region', 'US-TX'), edges: __.hasLabel('route'))).V().count()" + }, + { + _g.WithStrategies(new SubgraphStrategy(vertexProperties: __.HasNot("runways"))).V().Count(), + "g.withStrategies(new SubgraphStrategy(vertexProperties: __.hasNot('runways'))).V().count()" + }, + { + _g.WithStrategies(new SubgraphStrategy(vertices: __.Has("region", "US-TX"), + vertexProperties: __.HasNot("runways"))).V().Count(), + "g.withStrategies(new SubgraphStrategy(vertices: __.has('region', 'US-TX'), vertexProperties: __.hasNot('runways'))).V().count()" + }, + { + _g.WithStrategies(new ReadOnlyStrategy(), + new SubgraphStrategy(vertices: __.Has("region", "US-TX"), edges: __.HasLabel("route"))).V().Count(), + "g.withStrategies(new ReadOnlyStrategy(), new SubgraphStrategy(vertices: __.has('region', 'US-TX'), edges: __.hasLabel('route'))).V().count()" + }, + { + _g.WithStrategies(new ReadOnlyStrategy(), + new SubgraphStrategy(vertices: __.Has("region", "US-TX"), checkAdjacentVertices: true)).V() + .Count(), + "g.withStrategies(new ReadOnlyStrategy(), new SubgraphStrategy(vertices: __.has('region', 'US-TX'), checkAdjacentVertices: true)).V().count()" + }, + { + _g.With("evaluationTimeout", 500).V().Count(), + "g.withStrategies(new OptionsStrategy('evaluationTimeout': 500)).V().count()" + }, + { + _g.WithStrategies(new OptionsStrategy(new Dictionary { { "evaluationTimeout", 500 } })) + .V().Count(), + "g.withStrategies(new OptionsStrategy('evaluationTimeout': 500)).V().count()" + }, + { + _g.WithStrategies(new PartitionStrategy(partitionKey: "partition", writePartition: "a", + readPartitions: new List { "a" })).AddV("test"), + "g.withStrategies(new PartitionStrategy(partitionKey: 'partition', writePartition: 'a', readPartitions: ['a'])).addV('test')" + }, + { + _g.WithStrategies(new VertexProgramStrategy()).V().ShortestPath() + .With(ShortestPath.target, __.Has("name", "peter")), + "g.withStrategies(new VertexProgramStrategy()).V().shortestPath().with('~tinkerpop.shortestPath.target', __.has('name', 'peter'))" + } + }; + + foreach (var ( traversal, expectedGroovyScript) in expectedGroovyScriptByTraversal) + { + AssertTraversalTranslation(expectedGroovyScript, traversal); + } + } + + private void AssertTranslation(string expectedTranslation, params object?[]? objs) + { + AssertTraversalTranslation($"g.inject({expectedTranslation})", _g.Inject(objs)); + } + + private static void AssertTraversalTranslation(string expectedTranslation, ITraversal traversal) + { + var translator = GroovyTranslator.Of("g"); + + var translated = translator.Translate(traversal); + + Assert.Equal(expectedTranslation, translated); + } } \ No newline at end of file diff --git a/gremlin-go/driver/anonymousTraversal.go b/gremlin-go/driver/anonymousTraversal.go index 18b92f300f6..4053095414f 100644 --- a/gremlin-go/driver/anonymousTraversal.go +++ b/gremlin-go/driver/anonymousTraversal.go @@ -285,8 +285,6 @@ type AnonymousTraversal interface { Skip(args ...interface{}) *GraphTraversal // Split adds the split step to the GraphTraversal. Split(args ...interface{}) *GraphTraversal - // Store adds the store step to the GraphTraversal. - Store(args ...interface{}) *GraphTraversal // Subgraph adds the subgraph step to the GraphTraversal. Subgraph(args ...interface{}) *GraphTraversal // Substring adds the substring step to the GraphTraversal. @@ -918,11 +916,6 @@ func (anonymousTraversal *anonymousTraversal) Split(args ...interface{}) *GraphT return anonymousTraversal.graphTraversal().Split(args...) } -// Store adds the store step to the GraphTraversal. -func (anonymousTraversal *anonymousTraversal) Store(args ...interface{}) *GraphTraversal { - return anonymousTraversal.graphTraversal().Store(args...) -} - // Subgraph adds the subgraph step to the GraphTraversal. func (anonymousTraversal *anonymousTraversal) Subgraph(args ...interface{}) *GraphTraversal { return anonymousTraversal.graphTraversal().Subgraph(args...) diff --git a/gremlin-go/driver/cucumber/gremlin.go b/gremlin-go/driver/cucumber/gremlin.go index 6e29a64dfdc..131b6b48b22 100644 --- a/gremlin-go/driver/cucumber/gremlin.go +++ b/gremlin-go/driver/cucumber/gremlin.go @@ -264,7 +264,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_V_valuesXintX_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_isXbetweenX20_30XX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("data").Property("int", 25)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("int").AsNumber(gremlingo.GType.Short).Is(gremlingo.P.TypeOf(gremlingo.GType.Short)).Is(gremlingo.P.Between(20, 30))}}, "g_V_valuesXintX_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_minX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("data").Property("int", 10).AddV("data").Property("int", 20).AddV("data").Property("int", 30)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("int").AsNumber(gremlingo.GType.Short).Is(gremlingo.P.TypeOf(gremlingo.GType.Short)).Min()}}, "g_V_valuesXintX_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_maxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("data").Property("int", 15).AddV("data").Property("int", 25).AddV("data").Property("int", 35)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("int").AsNumber(gremlingo.GType.Short).Is(gremlingo.P.TypeOf(gremlingo.GType.Short)).Max()}}, - "g_injectX42X_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_storeXaX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(42).AsNumber(gremlingo.GType.Short).Is(gremlingo.P.TypeOf(gremlingo.GType.Short)).Store("a").Cap("a")}}, + "g_injectX42X_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_storeXaX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(42).AsNumber(gremlingo.GType.Short).Is(gremlingo.P.TypeOf(gremlingo.GType.Short))}}, "g_V_valuesXageX_isXtypeOfXGType_SHORTXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("age").Is(gremlingo.P.TypeOf(gremlingo.GType.Short))}}, "g_V_valuesXuuidX_isXtypeOfXGType_UUIDXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("data").Property("uuid", uuid.MustParse("f47af10b-58cc-4372-a567-0f02b2f3d479"))}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("uuid").Is(gremlingo.P.TypeOf(gremlingo.GType.UUID))}}, "g_V_hasXuuid_typeOfXGType_UUIDXX_valuesXnameX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("data").Property("name", "test").Property("uuid", uuid.MustParse("f47af10b-58cc-4372-a567-0f02b2f3d479"))}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("uuid", gremlingo.P.TypeOf(gremlingo.GType.UUID)).Values("name")}}, @@ -277,7 +277,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_injectXUUIDX47af10b_58cc_4372_a567_0f02b2f3d479XX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(uuid.MustParse("f47af10b-58cc-4372-a567-0f02b2f3d479"))}}, "g_injectXUUIDXXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(uuid.New())}}, "g_V_aggregateXxX_byXnameX_byXageX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Aggregate("x").By("name").By("age").Cap("x")}}, - "g_V_aggregateXScope_local_xX_byXnameX_byXageX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Aggregate(gremlingo.Scope.Local, "x").By("name").By("age").Cap("x")}}, + "g_V_localXaggregateXxX_byXnameXX_byXageX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Local(gremlingo.T__.Aggregate("x").By("name").By("age")).Cap("x")}}, "g_V_valuesXageX_allXgtX32XX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("age").All(gremlingo.P.Gt(32))}}, "g_V_valuesXageX_whereXisXP_gtX33XXX_fold_allXgtX33XX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("age").Where(gremlingo.T__.Is(gremlingo.P.Gt(33))).Fold().All(gremlingo.P.Gt(33))}}, "g_V_valuesXageX_order_byXdescX_fold_allXgtX10XX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("age").Order().By(gremlingo.Order.Desc).Fold().All(gremlingo.P.Gt(10))}}, @@ -736,8 +736,8 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_withStrategiesXReadOnlyStrategyX_V_addVXpersonX_fromXVX1XX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.ReadOnlyStrategy()).V().AddE("link").From(gremlingo.T__.V(p["vid1"]))}}, "g_withStrategiesXReadOnlyStrategyX_V_propertyXname_joshX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.ReadOnlyStrategy()).V().Property("name", "josh")}}, "g_withStrategiesXReadOnlyStrategyX_E_propertyXweight_0X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.ReadOnlyStrategy()).E().Property("weight", 0)}}, - "g_V_classic_recommendation": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("name", "DARK STAR").As("a").Out("followedBy").Aggregate("stash").In("followedBy").Where(gremlingo.P.Neq("a").And(gremlingo.P.Not(gremlingo.P.Within("stash")))).GroupCount().Unfold().Project("x", "y", "z").By(gremlingo.T__.Select(gremlingo.Column.Keys).Values("name")).By(gremlingo.T__.Select(gremlingo.Column.Keys).Values("performances")).By(gremlingo.T__.Select(gremlingo.Column.Values)).Order().By(gremlingo.T__.Select("z"), gremlingo.Order.Desc).By(gremlingo.T__.Select("y"), gremlingo.Order.Asc).Limit(5).Aggregate(gremlingo.Scope.Local, "m").Select("x")}}, - "g_V_classic_recommendation_ranked": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("name", "DARK STAR").As("a").Out("followedBy").Aggregate("stash").In("followedBy").Where(gremlingo.P.Neq("a").And(gremlingo.P.Not(gremlingo.P.Within("stash")))).GroupCount().Unfold().Project("x", "y", "z").By(gremlingo.T__.Select(gremlingo.Column.Keys).Values("name")).By(gremlingo.T__.Select(gremlingo.Column.Keys).Values("performances")).By(gremlingo.T__.Select(gremlingo.Column.Values)).Order().By(gremlingo.T__.Select("z"), gremlingo.Order.Desc).By(gremlingo.T__.Select("y"), gremlingo.Order.Asc).Limit(5).Aggregate(gremlingo.Scope.Local, "m")}}, + "g_V_classic_recommendation": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("name", "DARK STAR").As("a").Out("followedBy").Aggregate("stash").In("followedBy").Where(gremlingo.P.Neq("a").And(gremlingo.P.Not(gremlingo.P.Within("stash")))).GroupCount().Unfold().Project("x", "y", "z").By(gremlingo.T__.Select(gremlingo.Column.Keys).Values("name")).By(gremlingo.T__.Select(gremlingo.Column.Keys).Values("performances")).By(gremlingo.T__.Select(gremlingo.Column.Values)).Order().By(gremlingo.T__.Select("z"), gremlingo.Order.Desc).By(gremlingo.T__.Select("y"), gremlingo.Order.Asc).Limit(5).Local(gremlingo.T__.Aggregate("m")).Select("x")}}, + "g_V_classic_recommendation_ranked": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("name", "DARK STAR").As("a").Out("followedBy").Aggregate("stash").In("followedBy").Where(gremlingo.P.Neq("a").And(gremlingo.P.Not(gremlingo.P.Within("stash")))).GroupCount().Unfold().Project("x", "y", "z").By(gremlingo.T__.Select(gremlingo.Column.Keys).Values("name")).By(gremlingo.T__.Select(gremlingo.Column.Keys).Values("performances")).By(gremlingo.T__.Select(gremlingo.Column.Values)).Order().By(gremlingo.T__.Select("z"), gremlingo.Order.Desc).By(gremlingo.T__.Select("y"), gremlingo.Order.Asc).Limit(5).Local(gremlingo.T__.Aggregate("m"))}}, "g_withStrategiesXReferenceElementStrategyX_V": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.ReferenceElementStrategy()).V()}}, "g_withoutStrategiesXReferenceElementStrategyX_V": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithoutStrategies(gremlingo.ReferenceElementStrategy()).V()}}, "g_withStrategiesXRepeatUnrollStrategyX_V_repeatXoutX_timesX2X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.RepeatUnrollStrategy()).V().Repeat(gremlingo.T__.Out()).Times(2)}}, @@ -1582,7 +1582,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_withStrategiesXProductiveByStrategyX_V_asXaX_selectXaX_byXageX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.ProductiveByStrategy()).V().As("a").Select("a").By("age")}}, "g_withSideEffectXk_nullX_injectXxX_selectXkX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("k", nil).Inject("x").Select("k")}}, "g_V_out_in_selectXall_a_a_aX_byXunfold_name_foldX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("A").Property("name", "a1").As("a1").AddV("B").Property("name", "b1").As("b1").AddE("ab").From("a1").To("b1")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").Out().As("a").In().As("a").Select(gremlingo.Pop.All, "a", "a", "a").By(gremlingo.T__.Unfold().Values("name").Fold())}}, - "g_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("label").Aggregate(gremlingo.Scope.Local, "x").Barrier().Select("x").Select("label")}}, + "g_V_asXlabelX_localXaggregateXxX_selectXxX_selectXlabelX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("label").Local(gremlingo.T__.Aggregate("x")).Barrier().Select("x").Select("label")}}, "g_V_name_asXaX_selectXfirst_aX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("name").As("a").Select(gremlingo.Pop.First, "a")}}, "g_V_name_asXaX_selectXlast_aX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("name").As("a").Select(gremlingo.Pop.Last, "a")}}, "g_V_name_asXaX_selectXmixed_aX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("name").As("a").Select(gremlingo.Pop.Mixed, "a")}}, @@ -1842,47 +1842,59 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_V_out_out_values_asXheadX_path_order_byXascX_selectXheadX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Out().Out().Values().As("head").Path().Order().By(gremlingo.Order.Asc).Select("head")}}, "g_V_out_out_values_asXheadX_path_order_byXdescX_selectXheadX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Out().Out().Values().As("head").Path().Order().By(gremlingo.Order.Desc).Select("head")}}, "g_V_valueXnameX_aggregateXxX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("name").Aggregate("x").Cap("x")}}, - "g_V_valueXnameX_aggregateXglobal_xX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("name").Aggregate(gremlingo.Scope.Global, "x").Cap("x")}}, "g_V_aggregateXxX_byXnameX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Aggregate("x").By("name").Cap("x")}}, "g_V_out_aggregateXaX_path": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Out().Aggregate("a").Path()}}, "g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Aggregate("x").By("age").Cap("x").As("y").Select("y")}}, "g_V_aggregateXxX_byXageX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Aggregate("x").By("age").Cap("x")}}, - "g_V_aggregateXlocal_xX_byXageX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Aggregate(gremlingo.Scope.Local, "x").By("age").Cap("x")}}, - "g_withStrategiesXProductiveByStrategyX_V_aggregateXlocal_xX_byXageX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.ProductiveByStrategy()).V().Aggregate(gremlingo.Scope.Local, "x").By("age").Cap("x")}}, - "g_V_aggregateXlocal_a_nameX_out_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Aggregate(gremlingo.Scope.Local, "a").By("name").Out().Cap("a")}}, - "g_VX1X_aggregateXlocal_aX_byXnameX_out_aggregateXlocal_aX_byXnameX_name_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Aggregate(gremlingo.Scope.Local, "a").By("name").Out().Aggregate(gremlingo.Scope.Local, "a").By("name").Values("name").Cap("a")}}, - "g_withSideEffectXa_setX_V_both_name_aggregateXlocal_aX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Both().Values("name").Aggregate(gremlingo.Scope.Local, "a").Cap("a")}}, - "g_withSideEffectXa_set_inlineX_V_both_name_aggregateXlocal_aX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", gremlingo.NewSimpleSet("alice")).V().Both().Values("name").Aggregate(gremlingo.Scope.Local, "a").Cap("a")}}, - "g_V_aggregateXlocal_aX_byXoutEXcreatedX_countX_out_out_aggregateXlocal_aX_byXinEXcreatedX_weight_sumX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Aggregate(gremlingo.Scope.Local, "a").By(gremlingo.T__.OutE("created").Count()).Out().Out().Aggregate(gremlingo.Scope.Local, "a").By(gremlingo.T__.InE("created").Values("weight").Sum()).Cap("a")}}, + "g_V_localXaggregateXxX_byXageXX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Local(gremlingo.T__.Aggregate("x").By("age")).Cap("x")}}, + "g_withStrategiesXProductiveByStrategyX_V_localXaggregateXxX_byXageXX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.ProductiveByStrategy()).V().Local(gremlingo.T__.Aggregate("x").By("age")).Cap("x")}}, + "g_V_localX_aggregateXa_byXnameXX_out_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Local(gremlingo.T__.Aggregate("a").By("name")).Out().Cap("a")}}, + "g_VX1X_localXaggregateXaX_byXnameXX_out_localXaggregateXaX_byXnameXX_name_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Local(gremlingo.T__.Aggregate("a").By("name")).Out().Local(gremlingo.T__.Aggregate("a").By("name")).Values("name").Cap("a")}}, + "g_withSideEffectXa_setX_V_both_name_localXaggregateX_aXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Both().Values("name").Local(gremlingo.T__.Aggregate("a")).Cap("a")}}, + "g_withSideEffectXa_set_inlineX_V_both_name_localXaggregateXaXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", gremlingo.NewSimpleSet("alice")).V().Both().Values("name").Local(gremlingo.T__.Aggregate("a")).Cap("a")}}, + "g_V_localXaggregateXaX_byXoutEXcreatedX_countXX_out_out_localXaggregateXaX_byXinEXcreatedX_weight_sumXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Local(gremlingo.T__.Aggregate("a").By(gremlingo.T__.OutE("created").Count())).Out().Out().Local(gremlingo.T__.Aggregate("a").By(gremlingo.T__.InE("created").Values("weight").Sum())).Cap("a")}}, "g_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Aggregate("x").By(gremlingo.T__.Values("age").Is(gremlingo.P.Gt(29))).Cap("x")}}, "g_withStrategiesXProductiveByStrategyX_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.ProductiveByStrategy()).V().Aggregate("x").By(gremlingo.T__.Values("age").Is(gremlingo.P.Gt(29))).Cap("x")}}, "g_V_aggregateXxX_byXout_order_byXnameXX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Aggregate("x").By(gremlingo.T__.Out().Order().By("name")).Cap("x")}}, "g_withStrategiesXProductiveByStrategyX_V_aggregateXxX_byXout_order_byXnameXX_capXxX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithStrategies(gremlingo.ProductiveByStrategy()).V().Aggregate("x").By(gremlingo.T__.Out().Order().By("name")).Cap("x")}}, "g_V_aggregateXaX_hasXperson_age_gteX30XXX_capXaX_unfold_valuesXnameX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Aggregate("a").Has("person", "age", gremlingo.P.Gte(30)).Cap("a").Unfold().Values("name")}}, "g_withSideEffectXa_1_sumX_V_aggregateXaX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 1, gremlingo.Operator.Sum).V().Aggregate("a").By("age").Cap("a")}}, - "g_withSideEffectXa_1_sumX_V_aggregateXlocal_aX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 1, gremlingo.Operator.Sum).V().Aggregate(gremlingo.Scope.Local, "a").By("age").Cap("a")}}, + "g_withSideEffectXa_1_sumX_V_localXaggregateX_aX_byXageXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 1, gremlingo.Operator.Sum).V().Local(gremlingo.T__.Aggregate("a").By("age")).Cap("a")}}, "g_withSideEffectXa_123_minusX_V_aggregateXaX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 123, gremlingo.Operator.Minus).V().Aggregate("a").By("age").Cap("a")}}, - "g_withSideEffectXa_123_minusX_V_aggregateXlocal_aX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 123, gremlingo.Operator.Minus).V().Aggregate(gremlingo.Scope.Local, "a").By("age").Cap("a")}}, + "g_withSideEffectXa_123_minusX_V_localXaggregateX_aX_byXageXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 123, gremlingo.Operator.Minus).V().Local(gremlingo.T__.Aggregate("a").By("age")).Cap("a")}}, "g_withSideEffectXa_2_multX_V_aggregateXaX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 2, gremlingo.Operator.Mult).V().Aggregate("a").By("age").Cap("a")}}, - "g_withSideEffectXa_2_multX_V_aggregateXlocal_aX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 2, gremlingo.Operator.Mult).V().Aggregate(gremlingo.Scope.Local, "a").By("age").Cap("a")}}, + "g_withSideEffectXa_2_multX_V_localXaggregateX_aX_byXageXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 2, gremlingo.Operator.Mult).V().Local(gremlingo.T__.Aggregate("a").By("age")).Cap("a")}}, "g_withSideEffectXa_876960_divX_V_aggregateXaX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 876960, gremlingo.Operator.Div).V().Aggregate("a").By("age").Cap("a")}}, - "g_withSideEffectXa_876960_divX_V_aggregateXlocal_aX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 876960, gremlingo.Operator.Div).V().Aggregate(gremlingo.Scope.Local, "a").By("age").Cap("a")}}, + "g_withSideEffectXa_876960_divX_V_localXaggregateX_aX_byXageXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 876960, gremlingo.Operator.Div).V().Local(gremlingo.T__.Aggregate("a").By("age")).Cap("a")}}, "g_withSideEffectXa_1_minX_V_aggregateXaX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 1, gremlingo.Operator.Min).V().Aggregate("a").By("age").Cap("a")}}, - "g_withSideEffectXa_1_minX_V_aggregateXlocal_aX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 1, gremlingo.Operator.Min).V().Aggregate(gremlingo.Scope.Local, "a").By("age").Cap("a")}}, + "g_withSideEffectXa_1_minX_V_localXaggregateX_aX_byXageXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 1, gremlingo.Operator.Min).V().Local(gremlingo.T__.Aggregate("a").By("age")).Cap("a")}}, "g_withSideEffectXa_100_minX_V_aggregateXaX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 100, gremlingo.Operator.Min).V().Aggregate("a").By("age").Cap("a")}}, - "g_withSideEffectXa_100_minX_V_aggregateXlocal_aX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 100, gremlingo.Operator.Min).V().Aggregate(gremlingo.Scope.Local, "a").By("age").Cap("a")}}, + "g_withSideEffectXa_100_minX_V_localXaggregateX_aX_byXageXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 100, gremlingo.Operator.Min).V().Local(gremlingo.T__.Aggregate("a").By("age")).Cap("a")}}, "g_withSideEffectXa_1_maxX_V_aggregateXaX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 1, gremlingo.Operator.Max).V().Aggregate("a").By("age").Cap("a")}}, - "g_withSideEffectXa_1_maxX_V_aggregateXlocal_aX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 1, gremlingo.Operator.Max).V().Aggregate(gremlingo.Scope.Local, "a").By("age").Cap("a")}}, + "g_withSideEffectXa_1_maxX_V_localXaggregateX_aX_byXageXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 1, gremlingo.Operator.Max).V().Local(gremlingo.T__.Aggregate("a").By("age")).Cap("a")}}, "g_withSideEffectXa_100_maxX_V_aggregateXaX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 100, gremlingo.Operator.Max).V().Aggregate("a").By("age").Cap("a")}}, - "g_withSideEffectXa_100_maxX_V_aggregateXlocal_aX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 100, gremlingo.Operator.Max).V().Aggregate(gremlingo.Scope.Local, "a").By("age").Cap("a")}}, + "g_withSideEffectXa_100_maxX_V_localXaggregateX_aX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", 100, gremlingo.Operator.Max).V().Local(gremlingo.T__.Aggregate("a").By("age")).Cap("a")}}, "g_withSideEffectXa_true_andX_V_constantXfalseX_aggregateXaX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", true, gremlingo.Operator.And).V().Constant(false).Aggregate("a").Cap("a")}}, - "g_withSideEffectXa_true_andX_V_constantXfalseX_aggregateXlocal_aX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", true, gremlingo.Operator.And).V().Constant(false).Aggregate(gremlingo.Scope.Local, "a").Cap("a")}}, + "g_withSideEffectXa_true_andX_V_constantXfalseX_localXaggregateX_aXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", true, gremlingo.Operator.And).V().Constant(false).Local(gremlingo.T__.Aggregate("a")).Cap("a")}}, "g_withSideEffectXa_true_orX_V_constantXfalseX_aggregateXaX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", true, gremlingo.Operator.Or).V().Constant(false).Aggregate("a").Cap("a")}}, - "g_withSideEffectXa_true_orX_V_constantXfalseX_aggregateXlocal_aX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", true, gremlingo.Operator.Or).V().Constant(false).Aggregate(gremlingo.Scope.Local, "a").Cap("a")}}, + "g_withSideEffectXa_true_orX_V_constantXfalseX_localXaggregateX_aXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", true, gremlingo.Operator.Or).V().Constant(false).Local(gremlingo.T__.Aggregate("a")).Cap("a")}}, "g_withSideEffectXa_1_2_3_addAllX_V_aggregateXaX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", []interface{}{int32(1), int32(2), int32(3)}, gremlingo.Operator.AddAll).V().Aggregate("a").By("age").Cap("a")}}, - "g_withSideEffectXa_1_2_3_addAllX_V_aggregateXlocal_aX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", []interface{}{int32(1), int32(2), int32(3)}, gremlingo.Operator.AddAll).V().Aggregate(gremlingo.Scope.Local, "a").By("age").Cap("a")}}, + "g_withSideEffectXa_1_2_3_addAllX_V_localXaggregateX_aX_byXageXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", []interface{}{int32(1), int32(2), int32(3)}, gremlingo.Operator.AddAll).V().Local(gremlingo.T__.Aggregate("a").By("age")).Cap("a")}}, "g_withSideEffectXa_1_2_3_assignX_V_aggregateXaX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", []interface{}{int32(1), int32(2), int32(3)}, gremlingo.Operator.Assign).V().Aggregate("a").By("age").Cap("a")}}, - "g_withSideEffectXa_1_2_3_assignX_V_order_byXageX_aggregateXlocal_aX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", []interface{}{int32(1), int32(2), int32(3)}, gremlingo.Operator.Assign).V().Order().By("age").Aggregate(gremlingo.Scope.Local, "a").By("age").Cap("a")}}, + "g_withSideEffectXa_1_2_3_assignX_V_order_byXageX_localXaggregateX_aX_byXageXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", []interface{}{int32(1), int32(2), int32(3)}, gremlingo.Operator.Assign).V().Order().By("age").Local(gremlingo.T__.Aggregate("a").By("age")).Cap("a")}}, + "g_V_localXaggregateXa_nameXX_out_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Local(gremlingo.T__.Aggregate("a").By("name")).Out().Cap("a")}}, + "g_withSideEffectXa_setX_V_both_name_localXaggregateXaXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Both().Values("name").Local(gremlingo.T__.Aggregate("a")).Cap("a")}}, + "g_V_localXaggregateXaXX_outE_inV_localXaggregateXaXX_capXaX_unfold_dedup": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Local(gremlingo.T__.Aggregate("a")).OutE().InV().Local(gremlingo.T__.Aggregate("a")).Cap("a").Unfold().Dedup()}}, + "g_V_hasLabelXpersonX_localXaggregateXaXX_outXcreatedX_localXaggregateXaXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Local(gremlingo.T__.Aggregate("a")).Out("created").Local(gremlingo.T__.Aggregate("a")).Cap("a")}}, + "g_V_localXaggregateXaXX_repeatXout_localXaggregateXaXXX_timesX2X_capXaX_unfold_groupCount": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Local(gremlingo.T__.Aggregate("a")).Repeat(gremlingo.T__.Out().Local(gremlingo.T__.Aggregate("a"))).Times(2).Cap("a").Unfold().Values("name").GroupCount()}}, + "g_V_hasXname_markoX_localXaggregateXaXX_outXknowsX_localXaggregateXaXX_outXcreatedX_localXaggregateXaXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("name", "marko").Local(gremlingo.T__.Aggregate("a")).Out("knows").Local(gremlingo.T__.Aggregate("a")).Out("created").Local(gremlingo.T__.Aggregate("a")).Cap("a")}}, + "g_V_hasLabelXsoftwareX_localXaggregateXaXX_inXcreatedX_localXaggregateXaXX_outXknowsX_localXaggregateXaXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("software").Local(gremlingo.T__.Aggregate("a")).In("created").Local(gremlingo.T__.Aggregate("a")).Out("knows").Local(gremlingo.T__.Aggregate("a")).Cap("a")}}, + "g_V_localXaggregateXaXX_outE_hasXweight_lgtX0_5XX_inV_localXaggregateXaXX_capXaX_unfold_path": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Local(gremlingo.T__.Aggregate("a")).OutE().Has("weight", gremlingo.P.Gt(0.5)).InV().Local(gremlingo.T__.Aggregate("a")).Cap("a").Unfold().Path()}}, + "g_V_localXaggregateXaXX_bothE_sampleX1X_otherV_localXaggregateXaXX_capXaX_unfold_groupCount_byXlabelX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Local(gremlingo.T__.Aggregate("a")).BothE().Sample(1).OtherV().Local(gremlingo.T__.Aggregate("a")).Cap("a").Unfold().GroupCount().By(gremlingo.T.Label)}}, + "g_V_hasLabelXpersonX_localXaggregateXaXX_outE_inV_simplePath_localXaggregateXaXX_capXaX_unfold_hasLabelXsoftwareX_count": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Local(gremlingo.T__.Aggregate("a")).OutE().InV().SimplePath().Local(gremlingo.T__.Aggregate("a")).Cap("a").Unfold().HasLabel("software").Count()}}, + "g_V_localXaggregateXaXX_unionXout_inX_localXaggregateXaXX_capXaX_unfold_dedup_valuesXnameX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Local(gremlingo.T__.Aggregate("a")).Union(gremlingo.T__.Out(), gremlingo.T__.In()).Local(gremlingo.T__.Aggregate("a")).Cap("a").Unfold().Dedup().Values("name")}}, + "g_V_hasXname_joshX_localXaggregateXaXX_outE_hasXweight_ltX1_0XX_inV_localXaggregateXaXX_outE_inV_localXaggregateXaXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("name", "josh").Local(gremlingo.T__.Aggregate("a")).OutE().Has("weight", gremlingo.P.Lt(1.0)).InV().Local(gremlingo.T__.Aggregate("a")).OutE().InV().Local(gremlingo.T__.Aggregate("a")).Cap("a")}}, + "g_V_hasLabelXpersonX_localXaggregateXaXX_outE_order_byXweightX_limitX1X_inV_localXaggregateXaXX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().HasLabel("person").Local(gremlingo.T__.Aggregate("a")).OutE().Order().By("weight").Limit(1).InV().Local(gremlingo.T__.Aggregate("a")).Cap("a")}}, "g_V_fail": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Fail()}}, "g_V_failXmsgX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Fail("msg")}}, "g_V_unionXout_failX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Union(gremlingo.T__.Out(), gremlingo.T__.Fail())}}, @@ -1983,7 +1995,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_V_sideEffectXidentity_valuesXnameXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().SideEffect(gremlingo.T__.Identity().Values("name"))}}, "g_V_sideEffectXpropertyXage_22X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("age", 21)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().SideEffect(gremlingo.T__.Property("age", 22))}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("age", 21)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("age", 22)}}, "g_V_group_byXvaluesXnameX_sideEffectXconstantXzyxXX_substringX1XX_byXconstantX1X_sideEffectXconstantXxyzXXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Group().By(gremlingo.T__.Values("name").SideEffect(gremlingo.T__.Constant("zyx")).Substring(0, 1)).By(gremlingo.T__.Constant(1).SideEffect(gremlingo.T__.Constant("xyz")))}}, - "g_withSideEffectXx_setX_V_both_both_sideEffectXstoreXxX_byXnameXX_capXxX_unfold": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("x", gremlingo.NewSimpleSet()).V().Both().Both().SideEffect(gremlingo.T__.Store("x").By("name")).Cap("x").Unfold()}}, + "g_withSideEffectXx_setX_V_both_both_sideEffectXlocalXaggregateXxX_byXnameXX_capXxX_unfold": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("x", gremlingo.NewSimpleSet()).V().Both().Both().SideEffect(gremlingo.T__.Local(gremlingo.T__.Aggregate("x").By("name"))).Cap("x").Unfold()}}, "g_V_hasXageX_groupCountXaX_byXnameX_out_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("age").GroupCount("a").By("name").Out().Cap("a")}}, "g_V_groupXaX_byXageX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Group("a").By("age").Cap("a")}}, "g_V_groupXaX_byXnameX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Group("a").By("name").Cap("a")}}, @@ -2005,11 +2017,6 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_V_groupXaX_by_byXout_label_limitX0X_foldX_capXaX_selectXvaluesX_unfold": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Group("a").By().By(gremlingo.T__.Out().Label().Limit(0).Fold()).Cap("a").Select(gremlingo.Column.Values).Unfold()}}, "g_V_groupXaX_by_byXout_label_limitX10X_foldX_capXaX_selectXvaluesX_unfold_orderXlocalX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Group("a").By().By(gremlingo.T__.Out().Label().Limit(10).Fold()).Cap("a").Select(gremlingo.Column.Values).Unfold().Order(gremlingo.Scope.Local)}}, "g_V_groupXaX_by_byXout_label_tailX10X_foldX_capXaX_selectXvaluesX_unfold_orderXlocalX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Group("a").By().By(gremlingo.T__.Out().Label().Tail(10).Fold()).Cap("a").Select(gremlingo.Column.Values).Unfold().Order(gremlingo.Scope.Local)}}, - "g_V_storeXa_nameX_out_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Store("a").By("name").Out().Cap("a")}}, - "g_VX1X_storeXaX_byXnameX_out_storeXaX_byXnameX_name_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Store("a").By("name").Out().Store("a").By("name").Values("name").Cap("a")}}, - "g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Both().Values("name").Store("a").Cap("a")}}, - "g_withSideEffectXa_set_inlineX_V_both_name_storeXaX_capXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", gremlingo.NewSimpleSet("alice")).V().Both().Values("name").Store("a").Cap("a")}}, - "g_V_storeXaX_byXoutEXcreatedX_countX_out_out_storeXaX_byXinEXcreatedX_weight_sumX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Store("a").By(gremlingo.T__.OutE("created").Count()).Out().Out().Store("a").By(gremlingo.T__.InE("created").Values("weight").Sum()).Cap("a")}}, "g_VX1X_outEXknowsX_subgraphXsgX_name_capXsgX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).OutE("knows").Subgraph("sg").Values("name").Cap("sg")}}, "g_V_repeatXbothEXcreatedX_subgraphXsgX_outVX_timesX5X_name_dedup_capXsgX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Repeat(gremlingo.T__.BothE("created").Subgraph("sg").OutV()).Times(5).Values("name").Dedup().Cap("sg")}}, "g_V_outEXnoexistX_subgraphXsgXcapXsgX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().OutE("noexist").Subgraph("sg").Cap("sg")}}, diff --git a/gremlin-go/driver/graphTraversal.go b/gremlin-go/driver/graphTraversal.go index f16a9c273ac..4cf7e757d77 100644 --- a/gremlin-go/driver/graphTraversal.go +++ b/gremlin-go/driver/graphTraversal.go @@ -114,8 +114,8 @@ func (g *GraphTraversal) AsBool(args ...interface{}) *GraphTraversal { // AsDate adds the asDate step to the GraphTraversal. func (g *GraphTraversal) AsDate(args ...interface{}) *GraphTraversal { - g.Bytecode.AddStep("asDate", args...) - return g + g.Bytecode.AddStep("asDate", args...) + return g } // AsNumber adds the asNumber step to the GraphTraversal. @@ -741,12 +741,6 @@ func (g *GraphTraversal) Split(args ...interface{}) *GraphTraversal { return g } -// Store adds the store step to the GraphTraversal. -func (g *GraphTraversal) Store(args ...interface{}) *GraphTraversal { - g.Bytecode.AddStep("store", args...) - return g -} - // Subgraph adds the subgraph step to the GraphTraversal. func (g *GraphTraversal) Subgraph(args ...interface{}) *GraphTraversal { g.Bytecode.AddStep("subgraph", args...) diff --git a/gremlin-go/driver/translator_test.go b/gremlin-go/driver/translator_test.go index 82f2a7a81e1..8daa5ce3128 100644 --- a/gremlin-go/driver/translator_test.go +++ b/gremlin-go/driver/translator_test.go @@ -234,12 +234,6 @@ func Test_translator_Translate(t *testing.T) { }, equals: "g.withSack(0).V('3','5').sack(sum).by('runways').sack()", }, - { - assert: func(g *GraphTraversalSource) *GraphTraversal { - return g.V("3").Values("runways").Store("x").V("4").Values("runways").Store("x").By(T__.Constant(1)).V("6").Store("x").By(T__.Constant(1)).Select("x").Unfold().Sum() - }, - equals: "g.V('3').values('runways').store('x').V('4').values('runways').store('x').by(constant(1)).V('6').store('x').by(constant(1)).select('x').unfold().sum()", - }, { assert: func(g *GraphTraversalSource) *GraphTraversal { return g.Inject(3, 4, 5) diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js index 7edcfe1085e..411bd68e1c4 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js @@ -1481,16 +1481,6 @@ class GraphTraversal extends Traversal { return this; } - /** - * Graph traversal store method. - * @param {...Object} args - * @returns {GraphTraversal} - */ - store(...args) { - this.bytecode.addStep('store', args); - return this; - } - /** * Graph traversal subgraph method. * @param {...Object} args @@ -1858,7 +1848,6 @@ const statics = { simplePath: (...args) => callOnEmptyTraversal('simplePath', args), skip: (...args) => callOnEmptyTraversal('skip', args), split: (...args) => callOnEmptyTraversal('split', args), - store: (...args) => callOnEmptyTraversal('store', args), subgraph: (...args) => callOnEmptyTraversal('subgraph', args), substring: (...args) => callOnEmptyTraversal('substring', args), sum: (...args) => callOnEmptyTraversal('sum', args), diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js index 5ceb2b99a62..c527e971794 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/gremlin.js @@ -295,7 +295,7 @@ const gremlins = { g_V_valuesXintX_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_isXbetweenX20_30XX: [function({g}) { return g.addV("data").property("int", 25) }, function({g}) { return g.V().values("int").asNumber(GType.short).is(P.typeOf(GType.short)).is(P.between(20, 30)) }], g_V_valuesXintX_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_minX: [function({g}) { return g.addV("data").property("int", 10).addV("data").property("int", 20).addV("data").property("int", 30) }, function({g}) { return g.V().values("int").asNumber(GType.short).is(P.typeOf(GType.short)).min() }], g_V_valuesXintX_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_maxX: [function({g}) { return g.addV("data").property("int", 15).addV("data").property("int", 25).addV("data").property("int", 35) }, function({g}) { return g.V().values("int").asNumber(GType.short).is(P.typeOf(GType.short)).max() }], - g_injectX42X_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_storeXaX_capXaX: [function({g}) { return g.inject(42).asNumber(GType.short).is(P.typeOf(GType.short)).store("a").cap("a") }], + g_injectX42X_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_storeXaX_capXaX: [function({g}) { return g.inject(42).asNumber(GType.short).is(P.typeOf(GType.short)) }], g_V_valuesXageX_isXtypeOfXGType_SHORTXX: [function({g}) { return g.V().values("age").is(P.typeOf(GType.short)) }], g_V_valuesXuuidX_isXtypeOfXGType_UUIDXX: [function({g}) { return g.addV("data").property("uuid", "f47af10b-58cc-4372-a567-0f02b2f3d479") }, function({g}) { return g.V().values("uuid").is(P.typeOf(GType.uuid)) }], g_V_hasXuuid_typeOfXGType_UUIDXX_valuesXnameX: [function({g}) { return g.addV("data").property("name", "test").property("uuid", "f47af10b-58cc-4372-a567-0f02b2f3d479") }, function({g}) { return g.V().has("uuid", P.typeOf(GType.uuid)).values("name") }], @@ -308,7 +308,7 @@ const gremlins = { g_injectXUUIDX47af10b_58cc_4372_a567_0f02b2f3d479XX: [function({g}) { return g.inject("f47af10b-58cc-4372-a567-0f02b2f3d479") }], g_injectXUUIDXXX: [function({g}) { return g.inject(uuid.v4()) }], g_V_aggregateXxX_byXnameX_byXageX_capXxX: [function({g}) { return g.V().aggregate("x").by("name").by("age").cap("x") }], - g_V_aggregateXScope_local_xX_byXnameX_byXageX_capXxX: [function({g}) { return g.V().aggregate(Scope.local, "x").by("name").by("age").cap("x") }], + g_V_localXaggregateXxX_byXnameXX_byXageX_capXxX: [function({g}) { return g.V().local(__.aggregate("x").by("name").by("age")).cap("x") }], g_V_valuesXageX_allXgtX32XX: [function({g}) { return g.V().values("age").all(P.gt(32)) }], g_V_valuesXageX_whereXisXP_gtX33XXX_fold_allXgtX33XX: [function({g}) { return g.V().values("age").where(__.is(P.gt(33))).fold().all(P.gt(33)) }], g_V_valuesXageX_order_byXdescX_fold_allXgtX10XX: [function({g}) { return g.V().values("age").order().by(Order.desc).fold().all(P.gt(10)) }], @@ -767,8 +767,8 @@ const gremlins = { g_withStrategiesXReadOnlyStrategyX_V_addVXpersonX_fromXVX1XX: [function({g, vid1}) { return g.withStrategies(new ReadOnlyStrategy()).V().addE("link").from_(__.V(vid1)) }], g_withStrategiesXReadOnlyStrategyX_V_propertyXname_joshX: [function({g}) { return g.withStrategies(new ReadOnlyStrategy()).V().property("name", "josh") }], g_withStrategiesXReadOnlyStrategyX_E_propertyXweight_0X: [function({g}) { return g.withStrategies(new ReadOnlyStrategy()).E().property("weight", 0) }], - g_V_classic_recommendation: [function({g}) { return g.V().has("name", "DARK STAR").as("a").out("followedBy").aggregate("stash").in_("followedBy").where(P.neq("a").and(P.not(P.within("stash")))).groupCount().unfold().project("x", "y", "z").by(__.select(Column.keys).values("name")).by(__.select(Column.keys).values("performances")).by(__.select(Column.values)).order().by(__.select("z"), Order.desc).by(__.select("y"), Order.asc).limit(5).aggregate(Scope.local, "m").select("x") }], - g_V_classic_recommendation_ranked: [function({g}) { return g.V().has("name", "DARK STAR").as("a").out("followedBy").aggregate("stash").in_("followedBy").where(P.neq("a").and(P.not(P.within("stash")))).groupCount().unfold().project("x", "y", "z").by(__.select(Column.keys).values("name")).by(__.select(Column.keys).values("performances")).by(__.select(Column.values)).order().by(__.select("z"), Order.desc).by(__.select("y"), Order.asc).limit(5).aggregate(Scope.local, "m") }], + g_V_classic_recommendation: [function({g}) { return g.V().has("name", "DARK STAR").as("a").out("followedBy").aggregate("stash").in_("followedBy").where(P.neq("a").and(P.not(P.within("stash")))).groupCount().unfold().project("x", "y", "z").by(__.select(Column.keys).values("name")).by(__.select(Column.keys).values("performances")).by(__.select(Column.values)).order().by(__.select("z"), Order.desc).by(__.select("y"), Order.asc).limit(5).local(__.aggregate("m")).select("x") }], + g_V_classic_recommendation_ranked: [function({g}) { return g.V().has("name", "DARK STAR").as("a").out("followedBy").aggregate("stash").in_("followedBy").where(P.neq("a").and(P.not(P.within("stash")))).groupCount().unfold().project("x", "y", "z").by(__.select(Column.keys).values("name")).by(__.select(Column.keys).values("performances")).by(__.select(Column.values)).order().by(__.select("z"), Order.desc).by(__.select("y"), Order.asc).limit(5).local(__.aggregate("m")) }], g_withStrategiesXReferenceElementStrategyX_V: [function({g}) { return g.withStrategies(new ReferenceElementStrategy()).V() }], g_withoutStrategiesXReferenceElementStrategyX_V: [function({g}) { return g.withoutStrategies(ReferenceElementStrategy).V() }], g_withStrategiesXRepeatUnrollStrategyX_V_repeatXoutX_timesX2X: [function({g}) { return g.withStrategies(new RepeatUnrollStrategy()).V().repeat(__.out()).times(2) }], @@ -1613,7 +1613,7 @@ const gremlins = { g_withStrategiesXProductiveByStrategyX_V_asXaX_selectXaX_byXageX: [function({g}) { return g.withStrategies(new ProductiveByStrategy()).V().as("a").select("a").by("age") }], g_withSideEffectXk_nullX_injectXxX_selectXkX: [function({g}) { return g.withSideEffect("k", null).inject("x").select("k") }], g_V_out_in_selectXall_a_a_aX_byXunfold_name_foldX: [function({g}) { return g.addV("A").property("name", "a1").as("a1").addV("B").property("name", "b1").as("b1").addE("ab").from_("a1").to("b1") }, function({g}) { return g.V().as("a").out().as("a").in_().as("a").select(Pop.all, "a", "a", "a").by(__.unfold().values("name").fold()) }], - g_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX: [function({g}) { return g.V().as("label").aggregate(Scope.local, "x").barrier().select("x").select("label") }], + g_V_asXlabelX_localXaggregateXxX_selectXxX_selectXlabelX: [function({g}) { return g.V().as("label").local(__.aggregate("x")).barrier().select("x").select("label") }], g_V_name_asXaX_selectXfirst_aX: [function({g}) { return g.V().values("name").as("a").select(Pop.first, "a") }], g_V_name_asXaX_selectXlast_aX: [function({g}) { return g.V().values("name").as("a").select(Pop.last, "a") }], g_V_name_asXaX_selectXmixed_aX: [function({g}) { return g.V().values("name").as("a").select(Pop.mixed, "a") }], @@ -1873,47 +1873,59 @@ const gremlins = { g_V_out_out_values_asXheadX_path_order_byXascX_selectXheadX: [function({g}) { return g.V().out().out().values().as("head").path().order().by(Order.asc).select("head") }], g_V_out_out_values_asXheadX_path_order_byXdescX_selectXheadX: [function({g}) { return g.V().out().out().values().as("head").path().order().by(Order.desc).select("head") }], g_V_valueXnameX_aggregateXxX_capXxX: [function({g}) { return g.V().values("name").aggregate("x").cap("x") }], - g_V_valueXnameX_aggregateXglobal_xX_capXxX: [function({g}) { return g.V().values("name").aggregate(Scope.global, "x").cap("x") }], g_V_aggregateXxX_byXnameX_capXxX: [function({g}) { return g.V().aggregate("x").by("name").cap("x") }], g_V_out_aggregateXaX_path: [function({g}) { return g.V().out().aggregate("a").path() }], g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX: [function({g}) { return g.V().hasLabel("person").aggregate("x").by("age").cap("x").as("y").select("y") }], g_V_aggregateXxX_byXageX_capXxX: [function({g}) { return g.V().aggregate("x").by("age").cap("x") }], - g_V_aggregateXlocal_xX_byXageX_capXxX: [function({g}) { return g.V().aggregate(Scope.local, "x").by("age").cap("x") }], - g_withStrategiesXProductiveByStrategyX_V_aggregateXlocal_xX_byXageX_capXxX: [function({g}) { return g.withStrategies(new ProductiveByStrategy()).V().aggregate(Scope.local, "x").by("age").cap("x") }], - g_V_aggregateXlocal_a_nameX_out_capXaX: [function({g}) { return g.V().aggregate(Scope.local, "a").by("name").out().cap("a") }], - g_VX1X_aggregateXlocal_aX_byXnameX_out_aggregateXlocal_aX_byXnameX_name_capXaX: [function({g, vid1}) { return g.V(vid1).aggregate(Scope.local, "a").by("name").out().aggregate(Scope.local, "a").by("name").values("name").cap("a") }], - g_withSideEffectXa_setX_V_both_name_aggregateXlocal_aX_capXaX: [function({g}) { return g.V().both().values("name").aggregate(Scope.local, "a").cap("a") }], - g_withSideEffectXa_set_inlineX_V_both_name_aggregateXlocal_aX_capXaX: [function({g}) { return g.withSideEffect("a", new Set(["alice"])).V().both().values("name").aggregate(Scope.local, "a").cap("a") }], - g_V_aggregateXlocal_aX_byXoutEXcreatedX_countX_out_out_aggregateXlocal_aX_byXinEXcreatedX_weight_sumX: [function({g}) { return g.V().aggregate(Scope.local, "a").by(__.outE("created").count()).out().out().aggregate(Scope.local, "a").by(__.inE("created").values("weight").sum()).cap("a") }], + g_V_localXaggregateXxX_byXageXX_capXxX: [function({g}) { return g.V().local(__.aggregate("x").by("age")).cap("x") }], + g_withStrategiesXProductiveByStrategyX_V_localXaggregateXxX_byXageXX_capXxX: [function({g}) { return g.withStrategies(new ProductiveByStrategy()).V().local(__.aggregate("x").by("age")).cap("x") }], + g_V_localX_aggregateXa_byXnameXX_out_capXaX: [function({g}) { return g.V().local(__.aggregate("a").by("name")).out().cap("a") }], + g_VX1X_localXaggregateXaX_byXnameXX_out_localXaggregateXaX_byXnameXX_name_capXaX: [function({g, vid1}) { return g.V(vid1).local(__.aggregate("a").by("name")).out().local(__.aggregate("a").by("name")).values("name").cap("a") }], + g_withSideEffectXa_setX_V_both_name_localXaggregateX_aXX_capXaX: [function({g}) { return g.V().both().values("name").local(__.aggregate("a")).cap("a") }], + g_withSideEffectXa_set_inlineX_V_both_name_localXaggregateXaXX_capXaX: [function({g}) { return g.withSideEffect("a", new Set(["alice"])).V().both().values("name").local(__.aggregate("a")).cap("a") }], + g_V_localXaggregateXaX_byXoutEXcreatedX_countXX_out_out_localXaggregateXaX_byXinEXcreatedX_weight_sumXX_capXaX: [function({g}) { return g.V().local(__.aggregate("a").by(__.outE("created").count())).out().out().local(__.aggregate("a").by(__.inE("created").values("weight").sum())).cap("a") }], g_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX: [function({g}) { return g.V().aggregate("x").by(__.values("age").is(P.gt(29))).cap("x") }], g_withStrategiesXProductiveByStrategyX_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX: [function({g}) { return g.withStrategies(new ProductiveByStrategy()).V().aggregate("x").by(__.values("age").is(P.gt(29))).cap("x") }], g_V_aggregateXxX_byXout_order_byXnameXX_capXxX: [function({g}) { return g.V().aggregate("x").by(__.out().order().by("name")).cap("x") }], g_withStrategiesXProductiveByStrategyX_V_aggregateXxX_byXout_order_byXnameXX_capXxX: [function({g}) { return g.withStrategies(new ProductiveByStrategy()).V().aggregate("x").by(__.out().order().by("name")).cap("x") }], g_V_aggregateXaX_hasXperson_age_gteX30XXX_capXaX_unfold_valuesXnameX: [function({g}) { return g.V().aggregate("a").has("person", "age", P.gte(30)).cap("a").unfold().values("name") }], g_withSideEffectXa_1_sumX_V_aggregateXaX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 1, Operator.sum).V().aggregate("a").by("age").cap("a") }], - g_withSideEffectXa_1_sumX_V_aggregateXlocal_aX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 1, Operator.sum).V().aggregate(Scope.local, "a").by("age").cap("a") }], + g_withSideEffectXa_1_sumX_V_localXaggregateX_aX_byXageXX_capXaX: [function({g}) { return g.withSideEffect("a", 1, Operator.sum).V().local(__.aggregate("a").by("age")).cap("a") }], g_withSideEffectXa_123_minusX_V_aggregateXaX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 123, Operator.minus).V().aggregate("a").by("age").cap("a") }], - g_withSideEffectXa_123_minusX_V_aggregateXlocal_aX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 123, Operator.minus).V().aggregate(Scope.local, "a").by("age").cap("a") }], + g_withSideEffectXa_123_minusX_V_localXaggregateX_aX_byXageXX_capXaX: [function({g}) { return g.withSideEffect("a", 123, Operator.minus).V().local(__.aggregate("a").by("age")).cap("a") }], g_withSideEffectXa_2_multX_V_aggregateXaX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 2, Operator.mult).V().aggregate("a").by("age").cap("a") }], - g_withSideEffectXa_2_multX_V_aggregateXlocal_aX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 2, Operator.mult).V().aggregate(Scope.local, "a").by("age").cap("a") }], + g_withSideEffectXa_2_multX_V_localXaggregateX_aX_byXageXX_capXaX: [function({g}) { return g.withSideEffect("a", 2, Operator.mult).V().local(__.aggregate("a").by("age")).cap("a") }], g_withSideEffectXa_876960_divX_V_aggregateXaX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 876960, Operator.div).V().aggregate("a").by("age").cap("a") }], - g_withSideEffectXa_876960_divX_V_aggregateXlocal_aX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 876960, Operator.div).V().aggregate(Scope.local, "a").by("age").cap("a") }], + g_withSideEffectXa_876960_divX_V_localXaggregateX_aX_byXageXX_capXaX: [function({g}) { return g.withSideEffect("a", 876960, Operator.div).V().local(__.aggregate("a").by("age")).cap("a") }], g_withSideEffectXa_1_minX_V_aggregateXaX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 1, Operator.min).V().aggregate("a").by("age").cap("a") }], - g_withSideEffectXa_1_minX_V_aggregateXlocal_aX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 1, Operator.min).V().aggregate(Scope.local, "a").by("age").cap("a") }], + g_withSideEffectXa_1_minX_V_localXaggregateX_aX_byXageXX_capXaX: [function({g}) { return g.withSideEffect("a", 1, Operator.min).V().local(__.aggregate("a").by("age")).cap("a") }], g_withSideEffectXa_100_minX_V_aggregateXaX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 100, Operator.min).V().aggregate("a").by("age").cap("a") }], - g_withSideEffectXa_100_minX_V_aggregateXlocal_aX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 100, Operator.min).V().aggregate(Scope.local, "a").by("age").cap("a") }], + g_withSideEffectXa_100_minX_V_localXaggregateX_aX_byXageXX_capXaX: [function({g}) { return g.withSideEffect("a", 100, Operator.min).V().local(__.aggregate("a").by("age")).cap("a") }], g_withSideEffectXa_1_maxX_V_aggregateXaX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 1, Operator.max).V().aggregate("a").by("age").cap("a") }], - g_withSideEffectXa_1_maxX_V_aggregateXlocal_aX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 1, Operator.max).V().aggregate(Scope.local, "a").by("age").cap("a") }], + g_withSideEffectXa_1_maxX_V_localXaggregateX_aX_byXageXX_capXaX: [function({g}) { return g.withSideEffect("a", 1, Operator.max).V().local(__.aggregate("a").by("age")).cap("a") }], g_withSideEffectXa_100_maxX_V_aggregateXaX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 100, Operator.max).V().aggregate("a").by("age").cap("a") }], - g_withSideEffectXa_100_maxX_V_aggregateXlocal_aX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 100, Operator.max).V().aggregate(Scope.local, "a").by("age").cap("a") }], + g_withSideEffectXa_100_maxX_V_localXaggregateX_aX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", 100, Operator.max).V().local(__.aggregate("a").by("age")).cap("a") }], g_withSideEffectXa_true_andX_V_constantXfalseX_aggregateXaX_capXaX: [function({g}) { return g.withSideEffect("a", true, Operator.and).V().constant(false).aggregate("a").cap("a") }], - g_withSideEffectXa_true_andX_V_constantXfalseX_aggregateXlocal_aX_capXaX: [function({g}) { return g.withSideEffect("a", true, Operator.and).V().constant(false).aggregate(Scope.local, "a").cap("a") }], + g_withSideEffectXa_true_andX_V_constantXfalseX_localXaggregateX_aXX_capXaX: [function({g}) { return g.withSideEffect("a", true, Operator.and).V().constant(false).local(__.aggregate("a")).cap("a") }], g_withSideEffectXa_true_orX_V_constantXfalseX_aggregateXaX_capXaX: [function({g}) { return g.withSideEffect("a", true, Operator.or).V().constant(false).aggregate("a").cap("a") }], - g_withSideEffectXa_true_orX_V_constantXfalseX_aggregateXlocal_aX_capXaX: [function({g}) { return g.withSideEffect("a", true, Operator.or).V().constant(false).aggregate(Scope.local, "a").cap("a") }], + g_withSideEffectXa_true_orX_V_constantXfalseX_localXaggregateX_aXX_capXaX: [function({g}) { return g.withSideEffect("a", true, Operator.or).V().constant(false).local(__.aggregate("a")).cap("a") }], g_withSideEffectXa_1_2_3_addAllX_V_aggregateXaX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", [1, 2, 3], Operator.addAll).V().aggregate("a").by("age").cap("a") }], - g_withSideEffectXa_1_2_3_addAllX_V_aggregateXlocal_aX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", [1, 2, 3], Operator.addAll).V().aggregate(Scope.local, "a").by("age").cap("a") }], + g_withSideEffectXa_1_2_3_addAllX_V_localXaggregateX_aX_byXageXX_capXaX: [function({g}) { return g.withSideEffect("a", [1, 2, 3], Operator.addAll).V().local(__.aggregate("a").by("age")).cap("a") }], g_withSideEffectXa_1_2_3_assignX_V_aggregateXaX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", [1, 2, 3], Operator.assign).V().aggregate("a").by("age").cap("a") }], - g_withSideEffectXa_1_2_3_assignX_V_order_byXageX_aggregateXlocal_aX_byXageX_capXaX: [function({g}) { return g.withSideEffect("a", [1, 2, 3], Operator.assign).V().order().by("age").aggregate(Scope.local, "a").by("age").cap("a") }], + g_withSideEffectXa_1_2_3_assignX_V_order_byXageX_localXaggregateX_aX_byXageXX_capXaX: [function({g}) { return g.withSideEffect("a", [1, 2, 3], Operator.assign).V().order().by("age").local(__.aggregate("a").by("age")).cap("a") }], + g_V_localXaggregateXa_nameXX_out_capXaX: [function({g}) { return g.V().local(__.aggregate("a").by("name")).out().cap("a") }], + g_withSideEffectXa_setX_V_both_name_localXaggregateXaXX_capXaX: [function({g}) { return g.V().both().values("name").local(__.aggregate("a")).cap("a") }], + g_V_localXaggregateXaXX_outE_inV_localXaggregateXaXX_capXaX_unfold_dedup: [function({g}) { return g.V().local(__.aggregate("a")).outE().inV().local(__.aggregate("a")).cap("a").unfold().dedup() }], + g_V_hasLabelXpersonX_localXaggregateXaXX_outXcreatedX_localXaggregateXaXX_capXaX: [function({g}) { return g.V().hasLabel("person").local(__.aggregate("a")).out("created").local(__.aggregate("a")).cap("a") }], + g_V_localXaggregateXaXX_repeatXout_localXaggregateXaXXX_timesX2X_capXaX_unfold_groupCount: [function({g}) { return g.V().local(__.aggregate("a")).repeat(__.out().local(__.aggregate("a"))).times(2).cap("a").unfold().values("name").groupCount() }], + g_V_hasXname_markoX_localXaggregateXaXX_outXknowsX_localXaggregateXaXX_outXcreatedX_localXaggregateXaXX_capXaX: [function({g}) { return g.V().has("name", "marko").local(__.aggregate("a")).out("knows").local(__.aggregate("a")).out("created").local(__.aggregate("a")).cap("a") }], + g_V_hasLabelXsoftwareX_localXaggregateXaXX_inXcreatedX_localXaggregateXaXX_outXknowsX_localXaggregateXaXX_capXaX: [function({g}) { return g.V().hasLabel("software").local(__.aggregate("a")).in_("created").local(__.aggregate("a")).out("knows").local(__.aggregate("a")).cap("a") }], + g_V_localXaggregateXaXX_outE_hasXweight_lgtX0_5XX_inV_localXaggregateXaXX_capXaX_unfold_path: [function({g}) { return g.V().local(__.aggregate("a")).outE().has("weight", P.gt(0.5)).inV().local(__.aggregate("a")).cap("a").unfold().path() }], + g_V_localXaggregateXaXX_bothE_sampleX1X_otherV_localXaggregateXaXX_capXaX_unfold_groupCount_byXlabelX: [function({g}) { return g.V().local(__.aggregate("a")).bothE().sample(1).otherV().local(__.aggregate("a")).cap("a").unfold().groupCount().by(T.label) }], + g_V_hasLabelXpersonX_localXaggregateXaXX_outE_inV_simplePath_localXaggregateXaXX_capXaX_unfold_hasLabelXsoftwareX_count: [function({g}) { return g.V().hasLabel("person").local(__.aggregate("a")).outE().inV().simplePath().local(__.aggregate("a")).cap("a").unfold().hasLabel("software").count() }], + g_V_localXaggregateXaXX_unionXout_inX_localXaggregateXaXX_capXaX_unfold_dedup_valuesXnameX: [function({g}) { return g.V().local(__.aggregate("a")).union(__.out(), __.in_()).local(__.aggregate("a")).cap("a").unfold().dedup().values("name") }], + g_V_hasXname_joshX_localXaggregateXaXX_outE_hasXweight_ltX1_0XX_inV_localXaggregateXaXX_outE_inV_localXaggregateXaXX_capXaX: [function({g}) { return g.V().has("name", "josh").local(__.aggregate("a")).outE().has("weight", P.lt(1.0)).inV().local(__.aggregate("a")).outE().inV().local(__.aggregate("a")).cap("a") }], + g_V_hasLabelXpersonX_localXaggregateXaXX_outE_order_byXweightX_limitX1X_inV_localXaggregateXaXX_capXaX: [function({g}) { return g.V().hasLabel("person").local(__.aggregate("a")).outE().order().by("weight").limit(1).inV().local(__.aggregate("a")).cap("a") }], g_V_fail: [function({g}) { return g.V().fail() }], g_V_failXmsgX: [function({g}) { return g.V().fail("msg") }], g_V_unionXout_failX: [function({g}) { return g.V().union(__.out(), __.fail()) }], @@ -2014,7 +2026,7 @@ const gremlins = { g_V_sideEffectXidentity_valuesXnameXX: [function({g}) { return g.V().sideEffect(__.identity().values("name")) }], g_V_sideEffectXpropertyXage_22X: [function({g}) { return g.addV("person").property("age", 21) }, function({g}) { return g.V().sideEffect(__.property("age", 22)) }, function({g}) { return g.V().has("age", 21) }, function({g}) { return g.V().has("age", 22) }], g_V_group_byXvaluesXnameX_sideEffectXconstantXzyxXX_substringX1XX_byXconstantX1X_sideEffectXconstantXxyzXXX: [function({g}) { return g.V().group().by(__.values("name").sideEffect(__.constant("zyx")).substring(0, 1)).by(__.constant(1).sideEffect(__.constant("xyz"))) }], - g_withSideEffectXx_setX_V_both_both_sideEffectXstoreXxX_byXnameXX_capXxX_unfold: [function({g}) { return g.withSideEffect("x", new Set([])).V().both().both().sideEffect(__.store("x").by("name")).cap("x").unfold() }], + g_withSideEffectXx_setX_V_both_both_sideEffectXlocalXaggregateXxX_byXnameXX_capXxX_unfold: [function({g}) { return g.withSideEffect("x", new Set([])).V().both().both().sideEffect(__.local(__.aggregate("x").by("name"))).cap("x").unfold() }], g_V_hasXageX_groupCountXaX_byXnameX_out_capXaX: [function({g}) { return g.V().has("age").groupCount("a").by("name").out().cap("a") }], g_V_groupXaX_byXageX_capXaX: [function({g}) { return g.V().group("a").by("age").cap("a") }], g_V_groupXaX_byXnameX_capXaX: [function({g}) { return g.V().group("a").by("name").cap("a") }], @@ -2036,11 +2048,6 @@ const gremlins = { g_V_groupXaX_by_byXout_label_limitX0X_foldX_capXaX_selectXvaluesX_unfold: [function({g}) { return g.V().group("a").by().by(__.out().label().limit(0).fold()).cap("a").select(Column.values).unfold() }], g_V_groupXaX_by_byXout_label_limitX10X_foldX_capXaX_selectXvaluesX_unfold_orderXlocalX: [function({g}) { return g.V().group("a").by().by(__.out().label().limit(10).fold()).cap("a").select(Column.values).unfold().order(Scope.local) }], g_V_groupXaX_by_byXout_label_tailX10X_foldX_capXaX_selectXvaluesX_unfold_orderXlocalX: [function({g}) { return g.V().group("a").by().by(__.out().label().tail(10).fold()).cap("a").select(Column.values).unfold().order(Scope.local) }], - g_V_storeXa_nameX_out_capXaX: [function({g}) { return g.V().store("a").by("name").out().cap("a") }], - g_VX1X_storeXaX_byXnameX_out_storeXaX_byXnameX_name_capXaX: [function({g, vid1}) { return g.V(vid1).store("a").by("name").out().store("a").by("name").values("name").cap("a") }], - g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX: [function({g}) { return g.V().both().values("name").store("a").cap("a") }], - g_withSideEffectXa_set_inlineX_V_both_name_storeXaX_capXaX: [function({g}) { return g.withSideEffect("a", new Set(["alice"])).V().both().values("name").store("a").cap("a") }], - g_V_storeXaX_byXoutEXcreatedX_countX_out_out_storeXaX_byXinEXcreatedX_weight_sumX: [function({g}) { return g.V().store("a").by(__.outE("created").count()).out().out().store("a").by(__.inE("created").values("weight").sum()).cap("a") }], g_VX1X_outEXknowsX_subgraphXsgX_name_capXsgX: [function({g, vid1}) { return g.V(vid1).outE("knows").subgraph("sg").values("name").cap("sg") }], g_V_repeatXbothEXcreatedX_subgraphXsgX_outVX_timesX5X_name_dedup_capXsgX: [function({g}) { return g.V().repeat(__.bothE("created").subgraph("sg").outV()).times(5).values("name").dedup().cap("sg") }], g_V_outEXnoexistX_subgraphXsgXcapXsgX: [function({g}) { return g.V().outE("noexist").subgraph("sg").cap("sg") }], diff --git a/gremlin-language/src/main/antlr4/Gremlin.g4 b/gremlin-language/src/main/antlr4/Gremlin.g4 index eb725287cda..395eb0b8f4c 100644 --- a/gremlin-language/src/main/antlr4/Gremlin.g4 +++ b/gremlin-language/src/main/antlr4/Gremlin.g4 @@ -270,7 +270,6 @@ traversalMethod | traversalMethod_sideEffect | traversalMethod_simplePath | traversalMethod_skip - | traversalMethod_store | traversalMethod_subgraph | traversalMethod_sum | traversalMethod_tail @@ -332,8 +331,7 @@ traversalMethod_addV ; traversalMethod_aggregate - : K_AGGREGATE LPAREN traversalScope COMMA stringLiteral RPAREN #traversalMethod_aggregate_Scope_String - | K_AGGREGATE LPAREN stringLiteral RPAREN #traversalMethod_aggregate_String + : K_AGGREGATE LPAREN stringLiteral RPAREN #traversalMethod_aggregate_String ; traversalMethod_all @@ -849,10 +847,6 @@ traversalMethod_split | K_SPLIT LPAREN traversalScope COMMA stringNullableLiteral RPAREN #traversalMethod_split_Scope_String ; -traversalMethod_store - : K_STORE LPAREN stringLiteral RPAREN - ; - traversalMethod_subgraph : K_SUBGRAPH LPAREN stringLiteral RPAREN ; @@ -1980,7 +1974,6 @@ keyword | K_SKIP | K_SPLIT | K_STARTINGWITH - | K_STORE | K_STRING | K_STRINGU | K_SUBGRAPH @@ -2291,7 +2284,6 @@ K_SINGLE: 'single'; K_SKIP: 'skip'; K_SPLIT: 'split'; K_STARTINGWITH: 'startingWith'; -K_STORE: 'store'; K_STRING: 'string'; K_STRINGU: 'STRING'; K_SUBGRAPH: 'subgraph'; diff --git a/gremlin-python/src/main/python/gremlin_python/process/graph_traversal.py b/gremlin-python/src/main/python/gremlin_python/process/graph_traversal.py index 887a9191d7c..98d141ab38d 100644 --- a/gremlin-python/src/main/python/gremlin_python/process/graph_traversal.py +++ b/gremlin-python/src/main/python/gremlin_python/process/graph_traversal.py @@ -914,10 +914,6 @@ def split(self, *args): self.bytecode.add_step("split", *args) return self - def store(self, *args): - self.bytecode.add_step("store", *args) - return self - def subgraph(self, *args): self.bytecode.add_step("subgraph", *args) return self @@ -1663,10 +1659,6 @@ def skip(cls, *args): def split(cls, *args): return cls.graph_traversal(None, None, Bytecode()).split(*args) - @classmethod - def store(cls, *args): - return cls.graph_traversal(None, None, Bytecode()).store(*args) - @classmethod def subgraph(cls, *args): return cls.graph_traversal(None, None, Bytecode()).subgraph(*args) @@ -2333,10 +2325,6 @@ def split(*args): return __.split(*args) -def store(*args): - return __.store(*args) - - def subgraph(*args): return __.subgraph(*args) @@ -2667,8 +2655,6 @@ def where(*args): statics.add_static('split', split) -statics.add_static('store', store) - statics.add_static('subgraph', subgraph) statics.add_static('substring', substring) diff --git a/gremlin-python/src/main/python/radish/gremlin.py b/gremlin-python/src/main/python/radish/gremlin.py index 4264332009a..34d0ecf07d5 100644 --- a/gremlin-python/src/main/python/radish/gremlin.py +++ b/gremlin-python/src/main/python/radish/gremlin.py @@ -267,7 +267,7 @@ 'g_V_valuesXintX_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_isXbetweenX20_30XX': [(lambda g:g.add_v('data').property('int', 25)), (lambda g:g.V().values('int').as_number(GType.SHORT).is_(P.type_of(GType.SHORT)).is_(P.between(20, 30)))], 'g_V_valuesXintX_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_minX': [(lambda g:g.add_v('data').property('int', 10).add_v('data').property('int', 20).add_v('data').property('int', 30)), (lambda g:g.V().values('int').as_number(GType.SHORT).is_(P.type_of(GType.SHORT)).min_())], 'g_V_valuesXintX_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_maxX': [(lambda g:g.add_v('data').property('int', 15).add_v('data').property('int', 25).add_v('data').property('int', 35)), (lambda g:g.V().values('int').as_number(GType.SHORT).is_(P.type_of(GType.SHORT)).max_())], - 'g_injectX42X_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_storeXaX_capXaX': [(lambda g:g.inject(42).as_number(GType.SHORT).is_(P.type_of(GType.SHORT)).store('a').cap('a'))], + 'g_injectX42X_asNumberXGType_SHORTX_isXtypeOfXGType_SHORTXX_storeXaX_capXaX': [(lambda g:g.inject(42).as_number(GType.SHORT).is_(P.type_of(GType.SHORT)))], 'g_V_valuesXageX_isXtypeOfXGType_SHORTXX': [(lambda g:g.V().values('age').is_(P.type_of(GType.SHORT)))], 'g_V_valuesXuuidX_isXtypeOfXGType_UUIDXX': [(lambda g:g.add_v('data').property('uuid', uuid.UUID('f47af10b-58cc-4372-a567-0f02b2f3d479'))), (lambda g:g.V().values('uuid').is_(P.type_of(GType.UUID)))], 'g_V_hasXuuid_typeOfXGType_UUIDXX_valuesXnameX': [(lambda g:g.add_v('data').property('name', 'test').property('uuid', uuid.UUID('f47af10b-58cc-4372-a567-0f02b2f3d479'))), (lambda g:g.V().has('uuid', P.type_of(GType.UUID)).values('name'))], @@ -280,7 +280,7 @@ 'g_injectXUUIDX47af10b_58cc_4372_a567_0f02b2f3d479XX': [(lambda g:g.inject(uuid.UUID('f47af10b-58cc-4372-a567-0f02b2f3d479')))], 'g_injectXUUIDXXX': [(lambda g:g.inject(uuid.uuid4()))], 'g_V_aggregateXxX_byXnameX_byXageX_capXxX': [(lambda g:g.V().aggregate('x').by('name').by('age').cap('x'))], - 'g_V_aggregateXScope_local_xX_byXnameX_byXageX_capXxX': [(lambda g:g.V().aggregate(Scope.local, 'x').by('name').by('age').cap('x'))], + 'g_V_localXaggregateXxX_byXnameXX_byXageX_capXxX': [(lambda g:g.V().local(__.aggregate('x').by('name').by('age')).cap('x'))], 'g_V_valuesXageX_allXgtX32XX': [(lambda g:g.V().values('age').all_(P.gt(32)))], 'g_V_valuesXageX_whereXisXP_gtX33XXX_fold_allXgtX33XX': [(lambda g:g.V().values('age').where(__.is_(P.gt(33))).fold().all_(P.gt(33)))], 'g_V_valuesXageX_order_byXdescX_fold_allXgtX10XX': [(lambda g:g.V().values('age').order().by(Order.desc).fold().all_(P.gt(10)))], @@ -739,8 +739,8 @@ 'g_withStrategiesXReadOnlyStrategyX_V_addVXpersonX_fromXVX1XX': [(lambda g, vid1=None:g.with_strategies(ReadOnlyStrategy()).V().add_e('link').from_(__.V(vid1)))], 'g_withStrategiesXReadOnlyStrategyX_V_propertyXname_joshX': [(lambda g:g.with_strategies(ReadOnlyStrategy()).V().property('name', 'josh'))], 'g_withStrategiesXReadOnlyStrategyX_E_propertyXweight_0X': [(lambda g:g.with_strategies(ReadOnlyStrategy()).E().property('weight', 0))], - 'g_V_classic_recommendation': [(lambda g:g.V().has('name', 'DARK STAR').as_('a').out('followedBy').aggregate('stash').in_('followedBy').where(P.neq('a').and_(P.not_(P.within('stash')))).group_count().unfold().project('x', 'y', 'z').by(__.select(Column.keys).values('name')).by(__.select(Column.keys).values('performances')).by(__.select(Column.values)).order().by(__.select('z'), Order.desc).by(__.select('y'), Order.asc).limit(5).aggregate(Scope.local, 'm').select('x'))], - 'g_V_classic_recommendation_ranked': [(lambda g:g.V().has('name', 'DARK STAR').as_('a').out('followedBy').aggregate('stash').in_('followedBy').where(P.neq('a').and_(P.not_(P.within('stash')))).group_count().unfold().project('x', 'y', 'z').by(__.select(Column.keys).values('name')).by(__.select(Column.keys).values('performances')).by(__.select(Column.values)).order().by(__.select('z'), Order.desc).by(__.select('y'), Order.asc).limit(5).aggregate(Scope.local, 'm'))], + 'g_V_classic_recommendation': [(lambda g:g.V().has('name', 'DARK STAR').as_('a').out('followedBy').aggregate('stash').in_('followedBy').where(P.neq('a').and_(P.not_(P.within('stash')))).group_count().unfold().project('x', 'y', 'z').by(__.select(Column.keys).values('name')).by(__.select(Column.keys).values('performances')).by(__.select(Column.values)).order().by(__.select('z'), Order.desc).by(__.select('y'), Order.asc).limit(5).local(__.aggregate('m')).select('x'))], + 'g_V_classic_recommendation_ranked': [(lambda g:g.V().has('name', 'DARK STAR').as_('a').out('followedBy').aggregate('stash').in_('followedBy').where(P.neq('a').and_(P.not_(P.within('stash')))).group_count().unfold().project('x', 'y', 'z').by(__.select(Column.keys).values('name')).by(__.select(Column.keys).values('performances')).by(__.select(Column.values)).order().by(__.select('z'), Order.desc).by(__.select('y'), Order.asc).limit(5).local(__.aggregate('m')))], 'g_withStrategiesXReferenceElementStrategyX_V': [(lambda g:g.with_strategies(ReferenceElementStrategy()).V())], 'g_withoutStrategiesXReferenceElementStrategyX_V': [(lambda g:g.without_strategies(*[GremlinType('org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ReferenceElementStrategy')]).V())], 'g_withStrategiesXRepeatUnrollStrategyX_V_repeatXoutX_timesX2X': [(lambda g:g.with_strategies(RepeatUnrollStrategy()).V().repeat(__.out()).times(2))], @@ -1585,7 +1585,7 @@ 'g_withStrategiesXProductiveByStrategyX_V_asXaX_selectXaX_byXageX': [(lambda g:g.with_strategies(ProductiveByStrategy()).V().as_('a').select('a').by('age'))], 'g_withSideEffectXk_nullX_injectXxX_selectXkX': [(lambda g:g.with_side_effect('k', None).inject('x').select('k'))], 'g_V_out_in_selectXall_a_a_aX_byXunfold_name_foldX': [(lambda g:g.add_v('A').property('name', 'a1').as_('a1').add_v('B').property('name', 'b1').as_('b1').add_e('ab').from_('a1').to('b1')), (lambda g:g.V().as_('a').out().as_('a').in_().as_('a').select(Pop.all_, 'a', 'a', 'a').by(__.unfold().values('name').fold()))], - 'g_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX': [(lambda g:g.V().as_('label').aggregate(Scope.local, 'x').barrier().select('x').select('label'))], + 'g_V_asXlabelX_localXaggregateXxX_selectXxX_selectXlabelX': [(lambda g:g.V().as_('label').local(__.aggregate('x')).barrier().select('x').select('label'))], 'g_V_name_asXaX_selectXfirst_aX': [(lambda g:g.V().values('name').as_('a').select(Pop.first, 'a'))], 'g_V_name_asXaX_selectXlast_aX': [(lambda g:g.V().values('name').as_('a').select(Pop.last, 'a'))], 'g_V_name_asXaX_selectXmixed_aX': [(lambda g:g.V().values('name').as_('a').select(Pop.mixed, 'a'))], @@ -1845,47 +1845,59 @@ 'g_V_out_out_values_asXheadX_path_order_byXascX_selectXheadX': [(lambda g:g.V().out().out().values().as_('head').path().order().by(Order.asc).select('head'))], 'g_V_out_out_values_asXheadX_path_order_byXdescX_selectXheadX': [(lambda g:g.V().out().out().values().as_('head').path().order().by(Order.desc).select('head'))], 'g_V_valueXnameX_aggregateXxX_capXxX': [(lambda g:g.V().values('name').aggregate('x').cap('x'))], - 'g_V_valueXnameX_aggregateXglobal_xX_capXxX': [(lambda g:g.V().values('name').aggregate(Scope.global_, 'x').cap('x'))], 'g_V_aggregateXxX_byXnameX_capXxX': [(lambda g:g.V().aggregate('x').by('name').cap('x'))], 'g_V_out_aggregateXaX_path': [(lambda g:g.V().out().aggregate('a').path())], 'g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX': [(lambda g:g.V().has_label('person').aggregate('x').by('age').cap('x').as_('y').select('y'))], 'g_V_aggregateXxX_byXageX_capXxX': [(lambda g:g.V().aggregate('x').by('age').cap('x'))], - 'g_V_aggregateXlocal_xX_byXageX_capXxX': [(lambda g:g.V().aggregate(Scope.local, 'x').by('age').cap('x'))], - 'g_withStrategiesXProductiveByStrategyX_V_aggregateXlocal_xX_byXageX_capXxX': [(lambda g:g.with_strategies(ProductiveByStrategy()).V().aggregate(Scope.local, 'x').by('age').cap('x'))], - 'g_V_aggregateXlocal_a_nameX_out_capXaX': [(lambda g:g.V().aggregate(Scope.local, 'a').by('name').out().cap('a'))], - 'g_VX1X_aggregateXlocal_aX_byXnameX_out_aggregateXlocal_aX_byXnameX_name_capXaX': [(lambda g, vid1=None:g.V(vid1).aggregate(Scope.local, 'a').by('name').out().aggregate(Scope.local, 'a').by('name').values('name').cap('a'))], - 'g_withSideEffectXa_setX_V_both_name_aggregateXlocal_aX_capXaX': [(lambda g:g.V().both().values('name').aggregate(Scope.local, 'a').cap('a'))], - 'g_withSideEffectXa_set_inlineX_V_both_name_aggregateXlocal_aX_capXaX': [(lambda g:g.with_side_effect('a', {'alice'}).V().both().values('name').aggregate(Scope.local, 'a').cap('a'))], - 'g_V_aggregateXlocal_aX_byXoutEXcreatedX_countX_out_out_aggregateXlocal_aX_byXinEXcreatedX_weight_sumX': [(lambda g:g.V().aggregate(Scope.local, 'a').by(__.out_e('created').count()).out().out().aggregate(Scope.local, 'a').by(__.in_e('created').values('weight').sum_()).cap('a'))], + 'g_V_localXaggregateXxX_byXageXX_capXxX': [(lambda g:g.V().local(__.aggregate('x').by('age')).cap('x'))], + 'g_withStrategiesXProductiveByStrategyX_V_localXaggregateXxX_byXageXX_capXxX': [(lambda g:g.with_strategies(ProductiveByStrategy()).V().local(__.aggregate('x').by('age')).cap('x'))], + 'g_V_localX_aggregateXa_byXnameXX_out_capXaX': [(lambda g:g.V().local(__.aggregate('a').by('name')).out().cap('a'))], + 'g_VX1X_localXaggregateXaX_byXnameXX_out_localXaggregateXaX_byXnameXX_name_capXaX': [(lambda g, vid1=None:g.V(vid1).local(__.aggregate('a').by('name')).out().local(__.aggregate('a').by('name')).values('name').cap('a'))], + 'g_withSideEffectXa_setX_V_both_name_localXaggregateX_aXX_capXaX': [(lambda g:g.V().both().values('name').local(__.aggregate('a')).cap('a'))], + 'g_withSideEffectXa_set_inlineX_V_both_name_localXaggregateXaXX_capXaX': [(lambda g:g.with_side_effect('a', {'alice'}).V().both().values('name').local(__.aggregate('a')).cap('a'))], + 'g_V_localXaggregateXaX_byXoutEXcreatedX_countXX_out_out_localXaggregateXaX_byXinEXcreatedX_weight_sumXX_capXaX': [(lambda g:g.V().local(__.aggregate('a').by(__.out_e('created').count())).out().out().local(__.aggregate('a').by(__.in_e('created').values('weight').sum_())).cap('a'))], 'g_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX': [(lambda g:g.V().aggregate('x').by(__.values('age').is_(P.gt(29))).cap('x'))], 'g_withStrategiesXProductiveByStrategyX_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX': [(lambda g:g.with_strategies(ProductiveByStrategy()).V().aggregate('x').by(__.values('age').is_(P.gt(29))).cap('x'))], 'g_V_aggregateXxX_byXout_order_byXnameXX_capXxX': [(lambda g:g.V().aggregate('x').by(__.out().order().by('name')).cap('x'))], 'g_withStrategiesXProductiveByStrategyX_V_aggregateXxX_byXout_order_byXnameXX_capXxX': [(lambda g:g.with_strategies(ProductiveByStrategy()).V().aggregate('x').by(__.out().order().by('name')).cap('x'))], 'g_V_aggregateXaX_hasXperson_age_gteX30XXX_capXaX_unfold_valuesXnameX': [(lambda g:g.V().aggregate('a').has('person', 'age', P.gte(30)).cap('a').unfold().values('name'))], 'g_withSideEffectXa_1_sumX_V_aggregateXaX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 1, Operator.sum_).V().aggregate('a').by('age').cap('a'))], - 'g_withSideEffectXa_1_sumX_V_aggregateXlocal_aX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 1, Operator.sum_).V().aggregate(Scope.local, 'a').by('age').cap('a'))], + 'g_withSideEffectXa_1_sumX_V_localXaggregateX_aX_byXageXX_capXaX': [(lambda g:g.with_side_effect('a', 1, Operator.sum_).V().local(__.aggregate('a').by('age')).cap('a'))], 'g_withSideEffectXa_123_minusX_V_aggregateXaX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 123, Operator.minus).V().aggregate('a').by('age').cap('a'))], - 'g_withSideEffectXa_123_minusX_V_aggregateXlocal_aX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 123, Operator.minus).V().aggregate(Scope.local, 'a').by('age').cap('a'))], + 'g_withSideEffectXa_123_minusX_V_localXaggregateX_aX_byXageXX_capXaX': [(lambda g:g.with_side_effect('a', 123, Operator.minus).V().local(__.aggregate('a').by('age')).cap('a'))], 'g_withSideEffectXa_2_multX_V_aggregateXaX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 2, Operator.mult).V().aggregate('a').by('age').cap('a'))], - 'g_withSideEffectXa_2_multX_V_aggregateXlocal_aX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 2, Operator.mult).V().aggregate(Scope.local, 'a').by('age').cap('a'))], + 'g_withSideEffectXa_2_multX_V_localXaggregateX_aX_byXageXX_capXaX': [(lambda g:g.with_side_effect('a', 2, Operator.mult).V().local(__.aggregate('a').by('age')).cap('a'))], 'g_withSideEffectXa_876960_divX_V_aggregateXaX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 876960, Operator.div).V().aggregate('a').by('age').cap('a'))], - 'g_withSideEffectXa_876960_divX_V_aggregateXlocal_aX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 876960, Operator.div).V().aggregate(Scope.local, 'a').by('age').cap('a'))], + 'g_withSideEffectXa_876960_divX_V_localXaggregateX_aX_byXageXX_capXaX': [(lambda g:g.with_side_effect('a', 876960, Operator.div).V().local(__.aggregate('a').by('age')).cap('a'))], 'g_withSideEffectXa_1_minX_V_aggregateXaX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 1, Operator.min_).V().aggregate('a').by('age').cap('a'))], - 'g_withSideEffectXa_1_minX_V_aggregateXlocal_aX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 1, Operator.min_).V().aggregate(Scope.local, 'a').by('age').cap('a'))], + 'g_withSideEffectXa_1_minX_V_localXaggregateX_aX_byXageXX_capXaX': [(lambda g:g.with_side_effect('a', 1, Operator.min_).V().local(__.aggregate('a').by('age')).cap('a'))], 'g_withSideEffectXa_100_minX_V_aggregateXaX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 100, Operator.min_).V().aggregate('a').by('age').cap('a'))], - 'g_withSideEffectXa_100_minX_V_aggregateXlocal_aX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 100, Operator.min_).V().aggregate(Scope.local, 'a').by('age').cap('a'))], + 'g_withSideEffectXa_100_minX_V_localXaggregateX_aX_byXageXX_capXaX': [(lambda g:g.with_side_effect('a', 100, Operator.min_).V().local(__.aggregate('a').by('age')).cap('a'))], 'g_withSideEffectXa_1_maxX_V_aggregateXaX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 1, Operator.max_).V().aggregate('a').by('age').cap('a'))], - 'g_withSideEffectXa_1_maxX_V_aggregateXlocal_aX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 1, Operator.max_).V().aggregate(Scope.local, 'a').by('age').cap('a'))], + 'g_withSideEffectXa_1_maxX_V_localXaggregateX_aX_byXageXX_capXaX': [(lambda g:g.with_side_effect('a', 1, Operator.max_).V().local(__.aggregate('a').by('age')).cap('a'))], 'g_withSideEffectXa_100_maxX_V_aggregateXaX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 100, Operator.max_).V().aggregate('a').by('age').cap('a'))], - 'g_withSideEffectXa_100_maxX_V_aggregateXlocal_aX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 100, Operator.max_).V().aggregate(Scope.local, 'a').by('age').cap('a'))], + 'g_withSideEffectXa_100_maxX_V_localXaggregateX_aX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', 100, Operator.max_).V().local(__.aggregate('a').by('age')).cap('a'))], 'g_withSideEffectXa_true_andX_V_constantXfalseX_aggregateXaX_capXaX': [(lambda g:g.with_side_effect('a', True, Operator.and_).V().constant(False).aggregate('a').cap('a'))], - 'g_withSideEffectXa_true_andX_V_constantXfalseX_aggregateXlocal_aX_capXaX': [(lambda g:g.with_side_effect('a', True, Operator.and_).V().constant(False).aggregate(Scope.local, 'a').cap('a'))], + 'g_withSideEffectXa_true_andX_V_constantXfalseX_localXaggregateX_aXX_capXaX': [(lambda g:g.with_side_effect('a', True, Operator.and_).V().constant(False).local(__.aggregate('a')).cap('a'))], 'g_withSideEffectXa_true_orX_V_constantXfalseX_aggregateXaX_capXaX': [(lambda g:g.with_side_effect('a', True, Operator.or_).V().constant(False).aggregate('a').cap('a'))], - 'g_withSideEffectXa_true_orX_V_constantXfalseX_aggregateXlocal_aX_capXaX': [(lambda g:g.with_side_effect('a', True, Operator.or_).V().constant(False).aggregate(Scope.local, 'a').cap('a'))], + 'g_withSideEffectXa_true_orX_V_constantXfalseX_localXaggregateX_aXX_capXaX': [(lambda g:g.with_side_effect('a', True, Operator.or_).V().constant(False).local(__.aggregate('a')).cap('a'))], 'g_withSideEffectXa_1_2_3_addAllX_V_aggregateXaX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', [1, 2, 3], Operator.add_all).V().aggregate('a').by('age').cap('a'))], - 'g_withSideEffectXa_1_2_3_addAllX_V_aggregateXlocal_aX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', [1, 2, 3], Operator.add_all).V().aggregate(Scope.local, 'a').by('age').cap('a'))], + 'g_withSideEffectXa_1_2_3_addAllX_V_localXaggregateX_aX_byXageXX_capXaX': [(lambda g:g.with_side_effect('a', [1, 2, 3], Operator.add_all).V().local(__.aggregate('a').by('age')).cap('a'))], 'g_withSideEffectXa_1_2_3_assignX_V_aggregateXaX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', [1, 2, 3], Operator.assign).V().aggregate('a').by('age').cap('a'))], - 'g_withSideEffectXa_1_2_3_assignX_V_order_byXageX_aggregateXlocal_aX_byXageX_capXaX': [(lambda g:g.with_side_effect('a', [1, 2, 3], Operator.assign).V().order().by('age').aggregate(Scope.local, 'a').by('age').cap('a'))], + 'g_withSideEffectXa_1_2_3_assignX_V_order_byXageX_localXaggregateX_aX_byXageXX_capXaX': [(lambda g:g.with_side_effect('a', [1, 2, 3], Operator.assign).V().order().by('age').local(__.aggregate('a').by('age')).cap('a'))], + 'g_V_localXaggregateXa_nameXX_out_capXaX': [(lambda g:g.V().local(__.aggregate('a').by('name')).out().cap('a'))], + 'g_withSideEffectXa_setX_V_both_name_localXaggregateXaXX_capXaX': [(lambda g:g.V().both().values('name').local(__.aggregate('a')).cap('a'))], + 'g_V_localXaggregateXaXX_outE_inV_localXaggregateXaXX_capXaX_unfold_dedup': [(lambda g:g.V().local(__.aggregate('a')).out_e().in_v().local(__.aggregate('a')).cap('a').unfold().dedup())], + 'g_V_hasLabelXpersonX_localXaggregateXaXX_outXcreatedX_localXaggregateXaXX_capXaX': [(lambda g:g.V().has_label('person').local(__.aggregate('a')).out('created').local(__.aggregate('a')).cap('a'))], + 'g_V_localXaggregateXaXX_repeatXout_localXaggregateXaXXX_timesX2X_capXaX_unfold_groupCount': [(lambda g:g.V().local(__.aggregate('a')).repeat(__.out().local(__.aggregate('a'))).times(2).cap('a').unfold().values('name').group_count())], + 'g_V_hasXname_markoX_localXaggregateXaXX_outXknowsX_localXaggregateXaXX_outXcreatedX_localXaggregateXaXX_capXaX': [(lambda g:g.V().has('name', 'marko').local(__.aggregate('a')).out('knows').local(__.aggregate('a')).out('created').local(__.aggregate('a')).cap('a'))], + 'g_V_hasLabelXsoftwareX_localXaggregateXaXX_inXcreatedX_localXaggregateXaXX_outXknowsX_localXaggregateXaXX_capXaX': [(lambda g:g.V().has_label('software').local(__.aggregate('a')).in_('created').local(__.aggregate('a')).out('knows').local(__.aggregate('a')).cap('a'))], + 'g_V_localXaggregateXaXX_outE_hasXweight_lgtX0_5XX_inV_localXaggregateXaXX_capXaX_unfold_path': [(lambda g:g.V().local(__.aggregate('a')).out_e().has('weight', P.gt(0.5)).in_v().local(__.aggregate('a')).cap('a').unfold().path())], + 'g_V_localXaggregateXaXX_bothE_sampleX1X_otherV_localXaggregateXaXX_capXaX_unfold_groupCount_byXlabelX': [(lambda g:g.V().local(__.aggregate('a')).both_e().sample(1).other_v().local(__.aggregate('a')).cap('a').unfold().group_count().by(T.label))], + 'g_V_hasLabelXpersonX_localXaggregateXaXX_outE_inV_simplePath_localXaggregateXaXX_capXaX_unfold_hasLabelXsoftwareX_count': [(lambda g:g.V().has_label('person').local(__.aggregate('a')).out_e().in_v().simple_path().local(__.aggregate('a')).cap('a').unfold().has_label('software').count())], + 'g_V_localXaggregateXaXX_unionXout_inX_localXaggregateXaXX_capXaX_unfold_dedup_valuesXnameX': [(lambda g:g.V().local(__.aggregate('a')).union(__.out(), __.in_()).local(__.aggregate('a')).cap('a').unfold().dedup().values('name'))], + 'g_V_hasXname_joshX_localXaggregateXaXX_outE_hasXweight_ltX1_0XX_inV_localXaggregateXaXX_outE_inV_localXaggregateXaXX_capXaX': [(lambda g:g.V().has('name', 'josh').local(__.aggregate('a')).out_e().has('weight', P.lt(1.0)).in_v().local(__.aggregate('a')).out_e().in_v().local(__.aggregate('a')).cap('a'))], + 'g_V_hasLabelXpersonX_localXaggregateXaXX_outE_order_byXweightX_limitX1X_inV_localXaggregateXaXX_capXaX': [(lambda g:g.V().has_label('person').local(__.aggregate('a')).out_e().order().by('weight').limit(1).in_v().local(__.aggregate('a')).cap('a'))], 'g_V_fail': [(lambda g:g.V().fail())], 'g_V_failXmsgX': [(lambda g:g.V().fail('msg'))], 'g_V_unionXout_failX': [(lambda g:g.V().union(__.out(), __.fail()))], @@ -1986,7 +1998,7 @@ 'g_V_sideEffectXidentity_valuesXnameXX': [(lambda g:g.V().side_effect(__.identity().values('name')))], 'g_V_sideEffectXpropertyXage_22X': [(lambda g:g.add_v('person').property('age', 21)), (lambda g:g.V().side_effect(__.property('age', 22))), (lambda g:g.V().has('age', 21)), (lambda g:g.V().has('age', 22))], 'g_V_group_byXvaluesXnameX_sideEffectXconstantXzyxXX_substringX1XX_byXconstantX1X_sideEffectXconstantXxyzXXX': [(lambda g:g.V().group().by(__.values('name').side_effect(__.constant('zyx')).substring(0, 1)).by(__.constant(1).side_effect(__.constant('xyz'))))], - 'g_withSideEffectXx_setX_V_both_both_sideEffectXstoreXxX_byXnameXX_capXxX_unfold': [(lambda g:g.with_side_effect('x', set()).V().both().both().side_effect(__.store('x').by('name')).cap('x').unfold())], + 'g_withSideEffectXx_setX_V_both_both_sideEffectXlocalXaggregateXxX_byXnameXX_capXxX_unfold': [(lambda g:g.with_side_effect('x', set()).V().both().both().side_effect(__.local(__.aggregate('x').by('name'))).cap('x').unfold())], 'g_V_hasXageX_groupCountXaX_byXnameX_out_capXaX': [(lambda g:g.V().has('age').group_count('a').by('name').out().cap('a'))], 'g_V_groupXaX_byXageX_capXaX': [(lambda g:g.V().group('a').by('age').cap('a'))], 'g_V_groupXaX_byXnameX_capXaX': [(lambda g:g.V().group('a').by('name').cap('a'))], @@ -2008,11 +2020,6 @@ 'g_V_groupXaX_by_byXout_label_limitX0X_foldX_capXaX_selectXvaluesX_unfold': [(lambda g:g.V().group('a').by().by(__.out().label().limit(0).fold()).cap('a').select(Column.values).unfold())], 'g_V_groupXaX_by_byXout_label_limitX10X_foldX_capXaX_selectXvaluesX_unfold_orderXlocalX': [(lambda g:g.V().group('a').by().by(__.out().label().limit(10).fold()).cap('a').select(Column.values).unfold().order(Scope.local))], 'g_V_groupXaX_by_byXout_label_tailX10X_foldX_capXaX_selectXvaluesX_unfold_orderXlocalX': [(lambda g:g.V().group('a').by().by(__.out().label().tail(10).fold()).cap('a').select(Column.values).unfold().order(Scope.local))], - 'g_V_storeXa_nameX_out_capXaX': [(lambda g:g.V().store('a').by('name').out().cap('a'))], - 'g_VX1X_storeXaX_byXnameX_out_storeXaX_byXnameX_name_capXaX': [(lambda g, vid1=None:g.V(vid1).store('a').by('name').out().store('a').by('name').values('name').cap('a'))], - 'g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX': [(lambda g:g.V().both().values('name').store('a').cap('a'))], - 'g_withSideEffectXa_set_inlineX_V_both_name_storeXaX_capXaX': [(lambda g:g.with_side_effect('a', {'alice'}).V().both().values('name').store('a').cap('a'))], - 'g_V_storeXaX_byXoutEXcreatedX_countX_out_out_storeXaX_byXinEXcreatedX_weight_sumX': [(lambda g:g.V().store('a').by(__.out_e('created').count()).out().out().store('a').by(__.in_e('created').values('weight').sum_()).cap('a'))], 'g_VX1X_outEXknowsX_subgraphXsgX_name_capXsgX': [(lambda g, vid1=None:g.V(vid1).out_e('knows').subgraph('sg').values('name').cap('sg'))], 'g_V_repeatXbothEXcreatedX_subgraphXsgX_outVX_timesX5X_name_dedup_capXsgX': [(lambda g:g.V().repeat(__.both_e('created').subgraph('sg').out_v()).times(5).values('name').dedup().cap('sg'))], 'g_V_outEXnoexistX_subgraphXsgXcapXsgX': [(lambda g:g.V().out_e('noexist').subgraph('sg').cap('sg'))], diff --git a/gremlin-python/src/main/python/tests/process/test_translator.py b/gremlin-python/src/main/python/tests/process/test_translator.py index 9c5a74da9ea..b3f70f370f4 100644 --- a/gremlin-python/src/main/python/tests/process/test_translator.py +++ b/gremlin-python/src/main/python/tests/process/test_translator.py @@ -145,10 +145,7 @@ def test_translations(self): # 36 tests.append([g.withSack(0).V('3', '5').sack(Operator.sum_).by('runways').sack(), "g.withSack(0).V('3','5').sack(Operator.sum).by('runways').sack()"]) - # 37 - tests.append([g.V('3').values('runways').store('x').V('4').values('runways').store('x').by(__.constant(1)).V( - '6').store('x').by(__.constant(1)).select('x').unfold().sum_(), - "g.V('3').values('runways').store('x').V('4').values('runways').store('x').by(__.constant(1)).V('6').store('x').by(__.constant(1)).select('x').unfold().sum()"]) + # 37 - removed as store() was deprecated and removed in 3.8.0 # 38 tests.append([g.inject(3, 4, 5), "g.inject(3,4,5)"]) diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java index 621d8a4647e..caa0b4cc19e 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessComputerSuite.java @@ -87,7 +87,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SackTest; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectCapTest; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectTest; -import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StoreTest; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphTest; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeTest; import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SeedStrategyProcessTest; @@ -195,7 +194,6 @@ public class ProcessComputerSuite extends AbstractGremlinSuite { SackTest.Traversals.class, SideEffectCapTest.Traversals.class, SideEffectTest.Traversals.class, - StoreTest.Traversals.class, SubgraphTest.Traversals.class, TreeTest.Traversals.class, @@ -288,7 +286,6 @@ public class ProcessComputerSuite extends AbstractGremlinSuite { SackTest.class, SideEffectCapTest.class, SideEffectTest.class, - StoreTest.class, SubgraphTest.class, TreeTest.class }; diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java index 6207aa8f07f..1940d9adf29 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/ProcessStandardSuite.java @@ -85,7 +85,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SackTest; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectCapTest; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectTest; -import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StoreTest; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SubgraphTest; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeTest; import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest; @@ -190,7 +189,6 @@ public class ProcessStandardSuite extends AbstractGremlinSuite { SackTest.Traversals.class, SideEffectCapTest.Traversals.class, SideEffectTest.Traversals.class, - StoreTest.Traversals.class, SubgraphTest.Traversals.class, TreeTest.Traversals.class, @@ -285,7 +283,6 @@ public class ProcessStandardSuite extends AbstractGremlinSuite { SackTest.class, SideEffectCapTest.class, SideEffectTest.class, - StoreTest.class, SubgraphTest.class, TreeTest.class, }; diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java index f7735c603cc..102196e9e06 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/ComplexTest.java @@ -51,6 +51,7 @@ import static org.apache.tinkerpop.gremlin.process.traversal.Pop.first; import static org.apache.tinkerpop.gremlin.process.traversal.Pop.last; import static org.apache.tinkerpop.gremlin.process.traversal.Scope.local; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.aggregate; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.both; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.branch; import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.constant; @@ -288,7 +289,7 @@ public Traversal getClassicRecommendation() { order(). by(select("z"), Order.desc). by(select("y"), Order.asc). - limit(5).store("m").select("x"); + limit(5).local(aggregate("m")).select("x"); } @Override diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateTest.java index cf5eb3172df..20afcce5021 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/AggregateTest.java @@ -58,10 +58,6 @@ @RunWith(GremlinProcessRunner.class) public abstract class AggregateTest extends AbstractGremlinProcessTest { - ////// global - - public abstract Traversal> get_g_V_name_aggregateXglobal_xX_capXxX(); - public abstract Traversal> get_g_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX(); public abstract Traversal> get_g_V_aggregateXxX_byXout_order_byXnameXX_capXxX(); @@ -74,26 +70,6 @@ public abstract class AggregateTest extends AbstractGremlinProcessTest { public abstract Traversal> get_g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX(); - ////// local - - public abstract Traversal get_g_V_aggregateXlocal_aX_byXnameX_out_capXaX(); - - public abstract Traversal get_g_VX1X_aggregateXlocal_aX_byXnameX_out_aggregateXlocal_aX_byXnameX_name_capXaX(final Object v1Id); - - public abstract Traversal> get_g_withSideEffectXa_setX_V_both_name_aggregateXlocal_aX_capXaX(); - - public abstract Traversal get_g_V_aggregateXlocal_aX_byXoutEXcreatedX_countX_out_out_aggregateXlocal_aX_byXinEXcreatedX_weight_sumX_capXaX(); - - @Test - @LoadGraphWith(MODERN) - public void g_V_valueXnameX_aggregateXglobal_xX_capXxX() { - final Traversal> traversal = get_g_V_name_aggregateXglobal_xX_capXxX(); - printTraversalForm(traversal); - final Collection names = traversal.next(); - assertFalse(traversal.hasNext()); - checkListOfNames(names); - } - @Test @LoadGraphWith(MODERN) public void g_V_valueXnameX_aggregateXxX_capXxX() { @@ -173,68 +149,6 @@ public void g_V_hasLabelXpersonX_aggregateXxX_byXageX_capXxX_asXyX_selectXyX() { assertFalse(traversal.hasNext()); } - @Test - @LoadGraphWith(MODERN) - public void g_V_aggregateXlocal_a_nameX_out_capXaX() { - final Traversal traversal = get_g_V_aggregateXlocal_aX_byXnameX_out_capXaX(); - printTraversalForm(traversal); - final Collection names = traversal.next(); - assertEquals(6, names.size()); - assertTrue(names.contains("marko")); - assertTrue(names.contains("josh")); - assertTrue(names.contains("peter")); - assertTrue(names.contains("lop")); - assertTrue(names.contains("ripple")); - assertTrue(names.contains("vadas")); - assertFalse(traversal.hasNext()); - } - - @Test - @LoadGraphWith(MODERN) - public void g_VX1X_aggregateXlocal_aX_byXnameX_out_aggregateXlocal_aX_byXnameX_name_capXaX() { - final Traversal traversal = get_g_VX1X_aggregateXlocal_aX_byXnameX_out_aggregateXlocal_aX_byXnameX_name_capXaX(convertToVertexId("marko")); - printTraversalForm(traversal); - final Collection names = traversal.next(); - assertEquals(4, names.size()); - assertTrue(names.contains("marko")); - assertTrue(names.contains("josh")); - assertTrue(names.contains("vadas")); - assertTrue(names.contains("lop")); - assertFalse(traversal.hasNext()); - } - - @Test - @LoadGraphWith(MODERN) - public void g_withSideEffectXa_setX_V_both_name_aggregateXlocal_aX_capXaX() { - final Traversal> traversal = get_g_withSideEffectXa_setX_V_both_name_aggregateXlocal_aX_capXaX(); - printTraversalForm(traversal); - final Set names = traversal.next(); - assertFalse(traversal.hasNext()); - assertEquals(6, names.size()); - assertTrue(names.contains("marko")); - assertTrue(names.contains("vadas")); - assertTrue(names.contains("josh")); - assertTrue(names.contains("lop")); - assertTrue(names.contains("ripple")); - assertTrue(names.contains("peter")); - } - - @Test - @LoadGraphWith(MODERN) - public void g_V_aggregateXlocal_aX_byXoutEXcreatedX_countX_out_out_aggregateXlocal_aX_byXinEXcreatedX_weight_sumX() { - final Traversal traversal = get_g_V_aggregateXlocal_aX_byXoutEXcreatedX_countX_out_out_aggregateXlocal_aX_byXinEXcreatedX_weight_sumX_capXaX(); - printTraversalForm(traversal); - assertTrue(traversal.hasNext()); - final Collection store = traversal.next(); - assertFalse(traversal.hasNext()); - assertEquals(8, store.size()); - assertTrue(store.contains(0L)); - assertTrue(store.contains(1L)); - assertTrue(store.contains(2L)); - assertTrue(store.contains(1.0d)); - assertFalse(store.isEmpty()); - } - @Test @LoadGraphWith(MODERN) public void g_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX() { @@ -257,11 +171,6 @@ public void g_V_aggregateXxX_byXout_order_byXnameXX_capXxX() { public static class Traversals extends AggregateTest { - @Override - public Traversal> get_g_V_name_aggregateXglobal_xX_capXxX() { - return g.V().values("name").aggregate(Scope.global, "x").cap("x"); - } - @Override public Traversal> get_g_V_aggregateXxX_byXout_order_byXnameXX_capXxX() { return g.V().aggregate("x").by(__.out().order().by("name")).cap("x"); @@ -292,24 +201,5 @@ public Traversal> get_g_V_hasLabelXpersonX_aggregate return g.V().hasLabel("person").aggregate("x").by("age").cap("x").as("y").select("y"); } - @Override - public Traversal get_g_V_aggregateXlocal_aX_byXnameX_out_capXaX() { - return g.V().aggregate(Scope.local, "a").by("name").out().cap("a"); - } - - @Override - public Traversal get_g_VX1X_aggregateXlocal_aX_byXnameX_out_aggregateXlocal_aX_byXnameX_name_capXaX(final Object v1Id) { - return g.V(v1Id).aggregate(Scope.local, "a").by("name").out().aggregate(Scope.local, "a").by("name").values("name").cap("a"); - } - - @Override - public Traversal> get_g_withSideEffectXa_setX_V_both_name_aggregateXlocal_aX_capXaX() { - return g.withSideEffect("a", new HashSet()).V().both().values("name").aggregate(Scope.local, "a").cap("a"); - } - - @Override - public Traversal get_g_V_aggregateXlocal_aX_byXoutEXcreatedX_countX_out_out_aggregateXlocal_aX_byXinEXcreatedX_weight_sumX_capXaX() { - return g.V().aggregate(Scope.local, "a").by(outE("created").count()).out().out().aggregate(Scope.local, "a").by(inE("created").values("weight").sum()).cap("a"); - } } } diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SideEffectTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SideEffectTest.java index 236aa706a7e..660f0aad2b2 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SideEffectTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/SideEffectTest.java @@ -33,6 +33,7 @@ import java.util.HashSet; import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN; +import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.aggregate; /** * @author Marko A. Rodriguez (http://markorodriguez.com) @@ -45,7 +46,7 @@ public abstract class SideEffectTest extends AbstractGremlinProcessTest { public abstract Traversal get_g_V_valuesXnameX_sideEffectXidentity_substringX1XX(); - public abstract Traversal get_g_withSideEffectXx_setX_V_both_both_sideEffectXstoreXxX_byXnameXX_capXxX_unfold(); + public abstract Traversal get_g_withSideEffectXx_setX_V_both_both_sideEffectX_localX_aggregateXxX_byXnameXX_capXxX_unfold(); @Test @LoadGraphWith(MODERN) @@ -69,7 +70,7 @@ public void g_V_valuesXnameX_sideEffectXidentity_substringX1XX() { @LoadGraphWith(MODERN) @IgnoreEngine(TraversalEngine.Type.COMPUTER) public void g_withSideEffectXx_setX_V_both_both_sideEffectXstoreXxX_byXnameXX_capXxX_unfold() { - final Traversal traversal = get_g_withSideEffectXx_setX_V_both_both_sideEffectXstoreXxX_byXnameXX_capXxX_unfold(); + final Traversal traversal = get_g_withSideEffectXx_setX_V_both_both_sideEffectX_localX_aggregateXxX_byXnameXX_capXxX_unfold(); printTraversalForm(traversal); checkResults(Arrays.asList("josh", "peter", "ripple", "marko", "vadas", "lop"), traversal); checkSideEffects(traversal.asAdmin().getSideEffects(), "x", HashSet.class); @@ -88,8 +89,8 @@ public Traversal get_g_V_valuesXnameX_sideEffectXidentity_substr } @Override - public Traversal get_g_withSideEffectXx_setX_V_both_both_sideEffectXstoreXxX_byXnameXX_capXxX_unfold() { - return g.withSideEffect("x",new HashSet<>()).V().both().both().sideEffect(__.store("x").by("name")).cap("x").unfold(); + public Traversal get_g_withSideEffectXx_setX_V_both_both_sideEffectX_localX_aggregateXxX_byXnameXX_capXxX_unfold() { + return g.withSideEffect("x",new HashSet<>()).V().both().both().sideEffect(__.local(aggregate("x").by("name"))).cap("x").unfold(); } } diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/StoreTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/StoreTest.java deleted file mode 100644 index b49e6c176c8..00000000000 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/sideEffect/StoreTest.java +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect; - -import org.apache.tinkerpop.gremlin.LoadGraphWith; -import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest; -import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner; -import org.apache.tinkerpop.gremlin.process.traversal.Traversal; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.junit.Test; -import org.junit.runner.RunWith; - -import java.util.Collection; -import java.util.HashSet; -import java.util.Set; - -import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN; -import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.inE; -import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.outE; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertFalse; -import static org.junit.Assert.assertTrue; - -/** - * @author Marko A. Rodriguez (http://markorodriguez.com) - */ -@RunWith(GremlinProcessRunner.class) -public abstract class StoreTest extends AbstractGremlinProcessTest { - public abstract Traversal get_g_V_storeXaX_byXnameX_out_capXaX(); - - public abstract Traversal get_g_VX1X_storeXaX_byXnameX_out_storeXaX_byXnameX_name_capXaX(final Object v1Id); - - public abstract Traversal> get_g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX(); - - public abstract Traversal get_g_V_storeXaX_byXoutEXcreatedX_countX_out_out_storeXaX_byXinEXcreatedX_weight_sumX_capXaX(); - - @Test - @LoadGraphWith(MODERN) - public void g_V_storeXa_nameX_out_capXaX() { - final Traversal traversal = get_g_V_storeXaX_byXnameX_out_capXaX(); - printTraversalForm(traversal); - final Collection names = traversal.next(); - assertEquals(6, names.size()); - assertTrue(names.contains("marko")); - assertTrue(names.contains("josh")); - assertTrue(names.contains("peter")); - assertTrue(names.contains("lop")); - assertTrue(names.contains("ripple")); - assertTrue(names.contains("vadas")); - assertFalse(traversal.hasNext()); - } - - @Test - @LoadGraphWith(MODERN) - public void g_VX1X_storeXaX_byXnameX_out_storeXaX_byXnameX_name_capXaX() { - final Traversal traversal = get_g_VX1X_storeXaX_byXnameX_out_storeXaX_byXnameX_name_capXaX(convertToVertexId("marko")); - printTraversalForm(traversal); - final Collection names = traversal.next(); - assertEquals(4, names.size()); - assertTrue(names.contains("marko")); - assertTrue(names.contains("josh")); - assertTrue(names.contains("vadas")); - assertTrue(names.contains("lop")); - assertFalse(traversal.hasNext()); - } - - @Test - @LoadGraphWith(MODERN) - public void g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX() { - final Traversal> traversal = get_g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX(); - printTraversalForm(traversal); - final Set names = traversal.next(); - assertFalse(traversal.hasNext()); - assertEquals(6, names.size()); - assertTrue(names.contains("marko")); - assertTrue(names.contains("vadas")); - assertTrue(names.contains("josh")); - assertTrue(names.contains("lop")); - assertTrue(names.contains("ripple")); - assertTrue(names.contains("peter")); - } - - @Test - @LoadGraphWith(MODERN) - public void g_V_storeXaX_byXoutEXcreatedX_countX_out_out_storeXaX_byXinEXcreatedX_weight_sumX() { - final Traversal traversal = get_g_V_storeXaX_byXoutEXcreatedX_countX_out_out_storeXaX_byXinEXcreatedX_weight_sumX_capXaX(); - printTraversalForm(traversal); - assertTrue(traversal.hasNext()); - final Collection store = traversal.next(); - assertFalse(traversal.hasNext()); - assertEquals(8, store.size()); - assertTrue(store.contains(0L)); - assertTrue(store.contains(1L)); - assertTrue(store.contains(2L)); - assertTrue(store.contains(1.0d)); - assertFalse(store.isEmpty()); - } - - public static class Traversals extends StoreTest { - @Override - public Traversal get_g_V_storeXaX_byXnameX_out_capXaX() { - return g.V().store("a").by("name").out().cap("a"); - } - - @Override - public Traversal get_g_VX1X_storeXaX_byXnameX_out_storeXaX_byXnameX_name_capXaX(final Object v1Id) { - return g.V(v1Id).store("a").by("name").out().store("a").by("name").values("name").cap("a"); - } - - @Override - public Traversal> get_g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX() { - return g.withSideEffect("a", new HashSet()).V().both().values("name").store("a").cap("a"); - } - - @Override - public Traversal get_g_V_storeXaX_byXoutEXcreatedX_countX_out_out_storeXaX_byXinEXcreatedX_weight_sumX_capXaX() { - return g.V().store("a").by(outE("created").count()).out().out().store("a").by(inE("created").values("weight").sum()).cap("a"); - } - } -} diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/data/Short.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/data/Short.feature index cb8238b15df..9446cab2e1c 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/data/Short.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/data/Short.feature @@ -102,9 +102,9 @@ Feature: Data - SHORT Given the empty graph And the traversal of """ - g.inject(42).asNumber(GType.SHORT).is(P.typeOf(GType.SHORT)).store("a").cap("a") + g.inject(42).asNumber(GType.SHORT).is(P.typeOf(GType.SHORT)) """ - When iterated next + When iterated to list Then the result should be unordered | result | | d[42].s | diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Aggregate.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Aggregate.feature index 296c6f36b84..7b0db68d4f4 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Aggregate.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Aggregate.feature @@ -27,11 +27,11 @@ Feature: Step - aggregate() When iterated to list Then the traversal will raise an error with message containing text of "Aggregate step can only have one by modulator" - Scenario: g_V_aggregateXScope_local_xX_byXnameX_byXageX_capXxX + Scenario: g_V_localXaggregateXxX_byXnameXX_byXageX_capXxX Given the modern graph And the traversal of """ - g.V().aggregate(Scope.local, "x").by("name").by("age").cap("x") + g.V().local(aggregate("x").by("name").by("age")).cap("x") """ When iterated to list Then the traversal will raise an error with message containing text of "Aggregate step can only have one by modulator" diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/integrated/Recommendation.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/integrated/Recommendation.feature index bb91c948ea9..422187c647d 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/integrated/Recommendation.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/integrated/Recommendation.feature @@ -33,7 +33,7 @@ Feature: Step - recommendation order(). by(__.select("z"), Order.desc). by(__.select("y"), Order.asc). - limit(5).aggregate(Scope.local,"m").select("x") + limit(5).local(aggregate("m")).select("x") """ When iterated to list Then the result should be unordered @@ -59,7 +59,7 @@ Feature: Step - recommendation order(). by(__.select("z"), Order.desc). by(__.select("y"), Order.asc). - limit(5).aggregate(Scope.local,"m") + limit(5).local(aggregate("m")) """ When iterated to list Then the result should be unordered diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Select.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Select.feature index 948f6070e98..1b02b49c0b1 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Select.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Select.feature @@ -896,11 +896,11 @@ Feature: Step - select() | m[{"a":["a1","a1","b1"]}] | | m[{"a":["b1","a1","a1"]}] | - Scenario: g_V_asXlabelX_aggregateXlocal_xX_selectXxX_selectXlabelX + Scenario: g_V_asXlabelX_localXaggregateXxX_selectXxX_selectXlabelX Given the modern graph And the traversal of """ - g.V().as("label").aggregate(local,"x").barrier().select("x").select("label") + g.V().as("label").local(aggregate("x")).barrier().select("x").select("label") """ When iterated to list Then the result should be unordered diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Aggregate.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Aggregate.feature index 8f29804882d..68c310148e5 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Aggregate.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Aggregate.feature @@ -34,22 +34,6 @@ Feature: Step - aggregate() | vadas | | ripple | - Scenario: g_V_valueXnameX_aggregateXglobal_xX_capXxX - Given the modern graph - And the traversal of - """ - g.V().values("name").aggregate(Scope.global,"x").cap("x") - """ - When iterated next - Then the result should be unordered - | result | - | marko | - | josh | - | peter | - | lop | - | vadas | - | ripple | - Scenario: g_V_aggregateXxX_byXnameX_capXxX Given the modern graph And the traversal of @@ -110,11 +94,11 @@ Feature: Step - aggregate() | d[32].i | | d[35].i | - Scenario: g_V_aggregateXlocal_xX_byXageX_capXxX + Scenario: g_V_localXaggregateXxX_byXageXX_capXxX Given the modern graph And the traversal of """ - g.V().aggregate(Scope.local, "x").by("age").cap("x") + g.V().local(aggregate("x").by("age")).cap("x") """ When iterated next Then the result should be unordered @@ -125,11 +109,11 @@ Feature: Step - aggregate() | d[35].i | @WithProductiveByStrategy - Scenario: g_withStrategiesXProductiveByStrategyX_V_aggregateXlocal_xX_byXageX_capXxX + Scenario: g_withStrategiesXProductiveByStrategyX_V_localXaggregateXxX_byXageXX_capXxX Given the modern graph And the traversal of """ - g.withStrategies(ProductiveByStrategy).V().aggregate(Scope.local, "x").by("age").cap("x") + g.withStrategies(ProductiveByStrategy).V().local(aggregate("x").by("age")).cap("x") """ When iterated next Then the result should be unordered @@ -141,81 +125,80 @@ Feature: Step - aggregate() | null | | null | - Scenario: g_V_aggregateXlocal_a_nameX_out_capXaX + Scenario: g_V_localX_aggregateXa_byXnameXX_out_capXaX Given the modern graph And the traversal of """ - g.V().aggregate(Scope.local,"a").by("name").out().cap("a") + g.V().local(aggregate("a").by("name")).out().cap("a") """ When iterated next Then the result should be unordered - | result | - | marko | - | vadas | - | lop | - | josh | - | ripple | - | peter | + | result | + | marko | + | vadas | + | lop | + | josh | + | ripple | + | peter | - Scenario: g_VX1X_aggregateXlocal_aX_byXnameX_out_aggregateXlocal_aX_byXnameX_name_capXaX + Scenario: g_VX1X_localXaggregateXaX_byXnameXX_out_localXaggregateXaX_byXnameXX_name_capXaX Given the modern graph And using the parameter vid1 defined as "v[marko].id" And the traversal of """ - g.V(vid1).aggregate(Scope.local,"a").by("name").out().aggregate(Scope.local,"a").by("name").values("name").cap("a") + g.V(vid1).local(aggregate("a").by("name")).out().local(aggregate("a").by("name")).values("name").cap("a") """ When iterated next Then the result should be unordered - | result | - | marko | - | vadas | - | lop | - | josh | + | result | + | marko | + | vadas | + | lop | + | josh | - Scenario: g_withSideEffectXa_setX_V_both_name_aggregateXlocal_aX_capXaX + Scenario: g_withSideEffectXa_setX_V_both_name_localXaggregateX_aXX_capXaX Given the modern graph And using the side effect a defined as "s[]" And the traversal of """ - g.V().both().values("name").aggregate(Scope.local,"a").cap("a") + g.V().both().values("name").local(aggregate("a")).cap("a") """ When iterated to list Then the result should be unordered | result | | s[marko,vadas,lop,josh,ripple,peter] | - Scenario: g_withSideEffectXa_set_inlineX_V_both_name_aggregateXlocal_aX_capXaX + Scenario: g_withSideEffectXa_set_inlineX_V_both_name_localXaggregateXaXX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", {"alice"}).V().both().values("name").aggregate(local,"a").cap("a") + g.withSideEffect("a", {"alice"}).V().both().values("name").local(aggregate("a")).cap("a") """ When iterated to list Then the result should be unordered | result | | s[alice,marko,vadas,lop,josh,ripple,peter] | - Scenario: g_V_aggregateXlocal_aX_byXoutEXcreatedX_countX_out_out_aggregateXlocal_aX_byXinEXcreatedX_weight_sumX + Scenario: g_V_localXaggregateXaX_byXoutEXcreatedX_countXX_out_out_localXaggregateXaX_byXinEXcreatedX_weight_sumXX_capXaX Given the modern graph And the traversal of """ - g.V().aggregate(Scope.local,"a"). - by(__.outE("created").count()). - out().out().aggregate(Scope.local,"a"). - by(__.inE("created").values("weight").sum()). - cap("a") + g.V().local(aggregate("a").by(__.outE("created").count())). + out().out(). + local(aggregate("a").by(__.inE("created").values("weight").sum())). + cap("a") """ When iterated next Then the result should be unordered - | result | - | d[1].l | - | d[1].l | - | d[0].l | - | d[0].l | - | d[0].l | - | d[2].l | - | d[1.0].d | - | d[1.0].d | + | result | + | d[1].l | + | d[1].l | + | d[0].l | + | d[0].l | + | d[0].l | + | d[2].l | + | d[1.0].d | + | d[1.0].d | Scenario: g_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX Given the modern graph @@ -225,9 +208,9 @@ Feature: Step - aggregate() """ When iterated next Then the result should be unordered - | result | - | d[32].i | - | d[35].i | + | result | + | d[32].i | + | d[35].i | @WithProductiveByStrategy Scenario: g_withStrategiesXProductiveByStrategyX_V_aggregateXxX_byXvaluesXageX_isXgtX29XXX_capXxX @@ -238,13 +221,13 @@ Feature: Step - aggregate() """ When iterated next Then the result should be unordered - | result | - | d[32].i | - | d[35].i | - | null | - | null | - | null | - | null | + | result | + | d[32].i | + | d[35].i | + | null | + | null | + | null | + | null | @GraphComputerVerificationStarGraphExceeded Scenario: g_V_aggregateXxX_byXout_order_byXnameXX_capXxX @@ -255,10 +238,10 @@ Feature: Step - aggregate() """ When iterated next Then the result should be unordered - | result | - | v[josh] | - | v[lop] | - | v[lop] | + | result | + | v[josh] | + | v[lop] | + | v[lop] | @GraphComputerVerificationReferenceOnly @WithProductiveByStrategy Scenario: g_withStrategiesXProductiveByStrategyX_V_aggregateXxX_byXout_order_byXnameXX_capXxX @@ -269,13 +252,13 @@ Feature: Step - aggregate() """ When iterated next Then the result should be unordered - | result | - | v[josh] | - | v[lop] | - | v[lop] | - | null | - | null | - | null | + | result | + | v[josh] | + | v[lop] | + | v[lop] | + | null | + | null | + | null | Scenario: g_V_aggregateXaX_hasXperson_age_gteX30XXX_capXaX_unfold_valuesXnameX Given the modern graph @@ -285,13 +268,13 @@ Feature: Step - aggregate() """ When iterated to list Then the result should be unordered - | result | - | marko | - | josh | - | peter | - | lop | - | vadas | - | ripple | + | result | + | marko | + | josh | + | peter | + | lop | + | vadas | + | ripple | Scenario: g_withSideEffectXa_1_sumX_V_aggregateXaX_byXageX_capXaX Given the modern graph @@ -301,14 +284,14 @@ Feature: Step - aggregate() """ When iterated to list Then the result should be unordered - | result | - | d[124].i | + | result | + | d[124].i | - Scenario: g_withSideEffectXa_1_sumX_V_aggregateXlocal_aX_byXageX_capXaX + Scenario: g_withSideEffectXa_1_sumX_V_localXaggregateX_aX_byXageXX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", 1, Operator.sum).V().aggregate(Scope.local, "a").by("age").cap("a") + g.withSideEffect("a", 1, Operator.sum).V().local(aggregate("a").by("age")).cap("a") """ When iterated to list Then the result should be unordered @@ -324,15 +307,15 @@ Feature: Step - aggregate() """ When iterated to list Then the result should be unordered - | result | - | d[0].i | + | result | + | d[0].i | @GraphComputerVerificationStrategyNotSupported - Scenario: g_withSideEffectXa_123_minusX_V_aggregateXlocal_aX_byXageX_capXaX + Scenario: g_withSideEffectXa_123_minusX_V_localXaggregateX_aX_byXageXX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", 123, Operator.minus).V().aggregate(Scope.local, "a").by("age").cap("a") + g.withSideEffect("a", 123, Operator.minus).V().local(aggregate("a").by("age")).cap("a") """ When iterated to list Then the result should be unordered @@ -347,14 +330,14 @@ Feature: Step - aggregate() """ When iterated to list Then the result should be unordered - | result | - | d[1753920].i | + | result | + | d[1753920].i | - Scenario: g_withSideEffectXa_2_multX_V_aggregateXlocal_aX_byXageX_capXaX + Scenario: g_withSideEffectXa_2_multX_V_localXaggregateX_aX_byXageXX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", 2, Operator.mult).V().aggregate(Scope.local, "a").by("age").cap("a") + g.withSideEffect("a", 2, Operator.mult).V().local(aggregate("a").by("age")).cap("a") """ When iterated to list Then the result should be unordered @@ -370,15 +353,15 @@ Feature: Step - aggregate() """ When iterated to list Then the result should be unordered - | result | - | d[1].i | + | result | + | d[1].i | @GraphComputerVerificationStrategyNotSupported - Scenario: g_withSideEffectXa_876960_divX_V_aggregateXlocal_aX_byXageX_capXaX + Scenario: g_withSideEffectXa_876960_divX_V_localXaggregateX_aX_byXageXX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", 876960, Operator.div).V().aggregate(Scope.local, "a").by("age").cap("a") + g.withSideEffect("a", 876960, Operator.div).V().local(aggregate("a").by("age")).cap("a") """ When iterated to list Then the result should be unordered @@ -393,14 +376,14 @@ Feature: Step - aggregate() """ When iterated to list Then the result should be unordered - | result | - | d[1].i | + | result | + | d[1].i | - Scenario: g_withSideEffectXa_1_minX_V_aggregateXlocal_aX_byXageX_capXaX + Scenario: g_withSideEffectXa_1_minX_V_localXaggregateX_aX_byXageXX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", 1, Operator.min).V().aggregate(Scope.local, "a").by("age").cap("a") + g.withSideEffect("a", 1, Operator.min).V().local(aggregate("a").by("age")).cap("a") """ When iterated to list Then the result should be unordered @@ -415,14 +398,14 @@ Feature: Step - aggregate() """ When iterated to list Then the result should be unordered - | result | - | d[27].i | + | result | + | d[27].i | - Scenario: g_withSideEffectXa_100_minX_V_aggregateXlocal_aX_byXageX_capXaX + Scenario: g_withSideEffectXa_100_minX_V_localXaggregateX_aX_byXageXX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", 100, Operator.min).V().aggregate(Scope.local, "a").by("age").cap("a") + g.withSideEffect("a", 100, Operator.min).V().local(aggregate("a").by("age")).cap("a") """ When iterated to list Then the result should be unordered @@ -437,14 +420,14 @@ Feature: Step - aggregate() """ When iterated to list Then the result should be unordered - | result | - | d[35].i | + | result | + | d[35].i | - Scenario: g_withSideEffectXa_1_maxX_V_aggregateXlocal_aX_byXageX_capXaX + Scenario: g_withSideEffectXa_1_maxX_V_localXaggregateX_aX_byXageXX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", 1, Operator.max).V().aggregate(Scope.local, "a").by("age").cap("a") + g.withSideEffect("a", 1, Operator.max).V().local(aggregate("a").by("age")).cap("a") """ When iterated to list Then the result should be unordered @@ -459,14 +442,14 @@ Feature: Step - aggregate() """ When iterated to list Then the result should be unordered - | result | - | d[100].i | + | result | + | d[100].i | - Scenario: g_withSideEffectXa_100_maxX_V_aggregateXlocal_aX_byXageX_capXaX + Scenario: g_withSideEffectXa_100_maxX_V_localXaggregateX_aX_byXageX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", 100, Operator.max).V().aggregate(Scope.local, "a").by("age").cap("a") + g.withSideEffect("a", 100, Operator.max).V().local(aggregate("a").by("age")).cap("a") """ When iterated to list Then the result should be unordered @@ -484,11 +467,11 @@ Feature: Step - aggregate() | result | | false | - Scenario: g_withSideEffectXa_true_andX_V_constantXfalseX_aggregateXlocal_aX_capXaX + Scenario: g_withSideEffectXa_true_andX_V_constantXfalseX_localXaggregateX_aXX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", true, Operator.and).V().constant(false).aggregate(Scope.local, "a").cap("a") + g.withSideEffect("a", true, Operator.and).V().constant(false).local(aggregate("a")).cap("a") """ When iterated to list Then the result should be unordered @@ -506,11 +489,11 @@ Feature: Step - aggregate() | result | | true | - Scenario: g_withSideEffectXa_true_orX_V_constantXfalseX_aggregateXlocal_aX_capXaX + Scenario: g_withSideEffectXa_true_orX_V_constantXfalseX_localXaggregateX_aXX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", true, Operator.or).V().constant(false).aggregate(Scope.local, "a").cap("a") + g.withSideEffect("a", true, Operator.or).V().constant(false).local(aggregate("a")).cap("a") """ When iterated to list Then the result should be unordered @@ -525,20 +508,20 @@ Feature: Step - aggregate() """ When iterated next Then the result should be unordered - | result | - | d[1].i | - | d[2].i | - | d[3].i | - | d[29].i | - | d[27].i | - | d[32].i | - | d[35].i | + | result | + | d[1].i | + | d[2].i | + | d[3].i | + | d[29].i | + | d[27].i | + | d[32].i | + | d[35].i | - Scenario: g_withSideEffectXa_1_2_3_addAllX_V_aggregateXlocal_aX_byXageX_capXaX + Scenario: g_withSideEffectXa_1_2_3_addAllX_V_localXaggregateX_aX_byXageXX_capXaX Given the modern graph And the traversal of """ - g.withSideEffect("a", [1i,2i,3i], Operator.addAll).V().aggregate(Scope.local, "a").by("age").cap("a") + g.withSideEffect("a", [1i,2i,3i], Operator.addAll).V().local(aggregate("a").by("age")).cap("a") """ When iterated next Then the result should be unordered @@ -560,21 +543,199 @@ Feature: Step - aggregate() """ When iterated next Then the result should be unordered - | result | - | d[29].i | - | d[27].i | - | d[32].i | - | d[35].i | + | result | + | d[29].i | + | d[27].i | + | d[32].i | + | d[35].i | @GraphComputerVerificationInjectionNotSupported - Scenario: g_withSideEffectXa_1_2_3_assignX_V_order_byXageX_aggregateXlocal_aX_byXageX_capXaX + Scenario: g_withSideEffectXa_1_2_3_assignX_V_order_byXageX_localXaggregateX_aX_byXageXX_capXaX Given the modern graph And the traversal of # add order().by("age") to deterministically assign a vertex with the largest age value at the end """ - g.withSideEffect("a", [1i,2i,3i], Operator.assign).V().order().by("age").aggregate(Scope.local, "a").by("age").cap("a") + g.withSideEffect("a", [1i,2i,3i], Operator.assign).V().order().by("age").local(aggregate("a").by("age")).cap("a") """ When iterated next Then the result should be unordered | result | | d[35].i | + + Scenario: g_V_localXaggregateXa_nameXX_out_capXaX + Given the modern graph + And the traversal of + """ + g.V().local(aggregate("a").by("name")).out().cap("a") + """ + When iterated next + Then the result should be unordered + | result | + | marko | + | vadas | + | lop | + | josh | + | ripple | + | peter | + + Scenario: g_withSideEffectXa_setX_V_both_name_localXaggregateXaXX_capXaX + Given the modern graph + And using the side effect a defined as "s[]" + And the traversal of + """ + g.V().both().values("name").local(aggregate("a")).cap("a") + """ + When iterated to list + Then the result should be unordered + | result | + | s[marko,vadas,lop,josh,ripple,peter] | + + Scenario: g_V_localXaggregateXaXX_outE_inV_localXaggregateXaXX_capXaX_unfold_dedup + Given the modern graph + And the traversal of + """ + g.V().local(aggregate("a")).outE().inV().local(aggregate("a")).cap("a").unfold().dedup() + """ + When iterated to list + Then the result should be unordered + | result | + | v[marko] | + | v[vadas] | + | v[lop] | + | v[josh] | + | v[ripple] | + | v[peter] | + + Scenario: g_V_hasLabelXpersonX_localXaggregateXaXX_outXcreatedX_localXaggregateXaXX_capXaX + Given the modern graph + And the traversal of + """ + g.V().hasLabel("person").local(aggregate("a")).out("created").local(aggregate("a")).cap("a") + """ + When iterated next + Then the result should be unordered + | result | + | v[marko] | + | v[lop] | + | v[lop] | + | v[lop] | + | v[vadas] | + | v[ripple] | + | v[josh] | + | v[peter] | + + Scenario: g_V_localXaggregateXaXX_repeatXout_localXaggregateXaXXX_timesX2X_capXaX_unfold_groupCount + Given the modern graph + And the traversal of + """ + g.V().local(aggregate("a")).repeat(__.out().local(aggregate("a"))).times(2).cap("a").unfold().values("name").groupCount() + """ + When iterated to list + Then the result should be unordered + | result | + | m[{"marko":"d[1].l","lop":"d[5].l","vadas":"d[2].l","josh":"d[2].l","ripple":"d[3].l","peter":"d[1].l"}] | + + Scenario: g_V_hasXname_markoX_localXaggregateXaXX_outXknowsX_localXaggregateXaXX_outXcreatedX_localXaggregateXaXX_capXaX + Given the modern graph + And the traversal of + """ + g.V().has("name", "marko").local(aggregate("a")).out("knows").local(aggregate("a")).out("created").local(aggregate("a")).cap("a") + """ + When iterated next + Then the result should be unordered + | result | + | v[marko] | + | v[vadas] | + | v[josh] | + | v[lop] | + | v[ripple] | + + Scenario: g_V_hasLabelXsoftwareX_localXaggregateXaXX_inXcreatedX_localXaggregateXaXX_outXknowsX_localXaggregateXaXX_capXaX + Given the modern graph + And the traversal of + """ + g.V().hasLabel("software").local(aggregate("a")).in("created").local(aggregate("a")).out("knows").local(aggregate("a")).cap("a") + """ + When iterated next + Then the result should be unordered + | result | + | v[lop] | + | v[marko] | + | v[josh] | + | v[josh] | + | v[josh] | + | v[peter] | + | v[vadas] | + | v[ripple] | + + Scenario: g_V_localXaggregateXaXX_outE_hasXweight_lgtX0_5XX_inV_localXaggregateXaXX_capXaX_unfold_path + Given the modern graph + And the traversal of + """ + g.V().local(aggregate("a")).outE().has("weight", P.gt(0.5)).inV().local(aggregate("a")).cap("a").unfold().path() + """ + When iterated to list + Then the result should have a count of 8 + + Scenario: g_V_localXaggregateXaXX_bothE_sampleX1X_otherV_localXaggregateXaXX_capXaX_unfold_groupCount_byXlabelX + Given the modern graph + And the traversal of + """ + g.V().local(aggregate("a")).bothE().sample(1).otherV().local(aggregate("a")).cap("a").unfold().groupCount().by(T.label) + """ + When iterated to list + Then the result should have a count of 1 + + Scenario: g_V_hasLabelXpersonX_localXaggregateXaXX_outE_inV_simplePath_localXaggregateXaXX_capXaX_unfold_hasLabelXsoftwareX_count + Given the modern graph + And the traversal of + """ + g.V().hasLabel("person").local(aggregate("a")).outE().inV().simplePath().local(aggregate("a")).cap("a").unfold().hasLabel("software").count() + """ + When iterated to list + Then the result should be unordered + | result | + | d[4].l | + + Scenario: g_V_localXaggregateXaXX_unionXout_inX_localXaggregateXaXX_capXaX_unfold_dedup_valuesXnameX + Given the modern graph + And the traversal of + """ + g.V().local(aggregate("a")).union(__.out(), __.in()).local(aggregate("a")).cap("a").unfold().dedup().values("name") + """ + When iterated to list + Then the result should be unordered + | result | + | marko | + | vadas | + | lop | + | josh | + | ripple | + | peter | + + Scenario: g_V_hasXname_joshX_localXaggregateXaXX_outE_hasXweight_ltX1_0XX_inV_localXaggregateXaXX_outE_inV_localXaggregateXaXX_capXaX + Given the modern graph + And the traversal of + """ + g.V().has("name", "josh").local(aggregate("a")).outE().has("weight", P.lt(1.0)).inV().local(aggregate("a")).outE().inV().local(aggregate("a")).cap("a") + """ + When iterated next + Then the result should be unordered + | result | + | v[josh] | + | v[lop] | + + Scenario: g_V_hasLabelXpersonX_localXaggregateXaXX_outE_order_byXweightX_limitX1X_inV_localXaggregateXaXX_capXaX + Given the modern graph + And the traversal of + """ + g.V().hasLabel("person").local(aggregate("a")).outE().order().by("weight").limit(1).inV().local(aggregate("a")).cap("a") + """ + When iterated next + Then the result should be unordered + | result | + | v[marko] | + | v[vadas] | + | v[josh] | + | v[lop] | + | v[peter] | diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/SideEffect.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/SideEffect.feature index d68a4d35ca2..42b2faca8ad 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/SideEffect.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/SideEffect.feature @@ -76,11 +76,11 @@ Feature: Step - sideEffect() | result | | m[{"p":"d[1].i", "r":"d[1].i", "v":"d[1].i", "j":"d[1].i", "l":"d[1].i", "m":"d[1].i"}] | - Scenario: g_withSideEffectXx_setX_V_both_both_sideEffectXstoreXxX_byXnameXX_capXxX_unfold + Scenario: g_withSideEffectXx_setX_V_both_both_sideEffectXlocalXaggregateXxX_byXnameXX_capXxX_unfold Given the modern graph And the traversal of """ - g.withSideEffect("x",{}).V().both().both().sideEffect(__.store("x").by("name")).cap("x").unfold() + g.withSideEffect("x",{}).V().both().both().sideEffect(__.local(aggregate("x").by("name"))).cap("x").unfold() """ When iterated to list Then the result should be unordered diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Store.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Store.feature deleted file mode 100644 index 472826f9c5d..00000000000 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Store.feature +++ /dev/null @@ -1,95 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one -# or more contributor license agreements. See the NOTICE file -# distributed with this work for additional information -# regarding copyright ownership. The ASF licenses this file -# to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance -# with the License. You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, -# software distributed under the License is distributed on an -# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -# KIND, either express or implied. See the License for the -# specific language governing permissions and limitations -# under the License. - -@StepClassSideEffect @StepStore -Feature: Step - store() - - Scenario: g_V_storeXa_nameX_out_capXaX - Given the modern graph - And the traversal of - """ - g.V().store("a").by("name").out().cap("a") - """ - When iterated next - Then the result should be unordered - | result | - | marko | - | vadas | - | lop | - | josh | - | ripple | - | peter | - - Scenario: g_VX1X_storeXaX_byXnameX_out_storeXaX_byXnameX_name_capXaX - Given the modern graph - And using the parameter vid1 defined as "v[marko].id" - And the traversal of - """ - g.V(vid1).store("a").by("name").out().store("a").by("name").values("name").cap("a") - """ - When iterated next - Then the result should be unordered - | result | - | marko | - | vadas | - | lop | - | josh | - - Scenario: g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX - Given the modern graph - And using the side effect a defined as "s[]" - And the traversal of - """ - g.V().both().values("name").store("a").cap("a") - """ - When iterated to list - Then the result should be unordered - | result | - | s[marko,vadas,lop,josh,ripple,peter] | - - Scenario: g_withSideEffectXa_set_inlineX_V_both_name_storeXaX_capXaX - Given the modern graph - And the traversal of - """ - g.withSideEffect("a", {"alice"}).V().both().values("name").store("a").cap("a") - """ - When iterated to list - Then the result should be unordered - | result | - | s[alice,marko,vadas,lop,josh,ripple,peter] | - - Scenario: g_V_storeXaX_byXoutEXcreatedX_countX_out_out_storeXaX_byXinEXcreatedX_weight_sumX - Given the modern graph - And the traversal of - """ - g.V().store("a"). - by(__.outE("created").count()). - out().out().store("a"). - by(__.inE("created").values("weight").sum()). - cap("a") - """ - When iterated next - Then the result should be unordered - | result | - | d[1].l | - | d[1].l | - | d[0].l | - | d[0].l | - | d[0].l | - | d[2].l | - | d[1.0].d | - | d[1.0].d | \ No newline at end of file diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java index c0b0672c7e5..896a5d9b465 100644 --- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java +++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java @@ -72,7 +72,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.InjectTest; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SackTest; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectCapTest; -import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StoreTest; import org.junit.Test; import java.io.BufferedReader; @@ -169,7 +168,6 @@ public void shouldImplementAllProcessTestsAsFeatures() throws Exception { SackTest.class, SideEffectCapTest.class, //SideEffectTest.class, - StoreTest.class, WriteTest.class); // SubgraphTest.class, // TreeTest.class); diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/optimization/TinkerGraphCountStrategy.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/optimization/TinkerGraphCountStrategy.java index 1002bb520d8..af974c0534c 100644 --- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/optimization/TinkerGraphCountStrategy.java +++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/optimization/TinkerGraphCountStrategy.java @@ -26,7 +26,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.CountGlobalStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep; import org.apache.tinkerpop.gremlin.process.traversal.step.map.NoOpBarrierStep; -import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateGlobalStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateStep; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.IdentityStep; import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectStep; import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy; @@ -77,7 +77,7 @@ public void apply(final Traversal.Admin traversal) { if (!(current instanceof IdentityStep || current instanceof NoOpBarrierStep) || (current instanceof TraversalParent && - TraversalHelper.anyStepRecursively(s -> (s instanceof SideEffectStep || s instanceof AggregateGlobalStep), (TraversalParent) current))) + TraversalHelper.anyStepRecursively(s -> (s instanceof SideEffectStep || s instanceof AggregateStep), (TraversalParent) current))) return; } final Class elementClass = ((GraphStep) steps.get(0)).getReturnClass(); diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/AbstractTinkerGraphGraphSONTranslatorProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/AbstractTinkerGraphGraphSONTranslatorProvider.java index ab3041111e7..7c4df640b3f 100644 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/AbstractTinkerGraphGraphSONTranslatorProvider.java +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/AbstractTinkerGraphGraphSONTranslatorProvider.java @@ -125,18 +125,10 @@ public GraphTraversalSource traversal(final Graph graph) { test = "org.apache.tinkerpop.gremlin.process.traversal.step.OrderabilityTest", method = "g_inject_order_with_unknown_type", reason = "Remoting serializers only support known Gremlin types") - @Graph.OptOut( - test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.StoreTest", - method = "g_withSideEffectXa_setX_V_both_name_storeXaX_capXaX", - reason = "GraphSONv2 does not properly round trip Maps and Sets") @Graph.OptOut( test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.SideEffectTest", method = "g_withSideEffectXx_setX_V_both_both_sideEffectXstoreXxX_byXnameXX_capXxX_unfold", reason = "GraphSONv2 does not properly round trip Maps and Sets") - @Graph.OptOut( - test = "org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AggregateTest", - method = "g_withSideEffectXa_setX_V_both_name_aggregateXlocal_aX_capXaX", - reason = "GraphSONv2 does not properly round trip Maps and Sets") @Graph.OptOut( test = "org.apache.tinkerpop.gremlin.process.traversal.step.map.MergeEdgeTest", method = "*",