diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index ae9e0e91b8a..07f7679a449 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Removed Vertex/ReferenceVertex from grammar. Use vertex id in traversals now instead. * Modified mathematical operators to prevent overflows in steps such as `sum()` and 'sack()' to prefer promotion to the next highest number type. * Added `DateTime` ontop of the existing 'datetime' grammar. * Added UUID() + UUID(value) to grammar diff --git a/docs/src/upgrade/release-3.8.x.asciidoc b/docs/src/upgrade/release-3.8.x.asciidoc index c1de647afc6..e8ed68dee11 100644 --- a/docs/src/upgrade/release-3.8.x.asciidoc +++ b/docs/src/upgrade/release-3.8.x.asciidoc @@ -30,6 +30,38 @@ complete list of all the modifications that are part of this release. === Upgrading for Users +==== Removal of Vertex/ReferenceVertex from grammar + +`StructureVertex`, previously used to construct new vertices in the grammar, now been removed. The `V()` step, as well +as the `from()` and `to()` modulators used with `addE()`, previously accepted `StructureVertex` as arguments in the +grammar. In its place, the `from()` and `to()` modulators can now directly accept a vertex id in place of a `Vertex` +when used with `addE()` (`V()` has always accepted ids in addition to vertices). When using these steps in `gremlin-lang` +scripts, the vertex id must be used directly. This change has no effect on the `GraphTraversal` API, nor on +`gremlin-groovy` scripts. Vertices can continue to be used directly such places. + +[source,groovy] +---- +// 3.7.3 +gremlin> v1 = g.V(1).next() +==>v[1] +gremlin> v2 = g.V(2).next() +==>v[2] +gremlin> script = String.format("g.V(new Vertex(%s)).outE().where(inV().is(new Vertex(%s)))", v1.id(), v2.id()) +==>g.V(new Vertex(1)).outE().where(inV().is(new Vertex(2))) +gremlin> client.submit(script).all().get().get(0).getEdge() +==>e[7][1-knows->2] + +// 3.8.0 +gremlin> v1 = g.V(1).next() +==>v[1] +gremlin> v2 = g.V(2).next() +==>v[2] +gremlin> script = String.format("g.V(%s).outE().where(inV().id().is(%s))", v1.id(), v2.id()) +==>g.V(1).outE().where(inV().id().is(2)) +gremlin> client.submit(script).all().get().get(0).getEdge() +==>e[7][1-knows->2] +---- + ==== Auto promotion of number types Previously, operations like sum or sack that involved mathematical calculations did not automatically promote the result @@ -411,7 +443,6 @@ See: link:https://issues.apache.org/jira/browse/TINKERPOP-2974[TINKERPOP-2974] All of the following types in the grammar have been renamed to follow consistent rules: `genericLiteralArgument` -> `genericArgument` -`structureVertex` -> `structureVertexLiteral` `stringLiteralVarargsArgument` -> `stringNullableArgumentVarargs` `genericLiteralMapArgument` -> `genericMapArgument` `genericLiteralMapNullable` -> `genericMapNullableLiteral` diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/ArgumentVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/ArgumentVisitor.java index 178baf1ea86..6776586ee79 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/ArgumentVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/ArgumentVisitor.java @@ -79,13 +79,6 @@ public Object parseObject(final GremlinParser.GenericArgumentContext ctx) { return visitGenericArgument(ctx); } - /** - * Wrapper for visit function for {@link Vertex} types. - */ - public Vertex parseVertex(final GremlinParser.StructureVertexArgumentContext ctx) { - return (Vertex) visitStructureVertexArgument(ctx); - } - /** * Wrapper for visit function for {@code Map} types. */ @@ -184,15 +177,6 @@ public Object visitGenericArgument(final GremlinParser.GenericArgumentContext ct } } - @Override - public Object visitStructureVertexArgument(final GremlinParser.StructureVertexArgumentContext ctx) { - if (ctx.structureVertexLiteral() != null) { - return antlr.structureVisitor.visitStructureVertexLiteral(ctx.structureVertexLiteral()); - } else { - return visitVariable(ctx.variable()); - } - } - @Override public Object visitGenericMapArgument(final GremlinParser.GenericMapArgumentContext ctx) { if (ctx.genericMapLiteral() != null) { diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/DefaultGremlinBaseVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/DefaultGremlinBaseVisitor.java index cf3946e5506..37752152ff2 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/DefaultGremlinBaseVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/DefaultGremlinBaseVisitor.java @@ -414,7 +414,7 @@ protected void notImplemented(final ParseTree ctx) { /** * {@inheritDoc} */ - @Override public T visitTraversalMethod_from_Vertex(final GremlinParser.TraversalMethod_from_VertexContext ctx) { notImplemented(ctx); return null; } + @Override public T visitTraversalMethod_from_GenricArgument(GremlinParser.TraversalMethod_from_GenricArgumentContext ctx) { return null; } /** * {@inheritDoc} */ @@ -854,7 +854,7 @@ protected void notImplemented(final ParseTree ctx) { /** * {@inheritDoc} */ - @Override public T visitTraversalMethod_to_Vertex(final GremlinParser.TraversalMethod_to_VertexContext ctx) { notImplemented(ctx); return null; } + @Override public T visitTraversalMethod_to_GenricArgument(final GremlinParser.TraversalMethod_to_GenricArgumentContext ctx) { notImplemented(ctx); return null; } /** * {@inheritDoc} */ @@ -1367,10 +1367,6 @@ protected void notImplemented(final ParseTree ctx) { * {@inheritDoc} */ @Override public T visitIoOptionsStringConstant(final GremlinParser.IoOptionsStringConstantContext ctx) { notImplemented(ctx); return null; } - /** - * {@inheritDoc} - */ - @Override public T visitStructureVertexLiteral(final GremlinParser.StructureVertexLiteralContext ctx) { notImplemented(ctx); return null; } /** * {@inheritDoc} */ @@ -1687,8 +1683,4 @@ protected void notImplemented(final ParseTree ctx) { * {@inheritDoc} */ @Override public T visitNakedKey(final GremlinParser.NakedKeyContext ctx) { notImplemented(ctx); return null;} - /** - * {@inheritDoc} - */ - @Override public T visitStructureVertexArgument(final GremlinParser.StructureVertexArgumentContext ctx) { notImplemented(ctx); return null; } } \ No newline at end of file diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/GenericLiteralVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/GenericLiteralVisitor.java index 91cc91b7c5b..2556f6ee87c 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/GenericLiteralVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/GenericLiteralVisitor.java @@ -386,11 +386,6 @@ public Object visitNestedTraversal(final GremlinParser.NestedTraversalContext ct return antlr.tvisitor.visitNestedTraversal(ctx); } - @Override - public Object visitStructureVertexLiteral(final GremlinParser.StructureVertexLiteralContext ctx) { - return antlr.structureVisitor.visitStructureVertexLiteral(ctx); - } - /** * {@inheritDoc} */ diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/GremlinAntlrToJava.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/GremlinAntlrToJava.java index f77e0a80630..ab6dbccb0a5 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/GremlinAntlrToJava.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/GremlinAntlrToJava.java @@ -99,11 +99,6 @@ public class GremlinAntlrToJava extends DefaultGremlinBaseVisitor { */ final TraversalPredicateVisitor traversalPredicateVisitor; - /** - * Parses structure instances like {@link Vertex}. - */ - final StructureElementVisitor structureVisitor; - /** * Constructs a new instance and is bound to an {@link EmptyGraph}. This form of construction is helpful for * generating {@link Bytecode} or for various forms of testing. {@link Traversal} instances constructed from this @@ -196,7 +191,6 @@ protected GremlinAntlrToJava(final String traversalSourceName, final Graph graph this.txVisitor = new TraversalSourceTxVisitor(g, this); this.traversalPredicateVisitor = new TraversalPredicateVisitor(this); this.traversalStrategyVisitor = new TraversalStrategyVisitor(this); - this.structureVisitor = new StructureElementVisitor(this); this.genericVisitor = new GenericLiteralVisitor(this); this.argumentVisitor = new ArgumentVisitor(variableResolver, this); } diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/StructureElementVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/StructureElementVisitor.java deleted file mode 100644 index a6e90c998a6..00000000000 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/StructureElementVisitor.java +++ /dev/null @@ -1,38 +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.language.grammar; - -import org.apache.tinkerpop.gremlin.structure.Element; -import org.apache.tinkerpop.gremlin.structure.Vertex; -import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex; - -public class StructureElementVisitor extends GremlinBaseVisitor { - - protected final GremlinAntlrToJava antlr; - - public StructureElementVisitor(final GremlinAntlrToJava antlr) { - this.antlr = antlr; - } - - @Override - public Vertex visitStructureVertexLiteral(final GremlinParser.StructureVertexLiteralContext ctx) { - return new ReferenceVertex(antlr.argumentVisitor.visitGenericArgument(ctx.genericArgument()), - (String) antlr.argumentVisitor.visitStringArgument(ctx.stringArgument())); - } -} diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitor.java index 6a45f660ffd..872e0eb6e83 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/grammar/TraversalMethodVisitor.java @@ -1788,16 +1788,16 @@ public Traversal visitTraversalMethod_option_Predicate_Traversal(final GremlinPa * {@inheritDoc} */ @Override - public Traversal visitTraversalMethod_from_Vertex(final GremlinParser.TraversalMethod_from_VertexContext ctx) { - return graphTraversal.from(antlr.argumentVisitor.parseVertex(ctx.structureVertexArgument())); + public GraphTraversal visitTraversalMethod_from_GenricArgument(final GremlinParser.TraversalMethod_from_GenricArgumentContext ctx) { + return graphTraversal.from(antlr.argumentVisitor.visitGenericArgument(ctx.genericArgument())); } /** * {@inheritDoc} */ @Override - public Traversal visitTraversalMethod_to_Vertex(final GremlinParser.TraversalMethod_to_VertexContext ctx) { - return graphTraversal.to(antlr.argumentVisitor.parseVertex(ctx.structureVertexArgument())); + public Traversal visitTraversalMethod_to_GenricArgument(final GremlinParser.TraversalMethod_to_GenricArgumentContext ctx) { + return graphTraversal.to(antlr.argumentVisitor.visitGenericArgument(ctx.genericArgument())); } /** diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java index 899d07aba7c..c72df796fff 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GoTranslateVisitor.java @@ -199,16 +199,6 @@ public Void visitNullLiteral(final GremlinParser.NullLiteralContext ctx) { return null; } - @Override - public Void visitStructureVertexLiteral(final GremlinParser.StructureVertexLiteralContext ctx) { - sb.append(GO_PACKAGE_NAME).append("Vertex{Element{"); - visit(ctx.getChild(3)); // id - sb.append(", "); - visit(ctx.getChild(5)); // label - sb.append("}}"); - return null; - } - @Override public Void visitTraversalStrategy(final GremlinParser.TraversalStrategyContext ctx) { if (ctx.getChildCount() == 1) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java index ccf14027062..97e76358ead 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/GroovyTranslateVisitor.java @@ -45,18 +45,6 @@ public GroovyTranslateVisitor(final String graphTraversalSourceName) { super(graphTraversalSourceName); } - @Override - public Void visitStructureVertexLiteral(final GremlinParser.StructureVertexLiteralContext ctx) { - sb.append("new "); - sb.append(vertexClassName); - sb.append("("); - visit(ctx.getChild(3)); // id - sb.append(", "); - visit(ctx.getChild(5)); // label - sb.append(")"); - return null; - } - @Override public Void visitIntegerLiteral(final GremlinParser.IntegerLiteralContext ctx) { final String integerLiteral = ctx.getText().toLowerCase(); diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java index 6e256e5bbf0..81b6b25b840 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavaTranslateVisitor.java @@ -52,18 +52,6 @@ public JavaTranslateVisitor(final String graphTraversalSourceName) { super(graphTraversalSourceName); } - @Override - public Void visitStructureVertexLiteral(final GremlinParser.StructureVertexLiteralContext ctx) { - sb.append("new "); - sb.append(vertexClassName); - sb.append("("); - visit(ctx.getChild(3)); // id - sb.append(", "); - visit(ctx.getChild(5)); // label - sb.append(")"); - return null; - } - @Override public Void visitTraversalStrategy(final GremlinParser.TraversalStrategyContext ctx) { if (ctx.getChildCount() == 1) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavascriptTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavascriptTranslateVisitor.java index 2a13bc6f94a..23d2bf7d80d 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavascriptTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/JavascriptTranslateVisitor.java @@ -53,16 +53,6 @@ public JavascriptTranslateVisitor(String graphTraversalSourceName) { super(graphTraversalSourceName); } - @Override - public Void visitStructureVertexLiteral(final GremlinParser.StructureVertexLiteralContext ctx) { - sb.append("new Vertex("); - visit(ctx.getChild(3)); // id - sb.append(", "); - visit(ctx.getChild(5)); // label - sb.append(")"); - return null; - } - @Override public Void visitTraversalStrategy(final GremlinParser.TraversalStrategyContext ctx) { sb.append("new "); diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/PythonTranslateVisitor.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/PythonTranslateVisitor.java index 8211b16121f..971e61805be 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/PythonTranslateVisitor.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/language/translator/PythonTranslateVisitor.java @@ -61,16 +61,6 @@ public Void visitBooleanLiteral(final GremlinParser.BooleanLiteralContext ctx) { return null; } - @Override - public Void visitStructureVertexLiteral(final GremlinParser.StructureVertexLiteralContext ctx) { - sb.append("Vertex("); - visit(ctx.getChild(3)); // id - sb.append(", "); - visit(ctx.getChild(5)); // label - sb.append(")"); - return null; - } - @Override public Void visitTraversalStrategy(final GremlinParser.TraversalStrategyContext ctx) { if (ctx.getChildCount() == 1) diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java index 32b830c2521..041888cb22a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java @@ -1292,7 +1292,7 @@ public default GraphTraversal from(final String fromStepLabel) { * @see Reference Documentation - From Step * @since 3.1.0-incubating */ - public default GraphTraversal to(final Traversal toVertex) { + public default GraphTraversal to(final Traversal toVertex) { final Step prev = this.asAdmin().getEndStep(); if (!(prev instanceof FromToModulating)) throw new IllegalArgumentException(String.format( @@ -1312,7 +1312,7 @@ public default GraphTraversal to(final Traversal toVertex) { * @see Reference Documentation - From Step * @since 3.1.0-incubating */ - public default GraphTraversal from(final Traversal fromVertex) { + public default GraphTraversal from(final Traversal fromVertex) { final Step prev = this.asAdmin().getEndStep(); if (!(prev instanceof FromToModulating)) throw new IllegalArgumentException(String.format( @@ -1332,7 +1332,13 @@ public default GraphTraversal from(final Traversal fromVertex) * @see Reference Documentation - From Step * @since 3.3.0 */ - public default GraphTraversal to(final Vertex toVertex) { + public default GraphTraversal to(final Object toVertex) { + if (toVertex instanceof String) { + return this.to((String) toVertex); + } else if (toVertex instanceof Traversal) { + this.to((Traversal)toVertex); + return this; + } final Step prev = this.asAdmin().getEndStep(); if (!(prev instanceof FromToModulating)) throw new IllegalArgumentException(String.format( @@ -1352,7 +1358,13 @@ public default GraphTraversal to(final Vertex toVertex) { * @see Reference Documentation - From Step * @since 3.3.0 */ - public default GraphTraversal from(final Vertex fromVertex) { + public default GraphTraversal from(final Object fromVertex) { + if (fromVertex instanceof String) { + return this.from((String) fromVertex); + } else if (fromVertex instanceof Traversal) { + this.from((Traversal)fromVertex); + return this; + } final Step prev = this.asAdmin().getEndStep(); if (!(prev instanceof FromToModulating)) throw new IllegalArgumentException(String.format( diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStartStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStartStep.java index 95907e9c7a1..8eb8bccbed7 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStartStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStartStep.java @@ -41,6 +41,7 @@ import org.apache.tinkerpop.gremlin.structure.util.Attachable; import org.apache.tinkerpop.gremlin.structure.util.StringFactory; import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph; +import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex; import java.util.List; import java.util.Set; @@ -110,27 +111,45 @@ protected Traverser.Admin processNextStart() { final String edgeLabel = (String) this.parameters.get(traverser, T.label, () -> Edge.DEFAULT_LABEL).get(0); // FROM/TO must be set and must be vertices - final Object theTo = this.parameters.get(traverser, TO, () -> null).get(0); - if (!(theTo instanceof Vertex)) + Object theTo = this.parameters.get(traverser, TO, () -> null).get(0); + if (theTo != null && !(theTo instanceof Vertex)) { + theTo = new ReferenceVertex(theTo); + } + + if (theTo == null) throw new IllegalStateException(String.format( - "The value given to addE(%s).to() must resolve to a Vertex but %s was specified instead", edgeLabel, - null == theTo ? "null" : theTo.getClass().getSimpleName())); + "The value given to addE(%s).to() must resolve to a Vertex or the ID of a Vertex present in the graph, but null was specified instead", edgeLabel)); - final Object theFrom = this.parameters.get(traverser, FROM, () -> null).get(0); - if (!(theFrom instanceof Vertex)) + Object theFrom = this.parameters.get(traverser, FROM, () -> null).get(0); + if (theFrom != null && !(theFrom instanceof Vertex)) { + theFrom = new ReferenceVertex(theFrom); + } + if (theFrom == null) throw new IllegalStateException(String.format( - "The value given to addE(%s).from() must resolve to a Vertex but %s was specified instead", edgeLabel, - null == theFrom ? "null" : theFrom.getClass().getSimpleName())); + "The value given to addE(%s).from() must resolve to a Vertex or the ID of a Vertex present in the graph, but null was specified instead", edgeLabel)); Vertex toVertex = (Vertex) theTo; Vertex fromVertex = (Vertex) theFrom; - if (toVertex instanceof Attachable) - toVertex = ((Attachable) toVertex) - .attach(Attachable.Method.get(this.getTraversal().getGraph().orElse(EmptyGraph.instance()))); - if (fromVertex instanceof Attachable) - fromVertex = ((Attachable) fromVertex) - .attach(Attachable.Method.get(this.getTraversal().getGraph().orElse(EmptyGraph.instance()))); + try { + if (toVertex instanceof Attachable) + toVertex = ((Attachable) toVertex) + .attach(Attachable.Method.get(this.getTraversal().getGraph().orElse(EmptyGraph.instance()))); + } + catch (IllegalArgumentException e) { + throw new IllegalStateException(String.format( + "The value given to addE(%s).to() must resolve to a Vertex or the ID of a Vertex present in the graph. The provided value does not match any vertices in the graph", edgeLabel)); + } + + try { + if (fromVertex instanceof Attachable) + fromVertex = ((Attachable) fromVertex) + .attach(Attachable.Method.get(this.getTraversal().getGraph().orElse(EmptyGraph.instance()))); + } + catch (IllegalArgumentException e) { + throw new IllegalStateException(String.format( + "The value given to addE(%s).from() must resolve to a Vertex or the ID of a Vertex present in the graph. The provided value does not match any vertices in the graph", edgeLabel)); + } final Edge edge = fromVertex.addEdge(edgeLabel, toVertex, this.parameters.getKeyValues(traverser, TO, FROM, T.label)); EventUtil.registerEdgeCreation(callbackRegistry, getTraversal(), edge); diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java index f5f72807641..dd3b61bbb76 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/AddEdgeStep.java @@ -37,6 +37,7 @@ import org.apache.tinkerpop.gremlin.structure.util.Attachable; import org.apache.tinkerpop.gremlin.structure.util.StringFactory; import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph; +import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex; import java.util.List; import java.util.Set; @@ -98,43 +99,61 @@ public void addFrom(final Traversal.Admin fromObject) { protected Edge map(final Traverser.Admin traverser) { final String edgeLabel = this.parameters.get(traverser, T.label, () -> Edge.DEFAULT_LABEL).get(0); - final Object theTo; + Object theTo; try { theTo = this.parameters.get(traverser, TO, traverser::get).get(0); + if (theTo != null && !(theTo instanceof Vertex)) { + theTo = new ReferenceVertex(theTo); + } } catch (IllegalArgumentException e) { // as thrown by TraversalUtil.apply() throw new IllegalStateException(String.format( "addE(%s) failed because the to() traversal (which should give a Vertex) failed with: %s", edgeLabel, e.getMessage())); } - if (!(theTo instanceof Vertex)) + if (theTo == null) throw new IllegalStateException(String.format( - "The value given to addE(%s).to() must resolve to a Vertex but %s was specified instead", edgeLabel, - null == theTo ? "null" : theTo.getClass().getSimpleName())); + "The value given to addE(%s).to() must resolve to a Vertex or the ID of a Vertex present in the graph, but null was specified instead", edgeLabel)); - final Object theFrom; + Object theFrom; try { theFrom = this.parameters.get(traverser, FROM, traverser::get).get(0); + if (theFrom != null && !(theFrom instanceof Vertex)) { + theFrom = new ReferenceVertex(theFrom); + } } catch (IllegalArgumentException e) { // as thrown by TraversalUtil.apply() throw new IllegalStateException(String.format( "addE(%s) failed because the from() traversal (which should give a Vertex) failed with: %s", edgeLabel, e.getMessage())); } - if (!(theFrom instanceof Vertex)) + if (theFrom == null) throw new IllegalStateException(String.format( - "The value given to addE(%s).to() must resolve to a Vertex but %s was specified instead", edgeLabel, - null == theFrom ? "null" : theFrom.getClass().getSimpleName())); + "The value given to addE(%s).from() must resolve to a Vertex or the ID of a Vertex present in the graph, but null was specified instead", edgeLabel)); Vertex toVertex = (Vertex) theTo; Vertex fromVertex = (Vertex) theFrom; - if (toVertex instanceof Attachable) - toVertex = ((Attachable) toVertex) - .attach(Attachable.Method.get(this.getTraversal().getGraph().orElse(EmptyGraph.instance()))); - if (fromVertex instanceof Attachable) - fromVertex = ((Attachable) fromVertex) - .attach(Attachable.Method.get(this.getTraversal().getGraph().orElse(EmptyGraph.instance()))); + try { + if (toVertex instanceof Attachable) + toVertex = ((Attachable) toVertex) + .attach(Attachable.Method.get(this.getTraversal().getGraph().orElse(EmptyGraph.instance()))); + } + catch (IllegalArgumentException e) { + throw new IllegalStateException(String.format( + "The value given to addE(%s).to() must resolve to a Vertex or the ID of a Vertex present in the graph. The provided value does not match any vertices in the graph", edgeLabel)); + } + + try { + if (fromVertex instanceof Attachable) + fromVertex = ((Attachable) fromVertex) + .attach(Attachable.Method.get(this.getTraversal().getGraph().orElse(EmptyGraph.instance()))); + } + catch (IllegalArgumentException e) { + throw new IllegalStateException(String.format( + "The value given to addE(%s).from() must resolve to a Vertex or the ID of a Vertex present in the graph. The provided value does not match any vertices in the graph", edgeLabel)); + } + final Edge edge = fromVertex.addEdge(edgeLabel, toVertex, this.parameters.getKeyValues(traverser, TO, FROM, T.label)); EventUtil.registerEdgeCreation(callbackRegistry, getTraversal(), edge); diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/ArgumentVisitorTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/ArgumentVisitorTest.java index 46d67961cb4..a37110d564b 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/ArgumentVisitorTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/ArgumentVisitorTest.java @@ -112,9 +112,6 @@ public static Iterable generateTestParameters() { {Object.class, "x", now, createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", now)))}, {Object.class, "[1,2,3]", Arrays.asList(1, 2, 3), createAntlr(VariableResolver.NoVariableResolver.instance())}, {Object.class, "x", P.eq(100), createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", P.eq(100))))}, - {Vertex.class, "x", new VariableResolverException("x"), createAntlr(VariableResolver.NoVariableResolver.instance())}, - {Vertex.class, "new Vertex(1i,'person')", new ReferenceVertex(1, "person"), createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", Direction.from)))}, - {Vertex.class, "x", new ReferenceVertex(1, "person"), createAntlr(new VariableResolver.DefaultVariableResolver(ElementHelper.asMap("x", new ReferenceVertex(1, "person"))))}, }); } @@ -157,11 +154,6 @@ public void shouldParse() { final GremlinParser.GenericArgumentVarargsContext ctx = parser.genericArgumentVarargs(); return antlrToLanguage.argumentVisitor.parseObjectVarargs(ctx); }); - } else if (clazz.equals(Vertex.class)) { - assertParsing(() -> { - final GremlinParser.StructureVertexArgumentContext ctx = parser.structureVertexArgument(); - return antlrToLanguage.argumentVisitor.parseVertex(ctx); - }); } else { fail("Missing an assertion type: " + clazz.getSimpleName()); } diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/StructureElementVisitorTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/StructureElementVisitorTest.java deleted file mode 100644 index ca3dff70f60..00000000000 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/grammar/StructureElementVisitorTest.java +++ /dev/null @@ -1,48 +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.language.grammar; - -import org.antlr.v4.runtime.CharStreams; -import org.antlr.v4.runtime.CommonTokenStream; -import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource; -import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph; -import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceVertex; -import org.junit.Test; - -import static org.junit.Assert.assertEquals; - -public class StructureElementVisitorTest { - - private static final GraphTraversalSource g = EmptyGraph.instance().traversal(); - - @Test - public void shouldParseVertex() { - assertEquals(g.addE("knows").from(new ReferenceVertex(2, "person")), eval("g.addE('knows').from(new Vertex(2, 'person'))")); - assertEquals(g.addE("knows").to(new ReferenceVertex("1", "person")), eval("g.addE('knows').to(new Vertex('1', 'person'))")); - assertEquals(g.addE("knows").from(new ReferenceVertex(2, "person")), eval("g.addE('knows').from(new ReferenceVertex(2, 'person'))")); - assertEquals(g.addE("knows").to(new ReferenceVertex("1", "person")), eval("g.addE('knows').to(new ReferenceVertex('1', 'person'))")); - } - - private static Object eval(final String query) { - final GremlinLexer lexer = new GremlinLexer(CharStreams.fromString(query)); - final GremlinParser parser = new GremlinParser(new CommonTokenStream(lexer)); - final GremlinAntlrToJava antlrToLanguage = new GremlinAntlrToJava(); - return antlrToLanguage.visit(parser.queryList()); - } -} diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/translator/GremlinTranslatorTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/translator/GremlinTranslatorTest.java index f84b671eb0a..746a0cd711d 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/translator/GremlinTranslatorTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/language/translator/GremlinTranslatorTest.java @@ -947,15 +947,6 @@ public static Collection data() { "g.V().has(\"name\", \"foo\").property(new LinkedHashMap() {{ put(\"name\", Cardinality.set(\"bar\")); put(\"age\", 43); }})", "g.V().has(\"name\", \"foo\").property(new Map([[\"name\", CardinalityValue.set(\"bar\")], [\"age\", 43]]))", "g.V().has('name', 'foo').property({ 'name': CardinalityValue.set_('bar'), 'age': 43 })"}, - {"g.V(new Vertex(1, \"person\")).limit(1)", - null, - "g.V(new Vertex(number0, string0)).limit(number0)", - "g.V(new Vertex(1, \"person\")).Limit(1)", - "g.V(gremlingo.Vertex{Element{1, \"person\"}}).Limit(1)", - "g.V(new ReferenceVertex(1, \"person\")).limit(1)", - "g.V(new ReferenceVertex(1, \"person\")).limit(1)", - "g.V(new Vertex(1, \"person\")).limit(1)", - "g.V(Vertex(1, 'person')).limit(1)",}, {"g.V().both().properties().dedup().hasKey(\"age\").value()", null, "g.V().both().properties().dedup().hasKey(string0).value()", diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs index 8adff6b8193..ef645da7516 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs @@ -862,6 +862,15 @@ public GraphTraversal Format(string format) return Wrap(this); } + /// + /// Adds the from step to this . + /// + public GraphTraversal From (object? fromStepVertexIdOrLabel) + { + Bytecode.AddStep("from", fromStepVertexIdOrLabel); + return Wrap(this); + } + /// /// Adds the from step to this . /// @@ -2193,6 +2202,15 @@ public GraphTraversal To (Direction? direction, params string?[] Bytecode.AddStep("to", args.ToArray()); return Wrap(this); } + + /// + /// Adds the to step to this . + /// + public GraphTraversal To (object? toStepVertexIdOrLabel) + { + Bytecode.AddStep("to", toStepVertexIdOrLabel); + return Wrap(this); + } /// /// Adds the to step to this . diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs index c7b67628f83..5908c0d966c 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/Gremlin.cs @@ -120,13 +120,13 @@ private static IDictionary, ITraversal>> {(g,p) =>g.V().Times(5)}}, {"g_unionXX", new List, ITraversal>> {(g,p) =>g.Union()}}, {"g_unionXV_name", new List, ITraversal>> {(g,p) =>g.Union(__.V().Values("name"))}}, - {"g_unionXVXv1X_VX4XX_name", new List, ITraversal>> {(g,p) =>g.Union(__.V((Vertex) p["v1"]), __.V((Vertex) p["v4"])).Values("name")}}, + {"g_unionXVXv1X_VX4XX_name", new List, ITraversal>> {(g,p) =>g.Union(__.V(p["vid1"]), __.V(p["vid4"])).Values("name")}}, {"g_unionXV_hasLabelXsoftwareX_V_hasLabelXpersonXX_name", new List, ITraversal>> {(g,p) =>g.Union(__.V().HasLabel("software"), __.V().HasLabel("person")).Values("name")}}, {"g_unionXV_out_out_V_hasLabelXsoftwareXX_path", new List, ITraversal>> {(g,p) =>g.Union(__.V().Out().Out(), __.V().HasLabel("software")).Path()}}, {"g_unionXV_out_out_V_hasLabelXsoftwareXX_path_byXnameX", new List, ITraversal>> {(g,p) =>g.Union(__.V().Out().Out(), __.V().HasLabel("software")).Path().By("name")}}, {"g_unionXunionXV_out_outX_V_hasLabelXsoftwareXX_path_byXnameX", new List, ITraversal>> {(g,p) =>g.Union(__.Union(__.V().Out().Out()), __.V().HasLabel("software")).Path().By("name")}}, {"g_unionXinjectX1X_injectX2X", new List, ITraversal>> {(g,p) =>g.Union(__.Inject(1), __.Inject(2))}}, - {"g_V_unionXconstantX1X_constantX2X_constantX3XX", new List, ITraversal>> {(g,p) =>g.V((Vertex) p["v2"]).Union(__.Constant(p["xx1"]), __.Constant(p["xx2"]), __.Constant(p["xx3"]))}}, + {"g_V_unionXconstantX1X_constantX2X_constantX3XX", new List, ITraversal>> {(g,p) =>g.V(p["vid2"]).Union(__.Constant(p["xx1"]), __.Constant(p["xx2"]), __.Constant(p["xx3"]))}}, {"g_V_unionXout__inX_name", new List, ITraversal>> {(g,p) =>g.V().Union(__.Out(), __.In()).Values("name")}}, {"g_VX1X_unionXrepeatXoutX_timesX2X__outX_name", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Union(__.Repeat(__.Out()).Times(2), __.Out()).Values("name")}}, {"g_V_chooseXlabel_is_person__unionX__out_lang__out_nameX__in_labelX", new List, ITraversal>> {(g,p) =>g.V().Choose(__.Label().Is("person"), __.Union(__.Out().Values("lang"), __.Out().Values("name")), __.In().Label())}}, @@ -228,9 +228,9 @@ private static IDictionary, ITraversal>> {(g,p) =>g.V().Has(T.Label, __.Is("software"))}}, {"g_VX1X_hasXage_gt_30X", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Has("age", P.Gt(30))}}, {"g_VX4X_hasXage_gt_30X", new List, ITraversal>> {(g,p) =>g.V(p["vid4"]).Has("age", P.Gt(30))}}, - {"g_VXv1X_hasXage_gt_30X", new List, ITraversal>> {(g,p) =>g.V((Vertex) p["v1"]).Has("age", P.Gt(30))}}, - {"g_VXv4X_hasXage_gt_30X", new List, ITraversal>> {(g,p) =>g.V((Vertex) p["v4"]).Has("age", P.Gt(30))}}, - {"g_VX1X_out_hasXid_2X", new List, ITraversal>> {(g,p) =>g.V((Vertex) p["v2"]).Has("age", P.Gt(30))}}, + {"g_VXv1X_hasXage_gt_30X", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Has("age", P.Gt(30))}}, + {"g_VXv4X_hasXage_gt_30X", new List, ITraversal>> {(g,p) =>g.V(p["vid4"]).Has("age", P.Gt(30))}}, + {"g_VX1X_out_hasXid_2X", new List, ITraversal>> {(g,p) =>g.V(p["vid2"]).Has("age", P.Gt(30))}}, {"g_V_hasXblahX", new List, ITraversal>> {(g,p) =>g.V().Has("blah")}}, {"g_V_hasXperson_name_markoX_age", new List, ITraversal>> {(g,p) =>g.V().Has("person", "name", "marko").Values("age")}}, {"g_VX1X_outE_hasXweight_inside_0_06X_inV", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).OutE().Has("weight", P.Inside(0.0, 0.6)).InV()}}, @@ -385,7 +385,7 @@ private static IDictionary, ITraversal>> {(g,p) =>g.V(p["vid1"]).As("a").Out("created").In("created").Where(P.Eq("a")).Values("name")}}, {"g_VX1X_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_name", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).As("a").Out("created").In("created").Where(P.Neq("a")).Values("name")}}, {"g_VX1X_out_aggregateXxX_out_whereXnotXwithinXaXXX", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Out().Aggregate("x").Out().Where(P.Not(P.Within("x")))}}, - {"g_withSideEffectXa_g_VX2XX_VX1X_out_whereXneqXaXX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", (Vertex) p["v2"]).V(p["vid1"]).Out().Where(P.Neq("a"))}}, + {"g_withSideEffectXa_g_VX2XX_VX1X_out_whereXneqXaXX", new List, ITraversal>> {(g,p) =>g.WithSideEffect("a", p["vid2"]).V(p["vid1"]).Out().Where(__.Id().Where(P.Neq("a")))}}, {"g_VX1X_repeatXbothEXcreatedX_whereXwithoutXeXX_aggregateXeX_otherVX_emit_path", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Repeat(__.BothE("created").Where(P.Without("e")).Aggregate("e").OtherV()).Emit().Path()}}, {"g_V_whereXnotXoutXcreatedXXX_name", new List, ITraversal>> {(g,p) =>g.V().Where(__.Not(__.Out("created"))).Values("name")}}, {"g_V_asXaX_out_asXbX_whereXandXasXaX_outXknowsX_asXbX__orXasXbX_outXcreatedX_hasXname_rippleX__asXbX_inXknowsX_count_isXnotXeqX0XXXXX_selectXa_bX", new List, ITraversal>> {(g,p) =>g.V().As("a").Out().As("b").Where(__.And(__.As("a").Out("knows").As("b"), __.Or(__.As("b").Out("created").Has("name", "ripple"), __.As("b").In("knows").Count().Is(P.Not(P.Eq(0)))))).Select("a", "b")}}, @@ -579,12 +579,12 @@ private static IDictionary, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.V().Aggregate("x").As("a").Select("x").Unfold().AddE("existsWith").To("a").Property("time", "now"), (g,p) =>g.E(), (g,p) =>g.V(p["vid1"]).BothE(), (g,p) =>g.V(p["vid1"]).InE("existsWith"), (g,p) =>g.V(p["vid1"]).OutE("existsWith"), (g,p) =>g.V(p["vid1"]).BothE("existsWith").Has("time", "now"), (g,p) =>g.V(p["vid2"]).BothE(), (g,p) =>g.V(p["vid2"]).InE("existsWith"), (g,p) =>g.V(p["vid2"]).OutE("existsWith"), (g,p) =>g.V(p["vid2"]).BothE("existsWith").Has("time", "now"), (g,p) =>g.V(p["vid3"]).BothE(), (g,p) =>g.V(p["vid3"]).InE("existsWith"), (g,p) =>g.V(p["vid3"]).OutE("existsWith"), (g,p) =>g.V(p["vid3"]).BothE("existsWith").Has("time", "now"), (g,p) =>g.V(p["vid4"]).BothE(), (g,p) =>g.V(p["vid4"]).InE("existsWith"), (g,p) =>g.V(p["vid4"]).OutE("existsWith"), (g,p) =>g.V(p["vid4"]).BothE("existsWith").Has("time", "now"), (g,p) =>g.V(p["vid5"]).BothE(), (g,p) =>g.V(p["vid5"]).InE("existsWith"), (g,p) =>g.V(p["vid5"]).OutE("existsWith"), (g,p) =>g.V(p["vid5"]).BothE("existsWith").Has("time", "now"), (g,p) =>g.V(p["vid6"]).BothE(), (g,p) =>g.V(p["vid6"]).InE("existsWith"), (g,p) =>g.V(p["vid6"]).OutE("existsWith"), (g,p) =>g.V(p["vid6"]).BothE("existsWith").Has("time", "now")}}, {"g_V_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_asXbX_addEXcodeveloperX_fromXaX_toXbX_propertyXyear_2009X", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.V().As("a").Out("created").In("created").Where(P.Neq("a")).As("b").AddE("codeveloper").From("a").To("b").Property("year", 2009), (g,p) =>g.E(), (g,p) =>g.V(p["vid1"]).BothE(), (g,p) =>g.V(p["vid1"]).InE("codeveloper"), (g,p) =>g.V(p["vid1"]).OutE("codeveloper"), (g,p) =>g.V(p["vid1"]).BothE("codeveloper").Has("year", 2009), (g,p) =>g.V(p["vid2"]).BothE(), (g,p) =>g.V(p["vid4"]).BothE(), (g,p) =>g.V(p["vid4"]).InE("codeveloper"), (g,p) =>g.V(p["vid4"]).OutE("codeveloper"), (g,p) =>g.V(p["vid4"]).BothE("codeveloper").Has("year", 2009), (g,p) =>g.V(p["vid6"]).BothE(), (g,p) =>g.V(p["vid6"]).InE("codeveloper"), (g,p) =>g.V(p["vid6"]).OutE("codeveloper"), (g,p) =>g.V(p["vid6"]).BothE("codeveloper").Has("year", 2009)}}, {"g_V_asXaX_inXcreatedX_addEXcreatedByX_fromXaX_propertyXyear_2009X_propertyXacl_publicX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.V().As("a").In("created").AddE("createdBy").From("a").Property("year", 2009).Property("acl", "public"), (g,p) =>g.E(), (g,p) =>g.V(p["vid1"]).BothE(), (g,p) =>g.V(p["vid1"]).InE("createdBy"), (g,p) =>g.V(p["vid1"]).OutE("createdBy"), (g,p) =>g.V(p["vid1"]).BothE("createdBy").Has("year", 2009).Has("acl", "public"), (g,p) =>g.V(p["vid2"]).BothE(), (g,p) =>g.V(p["vid3"]).BothE(), (g,p) =>g.V(p["vid3"]).InE("createdBy"), (g,p) =>g.V(p["vid3"]).OutE("createdBy"), (g,p) =>g.V(p["vid3"]).BothE("createdBy").Has("year", 2009).Has("acl", "public"), (g,p) =>g.V(p["vid4"]).BothE(), (g,p) =>g.V(p["vid4"]).InE("createdBy"), (g,p) =>g.V(p["vid4"]).OutE("createdBy"), (g,p) =>g.V(p["vid4"]).BothE("createdBy").Has("year", 2009).Has("acl", "public"), (g,p) =>g.V(p["vid5"]).BothE(), (g,p) =>g.V(p["vid5"]).InE("createdBy"), (g,p) =>g.V(p["vid5"]).OutE("createdBy"), (g,p) =>g.V(p["vid5"]).BothE("createdBy").Has("year", 2009).Has("acl", "public"), (g,p) =>g.V(p["vid6"]).BothE(), (g,p) =>g.V(p["vid6"]).InE("createdBy"), (g,p) =>g.V(p["vid6"]).OutE("createdBy"), (g,p) =>g.V(p["vid6"]).BothE("createdBy").Has("year", 2009).Has("acl", "public")}}, - {"g_withSideEffectXb_bX_VXaX_addEXknowsX_toXbX_propertyXweight_0_5X", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.WithSideEffect("b", (Vertex) p["v6"]).V((Vertex) p["v1"]).AddE("knows").To("b").Property("weight", 0.5d), (g,p) =>g.E(), (g,p) =>g.V((Vertex) p["v1"]).BothE(), (g,p) =>g.V((Vertex) p["v1"]).InE("knows"), (g,p) =>g.V((Vertex) p["v1"]).OutE("knows"), (g,p) =>g.V((Vertex) p["v1"]).BothE("knows").Has("weight", 0.5), (g,p) =>g.V((Vertex) p["v6"]).BothE(), (g,p) =>g.V((Vertex) p["v6"]).InE("knows"), (g,p) =>g.V((Vertex) p["v6"]).OutE("knows"), (g,p) =>g.V((Vertex) p["v6"]).BothE("knows").Has("weight", 0.5)}}, + {"g_withSideEffectXb_bX_VXaX_addEXknowsX_toXbX_propertyXweight_0_5X", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.WithSideEffect("b", p["vid6"]).V(p["vid1"]).AddE("knows").To("b").Property("weight", 0.5d), (g,p) =>g.E(), (g,p) =>g.V(p["vid1"]).BothE(), (g,p) =>g.V(p["vid1"]).InE("knows"), (g,p) =>g.V(p["vid1"]).OutE("knows"), (g,p) =>g.V(p["vid1"]).BothE("knows").Has("weight", 0.5), (g,p) =>g.V(p["vid6"]).BothE(), (g,p) =>g.V(p["vid6"]).InE("knows"), (g,p) =>g.V(p["vid6"]).OutE("knows"), (g,p) =>g.V(p["vid6"]).BothE("knows").Has("weight", 0.5)}}, {"g_addV_asXfirstX_repeatXaddEXnextX_toXaddVX_inVX_timesX5X_addEXnextX_toXselectXfirstXX", new List, ITraversal>> {(g,p) =>g.AddV().As("first").Repeat(__.AddE("next").To(__.AddV()).InV()).Times(5).AddE("next").To(__.Select("first")), (g,p) =>g.V(), (g,p) =>g.E(), (g,p) =>g.E().HasLabel("next"), (g,p) =>g.V().Limit(1).BothE(), (g,p) =>g.V().Limit(1).InE(), (g,p) =>g.V().Limit(1).OutE()}}, - {"g_V_hasXname_markoX_asXaX_outEXcreatedX_asXbX_inV_addEXselectXbX_labelX_toXaX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.V().Has("name", "marko").As("a").OutE("created").As("b").InV().AddE(__.Select("b").Label()).To("a"), (g,p) =>g.E(), (g,p) =>g.V((Vertex) p["v1"]).BothE(), (g,p) =>g.V((Vertex) p["v1"]).InE("created"), (g,p) =>g.V((Vertex) p["v1"]).In("created").Has("name", "lop"), (g,p) =>g.V((Vertex) p["v1"]).OutE("created")}}, - {"g_addEXV_outE_label_groupCount_orderXlocalX_byXvalues_descX_selectXkeysX_unfold_limitX1XX_fromXV_hasXname_vadasXX_toXV_hasXname_lopXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.AddE(__.V().OutE().Label().GroupCount().Order(Scope.Local).By(Column.Values, Order.Desc).Select(Column.Keys).Unfold().Limit(1)).From(__.V().Has("name", "vadas")).To(__.V().Has("name", "lop")), (g,p) =>g.E(), (g,p) =>g.V((Vertex) p["v2"]).BothE(), (g,p) =>g.V((Vertex) p["v2"]).InE("knows"), (g,p) =>g.V((Vertex) p["v2"]).OutE("created"), (g,p) =>g.V((Vertex) p["v2"]).Out("created").Has("name", "lop")}}, - {"g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.AddE("knows").From((Vertex) p["v1"]).To((Vertex) p["v6"]).Property("weight", p["xx1"]), (g,p) =>g.E(), (g,p) =>g.V((Vertex) p["v1"]).OutE("knows"), (g,p) =>g.V((Vertex) p["v1"]).Out("knows").Has("name", "peter")}}, - {"g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.V((Vertex) p["v1"]).AddE("knows").To((Vertex) p["v6"]).Property("weight", p["xx1"]), (g,p) =>g.E(), (g,p) =>g.V((Vertex) p["v1"]).OutE("knows"), (g,p) =>g.V((Vertex) p["v1"]).Out("knows").Has("name", "peter")}}, + {"g_V_hasXname_markoX_asXaX_outEXcreatedX_asXbX_inV_addEXselectXbX_labelX_toXaX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.V().Has("name", "marko").As("a").OutE("created").As("b").InV().AddE(__.Select("b").Label()).To("a"), (g,p) =>g.E(), (g,p) =>g.V(p["vid1"]).BothE(), (g,p) =>g.V(p["vid1"]).InE("created"), (g,p) =>g.V(p["vid1"]).In("created").Has("name", "lop"), (g,p) =>g.V(p["vid1"]).OutE("created")}}, + {"g_addEXV_outE_label_groupCount_orderXlocalX_byXvalues_descX_selectXkeysX_unfold_limitX1XX_fromXV_hasXname_vadasXX_toXV_hasXname_lopXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.AddE(__.V().OutE().Label().GroupCount().Order(Scope.Local).By(Column.Values, Order.Desc).Select(Column.Keys).Unfold().Limit(1)).From(__.V().Has("name", "vadas")).To(__.V().Has("name", "lop")), (g,p) =>g.E(), (g,p) =>g.V(p["vid2"]).BothE(), (g,p) =>g.V(p["vid2"]).InE("knows"), (g,p) =>g.V(p["vid2"]).OutE("created"), (g,p) =>g.V(p["vid2"]).Out("created").Has("name", "lop")}}, + {"g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.AddE("knows").From(p["vid1"]).To(p["vid6"]).Property("weight", p["xx1"]), (g,p) =>g.E(), (g,p) =>g.V(p["vid1"]).OutE("knows"), (g,p) =>g.V(p["vid1"]).Out("knows").Has("name", "peter")}}, + {"g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.V(p["vid1"]).AddE("knows").To(p["vid6"]).Property("weight", p["xx1"]), (g,p) =>g.E(), (g,p) =>g.V(p["vid1"]).OutE("knows"), (g,p) =>g.V(p["vid1"]).Out("knows").Has("name", "peter")}}, {"g_addEXknowsXpropertyXweight_nullXfromXV_hasXname_markoXX_toXV_hasXname_vadasXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).AddV("person").Property("name", "vadas").Property("age", 27), (g,p) =>g.AddE("knows").Property("weight", null).From(__.V().Has("name", "marko")).To(__.V().Has("name", "vadas")), (g,p) =>g.E().Has("knows", "weight", (object) null)}}, {"g_VX1X_addVXanimalX_propertyXage_selectXaX_byXageXX_propertyXname_puppyX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.V(p["vid1"]).As("a").AddV("animal").Property("age", __.Select("a").By("age")).Property("name", "puppy"), (g,p) =>g.V().Has("animal", "age", 29)}}, {"g_V_addVXanimalX_propertyXage_0X", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5d).AddE("knows").From("marko").To("josh").Property("weight", 1.0d).AddE("created").From("marko").To("lop").Property("weight", 0.4d).AddE("created").From("josh").To("ripple").Property("weight", 1.0d).AddE("created").From("josh").To("lop").Property("weight", 0.4d).AddE("created").From("peter").To("lop").Property("weight", 0.2d), (g,p) =>g.V().AddV("animal").Property("age", 0), (g,p) =>g.V().Has("animal", "age", 0)}}, @@ -788,13 +788,13 @@ private static IDictionary, ITraversal>> {(g,p) =>g.V().E(p["xx1"])}}, {"g_injectX1X_EX11_nullX", new List, ITraversal>> {(g,p) =>g.Inject(1).E(p["eid11"], null)}}, {"g_injectX1X_coalesceXEX_hasLabelXtestsX_addEXtestsX_from_V_hasXnameX_XjoshXX_toXV_hasXnameX_XvadasXXX", new List, ITraversal>> {(g,p) =>g.AddV("person").Property("name", "josh").AddV("person").Property("name", "vadas"), (g,p) =>g.Inject(1).Coalesce(__.E().HasLabel("tests"), __.AddE("tests").From(__.V().Has("name", "josh")).To(__.V().Has("name", "vadas"))), (g,p) =>g.E().HasLabel("tests")}}, - {"g_VX1X_properties_element", new List, ITraversal>> {(g,p) =>g.V((Vertex) p["v2"]).Properties().Element().Limit(1)}}, + {"g_VX1X_properties_element", new List, ITraversal>> {(g,p) =>g.V(p["vid2"]).Properties().Element().Limit(1)}}, {"g_V_properties_element", new List, ITraversal>> {(g,p) =>g.V().Properties().Element()}}, {"g_V_propertiesXageX_element", new List, ITraversal>> {(g,p) =>g.V().Properties("age").Element()}}, {"g_EX_properties_element", new List, ITraversal>> {(g,p) =>g.E(p["eid11"]).Properties().Element().Limit(1)}}, {"g_E_properties_element", new List, ITraversal>> {(g,p) =>g.E().Properties().Element()}}, - {"g_VXv7_properties_properties_element_element", new List, ITraversal>> {(g,p) =>g.V((Vertex) p["v7"]).Properties().Properties().Element().Element().Limit(1)}}, - {"g_V_properties_properties_element_element", new List, ITraversal>> {(g,p) =>g.V((Vertex) p["v7"]).Properties().Properties().Element().Element()}}, + {"g_VXv7_properties_properties_element_element", new List, ITraversal>> {(g,p) =>g.V(p["vid7"]).Properties().Properties().Element().Element().Limit(1)}}, + {"g_V_properties_properties_element_element", new List, ITraversal>> {(g,p) =>g.V(p["vid7"]).Properties().Properties().Element().Element()}}, {"g_V_elementMap", new List, ITraversal>> {(g,p) =>g.V().ElementMap()}}, {"g_V_elementMapXname_ageX", new List, ITraversal>> {(g,p) =>g.V().ElementMap("name", "age")}}, {"g_EX11X_elementMap", new List, ITraversal>> {(g,p) =>g.E(p["eid11"]).ElementMap()}}, @@ -906,7 +906,7 @@ private static IDictionary, ITraversal>> {(g,p) =>g.V().Project("a", "b", "c").By(__.BothE().Values("weight").Sum()).By(__.BothE().Count()).By("name").Order().By(__.Math("a / b"), Order.Desc).Select("c")}}, {"g_V_mathXit_plus_itXbyXageX", new List, ITraversal>> {(g,p) =>g.V().Math("_+_").By("age")}}, {"g_V_valueMap_mathXit_plus_itXbyXselectXageX_unfoldXX", new List, ITraversal>> {(g,p) =>g.V().ValueMap().Math("_+_").By(__.Select("age").Unfold())}}, - {"g_VX1X_outE_asXexpectedWeightX_mathXexpectedWeightPlusOneXbyXweightX", new List, ITraversal>> {(g,p) =>g.V((Vertex) p["v1"]).OutE().As("expectedWeight").Math("expectedWeight + 1").By("weight")}}, + {"g_VX1X_outE_asXexpectedWeightX_mathXexpectedWeightPlusOneXbyXweightX", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).OutE().As("expectedWeight").Math("expectedWeight + 1").By("weight")}}, {"g_V_age_max", new List, ITraversal>> {(g,p) =>g.V().Values("age").Max()}}, {"g_V_foo_max", new List, ITraversal>> {(g,p) =>g.V().Values("foo").Max()}}, {"g_V_name_max", new List, ITraversal>> {(g,p) =>g.V().Values("name").Max()}}, @@ -1378,7 +1378,7 @@ private static IDictionary, ITraversal>> {(g,p) =>g.V(p["xx1"]).Values("name")}}, {"g_VXlistXv1_v2_v3XX_name", new List, ITraversal>> {(g,p) =>g.V(p["xx1"]).Values("name")}}, {"g_V", new List, ITraversal>> {(g,p) =>g.V()}}, - {"g_VXv1X_out", new List, ITraversal>> {(g,p) =>g.V((Vertex) p["v1"]).Out()}}, + {"g_VXv1X_out", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Out()}}, {"g_VX1X_out", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Out()}}, {"g_VX2X_in", new List, ITraversal>> {(g,p) =>g.V(p["vid2"]).In()}}, {"g_VX4X_both", new List, ITraversal>> {(g,p) =>g.V(p["vid4"]).Both()}}, @@ -1618,9 +1618,7 @@ private static IDictionary, ITraversal>> {(g,p) =>g.V().Has("person", "name", "marko").Both("knows").GroupCount().By(__.Values("name").Fold())}}, {"g_V_outXcreatedX_groupCount_byXnameX_byXageX", new List, ITraversal>> {(g,p) =>g.V().Out("created").GroupCount().By("name").By("age")}}, {"g_V_outXcreatedX_groupCountXxX_byXnameX_byXageX", new List, ITraversal>> {(g,p) =>g.V().Out("created").GroupCount("x").By("name").By("age")}}, - {"g_VX1X_out_injectXv2X_name", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Out().Inject((Vertex) p["v2"]).Values("name")}}, {"g_VX1X_out_name_injectXdanielX_asXaX_mapXlengthX_path", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Out().Values("name").Inject("daniel").As("a").Map(__.Length()).Path()}}, - {"g_VX1X_injectXg_VX4XX_out_name", new List, ITraversal>> {(g,p) =>g.V(p["vid1"]).Inject((Vertex) p["v2"]).Out().Values("name")}}, {"g_injectXnull_1_3_nullX", new List, ITraversal>> {(g,p) =>g.Inject(null, 1, 3, null)}}, {"g_injectX10_20_null_20_10_10X_groupCountXxX_dedup_asXyX_projectXa_bX_by_byXselectXxX_selectXselectXyXXX", new List, ITraversal>> {(g,p) =>g.Inject(10, 20, null, 20, 10, 10).GroupCount("x").Dedup().As("y").Project("a", "b").By().By(__.Select("x").Select(__.Select("y")))}}, {"g_injectXname_marko_age_nullX_selectXname_ageX", new List, ITraversal>> {(g,p) =>g.Inject(p["xx1"]).Select("name", "age")}}, diff --git a/gremlin-go/driver/cucumber/gremlin.go b/gremlin-go/driver/cucumber/gremlin.go index 57534a17c37..1574cb18df0 100644 --- a/gremlin-go/driver/cucumber/gremlin.go +++ b/gremlin-go/driver/cucumber/gremlin.go @@ -90,13 +90,13 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_V_timesX5X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Times(5)}}, "g_unionXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union()}}, "g_unionXV_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union(gremlingo.T__.V().Values("name"))}}, - "g_unionXVXv1X_VX4XX_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union(gremlingo.T__.V(p["v1"]), gremlingo.T__.V(p["v4"])).Values("name")}}, + "g_unionXVXv1X_VX4XX_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union(gremlingo.T__.V(p["vid1"]), gremlingo.T__.V(p["vid4"])).Values("name")}}, "g_unionXV_hasLabelXsoftwareX_V_hasLabelXpersonXX_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union(gremlingo.T__.V().HasLabel("software"), gremlingo.T__.V().HasLabel("person")).Values("name")}}, "g_unionXV_out_out_V_hasLabelXsoftwareXX_path": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union(gremlingo.T__.V().Out().Out(), gremlingo.T__.V().HasLabel("software")).Path()}}, "g_unionXV_out_out_V_hasLabelXsoftwareXX_path_byXnameX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union(gremlingo.T__.V().Out().Out(), gremlingo.T__.V().HasLabel("software")).Path().By("name")}}, "g_unionXunionXV_out_outX_V_hasLabelXsoftwareXX_path_byXnameX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union(gremlingo.T__.Union(gremlingo.T__.V().Out().Out()), gremlingo.T__.V().HasLabel("software")).Path().By("name")}}, "g_unionXinjectX1X_injectX2X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Union(gremlingo.T__.Inject(1), gremlingo.T__.Inject(2))}}, - "g_V_unionXconstantX1X_constantX2X_constantX3XX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v2"]).Union(gremlingo.T__.Constant(p["xx1"]), gremlingo.T__.Constant(p["xx2"]), gremlingo.T__.Constant(p["xx3"]))}}, + "g_V_unionXconstantX1X_constantX2X_constantX3XX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).Union(gremlingo.T__.Constant(p["xx1"]), gremlingo.T__.Constant(p["xx2"]), gremlingo.T__.Constant(p["xx3"]))}}, "g_V_unionXout__inX_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Union(gremlingo.T__.Out(), gremlingo.T__.In()).Values("name")}}, "g_VX1X_unionXrepeatXoutX_timesX2X__outX_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Union(gremlingo.T__.Repeat(gremlingo.T__.Out()).Times(2), gremlingo.T__.Out()).Values("name")}}, "g_V_chooseXlabel_is_person__unionX__out_lang__out_nameX__in_labelX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Choose(gremlingo.T__.Label().Is("person"), gremlingo.T__.Union(gremlingo.T__.Out().Values("lang"), gremlingo.T__.Out().Values("name")), gremlingo.T__.In().Label())}}, @@ -198,9 +198,9 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_V_hasXlabel_isXsoftwareXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has(gremlingo.T.Label, gremlingo.T__.Is("software"))}}, "g_VX1X_hasXage_gt_30X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Has("age", gremlingo.P.Gt(30))}}, "g_VX4X_hasXage_gt_30X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).Has("age", gremlingo.P.Gt(30))}}, - "g_VXv1X_hasXage_gt_30X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).Has("age", gremlingo.P.Gt(30))}}, - "g_VXv4X_hasXage_gt_30X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v4"]).Has("age", gremlingo.P.Gt(30))}}, - "g_VX1X_out_hasXid_2X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v2"]).Has("age", gremlingo.P.Gt(30))}}, + "g_VXv1X_hasXage_gt_30X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Has("age", gremlingo.P.Gt(30))}}, + "g_VXv4X_hasXage_gt_30X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).Has("age", gremlingo.P.Gt(30))}}, + "g_VX1X_out_hasXid_2X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).Has("age", gremlingo.P.Gt(30))}}, "g_V_hasXblahX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("blah")}}, "g_V_hasXperson_name_markoX_age": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("person", "name", "marko").Values("age")}}, "g_VX1X_outE_hasXweight_inside_0_06X_inV": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).OutE().Has("weight", gremlingo.P.Inside(0.0, 0.6)).InV()}}, @@ -355,7 +355,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_VX1X_asXaX_outXcreatedX_inXcreatedX_whereXeqXaXX_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).As("a").Out("created").In("created").Where(gremlingo.P.Eq("a")).Values("name")}}, "g_VX1X_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).As("a").Out("created").In("created").Where(gremlingo.P.Neq("a")).Values("name")}}, "g_VX1X_out_aggregateXxX_out_whereXnotXwithinXaXXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Out().Aggregate("x").Out().Where(gremlingo.P.Not(gremlingo.P.Within("x")))}}, - "g_withSideEffectXa_g_VX2XX_VX1X_out_whereXneqXaXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", p["v2"]).V(p["vid1"]).Out().Where(gremlingo.P.Neq("a"))}}, + "g_withSideEffectXa_g_VX2XX_VX1X_out_whereXneqXaXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("a", p["vid2"]).V(p["vid1"]).Out().Where(gremlingo.T__.Id().Where(gremlingo.P.Neq("a")))}}, "g_VX1X_repeatXbothEXcreatedX_whereXwithoutXeXX_aggregateXeX_otherVX_emit_path": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Repeat(gremlingo.T__.BothE("created").Where(gremlingo.P.Without("e")).Aggregate("e").OtherV()).Emit().Path()}}, "g_V_whereXnotXoutXcreatedXXX_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Where(gremlingo.T__.Not(gremlingo.T__.Out("created"))).Values("name")}}, "g_V_asXaX_out_asXbX_whereXandXasXaX_outXknowsX_asXbX__orXasXbX_outXcreatedX_hasXname_rippleX__asXbX_inXknowsX_count_isXnotXeqX0XXXXX_selectXa_bX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").Out().As("b").Where(gremlingo.T__.And(gremlingo.T__.As("a").Out("knows").As("b"), gremlingo.T__.Or(gremlingo.T__.As("b").Out("created").Has("name", "ripple"), gremlingo.T__.As("b").In("knows").Count().Is(gremlingo.P.Not(gremlingo.P.Eq(0)))))).Select("a", "b")}}, @@ -549,12 +549,12 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_V_aggregateXxX_asXaX_selectXxX_unfold_addEXexistsWithX_toXaX_propertyXtime_nowX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Aggregate("x").As("a").Select("x").Unfold().AddE("existsWith").To("a").Property("time", "now")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).InE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).OutE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).BothE("existsWith").Has("time", "now")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).InE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).OutE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).BothE("existsWith").Has("time", "now")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid3"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid3"]).InE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid3"]).OutE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid3"]).BothE("existsWith").Has("time", "now")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).InE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).OutE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).BothE("existsWith").Has("time", "now")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid5"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid5"]).InE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid5"]).OutE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid5"]).BothE("existsWith").Has("time", "now")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).InE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).OutE("existsWith")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).BothE("existsWith").Has("time", "now")}}, "g_V_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_asXbX_addEXcodeveloperX_fromXaX_toXbX_propertyXyear_2009X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").Out("created").In("created").Where(gremlingo.P.Neq("a")).As("b").AddE("codeveloper").From("a").To("b").Property("year", 2009)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).InE("codeveloper")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).OutE("codeveloper")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).BothE("codeveloper").Has("year", 2009)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).InE("codeveloper")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).OutE("codeveloper")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).BothE("codeveloper").Has("year", 2009)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).InE("codeveloper")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).OutE("codeveloper")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).BothE("codeveloper").Has("year", 2009)}}, "g_V_asXaX_inXcreatedX_addEXcreatedByX_fromXaX_propertyXyear_2009X_propertyXacl_publicX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().As("a").In("created").AddE("createdBy").From("a").Property("year", 2009).Property("acl", "public")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).InE("createdBy")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).OutE("createdBy")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).BothE("createdBy").Has("year", 2009).Has("acl", "public")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid3"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid3"]).InE("createdBy")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid3"]).OutE("createdBy")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid3"]).BothE("createdBy").Has("year", 2009).Has("acl", "public")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).InE("createdBy")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).OutE("createdBy")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).BothE("createdBy").Has("year", 2009).Has("acl", "public")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid5"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid5"]).InE("createdBy")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid5"]).OutE("createdBy")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid5"]).BothE("createdBy").Has("year", 2009).Has("acl", "public")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).InE("createdBy")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).OutE("createdBy")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).BothE("createdBy").Has("year", 2009).Has("acl", "public")}}, - "g_withSideEffectXb_bX_VXaX_addEXknowsX_toXbX_propertyXweight_0_5X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("b", p["v6"]).V(p["v1"]).AddE("knows").To("b").Property("weight", 0.5)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).InE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).OutE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).BothE("knows").Has("weight", 0.5)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v6"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v6"]).InE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v6"]).OutE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v6"]).BothE("knows").Has("weight", 0.5)}}, + "g_withSideEffectXb_bX_VXaX_addEXknowsX_toXbX_propertyXweight_0_5X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.WithSideEffect("b", p["vid6"]).V(p["vid1"]).AddE("knows").To("b").Property("weight", 0.5)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).InE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).OutE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).BothE("knows").Has("weight", 0.5)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).InE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).OutE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid6"]).BothE("knows").Has("weight", 0.5)}}, "g_addV_asXfirstX_repeatXaddEXnextX_toXaddVX_inVX_timesX5X_addEXnextX_toXselectXfirstXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV().As("first").Repeat(gremlingo.T__.AddE("next").To(gremlingo.T__.AddV()).InV()).Times(5).AddE("next").To(gremlingo.T__.Select("first"))}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E().HasLabel("next")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Limit(1).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Limit(1).InE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Limit(1).OutE()}}, - "g_V_hasXname_markoX_asXaX_outEXcreatedX_asXbX_inV_addEXselectXbX_labelX_toXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("name", "marko").As("a").OutE("created").As("b").InV().AddE(gremlingo.T__.Select("b").Label()).To("a")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).InE("created")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).In("created").Has("name", "lop")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).OutE("created")}}, - "g_addEXV_outE_label_groupCount_orderXlocalX_byXvalues_descX_selectXkeysX_unfold_limitX1XX_fromXV_hasXname_vadasXX_toXV_hasXname_lopXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddE(gremlingo.T__.V().OutE().Label().GroupCount().Order(gremlingo.Scope.Local).By(gremlingo.Column.Values, gremlingo.Order.Desc).Select(gremlingo.Column.Keys).Unfold().Limit(1)).From(gremlingo.T__.V().Has("name", "vadas")).To(gremlingo.T__.V().Has("name", "lop"))}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v2"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v2"]).InE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v2"]).OutE("created")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v2"]).Out("created").Has("name", "lop")}}, - "g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddE("knows").From(p["v1"]).To(p["v6"]).Property("weight", p["xx1"])}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).OutE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).Out("knows").Has("name", "peter")}}, - "g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).AddE("knows").To(p["v6"]).Property("weight", p["xx1"])}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).OutE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).Out("knows").Has("name", "peter")}}, + "g_V_hasXname_markoX_asXaX_outEXcreatedX_asXbX_inV_addEXselectXbX_labelX_toXaX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("name", "marko").As("a").OutE("created").As("b").InV().AddE(gremlingo.T__.Select("b").Label()).To("a")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).InE("created")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).In("created").Has("name", "lop")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).OutE("created")}}, + "g_addEXV_outE_label_groupCount_orderXlocalX_byXvalues_descX_selectXkeysX_unfold_limitX1XX_fromXV_hasXname_vadasXX_toXV_hasXname_lopXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddE(gremlingo.T__.V().OutE().Label().GroupCount().Order(gremlingo.Scope.Local).By(gremlingo.Column.Values, gremlingo.Order.Desc).Select(gremlingo.Column.Keys).Unfold().Limit(1)).From(gremlingo.T__.V().Has("name", "vadas")).To(gremlingo.T__.V().Has("name", "lop"))}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).BothE()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).InE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).OutE("created")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).Out("created").Has("name", "lop")}}, + "g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddE("knows").From(p["vid1"]).To(p["vid6"]).Property("weight", p["xx1"])}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).OutE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Out("knows").Has("name", "peter")}}, + "g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).AddE("knows").To(p["vid6"]).Property("weight", p["xx1"])}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E()}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).OutE("knows")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Out("knows").Has("name", "peter")}}, "g_addEXknowsXpropertyXweight_nullXfromXV_hasXname_markoXX_toXV_hasXname_vadasXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).AddV("person").Property("name", "vadas").Property("age", 27)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddE("knows").Property("weight", nil).From(gremlingo.T__.V().Has("name", "marko")).To(gremlingo.T__.V().Has("name", "vadas"))}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E().Has("knows", "weight", nil)}}, "g_VX1X_addVXanimalX_propertyXage_selectXaX_byXageXX_propertyXname_puppyX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).As("a").AddV("animal").Property("age", gremlingo.T__.Select("a").By("age")).Property("name", "puppy")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("animal", "age", 29)}}, "g_V_addVXanimalX_propertyXage_0X": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "marko").Property("age", 29).As("marko").AddV("person").Property("name", "vadas").Property("age", 27).As("vadas").AddV("software").Property("name", "lop").Property("lang", "java").As("lop").AddV("person").Property("name", "josh").Property("age", 32).As("josh").AddV("software").Property("name", "ripple").Property("lang", "java").As("ripple").AddV("person").Property("name", "peter").Property("age", 35).As("peter").AddE("knows").From("marko").To("vadas").Property("weight", 0.5).AddE("knows").From("marko").To("josh").Property("weight", 1.0).AddE("created").From("marko").To("lop").Property("weight", 0.4).AddE("created").From("josh").To("ripple").Property("weight", 1.0).AddE("created").From("josh").To("lop").Property("weight", 0.4).AddE("created").From("peter").To("lop").Property("weight", 0.2)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().AddV("animal").Property("age", 0)}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("animal", "age", 0)}}, @@ -758,13 +758,13 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_V_EXlistXnullXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().E(p["xx1"])}}, "g_injectX1X_EX11_nullX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(1).E(p["eid11"], nil)}}, "g_injectX1X_coalesceXEX_hasLabelXtestsX_addEXtestsX_from_V_hasXnameX_XjoshXX_toXV_hasXnameX_XvadasXXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.AddV("person").Property("name", "josh").AddV("person").Property("name", "vadas")}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(1).Coalesce(gremlingo.T__.E().HasLabel("tests"), gremlingo.T__.AddE("tests").From(gremlingo.T__.V().Has("name", "josh")).To(gremlingo.T__.V().Has("name", "vadas")))}, func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E().HasLabel("tests")}}, - "g_VX1X_properties_element": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v2"]).Properties().Element().Limit(1)}}, + "g_VX1X_properties_element": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).Properties().Element().Limit(1)}}, "g_V_properties_element": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Properties().Element()}}, "g_V_propertiesXageX_element": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Properties("age").Element()}}, "g_EX_properties_element": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E(p["eid11"]).Properties().Element().Limit(1)}}, "g_E_properties_element": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E().Properties().Element()}}, - "g_VXv7_properties_properties_element_element": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v7"]).Properties().Properties().Element().Element().Limit(1)}}, - "g_V_properties_properties_element_element": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v7"]).Properties().Properties().Element().Element()}}, + "g_VXv7_properties_properties_element_element": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid7"]).Properties().Properties().Element().Element().Limit(1)}}, + "g_V_properties_properties_element_element": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid7"]).Properties().Properties().Element().Element()}}, "g_V_elementMap": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().ElementMap()}}, "g_V_elementMapXname_ageX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().ElementMap("name", "age")}}, "g_EX11X_elementMap": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.E(p["eid11"]).ElementMap()}}, @@ -876,7 +876,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_V_projectXa_b_cX_byXbothE_weight_sumX_byXbothE_countX_byXnameX_order_byXmathXa_div_bX_descX_selectXcX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Project("a", "b", "c").By(gremlingo.T__.BothE().Values("weight").Sum()).By(gremlingo.T__.BothE().Count()).By("name").Order().By(gremlingo.T__.Math("a / b"), gremlingo.Order.Desc).Select("c")}}, "g_V_mathXit_plus_itXbyXageX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Math("_+_").By("age")}}, "g_V_valueMap_mathXit_plus_itXbyXselectXageX_unfoldXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().ValueMap().Math("_+_").By(gremlingo.T__.Select("age").Unfold())}}, - "g_VX1X_outE_asXexpectedWeightX_mathXexpectedWeightPlusOneXbyXweightX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).OutE().As("expectedWeight").Math("expectedWeight + 1").By("weight")}}, + "g_VX1X_outE_asXexpectedWeightX_mathXexpectedWeightPlusOneXbyXweightX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).OutE().As("expectedWeight").Math("expectedWeight + 1").By("weight")}}, "g_V_age_max": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("age").Max()}}, "g_V_foo_max": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("foo").Max()}}, "g_V_name_max": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Values("name").Max()}}, @@ -1348,7 +1348,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_VXlistX1_2_3XX_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["xx1"]).Values("name")}}, "g_VXlistXv1_v2_v3XX_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["xx1"]).Values("name")}}, "g_V": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V()}}, - "g_VXv1X_out": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["v1"]).Out()}}, + "g_VXv1X_out": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Out()}}, "g_VX1X_out": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Out()}}, "g_VX2X_in": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid2"]).In()}}, "g_VX4X_both": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid4"]).Both()}}, @@ -1588,9 +1588,7 @@ var translationMap = map[string][]func(g *gremlingo.GraphTraversalSource, p map[ "g_V_hasXperson_name_markoX_bothXknowsX_groupCount_byXvaluesXnameX_foldX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Has("person", "name", "marko").Both("knows").GroupCount().By(gremlingo.T__.Values("name").Fold())}}, "g_V_outXcreatedX_groupCount_byXnameX_byXageX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Out("created").GroupCount().By("name").By("age")}}, "g_V_outXcreatedX_groupCountXxX_byXnameX_byXageX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V().Out("created").GroupCount("x").By("name").By("age")}}, - "g_VX1X_out_injectXv2X_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Out().Inject(p["v2"]).Values("name")}}, "g_VX1X_out_name_injectXdanielX_asXaX_mapXlengthX_path": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Out().Values("name").Inject("daniel").As("a").Map(gremlingo.T__.Length()).Path()}}, - "g_VX1X_injectXg_VX4XX_out_name": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.V(p["vid1"]).Inject(p["v2"]).Out().Values("name")}}, "g_injectXnull_1_3_nullX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(nil, 1, 3, nil)}}, "g_injectX10_20_null_20_10_10X_groupCountXxX_dedup_asXyX_projectXa_bX_by_byXselectXxX_selectXselectXyXXX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(10, 20, nil, 20, 10, 10).GroupCount("x").Dedup().As("y").Project("a", "b").By().By(gremlingo.T__.Select("x").Select(gremlingo.T__.Select("y")))}}, "g_injectXname_marko_age_nullX_selectXname_ageX": {func(g *gremlingo.GraphTraversalSource, p map[string]interface{}) *gremlingo.GraphTraversal {return g.Inject(p["xx1"]).Select("name", "age")}}, 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 e1a496e8464..aab974e2535 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 @@ -120,13 +120,13 @@ const gremlins = { g_V_timesX5X: [function({g}) { return g.V().times(5) }], g_unionXX: [function({g}) { return g.union() }], g_unionXV_name: [function({g}) { return g.union(__.V().values("name")) }], - g_unionXVXv1X_VX4XX_name: [function({g, v1, v4}) { return g.union(__.V(v1), __.V(v4)).values("name") }], + g_unionXVXv1X_VX4XX_name: [function({g, vid4, vid1}) { return g.union(__.V(vid1), __.V(vid4)).values("name") }], g_unionXV_hasLabelXsoftwareX_V_hasLabelXpersonXX_name: [function({g}) { return g.union(__.V().hasLabel("software"), __.V().hasLabel("person")).values("name") }], g_unionXV_out_out_V_hasLabelXsoftwareXX_path: [function({g}) { return g.union(__.V().out().out(), __.V().hasLabel("software")).path() }], g_unionXV_out_out_V_hasLabelXsoftwareXX_path_byXnameX: [function({g}) { return g.union(__.V().out().out(), __.V().hasLabel("software")).path().by("name") }], g_unionXunionXV_out_outX_V_hasLabelXsoftwareXX_path_byXnameX: [function({g}) { return g.union(__.union(__.V().out().out()), __.V().hasLabel("software")).path().by("name") }], g_unionXinjectX1X_injectX2X: [function({g}) { return g.union(__.inject(1), __.inject(2)) }], - g_V_unionXconstantX1X_constantX2X_constantX3XX: [function({g, xx1, xx3, xx2, v2}) { return g.V(v2).union(__.constant(xx1), __.constant(xx2), __.constant(xx3)) }], + g_V_unionXconstantX1X_constantX2X_constantX3XX: [function({g, xx1, xx3, xx2, vid2}) { return g.V(vid2).union(__.constant(xx1), __.constant(xx2), __.constant(xx3)) }], g_V_unionXout__inX_name: [function({g}) { return g.V().union(__.out(), __.in_()).values("name") }], g_VX1X_unionXrepeatXoutX_timesX2X__outX_name: [function({g, vid1}) { return g.V(vid1).union(__.repeat(__.out()).times(2), __.out()).values("name") }], g_V_chooseXlabel_is_person__unionX__out_lang__out_nameX__in_labelX: [function({g}) { return g.V().choose(__.label().is("person"), __.union(__.out().values("lang"), __.out().values("name")), __.in_().label()) }], @@ -228,9 +228,9 @@ const gremlins = { g_V_hasXlabel_isXsoftwareXX: [function({g}) { return g.V().has(T.label, __.is("software")) }], g_VX1X_hasXage_gt_30X: [function({g, vid1}) { return g.V(vid1).has("age", P.gt(30)) }], g_VX4X_hasXage_gt_30X: [function({g, vid4}) { return g.V(vid4).has("age", P.gt(30)) }], - g_VXv1X_hasXage_gt_30X: [function({g, v1}) { return g.V(v1).has("age", P.gt(30)) }], - g_VXv4X_hasXage_gt_30X: [function({g, v4}) { return g.V(v4).has("age", P.gt(30)) }], - g_VX1X_out_hasXid_2X: [function({g, v2}) { return g.V(v2).has("age", P.gt(30)) }], + g_VXv1X_hasXage_gt_30X: [function({g, vid1}) { return g.V(vid1).has("age", P.gt(30)) }], + g_VXv4X_hasXage_gt_30X: [function({g, vid4}) { return g.V(vid4).has("age", P.gt(30)) }], + g_VX1X_out_hasXid_2X: [function({g, vid2}) { return g.V(vid2).has("age", P.gt(30)) }], g_V_hasXblahX: [function({g}) { return g.V().has("blah") }], g_V_hasXperson_name_markoX_age: [function({g}) { return g.V().has("person", "name", "marko").values("age") }], g_VX1X_outE_hasXweight_inside_0_06X_inV: [function({g, vid1}) { return g.V(vid1).outE().has("weight", P.inside(0.0, 0.6)).inV() }], @@ -385,7 +385,7 @@ const gremlins = { g_VX1X_asXaX_outXcreatedX_inXcreatedX_whereXeqXaXX_name: [function({g, vid1}) { return g.V(vid1).as("a").out("created").in_("created").where(P.eq("a")).values("name") }], g_VX1X_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_name: [function({g, vid1}) { return g.V(vid1).as("a").out("created").in_("created").where(P.neq("a")).values("name") }], g_VX1X_out_aggregateXxX_out_whereXnotXwithinXaXXX: [function({g, vid1}) { return g.V(vid1).out().aggregate("x").out().where(P.not(P.within("x"))) }], - g_withSideEffectXa_g_VX2XX_VX1X_out_whereXneqXaXX: [function({g, vid1, v2}) { return g.withSideEffect("a", v2).V(vid1).out().where(P.neq("a")) }], + g_withSideEffectXa_g_VX2XX_VX1X_out_whereXneqXaXX: [function({g, vid2, vid1}) { return g.withSideEffect("a", vid2).V(vid1).out().where(__.id().where(P.neq("a"))) }], g_VX1X_repeatXbothEXcreatedX_whereXwithoutXeXX_aggregateXeX_otherVX_emit_path: [function({g, vid1}) { return g.V(vid1).repeat(__.bothE("created").where(P.without("e")).aggregate("e").otherV()).emit().path() }], g_V_whereXnotXoutXcreatedXXX_name: [function({g}) { return g.V().where(__.not(__.out("created"))).values("name") }], g_V_asXaX_out_asXbX_whereXandXasXaX_outXknowsX_asXbX__orXasXbX_outXcreatedX_hasXname_rippleX__asXbX_inXknowsX_count_isXnotXeqX0XXXXX_selectXa_bX: [function({g}) { return g.V().as("a").out().as("b").where(__.and(__.as("a").out("knows").as("b"), __.or(__.as("b").out("created").has("name", "ripple"), __.as("b").in_("knows").count().is(P.not(P.eq(0)))))).select("a", "b") }], @@ -579,12 +579,12 @@ const gremlins = { g_V_aggregateXxX_asXaX_selectXxX_unfold_addEXexistsWithX_toXaX_propertyXtime_nowX: [function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V().aggregate("x").as("a").select("x").unfold().addE("existsWith").to("a").property("time", "now") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.E() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid1).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid1).inE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid1).outE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid1).bothE("existsWith").has("time", "now") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid2).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid2).inE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid2).outE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid2).bothE("existsWith").has("time", "now") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid3).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid3).inE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid3).outE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid3).bothE("existsWith").has("time", "now") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid4).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid4).inE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid4).outE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid4).bothE("existsWith").has("time", "now") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid5).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid5).inE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid5).outE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid5).bothE("existsWith").has("time", "now") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid6).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid6).inE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid6).outE("existsWith") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid6).bothE("existsWith").has("time", "now") }], g_V_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_asXbX_addEXcodeveloperX_fromXaX_toXbX_propertyXyear_2009X: [function({g, vid1, vid2, vid4, vid6}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, vid1, vid2, vid4, vid6}) { return g.V().as("a").out("created").in_("created").where(P.neq("a")).as("b").addE("codeveloper").from_("a").to("b").property("year", 2009) }, function({g, vid1, vid2, vid4, vid6}) { return g.E() }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid1).bothE() }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid1).inE("codeveloper") }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid1).outE("codeveloper") }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid1).bothE("codeveloper").has("year", 2009) }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid2).bothE() }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid4).bothE() }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid4).inE("codeveloper") }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid4).outE("codeveloper") }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid4).bothE("codeveloper").has("year", 2009) }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid6).bothE() }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid6).inE("codeveloper") }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid6).outE("codeveloper") }, function({g, vid1, vid2, vid4, vid6}) { return g.V(vid6).bothE("codeveloper").has("year", 2009) }], g_V_asXaX_inXcreatedX_addEXcreatedByX_fromXaX_propertyXyear_2009X_propertyXacl_publicX: [function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V().as("a").in_("created").addE("createdBy").from_("a").property("year", 2009).property("acl", "public") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.E() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid1).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid1).inE("createdBy") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid1).outE("createdBy") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid1).bothE("createdBy").has("year", 2009).has("acl", "public") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid2).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid3).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid3).inE("createdBy") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid3).outE("createdBy") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid3).bothE("createdBy").has("year", 2009).has("acl", "public") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid4).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid4).inE("createdBy") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid4).outE("createdBy") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid4).bothE("createdBy").has("year", 2009).has("acl", "public") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid5).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid5).inE("createdBy") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid5).outE("createdBy") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid5).bothE("createdBy").has("year", 2009).has("acl", "public") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid6).bothE() }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid6).inE("createdBy") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid6).outE("createdBy") }, function({g, vid1, vid2, vid3, vid4, vid5, vid6}) { return g.V(vid6).bothE("createdBy").has("year", 2009).has("acl", "public") }], - g_withSideEffectXb_bX_VXaX_addEXknowsX_toXbX_propertyXweight_0_5X: [function({g, v6, v1}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, v6, v1}) { return g.withSideEffect("b", v6).V(v1).addE("knows").to("b").property("weight", 0.5) }, function({g, v6, v1}) { return g.E() }, function({g, v6, v1}) { return g.V(v1).bothE() }, function({g, v6, v1}) { return g.V(v1).inE("knows") }, function({g, v6, v1}) { return g.V(v1).outE("knows") }, function({g, v6, v1}) { return g.V(v1).bothE("knows").has("weight", 0.5) }, function({g, v6, v1}) { return g.V(v6).bothE() }, function({g, v6, v1}) { return g.V(v6).inE("knows") }, function({g, v6, v1}) { return g.V(v6).outE("knows") }, function({g, v6, v1}) { return g.V(v6).bothE("knows").has("weight", 0.5) }], + g_withSideEffectXb_bX_VXaX_addEXknowsX_toXbX_propertyXweight_0_5X: [function({g, vid6, vid1}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, vid6, vid1}) { return g.withSideEffect("b", vid6).V(vid1).addE("knows").to("b").property("weight", 0.5) }, function({g, vid6, vid1}) { return g.E() }, function({g, vid6, vid1}) { return g.V(vid1).bothE() }, function({g, vid6, vid1}) { return g.V(vid1).inE("knows") }, function({g, vid6, vid1}) { return g.V(vid1).outE("knows") }, function({g, vid6, vid1}) { return g.V(vid1).bothE("knows").has("weight", 0.5) }, function({g, vid6, vid1}) { return g.V(vid6).bothE() }, function({g, vid6, vid1}) { return g.V(vid6).inE("knows") }, function({g, vid6, vid1}) { return g.V(vid6).outE("knows") }, function({g, vid6, vid1}) { return g.V(vid6).bothE("knows").has("weight", 0.5) }], g_addV_asXfirstX_repeatXaddEXnextX_toXaddVX_inVX_timesX5X_addEXnextX_toXselectXfirstXX: [function({g}) { return g.addV().as("first").repeat(__.addE("next").to(__.addV()).inV()).times(5).addE("next").to(__.select("first")) }, function({g}) { return g.V() }, function({g}) { return g.E() }, function({g}) { return g.E().hasLabel("next") }, function({g}) { return g.V().limit(1).bothE() }, function({g}) { return g.V().limit(1).inE() }, function({g}) { return g.V().limit(1).outE() }], - g_V_hasXname_markoX_asXaX_outEXcreatedX_asXbX_inV_addEXselectXbX_labelX_toXaX: [function({g, v1}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, v1}) { return g.V().has("name", "marko").as("a").outE("created").as("b").inV().addE(__.select("b").label()).to("a") }, function({g, v1}) { return g.E() }, function({g, v1}) { return g.V(v1).bothE() }, function({g, v1}) { return g.V(v1).inE("created") }, function({g, v1}) { return g.V(v1).in_("created").has("name", "lop") }, function({g, v1}) { return g.V(v1).outE("created") }], - g_addEXV_outE_label_groupCount_orderXlocalX_byXvalues_descX_selectXkeysX_unfold_limitX1XX_fromXV_hasXname_vadasXX_toXV_hasXname_lopXX: [function({g, v2}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, v2}) { return g.addE(__.V().outE().label().groupCount().order(Scope.local).by(Column.values, Order.desc).select(Column.keys).unfold().limit(1)).from_(__.V().has("name", "vadas")).to(__.V().has("name", "lop")) }, function({g, v2}) { return g.E() }, function({g, v2}) { return g.V(v2).bothE() }, function({g, v2}) { return g.V(v2).inE("knows") }, function({g, v2}) { return g.V(v2).outE("created") }, function({g, v2}) { return g.V(v2).out("created").has("name", "lop") }], - g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X: [function({g, v6, xx1, v1}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, v6, xx1, v1}) { return g.addE("knows").from_(v1).to(v6).property("weight", xx1) }, function({g, v6, xx1, v1}) { return g.E() }, function({g, v6, xx1, v1}) { return g.V(v1).outE("knows") }, function({g, v6, xx1, v1}) { return g.V(v1).out("knows").has("name", "peter") }], - g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X: [function({g, v6, xx1, v1}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, v6, xx1, v1}) { return g.V(v1).addE("knows").to(v6).property("weight", xx1) }, function({g, v6, xx1, v1}) { return g.E() }, function({g, v6, xx1, v1}) { return g.V(v1).outE("knows") }, function({g, v6, xx1, v1}) { return g.V(v1).out("knows").has("name", "peter") }], + g_V_hasXname_markoX_asXaX_outEXcreatedX_asXbX_inV_addEXselectXbX_labelX_toXaX: [function({g, vid1}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, vid1}) { return g.V().has("name", "marko").as("a").outE("created").as("b").inV().addE(__.select("b").label()).to("a") }, function({g, vid1}) { return g.E() }, function({g, vid1}) { return g.V(vid1).bothE() }, function({g, vid1}) { return g.V(vid1).inE("created") }, function({g, vid1}) { return g.V(vid1).in_("created").has("name", "lop") }, function({g, vid1}) { return g.V(vid1).outE("created") }], + g_addEXV_outE_label_groupCount_orderXlocalX_byXvalues_descX_selectXkeysX_unfold_limitX1XX_fromXV_hasXname_vadasXX_toXV_hasXname_lopXX: [function({g, vid2}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, vid2}) { return g.addE(__.V().outE().label().groupCount().order(Scope.local).by(Column.values, Order.desc).select(Column.keys).unfold().limit(1)).from_(__.V().has("name", "vadas")).to(__.V().has("name", "lop")) }, function({g, vid2}) { return g.E() }, function({g, vid2}) { return g.V(vid2).bothE() }, function({g, vid2}) { return g.V(vid2).inE("knows") }, function({g, vid2}) { return g.V(vid2).outE("created") }, function({g, vid2}) { return g.V(vid2).out("created").has("name", "lop") }], + g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X: [function({g, xx1, vid6, vid1}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, xx1, vid6, vid1}) { return g.addE("knows").from_(vid1).to(vid6).property("weight", xx1) }, function({g, xx1, vid6, vid1}) { return g.E() }, function({g, xx1, vid6, vid1}) { return g.V(vid1).outE("knows") }, function({g, xx1, vid6, vid1}) { return g.V(vid1).out("knows").has("name", "peter") }], + g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X: [function({g, xx1, vid6, vid1}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, xx1, vid6, vid1}) { return g.V(vid1).addE("knows").to(vid6).property("weight", xx1) }, function({g, xx1, vid6, vid1}) { return g.E() }, function({g, xx1, vid6, vid1}) { return g.V(vid1).outE("knows") }, function({g, xx1, vid6, vid1}) { return g.V(vid1).out("knows").has("name", "peter") }], g_addEXknowsXpropertyXweight_nullXfromXV_hasXname_markoXX_toXV_hasXname_vadasXX: [function({g}) { return g.addV("person").property("name", "marko").property("age", 29).addV("person").property("name", "vadas").property("age", 27) }, function({g}) { return g.addE("knows").property("weight", null).from_(__.V().has("name", "marko")).to(__.V().has("name", "vadas")) }, function({g}) { return g.E().has("knows", "weight", null) }], g_VX1X_addVXanimalX_propertyXage_selectXaX_byXageXX_propertyXname_puppyX: [function({g, vid1}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g, vid1}) { return g.V(vid1).as("a").addV("animal").property("age", __.select("a").by("age")).property("name", "puppy") }, function({g, vid1}) { return g.V().has("animal", "age", 29) }], g_V_addVXanimalX_propertyXage_0X: [function({g}) { return g.addV("person").property("name", "marko").property("age", 29).as("marko").addV("person").property("name", "vadas").property("age", 27).as("vadas").addV("software").property("name", "lop").property("lang", "java").as("lop").addV("person").property("name", "josh").property("age", 32).as("josh").addV("software").property("name", "ripple").property("lang", "java").as("ripple").addV("person").property("name", "peter").property("age", 35).as("peter").addE("knows").from_("marko").to("vadas").property("weight", 0.5).addE("knows").from_("marko").to("josh").property("weight", 1.0).addE("created").from_("marko").to("lop").property("weight", 0.4).addE("created").from_("josh").to("ripple").property("weight", 1.0).addE("created").from_("josh").to("lop").property("weight", 0.4).addE("created").from_("peter").to("lop").property("weight", 0.2) }, function({g}) { return g.V().addV("animal").property("age", 0) }, function({g}) { return g.V().has("animal", "age", 0) }], @@ -788,13 +788,13 @@ const gremlins = { g_V_EXlistXnullXX: [function({g, xx1}) { return g.V().E(xx1) }], g_injectX1X_EX11_nullX: [function({g, eid11}) { return g.inject(1).E(eid11, null) }], g_injectX1X_coalesceXEX_hasLabelXtestsX_addEXtestsX_from_V_hasXnameX_XjoshXX_toXV_hasXnameX_XvadasXXX: [function({g}) { return g.addV("person").property("name", "josh").addV("person").property("name", "vadas") }, function({g}) { return g.inject(1).coalesce(__.E().hasLabel("tests"), __.addE("tests").from_(__.V().has("name", "josh")).to(__.V().has("name", "vadas"))) }, function({g}) { return g.E().hasLabel("tests") }], - g_VX1X_properties_element: [function({g, v2}) { return g.V(v2).properties().element().limit(1) }], + g_VX1X_properties_element: [function({g, vid2}) { return g.V(vid2).properties().element().limit(1) }], g_V_properties_element: [function({g}) { return g.V().properties().element() }], g_V_propertiesXageX_element: [function({g}) { return g.V().properties("age").element() }], g_EX_properties_element: [function({g, eid11}) { return g.E(eid11).properties().element().limit(1) }], g_E_properties_element: [function({g}) { return g.E().properties().element() }], - g_VXv7_properties_properties_element_element: [function({g, v7}) { return g.V(v7).properties().properties().element().element().limit(1) }], - g_V_properties_properties_element_element: [function({g, v7}) { return g.V(v7).properties().properties().element().element() }], + g_VXv7_properties_properties_element_element: [function({g, vid7}) { return g.V(vid7).properties().properties().element().element().limit(1) }], + g_V_properties_properties_element_element: [function({g, vid7}) { return g.V(vid7).properties().properties().element().element() }], g_V_elementMap: [function({g}) { return g.V().elementMap() }], g_V_elementMapXname_ageX: [function({g}) { return g.V().elementMap("name", "age") }], g_EX11X_elementMap: [function({g, eid11}) { return g.E(eid11).elementMap() }], @@ -906,7 +906,7 @@ const gremlins = { g_V_projectXa_b_cX_byXbothE_weight_sumX_byXbothE_countX_byXnameX_order_byXmathXa_div_bX_descX_selectXcX: [function({g}) { return g.V().project("a", "b", "c").by(__.bothE().values("weight").sum()).by(__.bothE().count()).by("name").order().by(__.math("a / b"), Order.desc).select("c") }], g_V_mathXit_plus_itXbyXageX: [function({g}) { return g.V().math("_+_").by("age") }], g_V_valueMap_mathXit_plus_itXbyXselectXageX_unfoldXX: [function({g}) { return g.V().valueMap().math("_+_").by(__.select("age").unfold()) }], - g_VX1X_outE_asXexpectedWeightX_mathXexpectedWeightPlusOneXbyXweightX: [function({g, v1}) { return g.V(v1).outE().as("expectedWeight").math("expectedWeight + 1").by("weight") }], + g_VX1X_outE_asXexpectedWeightX_mathXexpectedWeightPlusOneXbyXweightX: [function({g, vid1}) { return g.V(vid1).outE().as("expectedWeight").math("expectedWeight + 1").by("weight") }], g_V_age_max: [function({g}) { return g.V().values("age").max() }], g_V_foo_max: [function({g}) { return g.V().values("foo").max() }], g_V_name_max: [function({g}) { return g.V().values("name").max() }], @@ -1378,7 +1378,7 @@ const gremlins = { g_VXlistX1_2_3XX_name: [function({g, xx1}) { return g.V(xx1).values("name") }], g_VXlistXv1_v2_v3XX_name: [function({g, xx1}) { return g.V(xx1).values("name") }], g_V: [function({g}) { return g.V() }], - g_VXv1X_out: [function({g, v1}) { return g.V(v1).out() }], + g_VXv1X_out: [function({g, vid1}) { return g.V(vid1).out() }], g_VX1X_out: [function({g, vid1}) { return g.V(vid1).out() }], g_VX2X_in: [function({g, vid2}) { return g.V(vid2).in_() }], g_VX4X_both: [function({g, vid4}) { return g.V(vid4).both() }], @@ -1618,9 +1618,7 @@ const gremlins = { g_V_hasXperson_name_markoX_bothXknowsX_groupCount_byXvaluesXnameX_foldX: [function({g}) { return g.V().has("person", "name", "marko").both("knows").groupCount().by(__.values("name").fold()) }], g_V_outXcreatedX_groupCount_byXnameX_byXageX: [function({g}) { return g.V().out("created").groupCount().by("name").by("age") }], g_V_outXcreatedX_groupCountXxX_byXnameX_byXageX: [function({g}) { return g.V().out("created").groupCount("x").by("name").by("age") }], - g_VX1X_out_injectXv2X_name: [function({g, vid1, v2}) { return g.V(vid1).out().inject(v2).values("name") }], g_VX1X_out_name_injectXdanielX_asXaX_mapXlengthX_path: [function({g, vid1}) { return g.V(vid1).out().values("name").inject("daniel").as("a").map(__.length()).path() }], - g_VX1X_injectXg_VX4XX_out_name: [function({g, vid1, v2}) { return g.V(vid1).inject(v2).out().values("name") }], g_injectXnull_1_3_nullX: [function({g}) { return g.inject(null, 1, 3, null) }], g_injectX10_20_null_20_10_10X_groupCountXxX_dedup_asXyX_projectXa_bX_by_byXselectXxX_selectXselectXyXXX: [function({g}) { return g.inject(10, 20, null, 20, 10, 10).groupCount("x").dedup().as("y").project("a", "b").by().by(__.select("x").select(__.select("y"))) }], g_injectXname_marko_age_nullX_selectXname_ageX: [function({g, xx1}) { return g.inject(xx1).select("name", "age") }], diff --git a/gremlin-language/src/main/antlr4/Gremlin.g4 b/gremlin-language/src/main/antlr4/Gremlin.g4 index 0f22d6ec592..a2ae6fea148 100644 --- a/gremlin-language/src/main/antlr4/Gremlin.g4 +++ b/gremlin-language/src/main/antlr4/Gremlin.g4 @@ -516,7 +516,7 @@ traversalMethod_format traversalMethod_from : K_FROM LPAREN stringLiteral RPAREN #traversalMethod_from_String - | K_FROM LPAREN structureVertexArgument RPAREN #traversalMethod_from_Vertex + | K_FROM LPAREN genericArgument RPAREN #traversalMethod_from_GenricArgument | K_FROM LPAREN nestedTraversal RPAREN #traversalMethod_from_Traversal ; @@ -873,7 +873,7 @@ traversalMethod_times traversalMethod_to : K_TO LPAREN traversalDirection (COMMA stringNullableLiteralVarargs)? RPAREN #traversalMethod_to_Direction_String | K_TO LPAREN stringLiteral RPAREN #traversalMethod_to_String - | K_TO LPAREN structureVertexArgument RPAREN #traversalMethod_to_Vertex + | K_TO LPAREN genericArgument RPAREN #traversalMethod_to_GenricArgument | K_TO LPAREN nestedTraversal RPAREN #traversalMethod_to_Traversal ; @@ -950,14 +950,6 @@ traversalMethod_write ARGUMENT AND TERMINAL RULES **********************************************/ -// There is syntax available in the construction of a ReferenceVertex, that allows the label to not be specified. -// That use case is related to OLAP when the StarGraph does not preserve the label of adjacent vertices or other -// fail fast scenarios in that processing model. It is not relevant to the grammar however when a user is creating -// the Vertex to be used in a Traversal and therefore both id and label are required. -structureVertexLiteral - : K_NEW? (K_VERTEX | K_REFERENCEVERTEX) LPAREN genericArgument COMMA stringArgument RPAREN - ; - traversalStrategy : K_NEW? classType (LPAREN (configuration (COMMA configuration)*)? RPAREN)? ; @@ -1497,11 +1489,6 @@ genericMapNullableArgument | variable ; -structureVertexArgument - : structureVertexLiteral - | variable - ; - traversalStrategyVarargs : traversalStrategyExpr? ; @@ -1569,7 +1556,6 @@ genericLiteral | traversalMerge | traversalPick | traversalDT - | structureVertexLiteral | genericSetLiteral | genericCollectionLiteral | genericRangeLiteral @@ -1852,7 +1838,6 @@ keyword | K_RANGE | K_READ | K_READER - | K_REFERENCEVERTEX | K_REGEX | K_REPLACE | K_REPEAT @@ -1908,7 +1893,6 @@ keyword | K_VALUEMAP | K_VALUES | K_VALUE - | K_VERTEX | K_WHERE | K_WITH | K_WITHBULK @@ -2113,7 +2097,6 @@ K_PRODUCT: 'product'; K_RANGE: 'range'; K_READ: 'read'; K_READER: 'reader'; -K_REFERENCEVERTEX: 'ReferenceVertex'; K_REGEX: 'regex'; K_REPLACE: 'replace'; K_REPEAT: 'repeat'; @@ -2169,7 +2152,6 @@ K_V: 'V'; K_VALUEMAP: 'valueMap'; K_VALUES: 'values'; K_VALUE: 'value'; -K_VERTEX: 'Vertex'; K_WHERE: 'where'; K_WITH: 'with'; K_WITHBULK: 'withBulk'; diff --git a/gremlin-language/src/main/java/org/apache/tinkerpop/gremlin/language/corpus/DocumentationReader.java b/gremlin-language/src/main/java/org/apache/tinkerpop/gremlin/language/corpus/DocumentationReader.java index 83b837bfcea..d68af03fc7c 100644 --- a/gremlin-language/src/main/java/org/apache/tinkerpop/gremlin/language/corpus/DocumentationReader.java +++ b/gremlin-language/src/main/java/org/apache/tinkerpop/gremlin/language/corpus/DocumentationReader.java @@ -110,8 +110,8 @@ private static String replaceVariables(final String gremlin) { replace("vPeter", "\"peter\""). replace("vStephen", "\"stephen\""). replace("maps", "[:]"). - replace("v1", "new Vertex(1,\"vertex\")"). - replace("v2", "new Vertex(2,\"vertex\")"). + replace("v1.id()", "1"). + replace("v2.id()", "2"). replace("input.head()", "\"head\""). replace("input.tail().size()", "6"). replace("input.tail()", "\"tail\""). diff --git a/gremlin-language/src/test/resources/gremlin-values.txt b/gremlin-language/src/test/resources/gremlin-values.txt index ba97c5d05ca..2d458e4229f 100644 --- a/gremlin-language/src/test/resources/gremlin-values.txt +++ b/gremlin-language/src/test/resources/gremlin-values.txt @@ -222,9 +222,6 @@ Direction.from Direction.OUT Direction.to Direction.BOTH -# structureVertex -Vertex(1,'person') -Vertex("1", 'person') # genericLiteralSet {} { } @@ -282,8 +279,6 @@ Vertex("1", 'person') {1..5} {1..5, 10..20} {"a".."z"} -{Vertex("1", 'person')} -{1, Vertex("2", 'person')} {1, {2, {3}}} {1, {}, []} {1, {2}, [3], 4..5, "six"} diff --git a/gremlin-language/src/test/resources/incorrect-traversals.txt b/gremlin-language/src/test/resources/incorrect-traversals.txt index 1e70cf90968..d58aa992523 100644 --- a/gremlin-language/src/test/resources/incorrect-traversals.txt +++ b/gremlin-language/src/test/resources/incorrect-traversals.txt @@ -23,7 +23,6 @@ g.V().horder().by(id) g.mergeE(["weight": 0.5, Direction.out: 1]) g.mergeE(["weight": 0.5, Direction.in: 1]) g.addE('knows').from(g.V(1)) -g.addE('knows').from(g.V(1).next()) g.V().iterate().V() g.V().next().V() g.V().toList().V() \ No newline at end of file diff --git a/gremlin-python/src/main/python/radish/gremlin.py b/gremlin-python/src/main/python/radish/gremlin.py index 5d4b19fa135..27a45da568b 100644 --- a/gremlin-python/src/main/python/radish/gremlin.py +++ b/gremlin-python/src/main/python/radish/gremlin.py @@ -93,13 +93,13 @@ 'g_V_timesX5X': [(lambda g:g.V().times(5))], 'g_unionXX': [(lambda g:g.union())], 'g_unionXV_name': [(lambda g:g.union(__.V().values('name')))], - 'g_unionXVXv1X_VX4XX_name': [(lambda g, v1=None,v4=None:g.union(__.V(v1), __.V(v4)).values('name'))], + 'g_unionXVXv1X_VX4XX_name': [(lambda g, vid4=None,vid1=None:g.union(__.V(vid1), __.V(vid4)).values('name'))], 'g_unionXV_hasLabelXsoftwareX_V_hasLabelXpersonXX_name': [(lambda g:g.union(__.V().has_label('software'), __.V().has_label('person')).values('name'))], 'g_unionXV_out_out_V_hasLabelXsoftwareXX_path': [(lambda g:g.union(__.V().out().out(), __.V().has_label('software')).path())], 'g_unionXV_out_out_V_hasLabelXsoftwareXX_path_byXnameX': [(lambda g:g.union(__.V().out().out(), __.V().has_label('software')).path().by('name'))], 'g_unionXunionXV_out_outX_V_hasLabelXsoftwareXX_path_byXnameX': [(lambda g:g.union(__.union(__.V().out().out()), __.V().has_label('software')).path().by('name'))], 'g_unionXinjectX1X_injectX2X': [(lambda g:g.union(__.inject(1), __.inject(2)))], - 'g_V_unionXconstantX1X_constantX2X_constantX3XX': [(lambda g, xx1=None,xx3=None,xx2=None,v2=None:g.V(v2).union(__.constant(xx1), __.constant(xx2), __.constant(xx3)))], + 'g_V_unionXconstantX1X_constantX2X_constantX3XX': [(lambda g, xx1=None,xx3=None,xx2=None,vid2=None:g.V(vid2).union(__.constant(xx1), __.constant(xx2), __.constant(xx3)))], 'g_V_unionXout__inX_name': [(lambda g:g.V().union(__.out(), __.in_()).values('name'))], 'g_VX1X_unionXrepeatXoutX_timesX2X__outX_name': [(lambda g, vid1=None:g.V(vid1).union(__.repeat(__.out()).times(2), __.out()).values('name'))], 'g_V_chooseXlabel_is_person__unionX__out_lang__out_nameX__in_labelX': [(lambda g:g.V().choose(__.label().is_('person'), __.union(__.out().values('lang'), __.out().values('name')), __.in_().label()))], @@ -201,9 +201,9 @@ 'g_V_hasXlabel_isXsoftwareXX': [(lambda g:g.V().has(T.label, __.is_('software')))], 'g_VX1X_hasXage_gt_30X': [(lambda g, vid1=None:g.V(vid1).has('age', P.gt(30)))], 'g_VX4X_hasXage_gt_30X': [(lambda g, vid4=None:g.V(vid4).has('age', P.gt(30)))], - 'g_VXv1X_hasXage_gt_30X': [(lambda g, v1=None:g.V(v1).has('age', P.gt(30)))], - 'g_VXv4X_hasXage_gt_30X': [(lambda g, v4=None:g.V(v4).has('age', P.gt(30)))], - 'g_VX1X_out_hasXid_2X': [(lambda g, v2=None:g.V(v2).has('age', P.gt(30)))], + 'g_VXv1X_hasXage_gt_30X': [(lambda g, vid1=None:g.V(vid1).has('age', P.gt(30)))], + 'g_VXv4X_hasXage_gt_30X': [(lambda g, vid4=None:g.V(vid4).has('age', P.gt(30)))], + 'g_VX1X_out_hasXid_2X': [(lambda g, vid2=None:g.V(vid2).has('age', P.gt(30)))], 'g_V_hasXblahX': [(lambda g:g.V().has('blah'))], 'g_V_hasXperson_name_markoX_age': [(lambda g:g.V().has('person', 'name', 'marko').values('age'))], 'g_VX1X_outE_hasXweight_inside_0_06X_inV': [(lambda g, vid1=None:g.V(vid1).out_e().has('weight', P.inside(0.0, 0.6)).in_v())], @@ -358,7 +358,7 @@ 'g_VX1X_asXaX_outXcreatedX_inXcreatedX_whereXeqXaXX_name': [(lambda g, vid1=None:g.V(vid1).as_('a').out('created').in_('created').where(P.eq('a')).values('name'))], 'g_VX1X_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_name': [(lambda g, vid1=None:g.V(vid1).as_('a').out('created').in_('created').where(P.neq('a')).values('name'))], 'g_VX1X_out_aggregateXxX_out_whereXnotXwithinXaXXX': [(lambda g, vid1=None:g.V(vid1).out().aggregate('x').out().where(P.not_(P.within('x'))))], - 'g_withSideEffectXa_g_VX2XX_VX1X_out_whereXneqXaXX': [(lambda g, vid1=None,v2=None:g.with_side_effect('a', v2).V(vid1).out().where(P.neq('a')))], + 'g_withSideEffectXa_g_VX2XX_VX1X_out_whereXneqXaXX': [(lambda g, vid2=None,vid1=None:g.with_side_effect('a', vid2).V(vid1).out().where(__.id_().where(P.neq('a'))))], 'g_VX1X_repeatXbothEXcreatedX_whereXwithoutXeXX_aggregateXeX_otherVX_emit_path': [(lambda g, vid1=None:g.V(vid1).repeat(__.both_e('created').where(P.without('e')).aggregate('e').other_v()).emit().path())], 'g_V_whereXnotXoutXcreatedXXX_name': [(lambda g:g.V().where(__.not_(__.out('created'))).values('name'))], 'g_V_asXaX_out_asXbX_whereXandXasXaX_outXknowsX_asXbX__orXasXbX_outXcreatedX_hasXname_rippleX__asXbX_inXknowsX_count_isXnotXeqX0XXXXX_selectXa_bX': [(lambda g:g.V().as_('a').out().as_('b').where(__.and_(__.as_('a').out('knows').as_('b'), __.or_(__.as_('b').out('created').has('name', 'ripple'), __.as_('b').in_('knows').count().is_(P.not_(P.eq(0)))))).select('a', 'b'))], @@ -552,12 +552,12 @@ 'g_V_aggregateXxX_asXaX_selectXxX_unfold_addEXexistsWithX_toXaX_propertyXtime_nowX': [(lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V().aggregate('x').as_('a').select('x').unfold().add_e('existsWith').to('a').property('time', 'now')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.E()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid1).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid1).in_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid1).out_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid1).both_e('existsWith').has('time', 'now')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid2).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid2).in_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid2).out_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid2).both_e('existsWith').has('time', 'now')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid3).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid3).in_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid3).out_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid3).both_e('existsWith').has('time', 'now')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid4).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid4).in_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid4).out_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid4).both_e('existsWith').has('time', 'now')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid5).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid5).in_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid5).out_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid5).both_e('existsWith').has('time', 'now')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid6).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid6).in_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid6).out_e('existsWith')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid6).both_e('existsWith').has('time', 'now'))], 'g_V_asXaX_outXcreatedX_inXcreatedX_whereXneqXaXX_asXbX_addEXcodeveloperX_fromXaX_toXbX_propertyXyear_2009X': [(lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V().as_('a').out('created').in_('created').where(P.neq('a')).as_('b').add_e('codeveloper').from_('a').to('b').property('year', 2009)), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.E()), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid1).both_e()), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid1).in_e('codeveloper')), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid1).out_e('codeveloper')), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid1).both_e('codeveloper').has('year', 2009)), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid2).both_e()), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid4).both_e()), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid4).in_e('codeveloper')), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid4).out_e('codeveloper')), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid4).both_e('codeveloper').has('year', 2009)), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid6).both_e()), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid6).in_e('codeveloper')), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid6).out_e('codeveloper')), (lambda g, vid1=None,vid2=None,vid4=None,vid6=None:g.V(vid6).both_e('codeveloper').has('year', 2009))], 'g_V_asXaX_inXcreatedX_addEXcreatedByX_fromXaX_propertyXyear_2009X_propertyXacl_publicX': [(lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V().as_('a').in_('created').add_e('createdBy').from_('a').property('year', 2009).property('acl', 'public')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.E()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid1).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid1).in_e('createdBy')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid1).out_e('createdBy')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid1).both_e('createdBy').has('year', 2009).has('acl', 'public')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid2).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid3).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid3).in_e('createdBy')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid3).out_e('createdBy')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid3).both_e('createdBy').has('year', 2009).has('acl', 'public')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid4).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid4).in_e('createdBy')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid4).out_e('createdBy')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid4).both_e('createdBy').has('year', 2009).has('acl', 'public')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid5).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid5).in_e('createdBy')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid5).out_e('createdBy')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid5).both_e('createdBy').has('year', 2009).has('acl', 'public')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid6).both_e()), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid6).in_e('createdBy')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid6).out_e('createdBy')), (lambda g, vid1=None,vid2=None,vid3=None,vid4=None,vid5=None,vid6=None:g.V(vid6).both_e('createdBy').has('year', 2009).has('acl', 'public'))], - 'g_withSideEffectXb_bX_VXaX_addEXknowsX_toXbX_propertyXweight_0_5X': [(lambda g, v6=None,v1=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, v6=None,v1=None:g.with_side_effect('b', v6).V(v1).add_e('knows').to('b').property('weight', 0.5)), (lambda g, v6=None,v1=None:g.E()), (lambda g, v6=None,v1=None:g.V(v1).both_e()), (lambda g, v6=None,v1=None:g.V(v1).in_e('knows')), (lambda g, v6=None,v1=None:g.V(v1).out_e('knows')), (lambda g, v6=None,v1=None:g.V(v1).both_e('knows').has('weight', 0.5)), (lambda g, v6=None,v1=None:g.V(v6).both_e()), (lambda g, v6=None,v1=None:g.V(v6).in_e('knows')), (lambda g, v6=None,v1=None:g.V(v6).out_e('knows')), (lambda g, v6=None,v1=None:g.V(v6).both_e('knows').has('weight', 0.5))], + 'g_withSideEffectXb_bX_VXaX_addEXknowsX_toXbX_propertyXweight_0_5X': [(lambda g, vid6=None,vid1=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, vid6=None,vid1=None:g.with_side_effect('b', vid6).V(vid1).add_e('knows').to('b').property('weight', 0.5)), (lambda g, vid6=None,vid1=None:g.E()), (lambda g, vid6=None,vid1=None:g.V(vid1).both_e()), (lambda g, vid6=None,vid1=None:g.V(vid1).in_e('knows')), (lambda g, vid6=None,vid1=None:g.V(vid1).out_e('knows')), (lambda g, vid6=None,vid1=None:g.V(vid1).both_e('knows').has('weight', 0.5)), (lambda g, vid6=None,vid1=None:g.V(vid6).both_e()), (lambda g, vid6=None,vid1=None:g.V(vid6).in_e('knows')), (lambda g, vid6=None,vid1=None:g.V(vid6).out_e('knows')), (lambda g, vid6=None,vid1=None:g.V(vid6).both_e('knows').has('weight', 0.5))], 'g_addV_asXfirstX_repeatXaddEXnextX_toXaddVX_inVX_timesX5X_addEXnextX_toXselectXfirstXX': [(lambda g:g.add_v().as_('first').repeat(__.add_e('next').to(__.add_v()).in_v()).times(5).add_e('next').to(__.select('first'))), (lambda g:g.V()), (lambda g:g.E()), (lambda g:g.E().has_label('next')), (lambda g:g.V().limit(1).both_e()), (lambda g:g.V().limit(1).in_e()), (lambda g:g.V().limit(1).out_e())], - 'g_V_hasXname_markoX_asXaX_outEXcreatedX_asXbX_inV_addEXselectXbX_labelX_toXaX': [(lambda g, v1=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, v1=None:g.V().has('name', 'marko').as_('a').out_e('created').as_('b').in_v().add_e(__.select('b').label()).to('a')), (lambda g, v1=None:g.E()), (lambda g, v1=None:g.V(v1).both_e()), (lambda g, v1=None:g.V(v1).in_e('created')), (lambda g, v1=None:g.V(v1).in_('created').has('name', 'lop')), (lambda g, v1=None:g.V(v1).out_e('created'))], - 'g_addEXV_outE_label_groupCount_orderXlocalX_byXvalues_descX_selectXkeysX_unfold_limitX1XX_fromXV_hasXname_vadasXX_toXV_hasXname_lopXX': [(lambda g, v2=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, v2=None:g.add_e(__.V().out_e().label().group_count().order(Scope.local).by(Column.values, Order.desc).select(Column.keys).unfold().limit(1)).from_(__.V().has('name', 'vadas')).to(__.V().has('name', 'lop'))), (lambda g, v2=None:g.E()), (lambda g, v2=None:g.V(v2).both_e()), (lambda g, v2=None:g.V(v2).in_e('knows')), (lambda g, v2=None:g.V(v2).out_e('created')), (lambda g, v2=None:g.V(v2).out('created').has('name', 'lop'))], - 'g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X': [(lambda g, v6=None,xx1=None,v1=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, v6=None,xx1=None,v1=None:g.add_e('knows').from_(v1).to(v6).property('weight', xx1)), (lambda g, v6=None,xx1=None,v1=None:g.E()), (lambda g, v6=None,xx1=None,v1=None:g.V(v1).out_e('knows')), (lambda g, v6=None,xx1=None,v1=None:g.V(v1).out('knows').has('name', 'peter'))], - 'g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X': [(lambda g, v6=None,xx1=None,v1=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, v6=None,xx1=None,v1=None:g.V(v1).add_e('knows').to(v6).property('weight', xx1)), (lambda g, v6=None,xx1=None,v1=None:g.E()), (lambda g, v6=None,xx1=None,v1=None:g.V(v1).out_e('knows')), (lambda g, v6=None,xx1=None,v1=None:g.V(v1).out('knows').has('name', 'peter'))], + 'g_V_hasXname_markoX_asXaX_outEXcreatedX_asXbX_inV_addEXselectXbX_labelX_toXaX': [(lambda g, vid1=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, vid1=None:g.V().has('name', 'marko').as_('a').out_e('created').as_('b').in_v().add_e(__.select('b').label()).to('a')), (lambda g, vid1=None:g.E()), (lambda g, vid1=None:g.V(vid1).both_e()), (lambda g, vid1=None:g.V(vid1).in_e('created')), (lambda g, vid1=None:g.V(vid1).in_('created').has('name', 'lop')), (lambda g, vid1=None:g.V(vid1).out_e('created'))], + 'g_addEXV_outE_label_groupCount_orderXlocalX_byXvalues_descX_selectXkeysX_unfold_limitX1XX_fromXV_hasXname_vadasXX_toXV_hasXname_lopXX': [(lambda g, vid2=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, vid2=None:g.add_e(__.V().out_e().label().group_count().order(Scope.local).by(Column.values, Order.desc).select(Column.keys).unfold().limit(1)).from_(__.V().has('name', 'vadas')).to(__.V().has('name', 'lop'))), (lambda g, vid2=None:g.E()), (lambda g, vid2=None:g.V(vid2).both_e()), (lambda g, vid2=None:g.V(vid2).in_e('knows')), (lambda g, vid2=None:g.V(vid2).out_e('created')), (lambda g, vid2=None:g.V(vid2).out('created').has('name', 'lop'))], + 'g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X': [(lambda g, xx1=None,vid6=None,vid1=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, xx1=None,vid6=None,vid1=None:g.add_e('knows').from_(vid1).to(vid6).property('weight', xx1)), (lambda g, xx1=None,vid6=None,vid1=None:g.E()), (lambda g, xx1=None,vid6=None,vid1=None:g.V(vid1).out_e('knows')), (lambda g, xx1=None,vid6=None,vid1=None:g.V(vid1).out('knows').has('name', 'peter'))], + 'g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X': [(lambda g, xx1=None,vid6=None,vid1=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, xx1=None,vid6=None,vid1=None:g.V(vid1).add_e('knows').to(vid6).property('weight', xx1)), (lambda g, xx1=None,vid6=None,vid1=None:g.E()), (lambda g, xx1=None,vid6=None,vid1=None:g.V(vid1).out_e('knows')), (lambda g, xx1=None,vid6=None,vid1=None:g.V(vid1).out('knows').has('name', 'peter'))], 'g_addEXknowsXpropertyXweight_nullXfromXV_hasXname_markoXX_toXV_hasXname_vadasXX': [(lambda g:g.add_v('person').property('name', 'marko').property('age', 29).add_v('person').property('name', 'vadas').property('age', 27)), (lambda g:g.add_e('knows').property('weight', None).from_(__.V().has('name', 'marko')).to(__.V().has('name', 'vadas'))), (lambda g:g.E().has('knows', 'weight', None))], 'g_VX1X_addVXanimalX_propertyXage_selectXaX_byXageXX_propertyXname_puppyX': [(lambda g, vid1=None:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g, vid1=None:g.V(vid1).as_('a').add_v('animal').property('age', __.select('a').by('age')).property('name', 'puppy')), (lambda g, vid1=None:g.V().has('animal', 'age', 29))], 'g_V_addVXanimalX_propertyXage_0X': [(lambda g:g.add_v('person').property('name', 'marko').property('age', 29).as_('marko').add_v('person').property('name', 'vadas').property('age', 27).as_('vadas').add_v('software').property('name', 'lop').property('lang', 'java').as_('lop').add_v('person').property('name', 'josh').property('age', 32).as_('josh').add_v('software').property('name', 'ripple').property('lang', 'java').as_('ripple').add_v('person').property('name', 'peter').property('age', 35).as_('peter').add_e('knows').from_('marko').to('vadas').property('weight', 0.5).add_e('knows').from_('marko').to('josh').property('weight', 1.0).add_e('created').from_('marko').to('lop').property('weight', 0.4).add_e('created').from_('josh').to('ripple').property('weight', 1.0).add_e('created').from_('josh').to('lop').property('weight', 0.4).add_e('created').from_('peter').to('lop').property('weight', 0.2)), (lambda g:g.V().add_v('animal').property('age', 0)), (lambda g:g.V().has('animal', 'age', 0))], @@ -761,13 +761,13 @@ 'g_V_EXlistXnullXX': [(lambda g, xx1=None:g.V().E(xx1))], 'g_injectX1X_EX11_nullX': [(lambda g, eid11=None:g.inject(1).E(eid11, None))], 'g_injectX1X_coalesceXEX_hasLabelXtestsX_addEXtestsX_from_V_hasXnameX_XjoshXX_toXV_hasXnameX_XvadasXXX': [(lambda g:g.add_v('person').property('name', 'josh').add_v('person').property('name', 'vadas')), (lambda g:g.inject(1).coalesce(__.E().has_label('tests'), __.add_e('tests').from_(__.V().has('name', 'josh')).to(__.V().has('name', 'vadas')))), (lambda g:g.E().has_label('tests'))], - 'g_VX1X_properties_element': [(lambda g, v2=None:g.V(v2).properties().element().limit(1))], + 'g_VX1X_properties_element': [(lambda g, vid2=None:g.V(vid2).properties().element().limit(1))], 'g_V_properties_element': [(lambda g:g.V().properties().element())], 'g_V_propertiesXageX_element': [(lambda g:g.V().properties('age').element())], 'g_EX_properties_element': [(lambda g, eid11=None:g.E(eid11).properties().element().limit(1))], 'g_E_properties_element': [(lambda g:g.E().properties().element())], - 'g_VXv7_properties_properties_element_element': [(lambda g, v7=None:g.V(v7).properties().properties().element().element().limit(1))], - 'g_V_properties_properties_element_element': [(lambda g, v7=None:g.V(v7).properties().properties().element().element())], + 'g_VXv7_properties_properties_element_element': [(lambda g, vid7=None:g.V(vid7).properties().properties().element().element().limit(1))], + 'g_V_properties_properties_element_element': [(lambda g, vid7=None:g.V(vid7).properties().properties().element().element())], 'g_V_elementMap': [(lambda g:g.V().element_map())], 'g_V_elementMapXname_ageX': [(lambda g:g.V().element_map('name', 'age'))], 'g_EX11X_elementMap': [(lambda g, eid11=None:g.E(eid11).element_map())], @@ -879,7 +879,7 @@ 'g_V_projectXa_b_cX_byXbothE_weight_sumX_byXbothE_countX_byXnameX_order_byXmathXa_div_bX_descX_selectXcX': [(lambda g:g.V().project('a', 'b', 'c').by(__.both_e().values('weight').sum_()).by(__.both_e().count()).by('name').order().by(__.math('a / b'), Order.desc).select('c'))], 'g_V_mathXit_plus_itXbyXageX': [(lambda g:g.V().math('_+_').by('age'))], 'g_V_valueMap_mathXit_plus_itXbyXselectXageX_unfoldXX': [(lambda g:g.V().value_map().math('_+_').by(__.select('age').unfold()))], - 'g_VX1X_outE_asXexpectedWeightX_mathXexpectedWeightPlusOneXbyXweightX': [(lambda g, v1=None:g.V(v1).out_e().as_('expectedWeight').math('expectedWeight + 1').by('weight'))], + 'g_VX1X_outE_asXexpectedWeightX_mathXexpectedWeightPlusOneXbyXweightX': [(lambda g, vid1=None:g.V(vid1).out_e().as_('expectedWeight').math('expectedWeight + 1').by('weight'))], 'g_V_age_max': [(lambda g:g.V().values('age').max_())], 'g_V_foo_max': [(lambda g:g.V().values('foo').max_())], 'g_V_name_max': [(lambda g:g.V().values('name').max_())], @@ -1351,7 +1351,7 @@ 'g_VXlistX1_2_3XX_name': [(lambda g, xx1=None:g.V(xx1).values('name'))], 'g_VXlistXv1_v2_v3XX_name': [(lambda g, xx1=None:g.V(xx1).values('name'))], 'g_V': [(lambda g:g.V())], - 'g_VXv1X_out': [(lambda g, v1=None:g.V(v1).out())], + 'g_VXv1X_out': [(lambda g, vid1=None:g.V(vid1).out())], 'g_VX1X_out': [(lambda g, vid1=None:g.V(vid1).out())], 'g_VX2X_in': [(lambda g, vid2=None:g.V(vid2).in_())], 'g_VX4X_both': [(lambda g, vid4=None:g.V(vid4).both())], @@ -1591,9 +1591,7 @@ 'g_V_hasXperson_name_markoX_bothXknowsX_groupCount_byXvaluesXnameX_foldX': [(lambda g:g.V().has('person', 'name', 'marko').both('knows').group_count().by(__.values('name').fold()))], 'g_V_outXcreatedX_groupCount_byXnameX_byXageX': [(lambda g:g.V().out('created').group_count().by('name').by('age'))], 'g_V_outXcreatedX_groupCountXxX_byXnameX_byXageX': [(lambda g:g.V().out('created').group_count('x').by('name').by('age'))], - 'g_VX1X_out_injectXv2X_name': [(lambda g, vid1=None,v2=None:g.V(vid1).out().inject(v2).values('name'))], 'g_VX1X_out_name_injectXdanielX_asXaX_mapXlengthX_path': [(lambda g, vid1=None:g.V(vid1).out().values('name').inject('daniel').as_('a').map(__.length()).path())], - 'g_VX1X_injectXg_VX4XX_out_name': [(lambda g, vid1=None,v2=None:g.V(vid1).inject(v2).out().values('name'))], 'g_injectXnull_1_3_nullX': [(lambda g:g.inject(None, 1, 3, None))], 'g_injectX10_20_null_20_10_10X_groupCountXxX_dedup_asXyX_projectXa_bX_by_byXselectXxX_selectXselectXyXXX': [(lambda g:g.inject(10, 20, None, 20, 10, 10).group_count('x').dedup().as_('y').project('a', 'b').by().by(__.select('x').select(__.select('y'))))], 'g_injectXname_marko_age_nullX_selectXname_ageX': [(lambda g, xx1=None:g.inject(xx1).select('name', 'age'))], diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/branch/Union.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/branch/Union.feature index c30662afc96..0c5c5ee7a64 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/branch/Union.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/branch/Union.feature @@ -47,11 +47,11 @@ Feature: Step - union() @GraphComputerVerificationMidVNotSupported Scenario: g_unionXVXv1X_VX4XX_name Given the modern graph - And using the parameter v1 defined as "v[vadas]" - And using the parameter v4 defined as "v[josh]" + And using the parameter vid1 defined as "v[vadas].id" + And using the parameter vid4 defined as "v[josh].id" And the traversal of """ - g.union(__.V(v1), __.V(v4)).values("name") + g.union(__.V(vid1), __.V(vid4)).values("name") """ When iterated to list Then the result should be unordered @@ -139,10 +139,10 @@ Feature: Step - union() And using the parameter xx1 defined as "d[1].i" And using the parameter xx2 defined as "d[2].i" And using the parameter xx3 defined as "d[3].i" - And using the parameter v2 defined as "v[vadas]" + And using the parameter vid2 defined as "v[vadas].id" And the traversal of """ - g.V(v2).union(constant(xx1), constant(xx2), constant(xx3)) + g.V(vid2).union(constant(xx1), constant(xx2), constant(xx3)) """ When iterated to list Then the result should be unordered diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Has.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Has.feature index dbba7611118..8ef7742dc94 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Has.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Has.feature @@ -142,20 +142,20 @@ Feature: Step - has() Scenario: g_VXv1X_hasXage_gt_30X Given the modern graph - And using the parameter v1 defined as "v[marko]" + And using the parameter vid1 defined as "v[marko].id" And the traversal of """ - g.V(v1).has("age", P.gt(30)) + g.V(vid1).has("age", P.gt(30)) """ When iterated to list Then the result should be empty Scenario: g_VXv4X_hasXage_gt_30X Given the modern graph - And using the parameter v4 defined as "v[josh]" + And using the parameter vid4 defined as "v[josh].id" And the traversal of """ - g.V(v4).has("age", P.gt(30)) + g.V(vid4).has("age", P.gt(30)) """ When iterated to list Then the result should be unordered @@ -164,10 +164,10 @@ Feature: Step - has() Scenario: g_VX1X_out_hasXid_2X Given the modern graph - And using the parameter v2 defined as "v[josh]" + And using the parameter vid2 defined as "v[josh].id" And the traversal of """ - g.V(v2).has("age", P.gt(30)) + g.V(vid2).has("age", P.gt(30)) """ When iterated to list Then the result should be unordered diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Where.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Where.feature index 160951b4bdb..1f12a12a66f 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Where.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/filter/Where.feature @@ -171,10 +171,10 @@ Feature: Step - where() Scenario: g_withSideEffectXa_g_VX2XX_VX1X_out_whereXneqXaXX Given the modern graph And using the parameter vid1 defined as "v[marko].id" - And using the parameter v2 defined as "v[vadas]" + And using the parameter vid2 defined as "v[vadas].id" And the traversal of """ - g.withSideEffect("a", v2).V(vid1).out().where(P.neq("a")) + g.withSideEffect("a", vid2).V(vid1).out().where(id().where(P.neq("a"))) """ 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/AddEdge.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/AddEdge.feature index 806dccd9e22..2fa02fd1c4e 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/AddEdge.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/AddEdge.feature @@ -265,23 +265,23 @@ Feature: Step - addE() addE("created").from("josh").to("lop").property("weight", 0.4d). addE("created").from("peter").to("lop").property("weight", 0.2d) """ - And using the parameter v1 defined as "v[marko]" - And using the parameter v6 defined as "v[peter]" + And using the parameter vid1 defined as "v[marko].id" + And using the parameter vid6 defined as "v[peter].id" And the traversal of """ - g.withSideEffect("b", v6).V(v1).addE("knows").to("b").property("weight", 0.5D) + g.withSideEffect("b", vid6).V(vid1).addE("knows").to("b").property("weight", 0.5D) """ When iterated to list Then the result should have a count of 1 And the graph should return 7 for count of "g.E()" - And the graph should return 4 for count of "g.V(v1).bothE()" - And the graph should return 0 for count of "g.V(v1).inE(\"knows\")" - And the graph should return 3 for count of "g.V(v1).outE(\"knows\")" - And the graph should return 2 for count of "g.V(v1).bothE(\"knows\").has(\"weight\",0.5)" - And the graph should return 2 for count of "g.V(v6).bothE()" - And the graph should return 1 for count of "g.V(v6).inE(\"knows\")" - And the graph should return 0 for count of "g.V(v6).outE(\"knows\")" - And the graph should return 1 for count of "g.V(v6).bothE(\"knows\").has(\"weight\",0.5)" + And the graph should return 4 for count of "g.V(vid1).bothE()" + And the graph should return 0 for count of "g.V(vid1).inE(\"knows\")" + And the graph should return 3 for count of "g.V(vid1).outE(\"knows\")" + And the graph should return 2 for count of "g.V(vid1).bothE(\"knows\").has(\"weight\",0.5)" + And the graph should return 2 for count of "g.V(vid6).bothE()" + And the graph should return 1 for count of "g.V(vid6).inE(\"knows\")" + And the graph should return 0 for count of "g.V(vid6).outE(\"knows\")" + And the graph should return 1 for count of "g.V(vid6).bothE(\"knows\").has(\"weight\",0.5)" Scenario: g_addV_asXfirstX_repeatXaddEXnextX_toXaddVX_inVX_timesX5X_addEXnextX_toXselectXfirstXX Given the empty graph @@ -315,7 +315,7 @@ Feature: Step - addE() addE("created").from("josh").to("lop").property("weight", 0.4d). addE("created").from("peter").to("lop").property("weight", 0.2d) """ - And using the parameter v1 defined as "v[marko]" + And using the parameter vid1 defined as "v[marko].id" And the traversal of """ g.V().has("name", "marko").as("a").outE("created").as("b").inV().addE(__.select("b").label()).to("a") @@ -323,10 +323,10 @@ Feature: Step - addE() When iterated to list Then the result should have a count of 1 And the graph should return 7 for count of "g.E()" - And the graph should return 4 for count of "g.V(v1).bothE()" - And the graph should return 1 for count of "g.V(v1).inE(\"created\")" - And the graph should return 1 for count of "g.V(v1).in(\"created\").has(\"name\",\"lop\")" - And the graph should return 1 for count of "g.V(v1).outE(\"created\")" + And the graph should return 4 for count of "g.V(vid1).bothE()" + And the graph should return 1 for count of "g.V(vid1).inE(\"created\")" + And the graph should return 1 for count of "g.V(vid1).in(\"created\").has(\"name\",\"lop\")" + And the graph should return 1 for count of "g.V(vid1).outE(\"created\")" Scenario: g_addEXV_outE_label_groupCount_orderXlocalX_byXvalues_descX_selectXkeysX_unfold_limitX1XX_fromXV_hasXname_vadasXX_toXV_hasXname_lopXX Given the empty graph @@ -345,7 +345,7 @@ Feature: Step - addE() addE("created").from("josh").to("lop").property("weight", 0.4d). addE("created").from("peter").to("lop").property("weight", 0.2d) """ - And using the parameter v2 defined as "v[vadas]" + And using the parameter vid2 defined as "v[vadas].id" And the traversal of """ g.addE(__.V().outE().label().groupCount().order(Scope.local).by(Column.values, Order.desc).select(Column.keys).unfold().limit(1)).from(__.V().has("name", "vadas")).to(__.V().has("name", "lop")) @@ -353,10 +353,10 @@ Feature: Step - addE() When iterated to list Then the result should have a count of 1 And the graph should return 7 for count of "g.E()" - And the graph should return 2 for count of "g.V(v2).bothE()" - And the graph should return 1 for count of "g.V(v2).inE(\"knows\")" - And the graph should return 1 for count of "g.V(v2).outE(\"created\")" - And the graph should return 1 for count of "g.V(v2).out(\"created\").has(\"name\",\"lop\")" + And the graph should return 2 for count of "g.V(vid2).bothE()" + And the graph should return 1 for count of "g.V(vid2).inE(\"knows\")" + And the graph should return 1 for count of "g.V(vid2).outE(\"created\")" + And the graph should return 1 for count of "g.V(vid2).out(\"created\").has(\"name\",\"lop\")" Scenario: g_addEXknowsX_fromXaX_toXbX_propertyXweight_0_1X Given the empty graph @@ -375,18 +375,18 @@ Feature: Step - addE() addE("created").from("josh").to("lop").property("weight", 0.4d). addE("created").from("peter").to("lop").property("weight", 0.2d) """ - And using the parameter v1 defined as "v[marko]" - And using the parameter v6 defined as "v[peter]" + And using the parameter vid1 defined as "v[marko].id" + And using the parameter vid6 defined as "v[peter].id" And using the parameter xx1 defined as "d[0.1].d" And the traversal of """ - g.addE("knows").from(v1).to(v6).property("weight", xx1) + g.addE("knows").from(vid1).to(vid6).property("weight", xx1) """ When iterated to list Then the result should have a count of 1 And the graph should return 7 for count of "g.E()" - And the graph should return 3 for count of "g.V(v1).outE(\"knows\")" - And the graph should return 1 for count of "g.V(v1).out(\"knows\").has(\"name\",\"peter\")" + And the graph should return 3 for count of "g.V(vid1).outE(\"knows\")" + And the graph should return 1 for count of "g.V(vid1).out(\"knows\").has(\"name\",\"peter\")" Scenario: g_VXaX_addEXknowsX_toXbX_propertyXweight_0_1X Given the empty graph @@ -405,18 +405,18 @@ Feature: Step - addE() addE("created").from("josh").to("lop").property("weight", 0.4d). addE("created").from("peter").to("lop").property("weight", 0.2d) """ - And using the parameter v1 defined as "v[marko]" - And using the parameter v6 defined as "v[peter]" + And using the parameter vid1 defined as "v[marko].id" + And using the parameter vid6 defined as "v[peter].id" And using the parameter xx1 defined as "d[0.1].d" And the traversal of """ - g.V(v1).addE("knows").to(v6).property("weight", xx1) + g.V(vid1).addE("knows").to(vid6).property("weight", xx1) """ When iterated to list Then the result should have a count of 1 And the graph should return 7 for count of "g.E()" - And the graph should return 3 for count of "g.V(v1).outE(\"knows\")" - And the graph should return 1 for count of "g.V(v1).out(\"knows\").has(\"name\",\"peter\")" + And the graph should return 3 for count of "g.V(vid1).outE(\"knows\")" + And the graph should return 1 for count of "g.V(vid1).out(\"knows\").has(\"name\",\"peter\")" @AllowNullPropertyValues Scenario: g_addEXknowsXpropertyXweight_nullXfromXV_hasXname_markoXX_toXV_hasXname_vadasXX diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Element.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Element.feature index 3fe889f80d4..a04e17ab548 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Element.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Element.feature @@ -21,10 +21,10 @@ Feature: Step - element() # VertexProperty -> Vertex Scenario: g_VX1X_properties_element Given the modern graph - And using the parameter v2 defined as "v[josh]" + And using the parameter vid2 defined as "v[josh].id" And the traversal of """ - g.V(v2).properties().element().limit(1) + g.V(vid2).properties().element().limit(1) """ When iterated to list Then the result should be unordered @@ -100,10 +100,10 @@ Feature: Step - element() @MultiProperties @MetaProperties Scenario: g_VXv7_properties_properties_element_element Given the crew graph - And using the parameter v7 defined as "v[stephen]" + And using the parameter vid7 defined as "v[stephen].id" And the traversal of """ - g.V(v7).properties().properties().element().element().limit(1) + g.V(vid7).properties().properties().element().element().limit(1) """ When iterated to list Then the result should be unordered @@ -113,10 +113,10 @@ Feature: Step - element() @MultiProperties @MetaProperties Scenario: g_V_properties_properties_element_element Given the crew graph - And using the parameter v7 defined as "v[stephen]" + And using the parameter vid7 defined as "v[stephen].id" And the traversal of """ - g.V(v7).properties().properties().element().element() + g.V(vid7).properties().properties().element().element() """ 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/Math.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Math.feature index 79d247ff6b8..a0aece335ac 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Math.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Math.feature @@ -164,10 +164,10 @@ Feature: Step - math() @GraphComputerVerificationReferenceOnly Scenario: g_VX1X_outE_asXexpectedWeightX_mathXexpectedWeightPlusOneXbyXweightX Given the modern graph - And using the parameter v1 defined as "v[marko]" + And using the parameter vid1 defined as "v[marko].id" And the traversal of """ - g.V(v1).outE().as("expectedWeight").math("expectedWeight + 1").by("weight") + g.V(vid1).outE().as("expectedWeight").math("expectedWeight + 1").by("weight") """ 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/MergeEdge.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/MergeEdge.feature index fcd625da0ba..4d170d874c0 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/MergeEdge.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/MergeEdge.feature @@ -151,7 +151,7 @@ Feature: Step - mergeE() g.addV("person").property("name", "marko"). addV("person").property("name", "vadas") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" And the traversal of """ g.mergeE(xx1) @@ -167,7 +167,7 @@ Feature: Step - mergeE() g.addV("person").property("name", "marko"). addV("person").property("name", "vadas") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" And the traversal of """ g.withSideEffect("a",xx1).mergeE(__.select("a")) @@ -200,7 +200,7 @@ Feature: Step - mergeE() addV("person").property("name", "vadas").as("b"). addE("knows").from("a").to("b") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\", \"weight\":\"d[0.5].d\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\", \"weight\":\"d[0.5].d\"}]" And the traversal of """ g.mergeE(xx1) @@ -242,8 +242,8 @@ Feature: Step - mergeE() addV("person").property("name", "vadas").as("b"). addE("knows").from("a").to("b") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" - And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\",\"created\":\"Y\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" + And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\",\"created\":\"Y\"}]" And using the parameter xx3 defined as "m[{\"created\":\"N\"}]" And the traversal of """ @@ -263,8 +263,8 @@ Feature: Step - mergeE() addV("person").property("name", "vadas").as("b"). addE("knows").from("a").to("b").property("created","Y") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" - And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\",\"created\":\"Y\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" + And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\",\"created\":\"Y\"}]" And using the parameter xx3 defined as "m[{\"created\":\"N\"}]" And the traversal of """ @@ -286,7 +286,7 @@ Feature: Step - mergeE() addE("knows").from("a").to("b") """ And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\"}]" - And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\",\"created\":\"Y\"}]" + And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\",\"created\":\"Y\"}]" And using the parameter xx3 defined as "m[{\"created\":\"N\"}]" And the traversal of """ @@ -306,7 +306,7 @@ Feature: Step - mergeE() g.addV("person").property("name", "marko"). addV("person").property("name", "vadas") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" And the traversal of """ g.inject(xx1).mergeE() @@ -324,8 +324,8 @@ Feature: Step - mergeE() addE("knows").from("a").to("b").property("created","Y"). addE("knows").from("b").to("a").property("created","Y") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[IN]\":\"v[vadas]\"}]" - And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\",\"created\":\"Y\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[IN]\":\"v[vadas].id\"}]" + And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\",\"created\":\"Y\"}]" And using the parameter xx3 defined as "m[{\"created\":\"N\"}]" And the traversal of """ @@ -347,8 +347,8 @@ Feature: Step - mergeE() addE("knows").from("a").to("b").property("created","Y"). addE("knows").from("b").to("a").property("created","Y") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[vadas]\"}]" - And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\",\"created\":\"Y\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[vadas].id\"}]" + And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\",\"created\":\"Y\"}]" And using the parameter xx3 defined as "m[{\"created\":\"N\"}]" And the traversal of """ @@ -370,8 +370,8 @@ Feature: Step - mergeE() addE("knows").from("a").to("b").property("created","Y"). addE("knows").from("b").to("a").property("created","Y") """ - And using the parameter xx1 defined as "m[{\"D[OUT]\":\"v[vadas]\"}]" - And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\",\"created\":\"Y\"}]" + And using the parameter xx1 defined as "m[{\"D[OUT]\":\"v[vadas].id\"}]" + And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\",\"created\":\"Y\"}]" And using the parameter xx3 defined as "m[{\"created\":\"N\"}]" And the traversal of """ @@ -410,8 +410,8 @@ Feature: Step - mergeE() addV("person").property("name", "vadas").as("b"). addE("knows").from("a").to("b") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" - And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\",\"created\":\"Y\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" + And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\",\"created\":\"Y\"}]" And using the parameter xx3 defined as "m[{\"created\":\"N\"}]" And the traversal of """ @@ -431,8 +431,8 @@ Feature: Step - mergeE() g.addV("person").property("name", "marko").as("a"). addV("person").property("name", "vadas").as("b") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" - And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\",\"created\":\"Y\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" + And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\",\"created\":\"Y\"}]" And using the parameter xx3 defined as "m[{\"created\":\"N\"}]" And the traversal of """ @@ -475,7 +475,7 @@ Feature: Step - mergeE() g.addV("person").property("name", "marko"). addV("person").property("name", "vadas") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[from]\":\"v[marko]\", \"D[to]\":\"v[vadas]\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[from]\":\"v[marko].id\", \"D[to]\":\"v[vadas].id\"}]" And the traversal of """ g.mergeE(xx1) @@ -491,8 +491,8 @@ Feature: Step - mergeE() g.addV("person").property("name", "marko"). addV("person").property("name", "vadas") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" - And using the parameter xx2 defined as "m[{\"t[label]\": \"self\", \"D[OUT]\":\"v[vadas]\", \"D[IN]\":\"v[vadas]\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" + And using the parameter xx2 defined as "m[{\"t[label]\": \"self\", \"D[OUT]\":\"v[vadas].id\", \"D[IN]\":\"v[vadas].id\"}]" And the traversal of """ g.inject(xx1, xx2).mergeE() @@ -512,8 +512,8 @@ Feature: Step - mergeE() addV("person").property("name", "vadas").as("b"). addE("knows").property("weight", 1.0d).from("a").to("b") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" - And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\",\"created\":\"Y\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" + And using the parameter xx2 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\",\"created\":\"Y\"}]" And using the parameter xx3 defined as "m[{\"created\":\"N\"}]" And the traversal of """ @@ -741,7 +741,7 @@ Feature: Step - mergeE() addV("person").property("name", "vadas").as("b"). addE("knows").property("weight", 1).from("a").to("b") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" And the traversal of """ g.V().mergeE(xx1). @@ -758,7 +758,7 @@ Feature: Step - mergeE() addV("person").property("name", "vadas").as("b"). addE("knows").property("weight", 1).from("a").to("b") """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" And the traversal of """ g.mergeE(xx1). @@ -788,7 +788,7 @@ Feature: Step - mergeE() addE("created").from("josh").to("lop").property("weight", 0.4d). addE("created").from("peter").to("lop").property("weight", 0.2d) """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" And using the parameter xx2 defined as "m[{\"created\": \"N\"}]" And the traversal of """ @@ -822,7 +822,7 @@ Feature: Step - mergeE() addE("created").from("josh").to("lop").property("weight", 0.4d). addE("created").from("peter").to("lop").property("weight", 0.2d) """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"self\", \"D[OUT]\":\"v[vadas]\", \"D[IN]\":\"v[vadas]\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"self\", \"D[OUT]\":\"v[vadas].id\", \"D[IN]\":\"v[vadas].id\"}]" And using the parameter xx2 defined as "m[{\"created\": \"N\"}]" And the traversal of """ @@ -849,7 +849,7 @@ Feature: Step - mergeE() addV("person").property("name", "vadas").as("b"). addE("knows").from("a").to("b").property("weight",1.0d) """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" And using the parameter xx2 defined as "m[{\"weight\":null}]" And the traversal of """ @@ -870,7 +870,7 @@ Feature: Step - mergeE() addV("person").property("name", "vadas").as("b"). addE("knows").from("a").to("b").property("weight",1.0d) """ - And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko]\", \"D[IN]\":\"v[vadas]\"}]" + And using the parameter xx1 defined as "m[{\"t[label]\": \"knows\", \"D[OUT]\":\"v[marko].id\", \"D[IN]\":\"v[vadas].id\"}]" And using the parameter xx2 defined as "m[{\"weight\":null}]" And the traversal of """ diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Vertex.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Vertex.feature index 0d835cb5f5e..650f97c1bfd 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Vertex.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/map/Vertex.feature @@ -65,7 +65,7 @@ Feature: Step - V(), out(), in(), both(), inE(), outE(), bothE() Scenario: g_VXlistXv1_v2_v3XX_name Given the modern graph - And using the parameter xx1 defined as "l[v[marko],v[vadas],v[lop]]" + And using the parameter xx1 defined as "l[v[marko].id,v[vadas].id,v[lop].id]" And the traversal of """ g.V(xx1).values("name") @@ -95,10 +95,10 @@ Feature: Step - V(), out(), in(), both(), inE(), outE(), bothE() Scenario: g_VXv1X_out Given the modern graph - And using the parameter v1 defined as "v[marko]" + And using the parameter vid1 defined as "v[marko].id" And the traversal of """ - g.V(v1).out() + g.V(vid1).out() """ When iterated to list Then the result should be unordered @@ -627,7 +627,7 @@ Feature: Step - V(), out(), in(), both(), inE(), outE(), bothE() addE("created").from("josh").to("lop").property("weight", 0.4d). addE("created").from("peter").to("lop").property("weight", 0.2d) """ - And using the parameter xx1 defined as "l[v[lop],v[ripple]]" + And using the parameter xx1 defined as "l[v[lop].id,v[ripple].id]" And using the parameter vid1 defined as "v[marko].id" And using the parameter vid2 defined as "v[vadas].id" And using the parameter vid3 defined as "v[lop].id" diff --git a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Inject.feature b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Inject.feature index 036b828743f..81380e1d451 100644 --- a/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Inject.feature +++ b/gremlin-test/src/main/resources/org/apache/tinkerpop/gremlin/test/features/sideEffect/Inject.feature @@ -18,23 +18,6 @@ @StepClassSideEffect @StepInject Feature: Step - inject() - @GraphComputerVerificationInjectionNotSupported - Scenario: g_VX1X_out_injectXv2X_name - Given the modern graph - And using the parameter vid1 defined as "v[marko].id" - And using the parameter v2 defined as "v[vadas]" - And the traversal of - """ - g.V(vid1).out().inject(v2).values("name") - """ - When iterated to list - Then the result should be unordered - | result | - | vadas | - | lop | - | vadas | - | josh | - @GraphComputerVerificationInjectionNotSupported Scenario: g_VX1X_out_name_injectXdanielX_asXaX_mapXlengthX_path Given the modern graph @@ -51,24 +34,6 @@ Feature: Step - inject() | p[v[marko],v[vadas],vadas,d[5].i] | | p[v[marko],v[josh],josh,d[4].i] | - @GraphComputerVerificationInjectionNotSupported - Scenario: g_VX1X_injectXg_VX4XX_out_name - Given the modern graph - And using the parameter vid1 defined as "v[marko].id" - And using the parameter v2 defined as "v[josh]" - And the traversal of - """ - g.V(vid1).inject(v2).out().values("name") - """ - When iterated to list - Then the result should be unordered - | result | - | ripple | - | lop | - | lop | - | vadas | - | josh | - @GraphComputerVerificationInjectionNotSupported Scenario: g_injectXnull_1_3_nullX Given the modern graph diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java index 12d0fec5ccf..3116f6dd83f 100644 --- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphTest.java @@ -833,42 +833,42 @@ public void shouldProvideClearErrorWhenFromOrToDoesNotResolveToVertex() { g.addE("link").property(VertexProperty.Cardinality.single, "k", 100).to(__.V(1)).iterate(); fail("Should have thrown an error"); } catch (IllegalStateException ise) { - assertEquals("The value given to addE(link).from() must resolve to a Vertex but null was specified instead", ise.getMessage()); + assertEquals("The value given to addE(link).from() must resolve to a Vertex or the ID of a Vertex present in the graph, but null was specified instead", ise.getMessage()); } try { g.addE("link").property(VertexProperty.Cardinality.single, "k", 100).from(__.V(1)).iterate(); fail("Should have thrown an error"); } catch (IllegalStateException ise) { - assertEquals("The value given to addE(link).to() must resolve to a Vertex but null was specified instead", ise.getMessage()); + assertEquals("The value given to addE(link).to() must resolve to a Vertex or the ID of a Vertex present in the graph, but null was specified instead", ise.getMessage()); } try { g.addE("link").property("k", 100).from(__.V(1)).iterate(); fail("Should have thrown an error"); } catch (IllegalStateException ise) { - assertEquals("The value given to addE(link).to() must resolve to a Vertex but null was specified instead", ise.getMessage()); + assertEquals("The value given to addE(link).to() must resolve to a Vertex or the ID of a Vertex present in the graph, but null was specified instead", ise.getMessage()); } try { g.V(1).values("name").as("a").addE("link").property(VertexProperty.Cardinality.single, "k", 100).from("a").iterate(); fail("Should have thrown an error"); } catch (IllegalStateException ise) { - assertEquals("The value given to addE(link).to() must resolve to a Vertex but String was specified instead", ise.getMessage()); + assertEquals("The value given to addE(link).to() must resolve to a Vertex or the ID of a Vertex present in the graph. The provided value does not match any vertices in the graph", ise.getMessage()); } try { g.V(1).values("name").as("a").addE("link").property(VertexProperty.Cardinality.single, "k", 100).to("a").iterate(); fail("Should have thrown an error"); } catch (IllegalStateException ise) { - assertEquals("The value given to addE(link).to() must resolve to a Vertex but String was specified instead", ise.getMessage()); + assertEquals("The value given to addE(link).to() must resolve to a Vertex or the ID of a Vertex present in the graph. The provided value does not match any vertices in the graph", ise.getMessage()); } try { g.V(1).as("v").values("name").as("a").addE("link").property(VertexProperty.Cardinality.single, "k", 100).to("v").from("a").iterate(); fail("Should have thrown an error"); } catch (IllegalStateException ise) { - assertEquals("The value given to addE(link).to() must resolve to a Vertex but String was specified instead", ise.getMessage()); + assertEquals("The value given to addE(link).from() must resolve to a Vertex or the ID of a Vertex present in the graph. The provided value does not match any vertices in the graph", ise.getMessage()); } }