You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by sp...@apache.org on 2016/10/06 18:15:23 UTC

[01/14] tinkerpop git commit: first push. We now have TraversalSource.withStrategy(String, Object...) and TraversalSource.withoutStrategy(String). Added a test case to Gremlin-Python that uses SubgraphStrategy and it works :). [Forced Update!]

Repository: tinkerpop
Updated Branches:
  refs/heads/TINKERPOP-1487 808f299b8 -> ec6acefb3 (forced update)


first push. We now have TraversalSource.withStrategy(String, Object...) and TraversalSource.withoutStrategy(String). Added a test case to Gremlin-Python that uses SubgraphStrategy and it works :).


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e6e59e41
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e6e59e41
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e6e59e41

Branch: refs/heads/TINKERPOP-1487
Commit: e6e59e417f119c1b71a43141fce04cb212bc0a58
Parents: 8ab682f
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Oct 4 08:37:07 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Oct 4 08:37:07 2016 -0600

----------------------------------------------------------------------
 .../process/traversal/TraversalSource.java      | 52 +++++++++++++++++++-
 .../dsl/graph/GraphTraversalSource.java         | 10 ++++
 .../strategy/decoration/SubgraphStrategy.java   | 18 ++++++-
 .../dsl/graph/GraphTraversalSourceTest.java     | 23 +++++++++
 .../gremlin/groovy/jsr223/GroovyTranslator.java |  8 +--
 .../gremlin/python/jsr223/PythonTranslator.java |  3 +-
 .../gremlin_python/process/graph_traversal.py   |  8 +++
 .../driver/test_driver_remote_connection.py     | 16 +++++-
 .../decoration/SubgraphStrategyProcessTest.java | 40 ++++++---------
 9 files changed, 144 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e6e59e41/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
index 0d690e9..8d5cf93 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
@@ -19,20 +19,24 @@
 package org.apache.tinkerpop.gremlin.process.traversal;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.MapConfiguration;
 import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
 import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
-import org.apache.tinkerpop.gremlin.process.remote.traversal.strategy.decoration.RemoteStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SackStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SideEffectStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
+import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
 import org.apache.tinkerpop.gremlin.util.function.ConstantSupplier;
 
 import java.io.Serializable;
 import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Optional;
 import java.util.function.BinaryOperator;
 import java.util.function.Function;
@@ -94,11 +98,57 @@ public interface TraversalSource extends Cloneable, AutoCloseable {
         public static final String withComputer = "withComputer";
         public static final String withSideEffect = "withSideEffect";
         public static final String withRemote = "withRemote";
+        public static final String withStrategy = "withStrategy";
+        public static final String withoutStrategy = "withoutStrategy";
     }
 
     /////////////////////////////
 
     /**
+     * Add a {@link TraversalStrategy} to the traversal source given the strategy name and key/value pair creation arguments.
+     *
+     * @param strategyName   the name of the strategy (the full class name)
+     * @param namedArguments key/value pair arguments where the even indices are string keys
+     * @return a new traversal source with updated strategies
+     */
+    public default TraversalSource withStrategy(final String strategyName, final Object... namedArguments) {
+        ElementHelper.legalPropertyKeyValueArray(namedArguments);
+        final Map<String, Object> configuration = new HashMap<>();
+        for (int i = 0; i < namedArguments.length; i = i + 2) {
+            configuration.put((String) namedArguments[i], namedArguments[i + 1]);
+        }
+        try {
+            final TraversalStrategy<?> traversalStrategy = (TraversalStrategy) ((0 == namedArguments.length) ?
+                    Class.forName(strategyName).getMethod("instance").invoke(null) :
+                    Class.forName(strategyName).getMethod("create", Configuration.class).invoke(null, new MapConfiguration(configuration)));
+            final TraversalSource clone = this.clone();
+            clone.getStrategies().addStrategies(traversalStrategy);
+            clone.getBytecode().addSource(Symbols.withStrategy, strategyName, namedArguments);
+            return clone;
+        } catch (final ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
+            throw new IllegalArgumentException(e.getMessage(), e);
+        }
+    }
+
+    /**
+     * Remove a {@link TraversalStrategy} from the travesal source given the strategy name.
+     *
+     * @param strategyName the name of the strategy (the full class name)
+     * @return a new traversal source with updated strategies
+     */
+    @SuppressWarnings({"unchecked", "varargs"})
+    public default TraversalSource withoutStrategy(final String strategyName) {
+        try {
+            final TraversalSource clone = this.clone();
+            clone.getStrategies().removeStrategies((Class<TraversalStrategy>) Class.forName(strategyName));
+            clone.getBytecode().addSource(TraversalSource.Symbols.withoutStrategy, strategyName);
+            return clone;
+        } catch (final ClassNotFoundException e) {
+            throw new IllegalArgumentException(e.getMessage(), e);
+        }
+    }
+
+    /**
      * Add an arbitrary collection of {@link TraversalStrategy} instances to the traversal source.
      *
      * @param traversalStrategies a colleciton of traversal strategies to add

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e6e59e41/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
index 0525f8d..bf2da7e 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
@@ -142,6 +142,16 @@ public class GraphTraversalSource implements TraversalSource {
     }
 
     @Override
+    public GraphTraversalSource withStrategy(final String strategyName, final Object... nameArguments) {
+        return (GraphTraversalSource) TraversalSource.super.withStrategy(strategyName, nameArguments);
+    }
+
+    @Override
+    public GraphTraversalSource withoutStrategy(final String strategyName) {
+        return (GraphTraversalSource) TraversalSource.super.withoutStrategy(strategyName);
+    }
+
+    @Override
     public GraphTraversalSource withStrategies(final TraversalStrategy... traversalStrategies) {
         return (GraphTraversalSource) TraversalSource.super.withStrategies(traversalStrategies);
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e6e59e41/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
index 0187969..097299f 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
 
+import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -120,7 +121,7 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy<TraversalS
     }
 
     private static void applyCriterion(final List<Step> stepsToApplyCriterionAfter, final Traversal.Admin traversal,
-                                final Traversal.Admin<? extends Element, ?> criterion) {
+                                       final Traversal.Admin<? extends Element, ?> criterion) {
         for (final Step<?, ?> step : stepsToApplyCriterionAfter) {
             // re-assign the step label to the criterion because the label should apply seamlessly after the filter
             final Step filter = new TraversalFilterStep<>(traversal, criterion.clone());
@@ -290,6 +291,21 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy<TraversalS
         return this.vertexPropertyCriterion;
     }
 
+    public static SubgraphStrategy create(final Configuration configuration) {
+        final Builder builder = SubgraphStrategy.build();
+        configuration.getKeys().forEachRemaining(key -> {
+            if (key.equals("vertices") || key.equals("vertexCriterion"))
+                builder.vertices((Traversal) configuration.getProperty(key));
+            else if (key.equals("edges") || key.equals("edgeCriterion"))
+                builder.edges((Traversal) configuration.getProperty(key));
+            else if (key.equals("vertexProperties"))
+                builder.vertexProperties((Traversal) configuration.getProperty(key));
+            else
+                throw new IllegalArgumentException("The following configuration is unknown: " + key + ":" + configuration.getProperty(key));
+        });
+        return builder.create();
+    }
+
     public static Builder build() {
         return new Builder();
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e6e59e41/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
index f9cf1df..7604ab5 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
@@ -19,9 +19,13 @@
 package org.apache.tinkerpop.gremlin.process.traversal.dsl.graph;
 
 import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
 import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
 import org.junit.Test;
 
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
 import static org.mockito.Mockito.times;
 import static org.mockito.Mockito.verify;
@@ -50,4 +54,23 @@ public class GraphTraversalSourceTest {
         verify(mock1, times(1)).close();
         verify(mock2, times(1)).close();
     }
+
+    @Test
+    public void shouldSupportStringBasedStrategies() throws Exception {
+        GraphTraversalSource g = EmptyGraph.instance().traversal();
+        assertFalse(g.getStrategies().getStrategy(SubgraphStrategy.class).isPresent());
+        g = g.withStrategy(SubgraphStrategy.class.getCanonicalName(),
+                "vertices", __.hasLabel("person"),
+                "vertexProperties", __.limit(0),
+                "edges", __.hasLabel("knows"));
+        assertTrue(g.getStrategies().getStrategy(SubgraphStrategy.class).isPresent());
+        g = g.withoutStrategy(SubgraphStrategy.class.getCanonicalName());
+        assertFalse(g.getStrategies().getStrategy(SubgraphStrategy.class).isPresent());
+        //
+        assertFalse(g.getStrategies().getStrategy(ReadOnlyStrategy.class).isPresent());
+        g = g.withStrategy(ReadOnlyStrategy.class.getCanonicalName());
+        assertTrue(g.getStrategies().getStrategy(ReadOnlyStrategy.class).isPresent());
+        g = g.withoutStrategy(ReadOnlyStrategy.class.getCanonicalName());
+        assertFalse(g.getStrategies().getStrategy(ReadOnlyStrategy.class).isPresent());
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e6e59e41/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
index 4b93881..88ca626 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
@@ -24,7 +24,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
 import org.apache.tinkerpop.gremlin.process.traversal.Translator;
-import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
 import org.apache.tinkerpop.gremlin.process.traversal.util.OrP;
 import org.apache.tinkerpop.gremlin.structure.Element;
@@ -78,15 +77,12 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
         final StringBuilder traversalScript = new StringBuilder(start);
         for (final Bytecode.Instruction instruction : bytecode.getInstructions()) {
             final String methodName = instruction.getOperator();
-            if (methodName.equals(TraversalSource.Symbols.withStrategies))
-                continue;
-            final Object[] arguments = instruction.getArguments();
-            if (0 == arguments.length)
+            if (0 == instruction.getArguments().length)
                 traversalScript.append(".").append(methodName).append("()");
             else {
                 traversalScript.append(".");
                 String temp = methodName + "(";
-                for (final Object object : arguments) {
+                for (final Object object : instruction.getArguments()) {
                     temp = temp + convertToString(object) + ",";
                 }
                 traversalScript.append(temp.substring(0, temp.length() - 1)).append(")");

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e6e59e41/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
index 90d29e8..1a84e26 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
@@ -60,6 +60,7 @@ public class PythonTranslator implements Translator.ScriptTranslator {
 
     private final String traversalSource;
     private final boolean importStatics;
+    private static final boolean isTesting = Boolean.valueOf(System.getProperty("is.testing", "false"));
 
     PythonTranslator(final String traversalSource, final boolean importStatics) {
         this.traversalSource = traversalSource;
@@ -101,7 +102,7 @@ public class PythonTranslator implements Translator.ScriptTranslator {
         for (final Bytecode.Instruction instruction : bytecode.getInstructions()) {
             final String methodName = instruction.getOperator();
             final Object[] arguments = instruction.getArguments();
-            if (methodName.equals(TraversalSource.Symbols.withStrategies))
+            if (isTesting && methodName.equals(TraversalSource.Symbols.withStrategies))
                 continue;
             else if (0 == arguments.length)
                 traversalScript.append(".").append(SymbolHelper.toPython(methodName)).append("()");

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e6e59e41/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py b/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
index 35b9b71..46b6dee 100644
--- a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
+++ b/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
@@ -57,10 +57,18 @@ class GraphTraversalSource(object):
     source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
     source.bytecode.add_source("withStrategies", *args)
     return source
+  def withStrategy(self, *args):
+    source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
+    source.bytecode.add_source("withStrategy", *args)
+    return source
   def withoutStrategies(self, *args):
     source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
     source.bytecode.add_source("withoutStrategies", *args)
     return source
+  def withoutStrategy(self, *args):
+    source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
+    source.bytecode.add_source("withoutStrategy", *args)
+    return source
   def withRemote(self, remote_connection):
     source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
     source.traversal_strategies.add_strategies([RemoteStrategy(remote_connection)])

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e6e59e41/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
index b0efcf1..f0ca27f 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
@@ -26,6 +26,7 @@ from gremlin_python import statics
 from gremlin_python.statics import long
 from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
 from gremlin_python.process.traversal import Traverser
+from gremlin_python.process.graph_traversal import __
 from gremlin_python.structure.graph import Graph
 from gremlin_python.structure.graph import Vertex
 
@@ -59,6 +60,19 @@ class TestDriverRemoteConnection(TestCase):
         g.V().out().profile().next()
         connection.close()
 
+    def test_strategies(self):
+        statics.load_statics(globals())
+        connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
+        g = Graph().traversal().withRemote(connection).withStrategy(
+            "org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy",
+            "vertices", __.hasLabel("person"),
+            "edges", __.hasLabel("created"))
+        assert 4 == g.V().count().next()
+        assert 0 == g.E().count().next()
+        assert 1 == g.V().label().dedup().count().next()
+        assert "person" == g.V().label().dedup().next()
+        connection.close()
+
     def test_side_effects(self):
         statics.load_statics(globals())
         connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
@@ -104,7 +118,7 @@ class TestDriverRemoteConnection(TestCase):
         assert 3 == n["lop"]
         assert 1 == n["ripple"]
         #
-        t = g.withSideEffect('m',32).V().map(lambda: "x: x.sideEffects('m')")
+        t = g.withSideEffect('m', 32).V().map(lambda: "x: x.sideEffects('m')")
         results = t.toSet()
         assert 1 == len(results)
         assert 32 == list(results)[0]

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e6e59e41/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
index 1a854bd..2a79c3c 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
@@ -31,7 +31,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.Inli
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
 import org.apache.tinkerpop.gremlin.structure.Column;
 import org.apache.tinkerpop.gremlin.structure.Edge;
-import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -66,8 +65,7 @@ public class SubgraphStrategyProcessTest extends AbstractGremlinProcessTest {
     public void shouldFilterVertexCriterion() throws Exception {
         final Traversal<Vertex, ?> vertexCriterion = has("name", P.within("josh", "lop", "ripple"));
 
-        final SubgraphStrategy strategy = SubgraphStrategy.build().vertexCriterion(vertexCriterion).create();
-        final GraphTraversalSource sg = create(strategy);
+        final GraphTraversalSource sg = g.withStrategies(SubgraphStrategy.build().vertexCriterion(vertexCriterion).create());
 
         // three vertices are included in the subgraph
         assertEquals(6, g.V().count().next().longValue());
@@ -154,7 +152,7 @@ public class SubgraphStrategyProcessTest extends AbstractGremlinProcessTest {
         );
 
         final SubgraphStrategy strategy = SubgraphStrategy.build().edgeCriterion(edgeCriterion).create();
-        final GraphTraversalSource sg = create(strategy);
+        final GraphTraversalSource sg = g.withStrategies(strategy);
 
         // all vertices are here
         assertEquals(6, g.V().count().next().longValue());
@@ -261,8 +259,8 @@ public class SubgraphStrategyProcessTest extends AbstractGremlinProcessTest {
                 has("weight", 1.0d).hasLabel("created") // 10
         );
 
-        final SubgraphStrategy strategy = SubgraphStrategy.build().edgeCriterion(edgeCriterion).vertexCriterion(vertexCriterion).create();
-        final GraphTraversalSource sg = create(strategy);
+        final SubgraphStrategy strategy = SubgraphStrategy.build().edges(edgeCriterion).vertices(vertexCriterion).create();
+        final GraphTraversalSource sg = g.withStrategies(strategy);
 
         // three vertices are included in the subgraph
         assertEquals(6, g.V().count().next().longValue());
@@ -337,8 +335,7 @@ public class SubgraphStrategyProcessTest extends AbstractGremlinProcessTest {
         // this will exclude "peter"
         final Traversal<Vertex, ?> vertexCriterion = has("name", P.within("ripple", "josh", "marko"));
 
-        final SubgraphStrategy strategy = SubgraphStrategy.build().vertexCriterion(vertexCriterion).create();
-        final GraphTraversalSource sg = create(strategy);
+        final GraphTraversalSource sg = g.withStrategies(SubgraphStrategy.build().vertexCriterion(vertexCriterion).create());
 
         assertEquals(9, g.V().as("a").out().in().as("b").dedup("a", "b").count().next().intValue());
         assertEquals(2, sg.V().as("a").out().in().as("b").dedup("a", "b").count().next().intValue());
@@ -352,8 +349,7 @@ public class SubgraphStrategyProcessTest extends AbstractGremlinProcessTest {
     public void shouldGetExcludedVertex() throws Exception {
         final Traversal<Vertex, ?> vertexCriterion = has("name", P.within("josh", "lop", "ripple"));
 
-        final SubgraphStrategy strategy = SubgraphStrategy.build().vertexCriterion(vertexCriterion).create();
-        final GraphTraversalSource sg = create(strategy);
+        final GraphTraversalSource sg = g.withStrategies(SubgraphStrategy.build().vertexCriterion(vertexCriterion).create());
 
         sg.V(convertToVertexId("marko")).next();
     }
@@ -367,8 +363,7 @@ public class SubgraphStrategyProcessTest extends AbstractGremlinProcessTest {
                 has("weight", 1.0d).hasLabel("created") // 10
         );
 
-        final SubgraphStrategy strategy = SubgraphStrategy.build().edgeCriterion(edgeCriterion).create();
-        final GraphTraversalSource sg = create(strategy);
+        final GraphTraversalSource sg = g.withStrategies(SubgraphStrategy.build().edges(edgeCriterion).create());
 
         sg.E(sg.E(convertToEdgeId("marko", "knows", "vadas")).next()).next();
     }
@@ -376,48 +371,45 @@ public class SubgraphStrategyProcessTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(CREW)
     public void shouldFilterVertexProperties() throws Exception {
-        GraphTraversalSource sg = create(SubgraphStrategy.build().vertexProperties(has("startTime", P.gt(2005))).create());
+        GraphTraversalSource sg = g.withStrategy(SubgraphStrategy.class.getCanonicalName(), "vertexProperties", __.has("startTime", P.gt(2005)));
         checkResults(Arrays.asList("purcellville", "baltimore", "oakland", "seattle", "aachen"), sg.V().properties("location").value());
         checkResults(Arrays.asList("purcellville", "baltimore", "oakland", "seattle", "aachen"), sg.V().values("location"));
         if (sg.getStrategies().getStrategy(InlineFilterStrategy.class).isPresent())
             assertFalse(TraversalHelper.hasStepOfAssignableClassRecursively(TraversalFilterStep.class, sg.V().properties("location").value().iterate().asAdmin()));
         // check to make sure edge properties are not analyzed
-        sg = create(SubgraphStrategy.build().vertexProperties(has("startTime", P.gt(2005))).create());
+        sg = g.withStrategies(SubgraphStrategy.build().vertexProperties(has("startTime", P.gt(2005))).create());
         checkResults(Arrays.asList("purcellville", "baltimore", "oakland", "seattle", "aachen"), sg.V().as("a").properties("location").as("b").select("a").outE().properties().select("b").value().dedup());
         checkResults(Arrays.asList("purcellville", "baltimore", "oakland", "seattle", "aachen"), sg.V().as("a").values("location").as("b").select("a").outE().properties().select("b").dedup());
         if (sg.getStrategies().getStrategy(InlineFilterStrategy.class).isPresent())
             assertFalse(TraversalHelper.hasStepOfAssignableClassRecursively(TraversalFilterStep.class, sg.V().as("a").values("location").as("b").select("a").outE().properties().select("b").dedup().iterate().asAdmin()));
         //
-        sg = create(SubgraphStrategy.build().vertices(has("name", P.neq("stephen"))).vertexProperties(has("startTime", P.gt(2005))).create());
+        sg = g.withStrategies(SubgraphStrategy.build().vertices(has("name", P.neq("stephen"))).vertexProperties(has("startTime", P.gt(2005))).create());
         checkResults(Arrays.asList("baltimore", "oakland", "seattle", "aachen"), sg.V().properties("location").value());
         checkResults(Arrays.asList("baltimore", "oakland", "seattle", "aachen"), sg.V().values("location"));
         //
-        sg = create(SubgraphStrategy.build().vertices(has("name", P.not(P.within("stephen", "daniel")))).vertexProperties(has("startTime", P.gt(2005))).create());
+        sg = g.withStrategies(SubgraphStrategy.build().vertices(has("name", P.not(P.within("stephen", "daniel")))).vertexProperties(has("startTime", P.gt(2005))).create());
         checkResults(Arrays.asList("baltimore", "oakland", "seattle"), sg.V().properties("location").value());
         checkResults(Arrays.asList("baltimore", "oakland", "seattle"), sg.V().values("location"));
         //
-        sg = create(SubgraphStrategy.build().vertices(has("name", P.eq("matthias"))).vertexProperties(has("startTime", P.gte(2014))).create());
+        sg = g.withStrategies(SubgraphStrategy.build().vertices(has("name", P.eq("matthias"))).vertexProperties(has("startTime", P.gte(2014))).create());
         checkResults(makeMapList(1, "seattle", 1L), sg.V().groupCount().by("location"));
         //
-        sg = create(SubgraphStrategy.build().vertices(has("location")).vertexProperties(hasNot("endTime")).create());
+        sg = g.withStrategies(SubgraphStrategy.build().vertices(has("location")).vertexProperties(hasNot("endTime")).create());
         checkOrderedResults(Arrays.asList("aachen", "purcellville", "santa fe", "seattle"), sg.V().order().by("location", Order.incr).values("location"));
         //
-        sg = create(SubgraphStrategy.build().vertices(has("location")).vertexProperties(hasNot("endTime")).create());
+        sg = g.withStrategy(SubgraphStrategy.class.getCanonicalName(), "vertices", __.has("location"), "vertexProperties", __.hasNot("endTime"));
         checkResults(Arrays.asList("aachen", "purcellville", "santa fe", "seattle"), sg.V().valueMap("location").select(Column.values).unfold().unfold());
         checkResults(Arrays.asList("aachen", "purcellville", "santa fe", "seattle"), sg.V().propertyMap("location").select(Column.values).unfold().unfold().value());
         //
-        sg = create(SubgraphStrategy.build().edges(__.<Edge>hasLabel("uses").has("skill", 5)).create());
+        sg = g.withStrategies(SubgraphStrategy.build().edges(__.<Edge>hasLabel("uses").has("skill", 5)).create());
         checkResults(Arrays.asList(5, 5, 5), sg.V().outE().valueMap().select(Column.values).unfold());
         checkResults(Arrays.asList(5, 5, 5), sg.V().outE().propertyMap().select(Column.values).unfold().value());
         //
-        sg = create(SubgraphStrategy.build().vertexProperties(__.hasNot("skill")).create());
+        sg = g.withStrategies(SubgraphStrategy.build().vertexProperties(__.hasNot("skill")).create());
         checkResults(Arrays.asList(3, 3, 3, 4, 4, 5, 5, 5), sg.V().outE("uses").values("skill"));
         checkResults(Arrays.asList(3, 3, 3, 4, 4, 5, 5, 5), sg.V().as("a").properties().select("a").dedup().outE().values("skill"));
         checkResults(Arrays.asList(3, 3, 3, 4, 4, 5, 5, 5), sg.V().as("a").properties().select("a").dedup().outE().properties("skill").as("b").identity().select("b").by(__.value()));
     }
 
 
-    private GraphTraversalSource create(final SubgraphStrategy strategy) {
-        return graphProvider.traversal(graph, strategy);
-    }
 }


[09/14] tinkerpop git commit: Merge branch 'TINKERPOP-1455'

Posted by sp...@apache.org.
Merge branch 'TINKERPOP-1455'


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8e4f3e0e
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8e4f3e0e
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8e4f3e0e

Branch: refs/heads/TINKERPOP-1487
Commit: 8e4f3e0e4dd98fb8d7d55eeefaf601b85278c8cb
Parents: d43d4e0 894ff3d
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Oct 6 11:27:58 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Oct 6 11:27:58 2016 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |  10 ++
 docs/src/reference/gremlin-variants.asciidoc    |  19 +++
 .../upgrade/release-3.2.x-incubating.asciidoc   |  73 +++++++++++
 .../gremlin/jsr223/JavaTranslator.java          |  58 ++++++---
 .../gremlin/process/computer/Computer.java      |  59 +++++++++
 .../computer/util/GraphComputerHelper.java      |  25 ++++
 .../gremlin/process/traversal/Bindings.java     |   5 +
 .../gremlin/process/traversal/Bytecode.java     |  72 ++++++++---
 .../process/traversal/TraversalSource.java      | 111 +++++++++++------
 .../process/traversal/TraversalStrategy.java    |  13 ++
 .../dsl/graph/GraphTraversalSource.java         |  39 ++++--
 .../strategy/decoration/ElementIdStrategy.java  |  27 ++++-
 .../decoration/HaltedTraverserStrategy.java     |  23 ++++
 .../strategy/decoration/PartitionStrategy.java  |  79 ++++++++++--
 .../strategy/decoration/SubgraphStrategy.java   |  53 ++++++--
 .../finalization/MatchAlgorithmStrategy.java    |  24 ++++
 .../StandardVerificationStrategy.java           |   1 +
 .../gremlin/jsr223/JavaTranslatorTest.java      |  68 +++++++++++
 .../gremlin/process/traversal/BytecodeTest.java |  42 +++++++
 .../dsl/graph/GraphTraversalSourceTest.java     |  28 +++++
 .../groovy/jsr223/GroovyTranslatorTest.java     |  37 +++++-
 .../gremlin/groovy/jsr223/GroovyTranslator.java |  39 ++++--
 .../python/TraversalSourceGenerator.groovy      |  17 ++-
 .../jsr223/GremlinJythonScriptEngine.java       |   9 +-
 .../gremlin/python/jsr223/PythonTranslator.java |  30 ++++-
 .../jython/gremlin_python/process/traversal.py  |  17 ++-
 .../gremlin_python/structure/io/graphson.py     |   5 +-
 .../driver/test_driver_remote_connection.py     |  25 +++-
 .../python/jsr223/JythonTranslatorTest.java     |  34 ++++++
 .../PartitionStrategyProcessTest.java           | 121 +++++++++----------
 .../decoration/SubgraphStrategyProcessTest.java |  48 ++++----
 .../process/TinkerGraphComputerProvider.java    |  10 +-
 .../TinkerGraphGroovyTranslatorProvider.java    |   3 +
 .../TinkerGraphJavaTranslatorProvider.java      |   3 +
 .../decoration/HaltedTraverserStrategyTest.java |  10 +-
 35 files changed, 1017 insertions(+), 220 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8e4f3e0e/CHANGELOG.asciidoc
----------------------------------------------------------------------


[12/14] tinkerpop git commit: Add IO Reference docs

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/docs/src/dev/io/graphson.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/io/graphson.asciidoc b/docs/src/dev/io/graphson.asciidoc
new file mode 100644
index 0000000..8fa5eee
--- /dev/null
+++ b/docs/src/dev/io/graphson.asciidoc
@@ -0,0 +1,4586 @@
+////
+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.
+
+*******************************************************************************
+* The following groovy script generates the data samples for GraphSON.
+*******************************************************************************
+import java.time.*
+mapper = GraphSONMapper.build().
+                        addRegistry(TinkerIoRegistry.getInstance()).
+                        addCustomModule(new org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV1d0.GremlinServerModule()).
+                        version(GraphSONVersion.V1_0).create().createMapper()
+graph = TinkerFactory.createTheCrew()
+g = graph.traversal()
+
+toJson = { o, type, comment = "" ->
+  println "Writing ${type}"
+  "${type}\n" +
+  "^".multiply(type.length()) + "\n\n" +
+  (comment.isEmpty() ? "" : comment + "\n\n") +
+  "[source,json]\n" +
+  "----\n" +
+  mapper.writerWithDefaultPrettyPrinter().writeValueAsString(o) + "\n" +
+  "----\n" +
+  "\n"
+}
+
+file = new File("out-graphson-1d0.txt")
+file.withWriter { writer ->
+
+  writer.write("Graph Structure\n")
+  writer.write("~~~~~~~~~~~~~~~\n\n")
+  writer.write(toJson(graph.edges().next(), "Edge"))
+  writer.write(toJson(g.V().out().out().path().next(), "Path"))
+  writer.write(toJson(graph.edges().next().properties().next(), "Property"))
+  writer.write(toJson(new org.apache.tinkerpop.gremlin.structure.util.star.DirectionalStarGraph(org.apache.tinkerpop.gremlin.structure.util.star.StarGraph.of(graph.vertices().next()), Direction.BOTH), "StarGraph"))
+  writer.write(toJson(graph, "TinkerGraph", "`TinkerGraph` has a custom serializer that is registered as part of the `TinkerIoRegistry`."))
+  writer.write(toJson(g.V().out().out().tree().next(), "Tree"))
+  writer.write(toJson(graph.vertices().next(), "Vertex"))
+  writer.write(toJson(graph.vertices().next().properties().next(), "VertexProperty"))
+
+  writer.write("\n")
+  writer.write("RequestMessage\n")
+  writer.write("~~~~~~~~~~~~~~\n\n")
+  def msg = null
+  msg = RequestMessage.build("authentication").
+                       add("saslMechanism", "PLAIN", "sasl", "AHN0ZXBocGhlbgBwYXNzd29yZA==").create()
+  writer.write(toJson(msg, "Authentication Response", "The following `RequestMessage` is an example of the response that should be made to a SASL-based authentication challenge."))
+  msg = RequestMessage.build("eval").processor("session").
+                           add("gremlin", "g.V(x)", "bindings", [x: 1], "language", "gremlin-groovy", "session", UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786")).create()
+  writer.write(toJson(msg, "Session Eval", "The following `RequestMessage` is an example of a simple session request for a script evaluation with parameters."))
+  msg = RequestMessage.build("eval").processor("session").
+                       add("gremlin", "social.V(x)", "bindings", [x: 1], "language", "gremlin-groovy", "aliases", [g: "social"], "session", UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786")).create()
+  writer.write(toJson(msg, "Session Eval", "The following `RequestMessage` is an example of a session request for a script evaluation with an alias that binds the `TraversalSource` of \"g\" to \"social\"."))
+  msg = RequestMessage.build("close").processor("session").
+                       add("session", UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786")).create()
+  writer.write(toJson(msg, "Session Close", "The following `RequestMessage` is an example of a request to close a session."))
+  msg = RequestMessage.build("eval").
+                           add("gremlin", "g.V(x)", "bindings", [x: 1], "language", "gremlin-groovy").create()
+  writer.write(toJson(msg, "Sessionless Eval", "The following `RequestMessage` is an example of a simple sessionless request for a script evaluation with parameters."))
+  msg = RequestMessage.build("eval").
+                       add("gremlin", "social.V(x)", "bindings", [x: 1], "language", "gremlin-groovy", "aliases", [g: "social"]).create()
+  writer.write(toJson(msg, "Sessionless Eval", "The following `RequestMessage` is an example of a sessionless request for a script evaluation with an alias that binds the `TraversalSource` of \"g\" to \"social\"."))
+
+  writer.write("\n")
+  writer.write("ResponseMessage\n")
+  writer.write("~~~~~~~~~~~~~~~\n\n")
+  msg = ResponseMessage.build(UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786")).
+                        code(org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode.AUTHENTICATE).create()
+  writer.write(toJson(msg, "Authentication Challenge", "When authentication is enabled, an initial request to the server will result in an authentication challenge. The typical response message will appear as follows, but handling it could be different dependending on the SASL implementation (e.g. multiple challenges maybe requested in some cases, but no in the default provided by Gremlin Server)."))
+  msg = ResponseMessage.build(UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786")).
+                        code(org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode.SUCCESS).
+                        result(Arrays.asList(graph.vertices().next())).create()
+  writer.write(toJson(msg, "Standard Result", "The following `ResponseMessage` is a typical example of the typical successful response Gremlin Server will return when returning results from a script."))
+
+  writer.write("\n")
+  writer.write("Time\n")
+  writer.write("~~~~\n\n")
+  writer.write(toJson(Duration.ofDays(5), "Duration", "The following example is a `Duration` of five days."))
+  writer.write(toJson(Instant.now(), "Instant"))
+  writer.write(toJson(LocalDate.of(2016, 1, 1), "LocalDate"))
+  writer.write(toJson(LocalDateTime.of(2016, 1, 1, 12, 30), "LocalDateTime"))
+  writer.write(toJson(LocalTime.of(12, 30, 45), "LocalTime"))
+  writer.write(toJson(MonthDay.of(1, 1), "MonthDay"))
+  writer.write(toJson(OffsetDateTime.now(), "OffsetDateTime"))
+  writer.write(toJson(OffsetTime.now(), "OffsetTime"))
+  writer.write(toJson(Period.of(1, 6, 15), "Period", "The following example is a `Period` of one year, six months and fifteen days."))
+  writer.write(toJson(Year.of(2016), "Year", "The following example is of the `Year` \"2016\"."))
+  writer.write(toJson(YearMonth.of(2016, 6), "YearMonth", "The following example is a `YearMonth` of \"June 2016\""))
+  writer.write(toJson(ZonedDateTime.now(), "ZonedDateTime"))
+  writer.write(toJson(ZoneOffset.ofHoursMinutesSeconds(3, 6, 9), "ZoneOffset", "The following example is a `ZoneOffset` of three hours, six minutes, and nine seconds."))
+
+}
+
+mapper = GraphSONMapper.build().
+                        addRegistry(TinkerIoRegistryV2d0.getInstance()).
+                        typeInfo(TypeInfo.PARTIAL_TYPES).
+                        addCustomModule(GraphSONXModuleV2d0.build().create(false)).
+                        addCustomModule(new org.apache.tinkerpop.gremlin.driver.ser.AbstractGraphSONMessageSerializerV2d0.GremlinServerModule()).
+                        version(GraphSONVersion.V2_0).create().createMapper()
+
+file = new File("out-graphson-2d0.txt")
+file.withWriter { writer ->
+
+  writer.write("Core\n")
+  writer.write("~~~~\n\n")
+  writer.write(toJson(File, "Class"))
+  writer.write(toJson(new Date(), "Date"))
+  writer.write(toJson(100.00d, "Double"))
+  writer.write(toJson(100.00f, "Float"))
+  writer.write(toJson(100, "Integer"))
+  writer.write(toJson(100L, "Long"))
+  writer.write(toJson(new java.sql.Timestamp(System.currentTimeMillis()), "Timestamp"))
+  writer.write(toJson(UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786"), "UUID"))
+
+  writer.write("\n")
+  writer.write("Graph Structure\n")
+  writer.write("~~~~~~~~~~~~~~~\n\n")
+  writer.write(toJson(graph.edges().next(), "Edge"))
+  writer.write(toJson(g.V().out().out().path().next(), "Path"))
+  writer.write(toJson(graph.edges().next().properties().next(), "Property"))
+  writer.write(toJson(new org.apache.tinkerpop.gremlin.structure.util.star.DirectionalStarGraph(org.apache.tinkerpop.gremlin.structure.util.star.StarGraph.of(graph.vertices().next()), Direction.BOTH), "StarGraph"))
+  writer.write(toJson(graph, "TinkerGraph", "`TinkerGraph` has a custom serializer that is registered as part of the `TinkerIoRegistry`."))
+  writer.write(toJson(g.V().out().out().tree().next(), "Tree"))
+  writer.write(toJson(graph.vertices().next(), "Vertex"))
+  writer.write(toJson(graph.vertices().next().properties().next(), "VertexProperty"))
+
+  writer.write("\n")
+  writer.write("Graph Process\n")
+  writer.write("~~~~~~~~~~~~~\n\n")
+  writer.write(toJson(SackFunctions.Barrier.normSack, "Barrier"))
+  writer.write(toJson(new Bytecode.Binding("x", 1), "Binding", "A \"Binding\" refers to a `Bytecode.Binding`."))
+  writer.write(toJson(g.V().hasLabel('person').out().in().tree(), "Bytecode", "The following `Bytecode` example represents the traversal of `g.V().hasLabel('person').out().in().tree()`. Obviously the serialized `Bytecode` woudl be quite different for the endless variations of commands that could be used together in the Gremlin language."))
+  writer.write(toJson(VertexProperty.Cardinality.list, "Cardinality"))
+  writer.write(toJson(Column.keys, "Column"))
+  writer.write(toJson(Direction.OUT, "Direction"))
+  writer.write(toJson(Operator.sum, "Operator"))
+  writer.write(toJson(Order.incr, "Order"))
+  writer.write(toJson(Pop.all, "Pop"))
+  writer.write(toJson(org.apache.tinkerpop.gremlin.util.function.Lambda.function("{ it.get() }"), "Lambda"))
+  writer.write(toJson(P.gt(0), "P"))
+  writer.write(toJson(P.gt(0).and(P.lt(10)), "P and"))
+  writer.write(toJson(P.gt(0).or(P.within(-1, -10, -100)), "P or"))
+  writer.write(toJson(Scope.local, "Scope"))
+  writer.write(toJson(T.label, "T"))
+  writer.write(toJson(g.V().hasLabel('person').out().out().tree().profile().next(), "TraversalMetrics"))
+  writer.write(toJson(g.V().hasLabel('person').nextTraverser(), "Traverser"))
+
+  writer.write("\n")
+  writer.write("RequestMessage\n")
+  writer.write("~~~~~~~~~~~~~~\n\n")
+  def msg = null
+  msg = RequestMessage.build("authentication").
+                       add("saslMechanism", "PLAIN", "sasl", "AHN0ZXBocGhlbgBwYXNzd29yZA==").create()
+  writer.write(toJson(msg, "Authentication Response", "The following `RequestMessage` is an example of the response that should be made to a SASL-based authentication challenge."))
+  msg = RequestMessage.build("eval").processor("session").
+                           add("gremlin", "g.V(x)", "bindings", [x: 1], "language", "gremlin-groovy", "session", UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786")).create()
+  writer.write(toJson(msg, "Session Eval", "The following `RequestMessage` is an example of a simple session request for a script evaluation with parameters."))
+  msg = RequestMessage.build("eval").processor("session").
+                       add("gremlin", "social.V(x)", "bindings", [x: 1], "language", "gremlin-groovy", "aliases", [g: "social"], "session", UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786")).create()
+  writer.write(toJson(msg, "Session Eval", "The following `RequestMessage` is an example of a session request for a script evaluation with an alias that binds the `TraversalSource` of \"g\" to \"social\"."))
+  msg = RequestMessage.build("close").processor("session").
+                       add("session", UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786")).create()
+  writer.write(toJson(msg, "Session Close", "The following `RequestMessage` is an example of a request to close a session."))
+  msg = RequestMessage.build("eval").
+                           add("gremlin", "g.V(x)", "bindings", [x: 1], "language", "gremlin-groovy").create()
+  writer.write(toJson(msg, "Sessionless Eval", "The following `RequestMessage` is an example of a simple sessionless request for a script evaluation with parameters."))
+  msg = RequestMessage.build("eval").
+                       add("gremlin", "social.V(x)", "bindings", [x: 1], "language", "gremlin-groovy", "aliases", [g: "social"]).create()
+  writer.write(toJson(msg, "Sessionless Eval", "The following `RequestMessage` is an example of a sessionless request for a script evaluation with an alias that binds the `TraversalSource` of \"g\" to \"social\"."))
+
+  writer.write("\n")
+  writer.write("ResponseMessage\n")
+  writer.write("~~~~~~~~~~~~~~~\n\n")
+  msg = ResponseMessage.build(UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786")).
+                        code(org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode.AUTHENTICATE).create()
+  writer.write(toJson(msg, "Authentication Challenge", "When authentication is enabled, an initial request to the server will result in an authentication challenge. The typical response message will appear as follows, but handling it could be different dependending on the SASL implementation (e.g. multiple challenges maybe requested in some cases, but no in the default provided by Gremlin Server)."))
+  msg = ResponseMessage.build(UUID.fromString("41d2e28a-20a4-4ab0-b379-d810dede3786")).
+                        code(org.apache.tinkerpop.gremlin.driver.message.ResponseStatusCode.SUCCESS).
+                        result(Arrays.asList(graph.vertices().next())).create()
+  writer.write(toJson(msg, "Standard Result", "The following `ResponseMessage` is a typical example of the typical successful response Gremlin Server will return when returning results from a script."))
+
+  writer.write("\n")
+  writer.write("Extended\n")
+  writer.write("~~~~~~~~\n\n")
+  writer.write("""Note that the "extended" types require the addition of the separate `GraphSONXModuleV2d0` module as follows:\n
+[source,java]
+----
+mapper = GraphSONMapper.build().
+                        typeInfo(TypeInfo.PARTIAL_TYPES).
+                        addCustomModule(GraphSONXModuleV2d0.build().create(false)).
+                        version(GraphSONVersion.V2_0).create().createMapper()
+----\n
+""")
+  writer.write(toJson(new java.math.BigDecimal(new java.math.BigInteger("123456789987654321123456789987654321")), "BigDecimal"))
+  writer.write(toJson(new java.math.BigInteger("123456789987654321123456789987654321"), "BigInteger"))
+  writer.write(toJson(new Byte("1"), "Byte"))
+  writer.write(toJson(java.nio.ByteBuffer.wrap([1,2,3,4,5] as byte[]), "ByteBuffer"))
+  writer.write(toJson("x".charAt(0), "Char"))
+  writer.write(toJson(Duration.ofDays(5), "Duration", "The following example is a `Duration` of five days."))
+  writer.write(toJson(java.net.InetAddress.getByName("localhost"), "InetAddress"))
+  writer.write(toJson(Instant.now(), "Instant"))
+  writer.write(toJson(LocalDate.of(2016, 1, 1), "LocalDate"))
+  writer.write(toJson(LocalDateTime.of(2016, 1, 1, 12, 30), "LocalDateTime"))
+  writer.write(toJson(LocalTime.of(12, 30, 45), "LocalTime"))
+  writer.write(toJson(MonthDay.of(1, 1), "MonthDay"))
+  writer.write(toJson(OffsetDateTime.now(), "OffsetDateTime"))
+  writer.write(toJson(OffsetTime.now(), "OffsetTime"))
+  writer.write(toJson(Period.of(1, 6, 15), "Period", "The following example is a `Period` of one year, six months and fifteen days."))
+  writer.write(toJson(new Short("100"), "Short"))
+  writer.write(toJson(Year.of(2016), "Year", "The following example is of the `Year` \"2016\"."))
+  writer.write(toJson(YearMonth.of(2016, 6), "YearMonth", "The following example is a `YearMonth` of \"June 2016\""))
+  writer.write(toJson(ZonedDateTime.now(), "ZonedDateTime"))
+  writer.write(toJson(ZoneOffset.ofHoursMinutesSeconds(3, 6, 9), "ZoneOffset", "The following example is a `ZoneOffset` of three hours, six minutes, and nine seconds."))
+
+}
+*******************************************************************************
+
+
+////
+[[graphson]]
+GraphSON
+========
+
+image:gremlin-graphson.png[width=350,float=left] GraphSON is a JSON-based format that is designed for human readable
+output that is easily supported in any programming language through the wide-array of JSON parsing libraries that
+exist on virtually all platforms. GraphSON is considered both a "graph" format and a generalized object serialization
+format. That characteristic makes it useful as a serialization format for Gremlin Server where arbitrary objects
+of varying types may be returned as results.
+
+When considering GraphSON as a "graph" format, the relevant feature to consider is the `writeGraph` and `readGraph`
+methods on the `GraphSONWriter` and `GraphSONReader` interfaces, respectively. These methods write the entire `Graph`
+instance as output or read an entire `Graph` instance input and they do so in a way external to generalized object
+serialization. In other words, the output of:
+
+[source,java]
+----
+final Graph graph = TinkerFactory.createModern();
+final GraphWriter writer = graph.io(IoCore.graphson()).writer();
+writer.writeGraph("tinkerpop-modern.json");
+----
+
+will be different of:
+
+[source,java]
+----
+final Graph graph = TinkerFactory.createModern();
+final GraphWriter writer = graph.io(IoCore.graphson()).writer();
+final OutputStream os = new FileOutputStream("tinkerpop-modern.json");
+writer.writeObject(os, graph);
+----
+
+Generalized object serialization will be discussed later in this section, so for now the focus will be on the "graph"
+format. Unlike GraphML, GraphSON does not use an edge list format. It uses an adjacency list. In the adjacency list,
+each vertex is essentially a line in the file and the vertex line contains a list of all the edges associated with
+that vertex. The GraphSON 2.0 representation looks like this for the Modern toy graph:
+
+[source,json]
+----
+{"id":{"@type":"g:Int32","@value":1},"label":"person","outE":{"created":[{"id":{"@type":"g:Int32","@value":9},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.4}}}],"knows":[{"id":{"@type":"g:Int32","@value":7},"inV":{"@type":"g:Int32","@value":2},"properties":{"weight":{"@type":"g:Double","@value":0.5}}},{"id":{"@type":"g:Int32","@value":8},"inV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Double","@value":1.0}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"marko"}],"age":[{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29}}]}}
+{"id":{"@type":"g:Int32","@value":2},"label":"person","inE":{"knows":[{"id":{"@type":"g:Int32","@value":7},"outV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Double","@value":0.5}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":2},"value":"vadas"}],"age":[{"id":{"@type":"g:Int64","@value":3},"value":{"@type":"g:Int32","@value":27}}]}}
+{"id":{"@type":"g:Int32","@value":3},"label":"software","inE":{"created":[{"id":{"@type":"g:Int32","@value":9},"outV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Double","@value":0.4}}},{"id":{"@type":"g:Int32","@value":11},"outV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Double","@value":0.4}}},{"id":{"@type":"g:Int32","@value":12},"outV":{"@type":"g:Int32","@value":6},"properties":{"weight":{"@type":"g:Double","@value":0.2}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":4},"value":"lop"}],"lang":[{"id":{"@type":"g:Int64","@value":5},"value":"java"}]}}
+{"id":{"@type":"g:Int32","@value":4},"label":"person","inE":{"knows":[{"id":{"@type":"g:Int32","@value":8},"outV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Double","@value":1.0}}}]},"outE":{"created":[{"id":{"@type":"g:Int32","@value":10},"inV":{"@type":"g:Int32","@value":5},"properties":{"weight":{"@type":"g:Double","@value":1.0}}},{"id":{"@type":"g:Int32","@value":11},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.4}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":6},"value":"josh"}],"age":[{"id":{"@type":"g:Int64","@value":7},"value":{"@type":"g:Int32","@value":32}}]}}
+{"id":{"@type":"g:Int32","@value":5},"label":"software","inE":{"created":[{"id":{"@type":"g:Int32","@value":10},"outV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Double","@value":1.0}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":8},"value":"ripple"}],"lang":[{"id":{"@type":"g:Int64","@value":9},"value":"java"}]}}
+{"id":{"@type":"g:Int32","@value":6},"label":"person","outE":{"created":[{"id":{"@type":"g:Int32","@value":12},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.2}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":10},"value":"peter"}],"age":[{"id":{"@type":"g:Int64","@value":11},"value":{"@type":"g:Int32","@value":35}}]}}
+----
+
+At a glance, one can see that this is not a valid JSON document. While that may seem incorrect, there is a reason. The
+"graph" format is designed by default to be splittable, such that distributed systems like Spark can easily divide the
+a GraphSON file for processing. If this data were represented as an "array of vertices" with square brackets at the
+beginning and end of the file, the format would be less conducive to fit that purpose. It is possible to change this
+behavior by building the `GraphSONWriter` with the `wrapAdjacencyList` setting set to `true`, in which case the output
+will be a valid JSON document that looks like this:
+
+[source,json]
+----
+{ "vertices": [
+  {"id":{"@type":"g:Int32","@value":1},"label":"person","outE":{"created":[{"id":{"@type":"g:Int32","@value":9},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.4}}}],"knows":[{"id":{"@type":"g:Int32","@value":7},"inV":{"@type":"g:Int32","@value":2},"properties":{"weight":{"@type":"g:Double","@value":0.5}}},{"id":{"@type":"g:Int32","@value":8},"inV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Double","@value":1.0}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":0},"value":"marko"}],"age":[{"id":{"@type":"g:Int64","@value":1},"value":{"@type":"g:Int32","@value":29}}]}}
+  {"id":{"@type":"g:Int32","@value":2},"label":"person","inE":{"knows":[{"id":{"@type":"g:Int32","@value":7},"outV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Double","@value":0.5}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":2},"value":"vadas"}],"age":[{"id":{"@type":"g:Int64","@value":3},"value":{"@type":"g:Int32","@value":27}}]}}
+  {"id":{"@type":"g:Int32","@value":3},"label":"software","inE":{"created":[{"id":{"@type":"g:Int32","@value":9},"outV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Double","@value":0.4}}},{"id":{"@type":"g:Int32","@value":11},"outV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Double","@value":0.4}}},{"id":{"@type":"g:Int32","@value":12},"outV":{"@type":"g:Int32","@value":6},"properties":{"weight":{"@type":"g:Double","@value":0.2}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":4},"value":"lop"}],"lang":[{"id":{"@type":"g:Int64","@value":5},"value":"java"}]}}
+  {"id":{"@type":"g:Int32","@value":4},"label":"person","inE":{"knows":[{"id":{"@type":"g:Int32","@value":8},"outV":{"@type":"g:Int32","@value":1},"properties":{"weight":{"@type":"g:Double","@value":1.0}}}]},"outE":{"created":[{"id":{"@type":"g:Int32","@value":10},"inV":{"@type":"g:Int32","@value":5},"properties":{"weight":{"@type":"g:Double","@value":1.0}}},{"id":{"@type":"g:Int32","@value":11},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.4}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":6},"value":"josh"}],"age":[{"id":{"@type":"g:Int64","@value":7},"value":{"@type":"g:Int32","@value":32}}]}}
+  {"id":{"@type":"g:Int32","@value":5},"label":"software","inE":{"created":[{"id":{"@type":"g:Int32","@value":10},"outV":{"@type":"g:Int32","@value":4},"properties":{"weight":{"@type":"g:Double","@value":1.0}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":8},"value":"ripple"}],"lang":[{"id":{"@type":"g:Int64","@value":9},"value":"java"}]}}
+  {"id":{"@type":"g:Int32","@value":6},"label":"person","outE":{"created":[{"id":{"@type":"g:Int32","@value":12},"inV":{"@type":"g:Int32","@value":3},"properties":{"weight":{"@type":"g:Double","@value":0.2}}}]},"properties":{"name":[{"id":{"@type":"g:Int64","@value":10},"value":"peter"}],"age":[{"id":{"@type":"g:Int64","@value":11},"value":{"@type":"g:Int32","@value":35}}]}}
+]}
+----
+
+NOTE: The `writeGraph` method essentially calls `writeVertices` with the directionality of `BOTH`. The `writeVertices`
+method simply calls `writeVertex` which detaches each `Vertex` instance into a directional `StarGraph` which forms
+the basis for the format.
+
+The following sections discuss the GraphSON object serialization format as available in each version of GraphSON. Core
+to understanding these sections is to understand that GraphSON can be produced with and without types being embedded
+in the output. Without embedded types, the type system is restricted to standard JSON types of Object, List, String,
+Number, Boolean and that will lead to "lossyness" in the format (i.e. a float will be interpreted as double).
+
+[[graphson-1d0]]
+Version 1.0
+-----------
+
+Version 1.0 of GraphSON was released with TinkerPop 3.0.0. When types are embedded, GraphSON uses the standard
+link:https://github.com/FasterXML/jackson-databind[Jackson] type embedding approach that writes the full Java class
+name into a "@class" field in the JSON. While this approach isn't especially language agnostic it does at least give
+some hint as to what the expected type is.
+
+This section focuses on non-embedded types and their formats as there was little usage of embedded types in generalized
+object serialization use cases. The format was simply too cumbersome to parse of non-Jackson enabled libraries and the
+use cases for it were limited. <<graphson-2d0,GraphSON Version 2.0>> attempts to improve upon this limitation.
+
+Graph Structure
+~~~~~~~~~~~~~~~
+
+Edge
+^^^^
+
+[source,json]
+----
+{
+  "id" : 13,
+  "label" : "develops",
+  "type" : "edge",
+  "inVLabel" : "software",
+  "outVLabel" : "person",
+  "inV" : 10,
+  "outV" : 1,
+  "properties" : {
+    "since" : 2009
+  }
+}
+----
+
+Path
+^^^^
+
+[source,json]
+----
+{
+  "labels" : [ [ ], [ ], [ ] ],
+  "objects" : [ {
+    "id" : 1,
+    "label" : "person",
+    "type" : "vertex",
+    "properties" : {
+      "name" : [ {
+        "id" : 0,
+        "value" : "marko"
+      } ],
+      "location" : [ {
+        "id" : 6,
+        "value" : "san diego",
+        "properties" : {
+          "startTime" : 1997,
+          "endTime" : 2001
+        }
+      }, {
+        "id" : 7,
+        "value" : "santa cruz",
+        "properties" : {
+          "startTime" : 2001,
+          "endTime" : 2004
+        }
+      }, {
+        "id" : 8,
+        "value" : "brussels",
+        "properties" : {
+          "startTime" : 2004,
+          "endTime" : 2005
+        }
+      }, {
+        "id" : 9,
+        "value" : "santa fe",
+        "properties" : {
+          "startTime" : 2005
+        }
+      } ]
+    }
+  }, {
+    "id" : 10,
+    "label" : "software",
+    "type" : "vertex",
+    "properties" : {
+      "name" : [ {
+        "id" : 4,
+        "value" : "gremlin"
+      } ]
+    }
+  }, {
+    "id" : 11,
+    "label" : "software",
+    "type" : "vertex",
+    "properties" : {
+      "name" : [ {
+        "id" : 5,
+        "value" : "tinkergraph"
+      } ]
+    }
+  } ]
+}
+----
+
+Property
+^^^^^^^^
+
+[source,json]
+----
+{
+  "key" : "since",
+  "value" : 2009
+}
+----
+
+StarGraph
+^^^^^^^^^
+
+[source,json]
+----
+{
+  "id" : 1,
+  "label" : "person",
+  "outE" : {
+    "uses" : [ {
+      "id" : 16,
+      "inV" : 11,
+      "properties" : {
+        "skill" : 5
+      }
+    }, {
+      "id" : 15,
+      "inV" : 10,
+      "properties" : {
+        "skill" : 4
+      }
+    } ],
+    "develops" : [ {
+      "id" : 13,
+      "inV" : 10,
+      "properties" : {
+        "since" : 2009
+      }
+    }, {
+      "id" : 14,
+      "inV" : 11,
+      "properties" : {
+        "since" : 2010
+      }
+    } ]
+  },
+  "properties" : {
+    "name" : [ {
+      "id" : 0,
+      "value" : "marko"
+    } ],
+    "location" : [ {
+      "id" : 6,
+      "value" : "san diego",
+      "properties" : {
+        "startTime" : 1997,
+        "endTime" : 2001
+      }
+    }, {
+      "id" : 7,
+      "value" : "santa cruz",
+      "properties" : {
+        "startTime" : 2001,
+        "endTime" : 2004
+      }
+    }, {
+      "id" : 8,
+      "value" : "brussels",
+      "properties" : {
+        "startTime" : 2004,
+        "endTime" : 2005
+      }
+    }, {
+      "id" : 9,
+      "value" : "santa fe",
+      "properties" : {
+        "startTime" : 2005
+      }
+    } ]
+  }
+}
+----
+
+TinkerGraph
+^^^^^^^^^^^
+
+`TinkerGraph` has a custom serializer that is registered as part of the `TinkerIoRegistry`.
+
+[source,json]
+----
+{
+  "vertices" : [ {
+    "id" : 1,
+    "label" : "person",
+    "type" : "vertex",
+    "properties" : {
+      "name" : [ {
+        "id" : 0,
+        "value" : "marko"
+      } ],
+      "location" : [ {
+        "id" : 6,
+        "value" : "san diego",
+        "properties" : {
+          "startTime" : 1997,
+          "endTime" : 2001
+        }
+      }, {
+        "id" : 7,
+        "value" : "santa cruz",
+        "properties" : {
+          "startTime" : 2001,
+          "endTime" : 2004
+        }
+      }, {
+        "id" : 8,
+        "value" : "brussels",
+        "properties" : {
+          "startTime" : 2004,
+          "endTime" : 2005
+        }
+      }, {
+        "id" : 9,
+        "value" : "santa fe",
+        "properties" : {
+          "startTime" : 2005
+        }
+      } ]
+    }
+  }, {
+    "id" : 7,
+    "label" : "person",
+    "type" : "vertex",
+    "properties" : {
+      "name" : [ {
+        "id" : 1,
+        "value" : "stephen"
+      } ],
+      "location" : [ {
+        "id" : 10,
+        "value" : "centreville",
+        "properties" : {
+          "startTime" : 1990,
+          "endTime" : 2000
+        }
+      }, {
+        "id" : 11,
+        "value" : "dulles",
+        "properties" : {
+          "startTime" : 2000,
+          "endTime" : 2006
+        }
+      }, {
+        "id" : 12,
+        "value" : "purcellville",
+        "properties" : {
+          "startTime" : 2006
+        }
+      } ]
+    }
+  }, {
+    "id" : 8,
+    "label" : "person",
+    "type" : "vertex",
+    "properties" : {
+      "name" : [ {
+        "id" : 2,
+        "value" : "matthias"
+      } ],
+      "location" : [ {
+        "id" : 13,
+        "value" : "bremen",
+        "properties" : {
+          "startTime" : 2004,
+          "endTime" : 2007
+        }
+      }, {
+        "id" : 14,
+        "value" : "baltimore",
+        "properties" : {
+          "startTime" : 2007,
+          "endTime" : 2011
+        }
+      }, {
+        "id" : 15,
+        "value" : "oakland",
+        "properties" : {
+          "startTime" : 2011,
+          "endTime" : 2014
+        }
+      }, {
+        "id" : 16,
+        "value" : "seattle",
+        "properties" : {
+          "startTime" : 2014
+        }
+      } ]
+    }
+  }, {
+    "id" : 9,
+    "label" : "person",
+    "type" : "vertex",
+    "properties" : {
+      "name" : [ {
+        "id" : 3,
+        "value" : "daniel"
+      } ],
+      "location" : [ {
+        "id" : 17,
+        "value" : "spremberg",
+        "properties" : {
+          "startTime" : 1982,
+          "endTime" : 2005
+        }
+      }, {
+        "id" : 18,
+        "value" : "kaiserslautern",
+        "properties" : {
+          "startTime" : 2005,
+          "endTime" : 2009
+        }
+      }, {
+        "id" : 19,
+        "value" : "aachen",
+        "properties" : {
+          "startTime" : 2009
+        }
+      } ]
+    }
+  }, {
+    "id" : 10,
+    "label" : "software",
+    "type" : "vertex",
+    "properties" : {
+      "name" : [ {
+        "id" : 4,
+        "value" : "gremlin"
+      } ]
+    }
+  }, {
+    "id" : 11,
+    "label" : "software",
+    "type" : "vertex",
+    "properties" : {
+      "name" : [ {
+        "id" : 5,
+        "value" : "tinkergraph"
+      } ]
+    }
+  } ],
+  "edges" : [ {
+    "id" : 13,
+    "label" : "develops",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 10,
+    "outV" : 1,
+    "properties" : {
+      "since" : 2009
+    }
+  }, {
+    "id" : 14,
+    "label" : "develops",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 11,
+    "outV" : 1,
+    "properties" : {
+      "since" : 2010
+    }
+  }, {
+    "id" : 15,
+    "label" : "uses",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 10,
+    "outV" : 1,
+    "properties" : {
+      "skill" : 4
+    }
+  }, {
+    "id" : 16,
+    "label" : "uses",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 11,
+    "outV" : 1,
+    "properties" : {
+      "skill" : 5
+    }
+  }, {
+    "id" : 17,
+    "label" : "develops",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 10,
+    "outV" : 7,
+    "properties" : {
+      "since" : 2010
+    }
+  }, {
+    "id" : 18,
+    "label" : "develops",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 11,
+    "outV" : 7,
+    "properties" : {
+      "since" : 2011
+    }
+  }, {
+    "id" : 19,
+    "label" : "uses",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 10,
+    "outV" : 7,
+    "properties" : {
+      "skill" : 5
+    }
+  }, {
+    "id" : 20,
+    "label" : "uses",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 11,
+    "outV" : 7,
+    "properties" : {
+      "skill" : 4
+    }
+  }, {
+    "id" : 21,
+    "label" : "develops",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 10,
+    "outV" : 8,
+    "properties" : {
+      "since" : 2012
+    }
+  }, {
+    "id" : 22,
+    "label" : "uses",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 10,
+    "outV" : 8,
+    "properties" : {
+      "skill" : 3
+    }
+  }, {
+    "id" : 23,
+    "label" : "uses",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 11,
+    "outV" : 8,
+    "properties" : {
+      "skill" : 3
+    }
+  }, {
+    "id" : 24,
+    "label" : "uses",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 10,
+    "outV" : 9,
+    "properties" : {
+      "skill" : 5
+    }
+  }, {
+    "id" : 25,
+    "label" : "uses",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : 11,
+    "outV" : 9,
+    "properties" : {
+      "skill" : 3
+    }
+  }, {
+    "id" : 26,
+    "label" : "traverses",
+    "type" : "edge",
+    "inVLabel" : "software",
+    "outVLabel" : "software",
+    "inV" : 11,
+    "outV" : 10
+  } ]
+}
+----
+
+Tree
+^^^^
+
+[source,json]
+----
+{
+  "1" : {
+    "key" : {
+      "id" : 1,
+      "label" : "person",
+      "type" : "vertex",
+      "properties" : {
+        "name" : [ {
+          "id" : 0,
+          "value" : "marko"
+        } ],
+        "location" : [ {
+          "id" : 6,
+          "value" : "san diego",
+          "properties" : {
+            "startTime" : 1997,
+            "endTime" : 2001
+          }
+        }, {
+          "id" : 7,
+          "value" : "santa cruz",
+          "properties" : {
+            "startTime" : 2001,
+            "endTime" : 2004
+          }
+        }, {
+          "id" : 8,
+          "value" : "brussels",
+          "properties" : {
+            "startTime" : 2004,
+            "endTime" : 2005
+          }
+        }, {
+          "id" : 9,
+          "value" : "santa fe",
+          "properties" : {
+            "startTime" : 2005
+          }
+        } ]
+      }
+    },
+    "value" : {
+      "10" : {
+        "key" : {
+          "id" : 10,
+          "label" : "software",
+          "type" : "vertex",
+          "properties" : {
+            "name" : [ {
+              "id" : 4,
+              "value" : "gremlin"
+            } ]
+          }
+        },
+        "value" : {
+          "11" : {
+            "key" : {
+              "id" : 11,
+              "label" : "software",
+              "type" : "vertex",
+              "properties" : {
+                "name" : [ {
+                  "id" : 5,
+                  "value" : "tinkergraph"
+                } ]
+              }
+            },
+            "value" : { }
+          }
+        }
+      }
+    }
+  },
+  "7" : {
+    "key" : {
+      "id" : 7,
+      "label" : "person",
+      "type" : "vertex",
+      "properties" : {
+        "name" : [ {
+          "id" : 1,
+          "value" : "stephen"
+        } ],
+        "location" : [ {
+          "id" : 10,
+          "value" : "centreville",
+          "properties" : {
+            "startTime" : 1990,
+            "endTime" : 2000
+          }
+        }, {
+          "id" : 11,
+          "value" : "dulles",
+          "properties" : {
+            "startTime" : 2000,
+            "endTime" : 2006
+          }
+        }, {
+          "id" : 12,
+          "value" : "purcellville",
+          "properties" : {
+            "startTime" : 2006
+          }
+        } ]
+      }
+    },
+    "value" : {
+      "10" : {
+        "key" : {
+          "id" : 10,
+          "label" : "software",
+          "type" : "vertex",
+          "properties" : {
+            "name" : [ {
+              "id" : 4,
+              "value" : "gremlin"
+            } ]
+          }
+        },
+        "value" : {
+          "11" : {
+            "key" : {
+              "id" : 11,
+              "label" : "software",
+              "type" : "vertex",
+              "properties" : {
+                "name" : [ {
+                  "id" : 5,
+                  "value" : "tinkergraph"
+                } ]
+              }
+            },
+            "value" : { }
+          }
+        }
+      }
+    }
+  },
+  "8" : {
+    "key" : {
+      "id" : 8,
+      "label" : "person",
+      "type" : "vertex",
+      "properties" : {
+        "name" : [ {
+          "id" : 2,
+          "value" : "matthias"
+        } ],
+        "location" : [ {
+          "id" : 13,
+          "value" : "bremen",
+          "properties" : {
+            "startTime" : 2004,
+            "endTime" : 2007
+          }
+        }, {
+          "id" : 14,
+          "value" : "baltimore",
+          "properties" : {
+            "startTime" : 2007,
+            "endTime" : 2011
+          }
+        }, {
+          "id" : 15,
+          "value" : "oakland",
+          "properties" : {
+            "startTime" : 2011,
+            "endTime" : 2014
+          }
+        }, {
+          "id" : 16,
+          "value" : "seattle",
+          "properties" : {
+            "startTime" : 2014
+          }
+        } ]
+      }
+    },
+    "value" : {
+      "10" : {
+        "key" : {
+          "id" : 10,
+          "label" : "software",
+          "type" : "vertex",
+          "properties" : {
+            "name" : [ {
+              "id" : 4,
+              "value" : "gremlin"
+            } ]
+          }
+        },
+        "value" : {
+          "11" : {
+            "key" : {
+              "id" : 11,
+              "label" : "software",
+              "type" : "vertex",
+              "properties" : {
+                "name" : [ {
+                  "id" : 5,
+                  "value" : "tinkergraph"
+                } ]
+              }
+            },
+            "value" : { }
+          }
+        }
+      }
+    }
+  },
+  "9" : {
+    "key" : {
+      "id" : 9,
+      "label" : "person",
+      "type" : "vertex",
+      "properties" : {
+        "name" : [ {
+          "id" : 3,
+          "value" : "daniel"
+        } ],
+        "location" : [ {
+          "id" : 17,
+          "value" : "spremberg",
+          "properties" : {
+            "startTime" : 1982,
+            "endTime" : 2005
+          }
+        }, {
+          "id" : 18,
+          "value" : "kaiserslautern",
+          "properties" : {
+            "startTime" : 2005,
+            "endTime" : 2009
+          }
+        }, {
+          "id" : 19,
+          "value" : "aachen",
+          "properties" : {
+            "startTime" : 2009
+          }
+        } ]
+      }
+    },
+    "value" : {
+      "10" : {
+        "key" : {
+          "id" : 10,
+          "label" : "software",
+          "type" : "vertex",
+          "properties" : {
+            "name" : [ {
+              "id" : 4,
+              "value" : "gremlin"
+            } ]
+          }
+        },
+        "value" : {
+          "11" : {
+            "key" : {
+              "id" : 11,
+              "label" : "software",
+              "type" : "vertex",
+              "properties" : {
+                "name" : [ {
+                  "id" : 5,
+                  "value" : "tinkergraph"
+                } ]
+              }
+            },
+            "value" : { }
+          }
+        }
+      }
+    }
+  }
+}
+----
+
+Vertex
+^^^^^^
+
+[source,json]
+----
+{
+  "id" : 1,
+  "label" : "person",
+  "type" : "vertex",
+  "properties" : {
+    "name" : [ {
+      "id" : 0,
+      "value" : "marko"
+    } ],
+    "location" : [ {
+      "id" : 6,
+      "value" : "san diego",
+      "properties" : {
+        "startTime" : 1997,
+        "endTime" : 2001
+      }
+    }, {
+      "id" : 7,
+      "value" : "santa cruz",
+      "properties" : {
+        "startTime" : 2001,
+        "endTime" : 2004
+      }
+    }, {
+      "id" : 8,
+      "value" : "brussels",
+      "properties" : {
+        "startTime" : 2004,
+        "endTime" : 2005
+      }
+    }, {
+      "id" : 9,
+      "value" : "santa fe",
+      "properties" : {
+        "startTime" : 2005
+      }
+    } ]
+  }
+}
+----
+
+VertexProperty
+^^^^^^^^^^^^^^
+
+[source,json]
+----
+{
+  "id" : 0,
+  "value" : "marko",
+  "label" : "name"
+}
+----
+
+
+RequestMessage
+~~~~~~~~~~~~~~
+
+Authentication Response
+^^^^^^^^^^^^^^^^^^^^^^^
+
+The following `RequestMessage` is an example of the response that should be made to a SASL-based authentication challenge.
+
+[source,json]
+----
+{
+  "requestId" : "e943a111-a9f4-4fbd-bc47-28c5e01de67e",
+  "op" : "authentication",
+  "processor" : "",
+  "args" : {
+    "saslMechanism" : "PLAIN",
+    "sasl" : "AHN0ZXBocGhlbgBwYXNzd29yZA=="
+  }
+}
+----
+
+Session Eval
+^^^^^^^^^^^^
+
+The following `RequestMessage` is an example of a simple session request for a script evaluation with parameters.
+
+[source,json]
+----
+{
+  "requestId" : "5d7e3354-cd29-47eb-b14a-d6fcc973e58e",
+  "op" : "eval",
+  "processor" : "session",
+  "args" : {
+    "gremlin" : "g.V(x)",
+    "language" : "gremlin-groovy",
+    "session" : "41d2e28a-20a4-4ab0-b379-d810dede3786",
+    "bindings" : {
+      "x" : 1
+    }
+  }
+}
+----
+
+Session Eval
+^^^^^^^^^^^^
+
+The following `RequestMessage` is an example of a session request for a script evaluation with an alias that binds the `TraversalSource` of "g" to "social".
+
+[source,json]
+----
+{
+  "requestId" : "bb310bd3-f44f-4617-8195-4794e8e5851b",
+  "op" : "eval",
+  "processor" : "session",
+  "args" : {
+    "gremlin" : "social.V(x)",
+    "language" : "gremlin-groovy",
+    "aliases" : {
+      "g" : "social"
+    },
+    "session" : "41d2e28a-20a4-4ab0-b379-d810dede3786",
+    "bindings" : {
+      "x" : 1
+    }
+  }
+}
+----
+
+Session Close
+^^^^^^^^^^^^^
+
+The following `RequestMessage` is an example of a request to close a session.
+
+[source,json]
+----
+{
+  "requestId" : "58d90945-76b1-4109-b6f8-44629752bda0",
+  "op" : "close",
+  "processor" : "session",
+  "args" : {
+    "session" : "41d2e28a-20a4-4ab0-b379-d810dede3786"
+  }
+}
+----
+
+Sessionless Eval
+^^^^^^^^^^^^^^^^
+
+The following `RequestMessage` is an example of a simple sessionless request for a script evaluation with parameters.
+
+[source,json]
+----
+{
+  "requestId" : "7239b3a7-0e5a-4b6f-b941-bcbc2b38bf3e",
+  "op" : "eval",
+  "processor" : "",
+  "args" : {
+    "gremlin" : "g.V(x)",
+    "language" : "gremlin-groovy",
+    "bindings" : {
+      "x" : 1
+    }
+  }
+}
+----
+
+Sessionless Eval
+^^^^^^^^^^^^^^^^
+
+The following `RequestMessage` is an example of a sessionless request for a script evaluation with an alias that binds the `TraversalSource` of "g" to "social".
+
+[source,json]
+----
+{
+  "requestId" : "6e0fea49-2ea4-4cf9-859d-723b4b468efe",
+  "op" : "eval",
+  "processor" : "",
+  "args" : {
+    "gremlin" : "social.V(x)",
+    "language" : "gremlin-groovy",
+    "aliases" : {
+      "g" : "social"
+    },
+    "bindings" : {
+      "x" : 1
+    }
+  }
+}
+----
+
+
+ResponseMessage
+~~~~~~~~~~~~~~~
+
+Authentication Challenge
+^^^^^^^^^^^^^^^^^^^^^^^^
+
+When authentication is enabled, an initial request to the server will result in an authentication challenge. The typical response message will appear as follows, but handling it could be different dependending on the SASL implementation (e.g. multiple challenges maybe requested in some cases, but no in the default provided by Gremlin Server).
+
+[source,json]
+----
+{
+  "requestId" : "41d2e28a-20a4-4ab0-b379-d810dede3786",
+  "status" : {
+    "message" : "",
+    "code" : 407,
+    "attributes" : { }
+  },
+  "result" : {
+    "data" : null,
+    "meta" : { }
+  }
+}
+----
+
+Standard Result
+^^^^^^^^^^^^^^^
+
+The following `ResponseMessage` is a typical example of the typical successful response Gremlin Server will return when returning results from a script.
+
+[source,json]
+----
+{
+  "requestId" : "41d2e28a-20a4-4ab0-b379-d810dede3786",
+  "status" : {
+    "message" : "",
+    "code" : 200,
+    "attributes" : { }
+  },
+  "result" : {
+    "data" : [ {
+      "id" : 1,
+      "label" : "person",
+      "type" : "vertex",
+      "properties" : {
+        "name" : [ {
+          "id" : 0,
+          "value" : "marko"
+        } ],
+        "location" : [ {
+          "id" : 6,
+          "value" : "san diego",
+          "properties" : {
+            "startTime" : 1997,
+            "endTime" : 2001
+          }
+        }, {
+          "id" : 7,
+          "value" : "santa cruz",
+          "properties" : {
+            "startTime" : 2001,
+            "endTime" : 2004
+          }
+        }, {
+          "id" : 8,
+          "value" : "brussels",
+          "properties" : {
+            "startTime" : 2004,
+            "endTime" : 2005
+          }
+        }, {
+          "id" : 9,
+          "value" : "santa fe",
+          "properties" : {
+            "startTime" : 2005
+          }
+        } ]
+      }
+    } ],
+    "meta" : { }
+  }
+}
+----
+
+
+Time
+~~~~
+
+Duration
+^^^^^^^^
+
+The following example is a `Duration` of five days.
+
+[source,json]
+----
+"PT120H"
+----
+
+Instant
+^^^^^^^
+
+[source,json]
+----
+"2016-10-04T12:17:19.571Z"
+----
+
+LocalDate
+^^^^^^^^^
+
+[source,json]
+----
+"2016-01-01"
+----
+
+LocalDateTime
+^^^^^^^^^^^^^
+
+[source,json]
+----
+"2016-01-01T12:30"
+----
+
+LocalTime
+^^^^^^^^^
+
+[source,json]
+----
+"12:30:45"
+----
+
+MonthDay
+^^^^^^^^
+
+[source,json]
+----
+"--01-01"
+----
+
+OffsetDateTime
+^^^^^^^^^^^^^^
+
+[source,json]
+----
+"2016-10-04T08:17:19.613-04:00"
+----
+
+OffsetTime
+^^^^^^^^^^
+
+[source,json]
+----
+"08:17:19.620-04:00"
+----
+
+Period
+^^^^^^
+
+The following example is a `Period` of one year, six months and fifteen days.
+
+[source,json]
+----
+"P1Y6M15D"
+----
+
+Year
+^^^^
+
+The following example is of the `Year` "2016".
+
+[source,json]
+----
+"2016"
+----
+
+YearMonth
+^^^^^^^^^
+
+The following example is a `YearMonth` of "June 2016"
+
+[source,json]
+----
+"2016-06"
+----
+
+ZonedDateTime
+^^^^^^^^^^^^^
+
+[source,json]
+----
+"2016-10-04T08:17:19.633-04:00[America/New_York]"
+----
+
+ZoneOffset
+^^^^^^^^^^
+
+The following example is a `ZoneOffset` of three hours, six minutes, and nine seconds.
+
+[source,json]
+----
+"+03:06:09"
+----
+
+[[graphson-2d0]]
+Version 2.0
+-----------
+
+Version 2.0 of GraphSON was first introduced on TinkerPop 3.2.2. It was designed to be less tied to
+link:https://github.com/FasterXML/jackson-databind[Jackson] (a JVM library) and to be less lossy as it pertained to
+types. While the <<graphson-1d0,GraphSON 1.0>> section focused on GraphSON without embedded types, GraphSON 2.0 will
+do the opposite as embedded types is the expected manner in which non-JVM languages will interact with TinkerPop.
+
+With GraphSON 2.0, there are essentially two type formats:
+
+* A non-typed value which is assumed the type implied by JSON. These non-types are limited to `String`, `Boolean`,
+`Map` and `Collection`.
+* All other values are typed by way of a "complex object" that defines a `@typeId` and `@value`. The `@typeId` is
+composed of two parts: a namespace and a type name, in the format "namespace:typename". A namespace allows TinkerPop
+providers and users to categorize custom types that they may implement and avoid collision with existing TinkerPop
+types. By default, TinkerPop types will have the namespace "g" (or "gx" for "extended" types).
+
+Core
+~~~~
+
+Class
+^^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Class",
+  "@value" : "java.io.File"
+}
+----
+
+Date
+^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Date",
+  "@value" : 1475583442552
+}
+----
+
+Double
+^^^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Double",
+  "@value" : 100.0
+}
+----
+
+Float
+^^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Float",
+  "@value" : 100.0
+}
+----
+
+Integer
+^^^^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Int32",
+  "@value" : 100
+}
+----
+
+Long
+^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Int64",
+  "@value" : 100
+}
+----
+
+Timestamp
+^^^^^^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Timestamp",
+  "@value" : 1475583442558
+}
+----
+
+UUID
+^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:UUID",
+  "@value" : "41d2e28a-20a4-4ab0-b379-d810dede3786"
+}
+----
+
+
+Graph Structure
+~~~~~~~~~~~~~~~
+
+Edge
+^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Edge",
+  "@value" : {
+    "id" : {
+      "@type" : "g:Int32",
+      "@value" : 13
+    },
+    "label" : "develops",
+    "inVLabel" : "software",
+    "outVLabel" : "person",
+    "inV" : {
+      "@type" : "g:Int32",
+      "@value" : 10
+    },
+    "outV" : {
+      "@type" : "g:Int32",
+      "@value" : 1
+    },
+    "properties" : {
+      "since" : {
+        "@type" : "g:Property",
+        "@value" : {
+          "key" : "since",
+          "value" : {
+            "@type" : "g:Int32",
+            "@value" : 2009
+          }
+        }
+      }
+    }
+  }
+}
+----
+
+Path
+^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Path",
+  "@value" : {
+    "labels" : [ [ ], [ ], [ ] ],
+    "objects" : [ {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 1
+        },
+        "label" : "person",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 0
+              },
+              "value" : "marko",
+              "label" : "name"
+            }
+          } ],
+          "location" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 6
+              },
+              "value" : "san diego",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 1997
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2001
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 7
+              },
+              "value" : "santa cruz",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2001
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2004
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 8
+              },
+              "value" : "brussels",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2004
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2005
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 9
+              },
+              "value" : "santa fe",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2005
+                }
+              }
+            }
+          } ]
+        }
+      }
+    }, {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 10
+        },
+        "label" : "software",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 4
+              },
+              "value" : "gremlin",
+              "label" : "name"
+            }
+          } ]
+        }
+      }
+    }, {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 11
+        },
+        "label" : "software",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 5
+              },
+              "value" : "tinkergraph",
+              "label" : "name"
+            }
+          } ]
+        }
+      }
+    } ]
+  }
+}
+----
+
+Property
+^^^^^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Property",
+  "@value" : {
+    "key" : "since",
+    "value" : {
+      "@type" : "g:Int32",
+      "@value" : 2009
+    }
+  }
+}
+----
+
+StarGraph
+^^^^^^^^^
+
+[source,json]
+----
+{
+  "id" : {
+    "@type" : "g:Int32",
+    "@value" : 1
+  },
+  "label" : "person",
+  "outE" : {
+    "uses" : [ {
+      "id" : {
+        "@type" : "g:Int32",
+        "@value" : 16
+      },
+      "inV" : {
+        "@type" : "g:Int32",
+        "@value" : 11
+      },
+      "properties" : {
+        "skill" : {
+          "@type" : "g:Int32",
+          "@value" : 5
+        }
+      }
+    }, {
+      "id" : {
+        "@type" : "g:Int32",
+        "@value" : 15
+      },
+      "inV" : {
+        "@type" : "g:Int32",
+        "@value" : 10
+      },
+      "properties" : {
+        "skill" : {
+          "@type" : "g:Int32",
+          "@value" : 4
+        }
+      }
+    } ],
+    "develops" : [ {
+      "id" : {
+        "@type" : "g:Int32",
+        "@value" : 13
+      },
+      "inV" : {
+        "@type" : "g:Int32",
+        "@value" : 10
+      },
+      "properties" : {
+        "since" : {
+          "@type" : "g:Int32",
+          "@value" : 2009
+        }
+      }
+    }, {
+      "id" : {
+        "@type" : "g:Int32",
+        "@value" : 14
+      },
+      "inV" : {
+        "@type" : "g:Int32",
+        "@value" : 11
+      },
+      "properties" : {
+        "since" : {
+          "@type" : "g:Int32",
+          "@value" : 2010
+        }
+      }
+    } ]
+  },
+  "properties" : {
+    "name" : [ {
+      "id" : {
+        "@type" : "g:Int64",
+        "@value" : 0
+      },
+      "value" : "marko"
+    } ],
+    "location" : [ {
+      "id" : {
+        "@type" : "g:Int64",
+        "@value" : 6
+      },
+      "value" : "san diego",
+      "properties" : {
+        "startTime" : {
+          "@type" : "g:Int32",
+          "@value" : 1997
+        },
+        "endTime" : {
+          "@type" : "g:Int32",
+          "@value" : 2001
+        }
+      }
+    }, {
+      "id" : {
+        "@type" : "g:Int64",
+        "@value" : 7
+      },
+      "value" : "santa cruz",
+      "properties" : {
+        "startTime" : {
+          "@type" : "g:Int32",
+          "@value" : 2001
+        },
+        "endTime" : {
+          "@type" : "g:Int32",
+          "@value" : 2004
+        }
+      }
+    }, {
+      "id" : {
+        "@type" : "g:Int64",
+        "@value" : 8
+      },
+      "value" : "brussels",
+      "properties" : {
+        "startTime" : {
+          "@type" : "g:Int32",
+          "@value" : 2004
+        },
+        "endTime" : {
+          "@type" : "g:Int32",
+          "@value" : 2005
+        }
+      }
+    }, {
+      "id" : {
+        "@type" : "g:Int64",
+        "@value" : 9
+      },
+      "value" : "santa fe",
+      "properties" : {
+        "startTime" : {
+          "@type" : "g:Int32",
+          "@value" : 2005
+        }
+      }
+    } ]
+  }
+}
+----
+
+TinkerGraph
+^^^^^^^^^^^
+
+`TinkerGraph` has a custom serializer that is registered as part of the `TinkerIoRegistry`.
+
+[source,json]
+----
+{
+  "@type" : "tinker:graph",
+  "@value" : {
+    "vertices" : [ {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 1
+        },
+        "label" : "person",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 0
+              },
+              "value" : "marko",
+              "label" : "name"
+            }
+          } ],
+          "location" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 6
+              },
+              "value" : "san diego",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 1997
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2001
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 7
+              },
+              "value" : "santa cruz",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2001
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2004
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 8
+              },
+              "value" : "brussels",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2004
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2005
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 9
+              },
+              "value" : "santa fe",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2005
+                }
+              }
+            }
+          } ]
+        }
+      }
+    }, {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 7
+        },
+        "label" : "person",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 1
+              },
+              "value" : "stephen",
+              "label" : "name"
+            }
+          } ],
+          "location" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 10
+              },
+              "value" : "centreville",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 1990
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2000
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 11
+              },
+              "value" : "dulles",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2000
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2006
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 12
+              },
+              "value" : "purcellville",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2006
+                }
+              }
+            }
+          } ]
+        }
+      }
+    }, {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 8
+        },
+        "label" : "person",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 2
+              },
+              "value" : "matthias",
+              "label" : "name"
+            }
+          } ],
+          "location" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 13
+              },
+              "value" : "bremen",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2004
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2007
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 14
+              },
+              "value" : "baltimore",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2007
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2011
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 15
+              },
+              "value" : "oakland",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2011
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2014
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 16
+              },
+              "value" : "seattle",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2014
+                }
+              }
+            }
+          } ]
+        }
+      }
+    }, {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 9
+        },
+        "label" : "person",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 3
+              },
+              "value" : "daniel",
+              "label" : "name"
+            }
+          } ],
+          "location" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 17
+              },
+              "value" : "spremberg",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 1982
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2005
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 18
+              },
+              "value" : "kaiserslautern",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2005
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2009
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 19
+              },
+              "value" : "aachen",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2009
+                }
+              }
+            }
+          } ]
+        }
+      }
+    }, {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 10
+        },
+        "label" : "software",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 4
+              },
+              "value" : "gremlin",
+              "label" : "name"
+            }
+          } ]
+        }
+      }
+    }, {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 11
+        },
+        "label" : "software",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 5
+              },
+              "value" : "tinkergraph",
+              "label" : "name"
+            }
+          } ]
+        }
+      }
+    } ],
+    "edges" : [ {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 13
+        },
+        "label" : "develops",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 10
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 1
+        },
+        "properties" : {
+          "since" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "since",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 2009
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 14
+        },
+        "label" : "develops",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 11
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 1
+        },
+        "properties" : {
+          "since" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "since",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 2010
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 15
+        },
+        "label" : "uses",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 10
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 1
+        },
+        "properties" : {
+          "skill" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "skill",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 4
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 16
+        },
+        "label" : "uses",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 11
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 1
+        },
+        "properties" : {
+          "skill" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "skill",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 5
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 17
+        },
+        "label" : "develops",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 10
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 7
+        },
+        "properties" : {
+          "since" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "since",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 2010
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 18
+        },
+        "label" : "develops",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 11
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 7
+        },
+        "properties" : {
+          "since" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "since",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 2011
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 19
+        },
+        "label" : "uses",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 10
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 7
+        },
+        "properties" : {
+          "skill" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "skill",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 5
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 20
+        },
+        "label" : "uses",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 11
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 7
+        },
+        "properties" : {
+          "skill" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "skill",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 4
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 21
+        },
+        "label" : "develops",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 10
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 8
+        },
+        "properties" : {
+          "since" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "since",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 2012
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 22
+        },
+        "label" : "uses",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 10
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 8
+        },
+        "properties" : {
+          "skill" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "skill",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 3
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 23
+        },
+        "label" : "uses",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 11
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 8
+        },
+        "properties" : {
+          "skill" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "skill",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 3
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 24
+        },
+        "label" : "uses",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 10
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 9
+        },
+        "properties" : {
+          "skill" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "skill",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 5
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 25
+        },
+        "label" : "uses",
+        "inVLabel" : "software",
+        "outVLabel" : "person",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 11
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 9
+        },
+        "properties" : {
+          "skill" : {
+            "@type" : "g:Property",
+            "@value" : {
+              "key" : "skill",
+              "value" : {
+                "@type" : "g:Int32",
+                "@value" : 3
+              }
+            }
+          }
+        }
+      }
+    }, {
+      "@type" : "g:Edge",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 26
+        },
+        "label" : "traverses",
+        "inVLabel" : "software",
+        "outVLabel" : "software",
+        "inV" : {
+          "@type" : "g:Int32",
+          "@value" : 11
+        },
+        "outV" : {
+          "@type" : "g:Int32",
+          "@value" : 10
+        }
+      }
+    } ]
+  }
+}
+----
+
+Tree
+^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Tree",
+  "@value" : [ {
+    "key" : {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 1
+        },
+        "label" : "person",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 0
+              },
+              "value" : "marko",
+              "label" : "name"
+            }
+          } ],
+          "location" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 6
+              },
+              "value" : "san diego",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 1997
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2001
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 7
+              },
+              "value" : "santa cruz",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2001
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2004
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 8
+              },
+              "value" : "brussels",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2004
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2005
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 9
+              },
+              "value" : "santa fe",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2005
+                }
+              }
+            }
+          } ]
+        }
+      }
+    },
+    "value" : {
+      "@type" : "g:Tree",
+      "@value" : [ {
+        "key" : {
+          "@type" : "g:Vertex",
+          "@value" : {
+            "id" : {
+              "@type" : "g:Int32",
+              "@value" : 10
+            },
+            "label" : "software",
+            "properties" : {
+              "name" : [ {
+                "@type" : "g:VertexProperty",
+                "@value" : {
+                  "id" : {
+                    "@type" : "g:Int64",
+                    "@value" : 4
+                  },
+                  "value" : "gremlin",
+                  "label" : "name"
+                }
+              } ]
+            }
+          }
+        },
+        "value" : {
+          "@type" : "g:Tree",
+          "@value" : [ {
+            "key" : {
+              "@type" : "g:Vertex",
+              "@value" : {
+                "id" : {
+                  "@type" : "g:Int32",
+                  "@value" : 11
+                },
+                "label" : "software",
+                "properties" : {
+                  "name" : [ {
+                    "@type" : "g:VertexProperty",
+                    "@value" : {
+                      "id" : {
+                        "@type" : "g:Int64",
+                        "@value" : 5
+                      },
+                      "value" : "tinkergraph",
+                      "label" : "name"
+                    }
+                  } ]
+                }
+              }
+            },
+            "value" : {
+              "@type" : "g:Tree",
+              "@value" : [ ]
+            }
+          } ]
+        }
+      } ]
+    }
+  }, {
+    "key" : {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 7
+        },
+        "label" : "person",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 1
+              },
+              "value" : "stephen",
+              "label" : "name"
+            }
+          } ],
+          "location" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 10
+              },
+              "value" : "centreville",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 1990
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2000
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 11
+              },
+              "value" : "dulles",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2000
+                },
+                "endTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2006
+                }
+              }
+            }
+          }, {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 12
+              },
+              "value" : "purcellville",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+                  "@value" : 2006
+                }
+              }
+            }
+          } ]
+        }
+      }
+    },
+    "value" : {
+      "@type" : "g:Tree",
+      "@value" : [ {
+        "key" : {
+          "@type" : "g:Vertex",
+          "@value" : {
+            "id" : {
+              "@type" : "g:Int32",
+              "@value" : 10
+            },
+            "label" : "software",
+            "properties" : {
+              "name" : [ {
+                "@type" : "g:VertexProperty",
+                "@value" : {
+                  "id" : {
+                    "@type" : "g:Int64",
+                    "@value" : 4
+                  },
+                  "value" : "gremlin",
+                  "label" : "name"
+                }
+              } ]
+            }
+          }
+        },
+        "value" : {
+          "@type" : "g:Tree",
+          "@value" : [ {
+            "key" : {
+              "@type" : "g:Vertex",
+              "@value" : {
+                "id" : {
+                  "@type" : "g:Int32",
+                  "@value" : 11
+                },
+                "label" : "software",
+                "properties" : {
+                  "name" : [ {
+                    "@type" : "g:VertexProperty",
+                    "@value" : {
+                      "id" : {
+                        "@type" : "g:Int64",
+                        "@value" : 5
+                      },
+                      "value" : "tinkergraph",
+                      "label" : "name"
+                    }
+                  } ]
+                }
+              }
+            },
+            "value" : {
+              "@type" : "g:Tree",
+              "@value" : [ ]
+            }
+          } ]
+        }
+      } ]
+    }
+  }, {
+    "key" : {
+      "@type" : "g:Vertex",
+      "@value" : {
+        "id" : {
+          "@type" : "g:Int32",
+          "@value" : 8
+        },
+        "label" : "person",
+        "properties" : {
+          "name" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 2
+              },
+              "value" : "matthias",
+              "label" : "name"
+            }
+          } ],
+          "location" : [ {
+            "@type" : "g:VertexProperty",
+            "@value" : {
+              "id" : {
+                "@type" : "g:Int64",
+                "@value" : 13
+              },
+              "value" : "bremen",
+              "label" : "location",
+              "properties" : {
+                "startTime" : {
+                  "@type" : "g:Int32",
+            

<TRUNCATED>

[06/14] tinkerpop git commit: Added more javadoc and made nextTraverser() explicit.

Posted by sp...@apache.org.
Added more javadoc and made nextTraverser() explicit.

nextTraverser() on AbstractRemoteTraversal is now an abstract method which will make it more clear that it should be implemented. This method is instrumental to getting "remoting" to work as RemoteStep only calls that method and not next()/hasNext(). TINKERPOP-1486 CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d43d4e01
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d43d4e01
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d43d4e01

Branch: refs/heads/TINKERPOP-1487
Commit: d43d4e01a3299f9031a2b1ac38790e67f1fe01cb
Parents: d23b971
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Oct 5 15:15:08 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Wed Oct 5 15:15:08 2016 -0400

----------------------------------------------------------------------
 .../remote/traversal/AbstractRemoteTraversal.java | 17 +++++++++++++++++
 .../process/remote/traversal/RemoteTraversal.java | 18 ++++++++++++++++++
 .../traversal/RemoteTraversalSideEffects.java     | 13 +++++++++++++
 .../remote/traversal/step/map/RemoteStep.java     |  2 --
 .../driver/remote/DriverRemoteTraversal.java      |  9 ++++++++-
 5 files changed, 56 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d43d4e01/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/AbstractRemoteTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/AbstractRemoteTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/AbstractRemoteTraversal.java
index 28eeae8..0c6a7aa 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/AbstractRemoteTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/AbstractRemoteTraversal.java
@@ -18,12 +18,16 @@
  */
 package org.apache.tinkerpop.gremlin.process.remote.traversal;
 
+import org.apache.tinkerpop.gremlin.process.remote.traversal.step.map.RemoteStep;
 import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
+import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import org.apache.tinkerpop.gremlin.process.traversal.TraverserGenerator;
 import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 
@@ -32,9 +36,22 @@ import java.util.Optional;
 import java.util.Set;
 
 /**
+ * This is a stub implementation for {@link RemoteTraversal} and requires that the {@link #nextTraverser()} method
+ * is implemented from {@link Traversal.Admin}. It is this method that gets called from {@link RemoteStep} when
+ * the {@link Traversal} is iterated.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public abstract class AbstractRemoteTraversal<S,E> implements RemoteTraversal<S,E> {
+
+    /**
+     * Note that internally {@link #nextTraverser()} is called from within a loop (specifically in
+     * {@link AbstractStep#next()} that breaks properly when a {@link java.util.NoSuchElementException} is thrown. In
+     * other words the "results" should be iterated to force that failure.
+     */
+    @Override
+    public abstract Traverser.Admin<E> nextTraverser();
+
     @Override
     public Bytecode getBytecode() {
         throw new UnsupportedOperationException("Remote traversals do not support this method");

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d43d4e01/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversal.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversal.java
index 1f2ac74..9c893c2 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversal.java
@@ -18,12 +18,30 @@
  */
 package org.apache.tinkerpop.gremlin.process.remote.traversal;
 
+import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
+import org.apache.tinkerpop.gremlin.process.remote.traversal.step.map.RemoteStep;
+import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.AbstractStep;
 
 /**
+ * A {@link RemoteTraversal} is returned from {@link RemoteConnection#submit(Bytecode)}. It is iterated from within
+ * {@link RemoteStep} using {@link #nextTraverser()}. Implementations should typically be given a "result" from a
+ * remote source where the traversal was executed. The "result" should be an iterator which preferably has its data
+ * bulked.
+ * <p/>
+ * Note that internally {@link #nextTraverser()} is called from within a loop (specifically in
+ * {@link AbstractStep#next()} that breaks properly when a {@link java.util.NoSuchElementException} is thrown. In other
+ * words the "results" should be iterated to force that failure.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public interface RemoteTraversal<S,E> extends Traversal.Admin<S,E> {
+
+    /**
+     * Returns remote side-effects generated by the traversal so that they can accessible to the client. Note that
+     * "side-effect" refers to the value in "a" in the traversal {@code g.V().aggregate('a').values('name')}.
+     */
     @Override
     public RemoteTraversalSideEffects getSideEffects();
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d43d4e01/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversalSideEffects.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversalSideEffects.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversalSideEffects.java
index 97fb36d..ff16bf9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversalSideEffects.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/RemoteTraversalSideEffects.java
@@ -19,11 +19,24 @@
 package org.apache.tinkerpop.gremlin.process.remote.traversal;
 
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSideEffects;
+import org.apache.tinkerpop.gremlin.process.traversal.util.DefaultTraversalSideEffects;
 
 /**
+ * When a traversal is executed remotely, the ability to retrieve those side-effects (i.e. the value in "a" in the
+ * traversal {@code g.V().aggregate('a').values('name')}) can be exposed through this interface. As an example,
+ * with TinkerPop's {@code DriverRemoteConnection} that connects to Gremlin Server as a "remote", the side-effects
+ * are left on the server. The {@code RemoteTraversalSideEffects} implementation, in that case, lazily loads those
+ * side-effects when requested. Implementations should attempt to match the features of the locally processed
+ * {@link DefaultTraversalSideEffects} to keep consistency.
+ *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
 public interface RemoteTraversalSideEffects extends TraversalSideEffects, AutoCloseable {
+
+    /**
+     * If the "remote" that actually executed the traversal maintained resources that can be released, when the user
+     * is done with the side-effects, then this method can be used to trigger that release.
+     */
     @Override
     public default void close() throws Exception {
         //  do nothing

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d43d4e01/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/step/map/RemoteStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/step/map/RemoteStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/step/map/RemoteStep.java
index 99ca81e..c21f8c8 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/step/map/RemoteStep.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/remote/traversal/step/map/RemoteStep.java
@@ -63,7 +63,5 @@ public final class RemoteStep<S, E> extends AbstractStep<S, E> {
             }
         }
         return this.remoteTraversal.nextTraverser();
-        //final Traverser.Admin<E> remoteTraverser = this.remoteTraversal.nextTraverser();
-        //return this.getTraversal().getTraverserGenerator().generate(remoteTraverser.get(), (Step) this, remoteTraverser.bulk());
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d43d4e01/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversal.java b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversal.java
index 14d89cc..e6e1c9b 100644
--- a/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversal.java
+++ b/gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/remote/DriverRemoteTraversal.java
@@ -25,6 +25,8 @@ import org.apache.tinkerpop.gremlin.driver.ResultSet;
 import org.apache.tinkerpop.gremlin.process.remote.traversal.AbstractRemoteTraversal;
 import org.apache.tinkerpop.gremlin.process.remote.traversal.DefaultRemoteTraverser;
 import org.apache.tinkerpop.gremlin.process.remote.traversal.RemoteTraversalSideEffects;
+import org.apache.tinkerpop.gremlin.process.remote.traversal.step.map.RemoteStep;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import org.apache.tinkerpop.gremlin.process.traversal.traverser.util.EmptyTraverser;
 import org.apache.tinkerpop.gremlin.structure.Element;
@@ -37,7 +39,10 @@ import java.util.Optional;
 import java.util.function.Supplier;
 
 /**
- * A {@link AbstractRemoteTraversal} implementation for the Gremlin Driver.
+ * A {@link AbstractRemoteTraversal} implementation for the Gremlin Driver. This {@link Traversal} implementation is
+ * typically iterated from with {@link RemoteStep} where it the {@link #nextTraverser()} method is called. While
+ * this class provides implementations for both {@link #next()} and {@link #hasNext()} that unroll "bulked" results,
+ * those methods are not called directly from with TinkerPop remoting.
  *
  * @author Stephen Mallette (http://stephen.genoprime.com)
  */
@@ -93,6 +98,8 @@ public class DriverRemoteTraversal<S, E> extends AbstractRemoteTraversal<S, E> {
 
     @Override
     public Traverser.Admin<E> nextTraverser() {
+        // the lastTraverser is initialized as "empty" at start of iteration so the initial pass through will
+        // call next() to begin the iteration
         if (0L == this.lastTraverser.bulk())
             return this.traversers.next();
         else {


[05/14] tinkerpop git commit: changed the deprecated note.

Posted by sp...@apache.org.
changed the deprecated note.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/523ca1a4
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/523ca1a4
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/523ca1a4

Branch: refs/heads/TINKERPOP-1487
Commit: 523ca1a4211b151e6a473de7476578ced73a3d39
Parents: 71c7bec
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Oct 5 07:09:35 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Oct 5 07:09:35 2016 -0600

----------------------------------------------------------------------
 .../process/traversal/strategy/decoration/PartitionStrategy.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/523ca1a4/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
index ef424c7..1fa4105 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
@@ -404,7 +404,7 @@ public final class PartitionStrategy extends AbstractTraversalStrategy<Traversal
          * Specifies the partition of the graph to read from.  It is possible to assign multiple partition keys so
          * as to read from multiple partitions at the same time.
          *
-         * @deprecated Since 3.2.3. Use {@link Builder#readPartitions} instead
+         * @deprecated As of release 3.2.3, replaced by {@link Builder#readPartitions(List)}.
          */
         @Deprecated
         public Builder addReadPartition(final String readPartition) {


[10/14] tinkerpop git commit: Added a final declaration on a variable. CTR

Posted by sp...@apache.org.
Added a final declaration on a variable. CTR


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c1206f04
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c1206f04
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c1206f04

Branch: refs/heads/TINKERPOP-1487
Commit: c1206f04db0cbcfe489de5ac08303995f8ab2a01
Parents: 8e4f3e0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Thu Oct 6 14:02:34 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Oct 6 14:04:49 2016 -0400

----------------------------------------------------------------------
 .../gremlin/structure/io/graphson/GraphSONSerializerProvider.java  | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c1206f04/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
index 60c3200..458a2d9 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONSerializerProvider.java
@@ -35,7 +35,7 @@ final class GraphSONSerializerProvider extends DefaultSerializerProvider {
     private static final long serialVersionUID = 1L;
     private final JsonSerializer<Object> unknownTypeSerializer;
 
-    public GraphSONSerializerProvider(GraphSONVersion version) {
+    public GraphSONSerializerProvider(final GraphSONVersion version) {
         super();
         if (version == GraphSONVersion.V1_0) {
             setDefaultKeySerializer(new GraphSONSerializersV1d0.GraphSONKeySerializer());


[13/14] tinkerpop git commit: Add IO Reference docs

Posted by sp...@apache.org.
Add IO Reference docs

IO Reference docs provide more details and samples for GraphML, Gryo and GraphSON.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/17449e22
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/17449e22
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/17449e22

Branch: refs/heads/TINKERPOP-1487
Commit: 17449e22e42c891b5e6007e200a665dbf5730872
Parents: c1206f0
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Tue Oct 4 12:19:39 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Oct 6 14:07:44 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |    1 +
 docs/src/dev/io/graphml.asciidoc                |  119 +
 docs/src/dev/io/graphson.asciidoc               | 4586 ++++++++++++++++++
 docs/src/dev/io/gryo.asciidoc                   |   63 +
 docs/src/dev/io/index.asciidoc                  |   37 +
 docs/src/dev/provider/index.asciidoc            |    4 +
 docs/src/index.asciidoc                         |    2 +
 .../upgrade/release-3.2.x-incubating.asciidoc   |    9 +
 docs/static/images/gremlin-io2.png              |  Bin 0 -> 185756 bytes
 .../structure/io/graphson/GraphSONModule.java   |    2 +-
 pom.xml                                         |   25 +
 .../structure/TinkerIoRegistryV2d0.java         |    2 +-
 12 files changed, 4848 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 6826ca8..cfe2bfe 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -57,6 +57,7 @@ TinkerPop 3.2.3 (Release Date: NOT OFFICIALLY RELEASED YET)
 * `SubgraphStrategy` now supports vertex property filtering.
 * Fixed a bug in Gremlin-Python `P` where predicates reversed the order of the predicates.
 * Added tests to `DedupTest` for the `dedup(Scope, String...)` overload.
+* Added more detailed reference documentation for IO formats.
 * Fixed a bug in serialization of `Lambda` instances in GraphSON, which prevented their use in remote traversals.
 * Fixed a naming bug in Gremlin-Python where `P._and` and `P._or` should be `P.and_` and `P.or_`. (*breaking*)
 * `where()` predicate-based steps now support `by()`-modulation.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/docs/src/dev/io/graphml.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/io/graphml.asciidoc b/docs/src/dev/io/graphml.asciidoc
new file mode 100644
index 0000000..89eb0da
--- /dev/null
+++ b/docs/src/dev/io/graphml.asciidoc
@@ -0,0 +1,119 @@
+////
+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.
+////
+[[graphml]]
+GraphML
+=======
+
+image:gremlin-graphml.png[width=350,float=left] The link:http://graphml.graphdrawing.org/[GraphML] file format is a
+common XML-based representation of a graph. It uses an edge list format where vertices and their properties are listed
+and edges and their properties are listed by referencing the in and out vertices for each edge. GraphML does support a
+number of features which are not implemented by TinkerPop (e.g. extending GraphML with custom types) and there are
+features of TinkerPop that are not supported by GraphML (e.g. meta-properties), but GraphML does represent the most
+universal way to consume or produce a graph for integration with other systems as GraphML tends to have fairly wide
+support.
+
+In TinkerPop, GraphML is also not extended for purpose of serializing just any type (i.e. serialize just a `Vertex` to
+XML). It is only supported for a `Graph` instance.
+
+The following example is a representation of the Modern toy graph in GraphML:
+
+[source,xml]
+----
+<?xml version="1.0" encoding="UTF-8"?>
+<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.1/graphml.xsd">
+  <key id="labelV" for="node" attr.name="labelV" attr.type="string" />
+  <key id="name" for="node" attr.name="name" attr.type="string" />
+  <key id="lang" for="node" attr.name="lang" attr.type="string" />
+  <key id="age" for="node" attr.name="age" attr.type="int" />
+  <key id="labelE" for="edge" attr.name="labelE" attr.type="string" />
+  <key id="weight" for="edge" attr.name="weight" attr.type="double" />
+  <graph id="G" edgedefault="directed">
+    <node id="1">
+      <data key="labelV">person</data>
+      <data key="name">marko</data>
+      <data key="age">29</data>
+    </node>
+    <node id="2">
+      <data key="labelV">person</data>
+      <data key="name">vadas</data>
+      <data key="age">27</data>
+    </node>
+    <node id="3">
+      <data key="labelV">software</data>
+      <data key="name">lop</data>
+      <data key="lang">java</data>
+    </node>
+    <node id="4">
+      <data key="labelV">person</data>
+      <data key="name">josh</data>
+      <data key="age">32</data>
+    </node>
+    <node id="5">
+      <data key="labelV">software</data>
+      <data key="name">ripple</data>
+      <data key="lang">java</data>
+    </node>
+    <node id="6">
+      <data key="labelV">person</data>
+      <data key="name">peter</data>
+      <data key="age">35</data>
+    </node>
+    <edge id="7" source="1" target="2">
+      <data key="labelE">knows</data>
+      <data key="weight">0.5</data>
+    </edge>
+    <edge id="8" source="1" target="4">
+      <data key="labelE">knows</data>
+      <data key="weight">1.0</data>
+    </edge>
+    <edge id="9" source="1" target="3">
+      <data key="labelE">created</data>
+      <data key="weight">0.4</data>
+    </edge>
+    <edge id="10" source="4" target="5">
+      <data key="labelE">created</data>
+      <data key="weight">1.0</data>
+    </edge>
+    <edge id="11" source="4" target="3">
+      <data key="labelE">created</data>
+      <data key="weight">0.4</data>
+    </edge>
+    <edge id="12" source="6" target="3">
+      <data key="labelE">created</data>
+      <data key="weight">0.2</data>
+    </edge>
+  </graph>
+</graphml>
+----
+
+Consider the following points when reading a GraphML file to TinkerPop that was generated outside of TinkerPop:
+
+* Supports the following values in `attr.type`:
+** `string`
+** `float`
+** `double`
+** `int`
+** `long`
+** `boolean`
+* Does not currently support the `<default>` tag in the schema definitions.
+* The GraphML will be read as a directed graph regardless of the value supplied `edgedefault` setting in the `<graph>`
+tag as that is the nature of the type of graph that TinkerPop supports.
+* The vertex and edge `id` values will always be treated as a `String` if the `Graph` instance consuming the data
+supports user-supplied identifiers (i.e. TinkerGraph).
+* By default the labels for vertex and edges are referred to as "labelV" and "labelE" respectively. It is possible to
+change these defaults on the `Builder` for the `GraphReader`. If no label is supplied, the reader will default to
+"vertex" and "edge" respectively as is the general expectation in TinkerPop when those values are omitted.
\ No newline at end of file


[14/14] tinkerpop git commit: Added docs for Metrics and updated changelog

Posted by sp...@apache.org.
Added docs for Metrics and updated changelog


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ec6acefb
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ec6acefb
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ec6acefb

Branch: refs/heads/TINKERPOP-1487
Commit: ec6acefb353b4a3aa0e8604c6f914ca62fb9b0cd
Parents: 17449e2
Author: Stephen Mallette <sp...@genoprime.com>
Authored: Wed Oct 5 11:23:59 2016 -0400
Committer: Stephen Mallette <sp...@genoprime.com>
Committed: Thu Oct 6 14:07:44 2016 -0400

----------------------------------------------------------------------
 CHANGELOG.asciidoc                |  2 ++
 docs/src/dev/io/graphson.asciidoc | 65 ++++++++++++++++++++++++++++++++++
 2 files changed, 67 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ec6acefb/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index cfe2bfe..f24f8d1 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -42,6 +42,8 @@ TinkerPop 3.2.3 (Release Date: NOT OFFICIALLY RELEASED YET)
 * Fixed a end-step label bug in `MatchPredicateStrategy`.
 * Fixed a bug in `MatchPredicateStrategy` where inlined traversals did not have strategies applied to it.
 * Fixed a bug in `RepeatUnrollStrategy` where inlined traversal did not have strategies applied to it.
+* Fixed GraphSON 2.0 namespace for `TinkerGraph` to be "tinker" instead of "gremlin".
+* Dropped serialization support in GraphSON 2.0 for `Calendar`, `TimeZone`, and `Timestamp`.
 * Added `TraversalHelper.copyLabels()` for copying (or moving) labels form one step to another.
 * Added `TraversalHelper.applySingleLevelStrategies()` which will apply a subset of strategies but not walk the child tree.
 * Added the concept that hidden labels using during traversal compilation are removed at the end during `StandardVerificationStrategy`. (*breaking*)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ec6acefb/docs/src/dev/io/graphson.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/io/graphson.asciidoc b/docs/src/dev/io/graphson.asciidoc
index 8fa5eee..511a0fc 100644
--- a/docs/src/dev/io/graphson.asciidoc
+++ b/docs/src/dev/io/graphson.asciidoc
@@ -150,6 +150,10 @@ file.withWriter { writer ->
   writer.write(toJson(Order.incr, "Order"))
   writer.write(toJson(Pop.all, "Pop"))
   writer.write(toJson(org.apache.tinkerpop.gremlin.util.function.Lambda.function("{ it.get() }"), "Lambda"))
+  tm = g.V().hasLabel('person').out().out().tree().profile().next()
+  metrics = new org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics(tm.getMetrics(0));
+  metrics.addNested(new org.apache.tinkerpop.gremlin.process.traversal.util.MutableMetrics(tm.getMetrics(1)));
+  writer.write(toJson(m, "Metrics"))
   writer.write(toJson(P.gt(0), "P"))
   writer.write(toJson(P.gt(0).and(P.lt(10)), "P and"))
   writer.write(toJson(P.gt(0).or(P.within(-1, -10, -100)), "P or"))
@@ -3680,6 +3684,67 @@ Lambda
 }
 ----
 
+Metrics
+^^^^^^^
+
+[source,json]
+----
+{
+  "@type" : "g:Metrics",
+  "@value" : {
+    "dur" : {
+      "@type" : "g:Double",
+      "@value" : 0.163871
+    },
+    "counts" : {
+      "traverserCount" : {
+        "@type" : "g:Int64",
+        "@value" : 4
+      },
+      "elementCount" : {
+        "@type" : "g:Int64",
+        "@value" : 4
+      }
+    },
+    "name" : "TinkerGraphStep(vertex,[~label.eq(person)])",
+    "annotations" : {
+      "percentDur" : {
+        "@type" : "g:Double",
+        "@value" : 14.805689498929809
+      }
+    },
+    "id" : "7.0.0()",
+    "metrics" : [ {
+      "@type" : "g:Metrics",
+      "@value" : {
+        "dur" : {
+          "@type" : "g:Double",
+          "@value" : 0.293702
+        },
+        "counts" : {
+          "traverserCount" : {
+            "@type" : "g:Int64",
+            "@value" : 13
+          },
+          "elementCount" : {
+            "@type" : "g:Int64",
+            "@value" : 13
+          }
+        },
+        "name" : "VertexStep(OUT,vertex)",
+        "annotations" : {
+          "percentDur" : {
+            "@type" : "g:Double",
+            "@value" : 26.535876495625722
+          }
+        },
+        "id" : "2.0.0()"
+      }
+    } ]
+  }
+}
+----
+
 P
 ^
 


[02/14] tinkerpop git commit: added static create(Configuration) methods to all Builder-based strategies except EventStrategy as that requires Java objects :(. Deprecated PartitionStrategy.Builder.addReadParition() in favor of readParitions(String...). C

Posted by sp...@apache.org.
added static create(Configuration) methods to all Builder-based strategies except EventStrategy as that requires Java objects :(. Deprecated PartitionStrategy.Builder.addReadParition() in favor of readParitions(String...). Computer now has a Configuration-based constructor and corresponding withComputer(Object...) arguments.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/95557bf3
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/95557bf3
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/95557bf3

Branch: refs/heads/TINKERPOP-1487
Commit: 95557bf3aac279282e3f3779d68ce195bd4ca058
Parents: e6e59e4
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Oct 4 10:26:12 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Oct 4 10:26:12 2016 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   3 +
 .../upgrade/release-3.2.x-incubating.asciidoc   |  44 ++++++++
 .../gremlin/process/computer/Computer.java      |  30 +++++
 .../process/traversal/TraversalSource.java      |  32 ++++++
 .../dsl/graph/GraphTraversalSource.java         |   5 +
 .../strategy/decoration/ElementIdStrategy.java  |  16 ++-
 .../decoration/HaltedTraverserStrategy.java     |   9 ++
 .../strategy/decoration/PartitionStrategy.java  |  62 +++++++++--
 .../strategy/decoration/SubgraphStrategy.java   |   2 +-
 .../gremlin/groovy/jsr223/GroovyTranslator.java |  10 +-
 .../gremlin/python/jsr223/PythonTranslator.java |   7 +-
 .../driver/test_driver_remote_connection.py     |   6 +
 .../PartitionStrategyProcessTest.java           | 109 ++++++++++---------
 .../process/TinkerGraphComputerProvider.java    |   7 +-
 .../decoration/HaltedTraverserStrategyTest.java |   5 +-
 15 files changed, 269 insertions(+), 78 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index dc2b03b..35ff317 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,6 +26,9 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.3 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
+* Added `TraversalSource.withComputer(Object...)` for better language variant support.
+* Added `PartitionStrategy.Builder.readPartitions()` and deprecated `PartitionStrategy.Builder.addPartition()`.
+* Added `TraversalSource.withStrategy(String,Object...)`/`withoutStrategy(String)` for better language variant support.
 * `FilterRankStrategy` now propagates labels "right" over non-`Scoping` filters.
 * Fixed a bug in `ConnectiveP` where nested equivalent connectives should be inlined.
 * Fixed a bug in `IncidentToAdjacentStrategy` where `TreeStep` traversals were allowed.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 49790af..983c63e 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -158,6 +158,50 @@ Upgrading for Providers
 Graph System Providers
 ^^^^^^^^^^^^^^^^^^^^^^
 
+Configurable Strategies
++++++++++++++++++++++++
+
+`TraversalSource.withStrategies()` and `TraversalSource.withoutStrategies()` use Java objects. In order to make strategy
+manipulation possible from Gremlin language variants like Gremlin-Python, it is important to support non-JVM-based versions
+of these methods. As such, `TraversalSource.withStrategy(String,Object...)` and `TraversalSource.withoutStrategy(String)`
+were added.
+
+If the provider has non-configurable `TraversalStrategy` classes, those classes should expose a static `instance()`-method.
+This is typical and thus, backwards compatible. However, if the provider has a `TraversalStrategy` that can be configured
+(e.g. via a `Builder`), then it should expose a static `create(Configuration)`-method, where the keys of the configuration
+are the method names of the `Builder` and the values are the method arguments. For instance, for Gremlin-Python to create
+a `SubgraphStrategy`, it does the following:
+
+[source,python]
+----
+g = Graph().traversal().withRemote(connection).
+        withStrategy('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy',
+            'vertices', __.hasLabel('person'),
+            'edges', __.has('weight',gt(0.5))
+---
+
+`SubgraphStrategy.create(Configuration)`-method is defined as:
+
+[source,java]
+----
+public static SubgraphStrategy create(final Configuration configuration) {
+    final Builder builder = SubgraphStrategy.build();
+    configuration.getKeys().forEachRemaining(key -> {
+        if (key.equals("vertices") || key.equals("vertexCriterion"))
+            builder.vertices((Traversal) configuration.getProperty(key));
+        else if (key.equals("edges") || key.equals("edgeCriterion"))
+            builder.edges((Traversal) configuration.getProperty(key));
+        else if (key.equals("vertexProperties"))
+            builder.vertexProperties((Traversal) configuration.getProperty(key));
+        else
+            throw new IllegalArgumentException("The following " + SubgraphStrategy.class.getSimpleName() + " configuration is unknown: " + key + ":" + configuration.getProperty(key));
+        });
+        return builder.create();
+    }
+----
+
+See: link:https://issues.apache.org/jira/browse/TINKERPOP-1455[TINKERPOP-1455]
+
 Deprecated elementNotFound
 ++++++++++++++++++++++++++
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
index 8fca818..fdeac0b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
@@ -19,13 +19,16 @@
 
 package org.apache.tinkerpop.gremlin.process.computer;
 
+import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
+import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 
 import java.io.Serializable;
 import java.util.HashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.function.Function;
 
@@ -46,6 +49,33 @@ public final class Computer implements Function<Graph, GraphComputer>, Serializa
         this.graphComputerClass = graphComputerClass;
     }
 
+    public static Computer compute(final Configuration configuration) {
+        try {
+            final Computer computer = new Computer(configuration.containsKey("graphComputer") ?
+                    (Class) Class.forName(configuration.getString("graphComputer")) :
+                    GraphComputer.class);
+            for (final String key : (List<String>) IteratorUtils.asList(configuration.getKeys())) {
+                if (key.equals("graphComputer")) {
+                    // do nothing
+                } else if (key.equals("workers"))
+                    computer.workers = configuration.getInt(key);
+                else if (key.equals("persist"))
+                    computer.persist = GraphComputer.Persist.valueOf(configuration.getString(key));
+                else if (key.equals("result"))
+                    computer.resultGraph = GraphComputer.ResultGraph.valueOf(configuration.getString(key));
+                else if (key.equals("vertices"))
+                    computer.vertices = (Traversal) configuration.getProperty(key);
+                else if (key.equals("edges"))
+                    computer.edges = (Traversal) configuration.getProperty(key);
+                else
+                    computer.configuration.put(key, configuration.getProperty(key));
+            }
+            return computer;
+        } catch (final ClassNotFoundException e) {
+            throw new IllegalArgumentException(e.getMessage(), e);
+        }
+    }
+
     public static Computer compute() {
         return new Computer(GraphComputer.class);
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
index 8d5cf93..a31b875 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
@@ -189,6 +189,38 @@ public interface TraversalSource extends Cloneable, AutoCloseable {
     }
 
     /**
+     * Configure a {@link GraphComputer} to be used for the execution of subsequently spawned traversal.
+     *
+     * @param namedArguments key/value pair arguments where the even indices are string keys
+     * @return a new traversal source with updated strategies
+     */
+    public default TraversalSource withComputer(final Object... namedArguments) {
+        if (namedArguments.length == 1) {
+            if (namedArguments[0] instanceof Class)
+                return this.withComputer((Class<? extends GraphComputer>) namedArguments[1]);
+            else if (namedArguments[0] instanceof Computer)
+                return this.withComputer((Computer) namedArguments[1]);
+        }
+        ElementHelper.legalPropertyKeyValueArray(namedArguments);
+        final Map<String, Object> configuration = new HashMap<>();
+        for (int i = 0; i < namedArguments.length; i = i + 2) {
+            configuration.put((String) namedArguments[i], namedArguments[i + 1]);
+        }
+        final Computer computer = Computer.compute(new MapConfiguration(configuration));
+        final List<TraversalStrategy<?>> graphComputerStrategies = TraversalStrategies.GlobalCache.getStrategies(computer.apply(this.getGraph()).getClass()).toList();
+        final TraversalStrategy[] traversalStrategies = new TraversalStrategy[graphComputerStrategies.size() + 1];
+        traversalStrategies[0] = new VertexProgramStrategy(computer);
+        for (int i = 0; i < graphComputerStrategies.size(); i++) {
+            traversalStrategies[i + 1] = graphComputerStrategies.get(i);
+        }
+        ///
+        final TraversalSource clone = this.clone();
+        clone.getStrategies().addStrategies(traversalStrategies);
+        clone.getBytecode().addSource(TraversalSource.Symbols.withComputer, computer);
+        return clone;
+    }
+
+    /**
      * Add a {@link Function} that will generate a {@link GraphComputer} from the {@link Graph} that will be used to execute the traversal.
      * This adds a {@link VertexProgramStrategy} to the strategies.
      *

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
index bf2da7e..2bd4bdf 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
@@ -127,6 +127,11 @@ public class GraphTraversalSource implements TraversalSource {
     }
 
     @Override
+    public GraphTraversalSource withComputer(final Object... namedArguments) {
+        return (GraphTraversalSource) TraversalSource.super.withComputer(namedArguments);
+    }
+
+    @Override
     public GraphTraversalSource withComputer(final Computer computer) {
         return (GraphTraversalSource) TraversalSource.super.withComputer(computer);
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
index 40ac805..396de49 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
 
+import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
@@ -27,9 +28,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.filter.HasStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddEdgeStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.IdStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.PropertiesStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
@@ -150,4 +151,17 @@ public final class ElementIdStrategy extends AbstractTraversalStrategy<Traversal
             return new ElementIdStrategy(idPropertyKey, idMaker);
         }
     }
+
+    public static ElementIdStrategy create(final Configuration configuration) {
+        final ElementIdStrategy.Builder builder = ElementIdStrategy.build();
+        configuration.getKeys().forEachRemaining(key -> {
+            if (key.equals("idPropertyKey"))
+                builder.idPropertyKey((String) configuration.getProperty(key));
+            else if (key.equals("idMaker"))
+                builder.idMaker((Supplier) configuration.getProperty(key));
+            else
+                throw new IllegalArgumentException("The following " + ElementIdStrategy.class.getSimpleName() + " configuration is unknown: " + key + ":" + configuration.getProperty(key));
+        });
+        return builder.create();
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
index 1a2c207..cd5119b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
@@ -19,6 +19,7 @@
 
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
 
+import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
@@ -58,6 +59,14 @@ public final class HaltedTraverserStrategy extends AbstractTraversalStrategy<Tra
         return traverser;
     }
 
+    public static HaltedTraverserStrategy create(final Configuration configuration) {
+        try {
+            return new HaltedTraverserStrategy(Class.forName((String) configuration.getProperty("haltedTraverserFactory")));
+        } catch (final ClassNotFoundException e) {
+            throw new IllegalArgumentException(e.getMessage(), e);
+        }
+    }
+
     ////////////
 
     public static HaltedTraverserStrategy detached() {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
index 58e641b..ef424c7 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
@@ -18,6 +18,7 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
 
+import org.apache.commons.configuration.Configuration;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
@@ -33,12 +34,12 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStartSte
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.AddVertexStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeOtherVertexStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.EdgeVertexStep;
+import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.LambdaMapStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.PropertiesStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.PropertyMapStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.VertexStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.AddPropertyStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.GraphStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
@@ -53,6 +54,7 @@ import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
 
 import java.io.Serializable;
 import java.util.ArrayList;
+import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -83,7 +85,7 @@ public final class PartitionStrategy extends AbstractTraversalStrategy<Traversal
         this.writePartition = builder.writePartition;
         this.partitionKey = builder.partitionKey;
         this.readPartitions = Collections.unmodifiableSet(builder.readPartitions);
-        this.includeMetaProperties  = builder.includeMetaProperties;
+        this.includeMetaProperties = builder.includeMetaProperties;
     }
 
     public String getWritePartition() {
@@ -190,8 +192,8 @@ public final class PartitionStrategy extends AbstractTraversalStrategy<Traversal
         }
 
         final List<Step> stepsToInsertPropertyMutations = traversal.getSteps().stream().filter(step ->
-            step instanceof AddEdgeStep || step instanceof AddVertexStep ||
-                    step instanceof AddVertexStartStep || (includeMetaProperties && step instanceof AddPropertyStep)
+                step instanceof AddEdgeStep || step instanceof AddVertexStep ||
+                        step instanceof AddVertexStartStep || (includeMetaProperties && step instanceof AddPropertyStep)
         ).collect(Collectors.toList());
 
         stepsToInsertPropertyMutations.forEach(step -> {
@@ -271,11 +273,11 @@ public final class PartitionStrategy extends AbstractTraversalStrategy<Traversal
      * {@link VertexProperty} it applies a filter based on the current partitioning.  If is not a
      * {@link VertexProperty} the property is simply passed through.
      */
-    public final class MapPropertiesFilter implements Function<Traverser<Map<String,List<Property>>>, Map<String,List<Property>>>, Serializable {
+    public final class MapPropertiesFilter implements Function<Traverser<Map<String, List<Property>>>, Map<String, List<Property>>>, Serializable {
         @Override
         public Map<String, List<Property>> apply(final Traverser<Map<String, List<Property>>> mapTraverser) {
-            final Map<String,List<Property>> values = mapTraverser.get();
-            final Map<String,List<Property>> filtered = new HashMap<>();
+            final Map<String, List<Property>> values = mapTraverser.get();
+            final Map<String, List<Property>> filtered = new HashMap<>();
 
             // note the final filter that removes the partitionKey from the outgoing Map
             values.entrySet().forEach(p -> {
@@ -302,11 +304,11 @@ public final class PartitionStrategy extends AbstractTraversalStrategy<Traversal
     /**
      * Takes a {@link Map} of a {@link List} of {@link Property} objects and unwraps the {@link Property#value()}.
      */
-    public final class MapPropertiesConverter implements Function<Traverser<Map<String,List<Property>>>, Map<String,List<Property>>>, Serializable {
+    public final class MapPropertiesConverter implements Function<Traverser<Map<String, List<Property>>>, Map<String, List<Property>>>, Serializable {
         @Override
         public Map<String, List<Property>> apply(final Traverser<Map<String, List<Property>>> mapTraverser) {
-            final Map<String,List<Property>> values = mapTraverser.get();
-            final Map<String,List<Property>> converted = new HashMap<>();
+            final Map<String, List<Property>> values = mapTraverser.get();
+            final Map<String, List<Property>> converted = new HashMap<>();
 
             values.entrySet().forEach(p -> {
                 final List l = p.getValue().stream().map(property -> property.value()).collect(Collectors.toList());
@@ -322,13 +324,31 @@ public final class PartitionStrategy extends AbstractTraversalStrategy<Traversal
         }
     }
 
+    public static PartitionStrategy create(final Configuration configuration) {
+        final PartitionStrategy.Builder builder = PartitionStrategy.build();
+        configuration.getKeys().forEachRemaining(key -> {
+            if (key.equals("includeMetaProperties"))
+                builder.includeMetaProperties((Boolean) configuration.getProperty(key));
+            else if (key.equals("writePartition"))
+                builder.writePartition((String) configuration.getProperty(key));
+            else if (key.equals("partitionKey"))
+                builder.partitionKey((String) configuration.getProperty(key));
+            else if (key.equals("readPartitions"))
+                builder.readPartitions((List<String>) configuration.getProperty(key));
+            else
+                throw new IllegalArgumentException("The following " + PartitionStrategy.class.getSimpleName() + " configuration is unknown: " + key + ":" + configuration.getProperty(key));
+        });
+        return builder.create();
+    }
+
     public final static class Builder {
         private String writePartition;
         private String partitionKey;
         private Set<String> readPartitions = new HashSet<>();
         private boolean includeMetaProperties = false;
 
-        Builder() { }
+        Builder() {
+        }
 
         /**
          * Set to {@code true} if the {@link VertexProperty} instances should get assigned to partitions.  This
@@ -367,6 +387,26 @@ public final class PartitionStrategy extends AbstractTraversalStrategy<Traversal
          * Specifies the partition of the graph to read from.  It is possible to assign multiple partition keys so
          * as to read from multiple partitions at the same time.
          */
+        public Builder readPartitions(final List<String> readPartitions) {
+            this.readPartitions.addAll(readPartitions);
+            return this;
+        }
+
+        /**
+         * Specifies the partition of the graph to read from.  It is possible to assign multiple partition keys so
+         * as to read from multiple partitions at the same time.
+         */
+        public Builder readPartitions(final String... readPartitions) {
+            return this.readPartitions(Arrays.asList(readPartitions));
+        }
+
+        /**
+         * Specifies the partition of the graph to read from.  It is possible to assign multiple partition keys so
+         * as to read from multiple partitions at the same time.
+         *
+         * @deprecated Since 3.2.3. Use {@link Builder#readPartitions} instead
+         */
+        @Deprecated
         public Builder addReadPartition(final String readPartition) {
             this.readPartitions.add(readPartition);
             return this;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
index 097299f..bccff9b 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
@@ -301,7 +301,7 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy<TraversalS
             else if (key.equals("vertexProperties"))
                 builder.vertexProperties((Traversal) configuration.getProperty(key));
             else
-                throw new IllegalArgumentException("The following configuration is unknown: " + key + ":" + configuration.getProperty(key));
+                throw new IllegalArgumentException("The following " + SubgraphStrategy.class.getSimpleName() + " configuration is unknown: " + key + ":" + configuration.getProperty(key));
         });
         return builder.create();
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
index 88ca626..facb24f 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
@@ -19,11 +19,11 @@
 
 package org.apache.tinkerpop.gremlin.groovy.jsr223;
 
-import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
 import org.apache.tinkerpop.gremlin.process.traversal.Translator;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
 import org.apache.tinkerpop.gremlin.process.traversal.util.OrP;
 import org.apache.tinkerpop.gremlin.structure.Element;
@@ -39,6 +39,8 @@ import java.util.List;
  */
 public final class GroovyTranslator implements Translator.ScriptTranslator {
 
+    private static final boolean IS_TESTING = Boolean.valueOf(System.getProperty("is.testing", "false"));
+
     private final String traversalSource;
 
     private GroovyTranslator(final String traversalSource) {
@@ -77,6 +79,8 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
         final StringBuilder traversalScript = new StringBuilder(start);
         for (final Bytecode.Instruction instruction : bytecode.getInstructions()) {
             final String methodName = instruction.getOperator();
+            if (IS_TESTING && methodName.equals(TraversalSource.Symbols.withStrategies))
+                continue;
             if (0 == instruction.getArguments().length)
                 traversalScript.append(".").append(methodName).append("()");
             else {
@@ -122,9 +126,7 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
             return ((Enum) object).getDeclaringClass().getSimpleName() + "." + object.toString();
         else if (object instanceof Element)
             return convertToString(((Element) object).id()); // hack
-        else if (object instanceof Computer) { // TODO: blow out
-            return "";
-        } else if (object instanceof Lambda) {
+        else if (object instanceof Lambda) {
             final String lambdaString = ((Lambda) object).getLambdaScript().trim();
             return lambdaString.startsWith("{") ? lambdaString : "{" + lambdaString + "}";
         } else if (object instanceof Bytecode)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
index 1a84e26..19302e8 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
@@ -19,7 +19,6 @@
 
 package org.apache.tinkerpop.gremlin.python.jsr223;
 
-import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.Operator;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
@@ -52,6 +51,7 @@ import java.util.stream.Stream;
  */
 public class PythonTranslator implements Translator.ScriptTranslator {
 
+    private static final boolean IS_TESTING = Boolean.valueOf(System.getProperty("is.testing", "false"));
     private static final Set<String> STEP_NAMES = Stream.of(GraphTraversal.class.getMethods()).filter(method -> Traversal.class.isAssignableFrom(method.getReturnType())).map(Method::getName).collect(Collectors.toSet());
     private static final Set<String> NO_STATIC = Stream.of(T.values(), Operator.values())
             .flatMap(arg -> IteratorUtils.stream(new ArrayIterator<>(arg)))
@@ -60,7 +60,6 @@ public class PythonTranslator implements Translator.ScriptTranslator {
 
     private final String traversalSource;
     private final boolean importStatics;
-    private static final boolean isTesting = Boolean.valueOf(System.getProperty("is.testing", "false"));
 
     PythonTranslator(final String traversalSource, final boolean importStatics) {
         this.traversalSource = traversalSource;
@@ -102,7 +101,7 @@ public class PythonTranslator implements Translator.ScriptTranslator {
         for (final Bytecode.Instruction instruction : bytecode.getInstructions()) {
             final String methodName = instruction.getOperator();
             final Object[] arguments = instruction.getArguments();
-            if (isTesting && methodName.equals(TraversalSource.Symbols.withStrategies))
+            if (IS_TESTING && methodName.equals(TraversalSource.Symbols.withStrategies))
                 continue;
             else if (0 == arguments.length)
                 traversalScript.append(".").append(SymbolHelper.toPython(methodName)).append("()");
@@ -158,8 +157,6 @@ public class PythonTranslator implements Translator.ScriptTranslator {
             return convertToString(((Element) object).id()); // hack
         else if (object instanceof Bytecode)
             return this.internalTranslate("__", (Bytecode) object);
-        else if (object instanceof Computer)
-            return "";
         else if (object instanceof Lambda)
             return convertLambdaToString((Lambda) object);
         else

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
index f0ca27f..81ee886 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
@@ -71,6 +71,12 @@ class TestDriverRemoteConnection(TestCase):
         assert 0 == g.E().count().next()
         assert 1 == g.V().label().dedup().count().next()
         assert "person" == g.V().label().dedup().next()
+        #
+        g = g.withComputer("workers", 4, "vertices", __.has("name", "marko"))
+        assert 1 == g.V().count().next()
+        assert 0 == g.E().count().next()
+        assert "person" == g.V().label().next()
+        assert "marko" == g.V().name.next()
         connection.close()
 
     def test_side_effects(self):

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
index 79fd859..168e4fe 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
@@ -18,7 +18,6 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
 
-import org.apache.commons.lang.exception.ExceptionUtils;
 import org.apache.tinkerpop.gremlin.FeatureRequirement;
 import org.apache.tinkerpop.gremlin.FeatureRequirementSet;
 import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest;
@@ -31,6 +30,7 @@ import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.junit.Test;
 
+import java.util.Arrays;
 import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.stream.Collectors;
@@ -39,7 +39,11 @@ import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.Matchers.containsInAnyOrder;
 import static org.hamcrest.core.IsInstanceOf.instanceOf;
 import static org.hamcrest.core.StringStartsWith.startsWith;
-import static org.junit.Assert.*;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.fail;
 
 /**
  * @author Stephen Mallette (http://stephen.genoprime.com)
@@ -51,8 +55,8 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     public void shouldAppendPartitionToVertex() {
         final PartitionStrategy partitionStrategy = PartitionStrategy.build()
-                .partitionKey(partition).writePartition("A").addReadPartition("A").create();
-        final Vertex v = create(partitionStrategy).addV().property("any", "thing").next();
+                .partitionKey(partition).writePartition("A").readPartitions("A").create();
+        final Vertex v = g.withStrategies(partitionStrategy).addV().property("any", "thing").next();
 
         assertNotNull(v);
         assertEquals("thing", v.property("any").value());
@@ -65,8 +69,8 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     public void shouldAppendPartitionToVertexProperty() {
         final PartitionStrategy partitionStrategy = PartitionStrategy.build()
                 .includeMetaProperties(true)
-                .partitionKey(partition).writePartition("A").addReadPartition("A").create();
-        final Vertex v = create(partitionStrategy).addV().property("any", "thing").next();
+                .partitionKey(partition).writePartition("A").readPartitions("A").create();
+        final Vertex v = g.withStrategies(partitionStrategy).addV().property("any", "thing").next();
 
         assertNotNull(v);
         assertEquals("thing", v.property("any").value());
@@ -81,8 +85,8 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     public void shouldAppendPartitionToVertexPropertyOverMultiProperty() {
         final PartitionStrategy partitionStrategy = PartitionStrategy.build()
                 .includeMetaProperties(true)
-                .partitionKey(partition).writePartition("A").addReadPartition("A").create();
-        final Vertex v = create(partitionStrategy).addV().property(VertexProperty.Cardinality.list, "any", "thing")
+                .partitionKey(partition).writePartition("A").readPartitions("A").create();
+        final Vertex v = g.withStrategies(partitionStrategy).addV().property(VertexProperty.Cardinality.list, "any", "thing")
                 .property(VertexProperty.Cardinality.list, "any", "more").next();
 
         assertNotNull(v);
@@ -97,8 +101,8 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     public void shouldNotAppendPartitionToVertexProperty() {
         final PartitionStrategy partitionStrategy = PartitionStrategy.build()
                 .includeMetaProperties(false)
-                .partitionKey(partition).writePartition("A").addReadPartition("A").create();
-        final Vertex v = create(partitionStrategy).addV().property("any", "thing").next();
+                .partitionKey(partition).writePartition("A").readPartitions("A").create();
+        final Vertex v = g.withStrategies(partitionStrategy).addV().property("any", "thing").next();
 
         assertNotNull(v);
         assertEquals("thing", v.property("any").value());
@@ -111,19 +115,19 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
     public void shouldAppendPartitionToAllVertexProperties() {
-        final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+        final GraphTraversalSource gOverA = g.withStrategies(PartitionStrategy.build()
                 .includeMetaProperties(true)
                 .partitionKey(partition).writePartition("A").addReadPartition("A").create());
 
-        final GraphTraversalSource gOverB = create(PartitionStrategy.build()
+        final GraphTraversalSource gOverB = g.withStrategies(PartitionStrategy.build()
                 .includeMetaProperties(true)
                 .partitionKey(partition).writePartition("B").addReadPartition("B").create());
 
-        final GraphTraversalSource gOverAB = create(PartitionStrategy.build()
+        final GraphTraversalSource gOverAB = g.withStrategies(PartitionStrategy.build()
                 .includeMetaProperties(true)
                 .partitionKey(partition).writePartition("B").addReadPartition("B").addReadPartition("A").create());
 
-        final Vertex v = gOverA.addV().property("any", "thing").property("some","thing").next();
+        final Vertex v = gOverA.addV().property("any", "thing").property("some", "thing").next();
 
         assertNotNull(v);
         assertEquals("thing", v.property("any").value());
@@ -173,7 +177,7 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
     public void shouldHidePartitionKeyForValues() {
-        final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+        final GraphTraversalSource gOverA = g.withStrategies(PartitionStrategy.build()
                 .includeMetaProperties(true)
                 .partitionKey(partition).writePartition("A").addReadPartition("A").create());
         final Vertex v = gOverA.addV().property("any", "thing").next();
@@ -191,9 +195,9 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
     public void shouldHidePartitionKeyForValuesWithEmptyKeys() {
-        final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+        final GraphTraversalSource gOverA = g.withStrategies(PartitionStrategy.build()
                 .includeMetaProperties(true)
-                .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+                .partitionKey(partition).writePartition("A").readPartitions("A").create());
         final Vertex v = gOverA.addV().property("any", "thing").next();
 
         assertEquals(1l, (long) gOverA.V(v).values().count().next());
@@ -204,7 +208,7 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
     public void shouldHidePartitionKeyForProperties() {
-        final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+        final GraphTraversalSource gOverA = g.withStrategies(PartitionStrategy.build()
                 .includeMetaProperties(true)
                 .partitionKey(partition).writePartition("A").addReadPartition("A").create());
         final Vertex v = gOverA.addV().property("any", "thing").next();
@@ -221,9 +225,9 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
     public void shouldHidePartitionKeyForPropertiesWithEmptyKeys() {
-        final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+        final GraphTraversalSource gOverA = g.withStrategies(PartitionStrategy.build()
                 .includeMetaProperties(true)
-                .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+                .partitionKey(partition).writePartition("A").readPartitions("A").create());
         final Vertex v = gOverA.addV().property("any", "thing").next();
 
         assertEquals(1l, (long) gOverA.V(v).properties().count().next());
@@ -234,9 +238,9 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
     public void shouldHidePartitionKeyForPropertyMap() {
-        final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+        final GraphTraversalSource gOverA = g.withStrategies(PartitionStrategy.build()
                 .includeMetaProperties(true)
-                .partitionKey(partition).writePartition("A").addReadPartition("A").create());
+                .partitionKey(partition).writePartition("A").readPartitions("A").create());
         final Vertex v = gOverA.addV().property("any", "thing").next();
 
         gOverA.V(v).propertyMap(partition).next();
@@ -246,7 +250,7 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
     public void shouldHidePartitionKeyForPropertyMapWithEmptyKeys() {
-        final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+        final GraphTraversalSource gOverA = g.withStrategies(PartitionStrategy.build()
                 .includeMetaProperties(true)
                 .partitionKey(partition).writePartition("A").addReadPartition("A").create());
         final Vertex v = gOverA.addV().property("any", "thing").next();
@@ -255,10 +259,11 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
         assertEquals("thing", ((List<VertexProperty>) gOverA.V(v).propertyMap().next().get("any")).get(0).value());
     }
 
+    @Test
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
     public void shouldHidePartitionKeyForValueMap() {
-        final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+        final GraphTraversalSource gOverA = g.withStrategies(PartitionStrategy.build()
                 .includeMetaProperties(true)
                 .partitionKey(partition).writePartition("A").addReadPartition("A").create());
         final Vertex v = gOverA.addV().property("any", "thing").next();
@@ -267,8 +272,7 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
             gOverA.V(v).valueMap(partition).next();
             fail("Should have thrown exception");
         } catch (Exception ex) {
-            final Throwable root = ExceptionUtils.getRootCause(ex);
-            assertThat(root.getMessage(), startsWith("Cannot explicitly request the partitionKey in the traversal"));
+
         }
     }
 
@@ -276,7 +280,7 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.VERTICES_ONLY)
     @FeatureRequirement(featureClass = Graph.Features.VertexFeatures.class, feature = Graph.Features.VertexFeatures.FEATURE_META_PROPERTIES)
     public void shouldHidePartitionKeyForValueMapWithEmptyKeys() {
-        final GraphTraversalSource gOverA = create(PartitionStrategy.build()
+        final GraphTraversalSource gOverA = g.withStrategies(PartitionStrategy.build()
                 .includeMetaProperties(true)
                 .partitionKey(partition).writePartition("A").addReadPartition("A").create());
         final Vertex v = gOverA.addV().property("any", "thing").next();
@@ -290,7 +294,7 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     public void shouldAppendPartitionToEdge() {
         final PartitionStrategy partitionStrategy = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("A").addReadPartition("A").create();
-        final GraphTraversalSource source = create(partitionStrategy);
+        final GraphTraversalSource source = g.withStrategies(partitionStrategy);
         final Vertex v1 = source.addV().property("any", "thing").next();
         final Vertex v2 = source.addV().property("some", "thing").next();
         final Edge e = source.withSideEffect("v2", v2).V(v1.id()).addE("connectsTo").from("v2").property("every", "thing").next();
@@ -314,19 +318,19 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     public void shouldWriteVerticesToMultiplePartitions() {
         final PartitionStrategy partitionStrategyAA = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("A").addReadPartition("A").create();
-        final GraphTraversalSource sourceAA = create(partitionStrategyAA);
+        final GraphTraversalSource sourceAA = g.withStrategies(partitionStrategyAA);
 
         final PartitionStrategy partitionStrategyBA = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("B").addReadPartition("A").create();
-        final GraphTraversalSource sourceBA = create(partitionStrategyBA);
+        final GraphTraversalSource sourceBA = g.withStrategies(partitionStrategyBA);
 
         final PartitionStrategy partitionStrategyBB = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("B").addReadPartition("B").create();
-        final GraphTraversalSource sourceBB = create(partitionStrategyBB);
+        final GraphTraversalSource sourceBB = g.withStrategies(partitionStrategyBB);
 
         final PartitionStrategy partitionStrategyBAB = PartitionStrategy.build()
-                .partitionKey(partition).writePartition("B").addReadPartition("A").addReadPartition("B").create();
-        final GraphTraversalSource sourceBAB = create(partitionStrategyBAB);
+                .partitionKey(partition).writePartition("B").readPartitions("A", "B").create();
+        final GraphTraversalSource sourceBAB = g.withStrategies(partitionStrategyBAB);
 
 
         final Vertex vA = sourceAA.addV().property("any", "a").next();
@@ -351,11 +355,11 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     public void shouldThrowExceptionOnVInDifferentPartition() {
         final PartitionStrategy partitionStrategyAA = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("A").addReadPartition("A").create();
-        final GraphTraversalSource sourceAA = create(partitionStrategyAA);
+        final GraphTraversalSource sourceAA = g.withStrategies(partitionStrategyAA);
 
         final PartitionStrategy partitionStrategyA = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("A").create();
-        final GraphTraversalSource sourceA = create(partitionStrategyA);
+        final GraphTraversalSource sourceA = g.withStrategies(partitionStrategyA);
 
         final Vertex vA = sourceAA.addV().property("any", "a").next();
         assertEquals(vA.id(), sourceAA.V(vA.id()).id().next());
@@ -373,11 +377,11 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     public void shouldThrowExceptionOnEInDifferentPartition() {
         final PartitionStrategy partitionStrategyAA = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("A").addReadPartition("A").create();
-        final GraphTraversalSource sourceAA = create(partitionStrategyAA);
+        final GraphTraversalSource sourceAA = g.withStrategies(partitionStrategyAA);
 
         final PartitionStrategy partitionStrategyA = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("A").create();
-        final GraphTraversalSource sourceA = create(partitionStrategyA);
+        final GraphTraversalSource sourceA = g.withStrategies(partitionStrategyA);
 
         final Vertex vA = sourceAA.addV().property("any", "a").next();
         final Edge e = sourceAA.withSideEffect("vA", vA).V(vA.id()).addE("knows").to("vA").next();
@@ -396,24 +400,24 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
     @FeatureRequirementSet(FeatureRequirementSet.Package.SIMPLE)
     public void shouldWriteToMultiplePartitions() {
         final PartitionStrategy partitionStrategyAA = PartitionStrategy.build()
-                .partitionKey(partition).writePartition("A").addReadPartition("A").create();
-        final GraphTraversalSource sourceAA = create(partitionStrategyAA);
+                .partitionKey(partition).writePartition("A").readPartitions("A").create();
+        final GraphTraversalSource sourceAA = g.withStrategies(partitionStrategyAA);
 
         final PartitionStrategy partitionStrategyBA = PartitionStrategy.build()
-                .partitionKey(partition).writePartition("B").addReadPartition("A").create();
-        final GraphTraversalSource sourceBA = create(partitionStrategyBA);
+                .partitionKey(partition).writePartition("B").readPartitions("A").create();
+        final GraphTraversalSource sourceBA = g.withStrategies(partitionStrategyBA);
 
         final PartitionStrategy partitionStrategyCAB = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("C").addReadPartition("A").addReadPartition("B").create();
-        final GraphTraversalSource sourceCAB = create(partitionStrategyCAB);
+        final GraphTraversalSource sourceCAB = g.withStrategies(partitionStrategyCAB);
 
         final PartitionStrategy partitionStrategyC = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("C").create();
-        final GraphTraversalSource sourceC = create(partitionStrategyC);
+        final GraphTraversalSource sourceC = g.withStrategies(partitionStrategyC);
 
         final PartitionStrategy partitionStrategyCA = PartitionStrategy.build()
-                .partitionKey(partition).writePartition("C").addReadPartition("A").create();
-        final GraphTraversalSource sourceCA = create(partitionStrategyCA);
+                .partitionKey(partition).writePartition("C").readPartitions("A").create();
+        final GraphTraversalSource sourceCA = g.withStrategies(partitionStrategyCA);
 
         final PartitionStrategy partitionStrategyCABC = PartitionStrategy.build()
                 .partitionKey(partition)
@@ -421,15 +425,18 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
                 .addReadPartition("A")
                 .addReadPartition("B")
                 .addReadPartition("C").create();
-        final GraphTraversalSource sourceCABC = create(partitionStrategyCABC);
+        final GraphTraversalSource sourceCABC = g.withStrategy(PartitionStrategy.class.getCanonicalName(),
+                "writePartition", "C",
+                "partitionKey", partition,
+                "readPartitions", Arrays.asList("A", "B", "C"));
 
         final PartitionStrategy partitionStrategyCC = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("C").addReadPartition("C").create();
-        final GraphTraversalSource sourceCC = create(partitionStrategyCC);
+        final GraphTraversalSource sourceCC = g.withStrategies(partitionStrategyCC);
 
         final PartitionStrategy partitionStrategyCBC = PartitionStrategy.build()
-                .partitionKey(partition).writePartition("C").addReadPartition("C").addReadPartition("B").create();
-        final GraphTraversalSource sourceCBC = create(partitionStrategyCBC);
+                .partitionKey(partition).writePartition("C").readPartitions(Arrays.asList("B", "C")).create();
+        final GraphTraversalSource sourceCBC = g.withStrategies(partitionStrategyCBC);
 
         final Vertex vA = sourceAA.addV().property("any", "a").next();
         final Vertex vAA = sourceAA.addV().property("any", "aa").next();
@@ -480,8 +487,4 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
         assertEquals(vC.id(), sourceCBC.E(eAtovC.id()).inV().id().next());
         assertFalse(sourceCBC.E(eAtovC.id()).outV().hasNext());
     }
-
-    private GraphTraversalSource create(final PartitionStrategy strategy) {
-        return graphProvider.traversal(graph, strategy);
-    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
index ccea43c..3144211 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.tinkergraph.process;
 
 import org.apache.tinkerpop.gremlin.GraphProvider;
+import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider;
@@ -37,7 +38,11 @@ public class TinkerGraphComputerProvider extends TinkerGraphProvider {
     @Override
     public GraphTraversalSource traversal(final Graph graph) {
         return RANDOM.nextBoolean() ?
-                graph.traversal().withComputer() :
+                graph.traversal().withComputer(
+                        "workers", RANDOM.nextInt(4) + 1,
+                        "graphComputer", RANDOM.nextBoolean() ?
+                                GraphComputer.class.getCanonicalName() :
+                                TinkerGraphComputer.class.getCanonicalName()) :
                 graph.traversal(GraphTraversalSource.computer());
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/95557bf3/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/decoration/HaltedTraverserStrategyTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/decoration/HaltedTraverserStrategyTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/decoration/HaltedTraverserStrategyTest.java
index 0943391..fd3dfaa 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/decoration/HaltedTraverserStrategyTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/decoration/HaltedTraverserStrategyTest.java
@@ -19,10 +19,11 @@
 
 package org.apache.tinkerpop.gremlin.tinkergraph.process.traversal.strategy.decoration;
 
-import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.HaltedTraverserStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.HaltedTraverserStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedEdge;
+import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedPath;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedProperty;
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedVertex;
@@ -58,7 +59,7 @@ public class HaltedTraverserStrategyTest {
     @Test
     public void shouldReturnDetachedElements() {
         final Graph graph = TinkerFactory.createModern();
-        final GraphTraversalSource g = graph.traversal().withComputer().withStrategies(HaltedTraverserStrategy.detached());
+        final GraphTraversalSource g = graph.traversal().withComputer().withStrategy(HaltedTraverserStrategy.class.getCanonicalName(), "haltedTraverserFactory", DetachedFactory.class.getCanonicalName());
         g.V().out().forEachRemaining(vertex -> assertEquals(DetachedVertex.class, vertex.getClass()));
         g.V().out().properties("name").forEachRemaining(vertexProperty -> assertEquals(DetachedVertexProperty.class, vertexProperty.getClass()));
         g.V().out().values("name").forEachRemaining(value -> assertEquals(String.class, value.getClass()));


[07/14] tinkerpop git commit: changed the new methods to withSTrategies(Map...) and withoutStrategies(String...). Also, added withComputer(Map). This looks a lot cleaner in Gremlin-Python. Also, you can now register multiple strategies in one method call

Posted by sp...@apache.org.
changed the new methods to withSTrategies(Map...) and withoutStrategies(String...). Also, added withComputer(Map). This looks a lot cleaner in Gremlin-Python. Also, you can now register multiple strategies in one method call so you don't over-clone() and over-sort. Finally fixed a bug in JavaTranslator around Map translation. Cleaned up Partition/SubgraphStrategies -- added public static Strings for their parameters. Found a crazy bug in Jython where var arg coecing is no-bueno. Have a 'sorta fix' ... will fix it more thoroughly in another ticket. What a crazy day.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/3e4075bd
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/3e4075bd
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/3e4075bd

Branch: refs/heads/TINKERPOP-1487
Commit: 3e4075bd0997b22e3738478c4d03ab6f24b9e15f
Parents: 523ca1a
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Wed Oct 5 19:48:32 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Wed Oct 5 19:48:32 2016 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              |   6 +-
 docs/src/reference/gremlin-variants.asciidoc    |   8 +-
 .../gremlin/jsr223/JavaTranslator.java          |  42 ++++--
 .../gremlin/process/computer/Computer.java      |  29 ++--
 .../computer/util/GraphComputerHelper.java      |  25 ++++
 .../gremlin/process/traversal/Bytecode.java     |   9 +-
 .../process/traversal/TraversalSource.java      | 141 ++++++-------------
 .../process/traversal/TraversalStrategy.java    |   1 +
 .../dsl/graph/GraphTraversalSource.java         |  40 +++---
 .../decoration/HaltedTraverserStrategy.java     |   4 +-
 .../strategy/decoration/PartitionStrategy.java  |  25 ++--
 .../strategy/decoration/SubgraphStrategy.java   |  28 ++--
 .../StandardVerificationStrategy.java           |   3 +-
 .../dsl/graph/GraphTraversalSourceTest.java     |  19 ++-
 .../groovy/jsr223/GroovyTranslatorTest.java     |  37 ++++-
 .../gremlin/groovy/jsr223/GroovyTranslator.java |  18 ++-
 .../jsr223/GremlinJythonScriptEngine.java       |   9 +-
 .../gremlin/python/jsr223/PythonTranslator.java |  16 ++-
 .../gremlin_python/process/graph_traversal.py   |   8 --
 .../driver/test_driver_remote_connection.py     |  13 +-
 .../python/jsr223/JythonTranslatorTest.java     |  34 +++++
 .../PartitionStrategyProcessTest.java           |  18 +--
 .../decoration/SubgraphStrategyProcessTest.java |  12 +-
 .../process/TinkerGraphComputerProvider.java    |  13 +-
 .../decoration/HaltedTraverserStrategyTest.java |   7 +-
 25 files changed, 344 insertions(+), 221 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index 35ff317..f25e095 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,9 +26,11 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.3 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-* Added `TraversalSource.withComputer(Object...)` for better language variant support.
+* Fixed a `String` bug in `GroovyTranslator` and `PythonTranslator` where if the string has double-quotes, use """ """.
+* Fixed a `List` and `Map` bug in `JavaTranslator` where such collections were not being internally translated.
+* Added `TraversalSource.withComputer(Map<String,Object>)` for better language variant support.
+* Added `TraversalSource.withStrategies(Map<String,Object>)`/`withoutStrategies(String...)` for better language variant support.
 * Added `PartitionStrategy.Builder.readPartitions()` and deprecated `PartitionStrategy.Builder.addPartition()`.
-* Added `TraversalSource.withStrategy(String,Object...)`/`withoutStrategy(String)` for better language variant support.
 * `FilterRankStrategy` now propagates labels "right" over non-`Scoping` filters.
 * Fixed a bug in `ConnectiveP` where nested equivalent connectives should be inlined.
 * Fixed a bug in `IncidentToAdjacentStrategy` where `TreeStep` traversals were allowed.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/docs/src/reference/gremlin-variants.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc
index 1d4099e..d74fb95 100644
--- a/docs/src/reference/gremlin-variants.asciidoc
+++ b/docs/src/reference/gremlin-variants.asciidoc
@@ -227,15 +227,15 @@ it is possible to use the `withBindings()`-model as Gremlin-Python's `Bindings.o
 Traversal Strategies
 ~~~~~~~~~~~~~~~~~~~~
 
-In order to add and remove <<traversalstrategy,traversal strategies>> from a traversal source, the `withStrategy()` and
-`withoutStrategy()` steps should be used.
+In order to add and remove <<traversalstrategy,traversal strategies>> from a traversal source, the `withStrategies(Map<String,Object>...)` and
+`withoutStrategies(String...)` steps should be used.
 
 [gremlin-python,modern]
 ----
-g = g.withStrategy('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy','vertices',__.hasLabel('person'),'edges',__.has('weight',gt(0.5)))
+g = g.withStrategies({'strategy':'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy','vertices': hasLabel('person'),'edges': has('weight',gt(0.5))})
 g.V().name.toList()
 g.V().outE().valueMap(True).toList()
-g = g.withoutStrategy('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy')
+g = g.withoutStrategies('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy')
 g.V().name.toList()
 g.V().outE().valueMap(True).toList()
 ----

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
index 5d3e82d..af245c5 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
@@ -89,16 +89,33 @@ public final class JavaTranslator<S extends TraversalSource, T extends Traversal
 
     ////
 
-    private Traversal.Admin<?, ?> translateFromAnonymous(final Bytecode bytecode) {
-        try {
-            final Traversal.Admin<?, ?> traversal = (Traversal.Admin) this.anonymousTraversal.getMethod("start").invoke(null);
-            for (final Bytecode.Instruction instruction : bytecode.getStepInstructions()) {
-                invokeMethod(traversal, Traversal.class, instruction.getOperator(), instruction.getArguments());
+    private Object translateObject(final Object object) {
+        if (object instanceof Bytecode.Binding)
+            return ((Bytecode.Binding) object).value();
+        else if (object instanceof Bytecode) {
+            try {
+                final Traversal.Admin<?, ?> traversal = (Traversal.Admin) this.anonymousTraversal.getMethod("start").invoke(null);
+                for (final Bytecode.Instruction instruction : ((Bytecode) object).getStepInstructions()) {
+                    invokeMethod(traversal, Traversal.class, instruction.getOperator(), instruction.getArguments());
+                }
+                return traversal;
+            } catch (final Throwable e) {
+                throw new IllegalStateException(e.getMessage());
             }
-            return traversal;
-        } catch (final Throwable e) {
-            throw new IllegalStateException(e.getMessage());
-        }
+        } else if (object instanceof Map) {
+            final Map<Object, Object> map = new HashMap<>(((Map) object).size());
+            for (final Map.Entry<?, ?> entry : ((Map<?, ?>) object).entrySet()) {
+                map.put(translateObject(entry.getKey()), translateObject(entry.getValue()));
+            }
+            return map;
+        } else if (object instanceof List) {
+            final List<Object> list = new ArrayList<>();
+            for (final Object o : (List) object) {
+                list.add(translateObject(o));
+            }
+            return list;
+        } else
+            return object;
     }
 
     private Object invokeMethod(final Object delegate, final Class returnType, final String methodName, final Object... arguments) {
@@ -109,12 +126,7 @@ public final class JavaTranslator<S extends TraversalSource, T extends Traversal
         // create a copy of the argument array so as not to mutate the original bytecode
         final Object[] argumentsCopy = new Object[arguments.length];
         for (int i = 0; i < arguments.length; i++) {
-            if (arguments[i] instanceof Bytecode.Binding)
-                argumentsCopy[i] = ((Bytecode.Binding) arguments[i]).value();
-            else if (arguments[i] instanceof Bytecode)
-                argumentsCopy[i] = this.translateFromAnonymous((Bytecode) arguments[i]);
-            else
-                argumentsCopy[i] = arguments[i];
+            argumentsCopy[i] = translateObject(arguments[i]);
         }
         try {
             for (final Method method : methodCache.get(methodName)) {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
index fdeac0b..e06a62a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
@@ -45,27 +45,36 @@ public final class Computer implements Function<Graph, GraphComputer>, Serializa
     private Traversal<Vertex, Vertex> vertices = null;
     private Traversal<Vertex, Edge> edges = null;
 
+    public static final String GRAPH_COMPUTER = "graphComputer";
+    public static final String WORKERS = "workers";
+    public static final String PERSIST = "persist";
+    public static final String RESULT = "result";
+    public static final String VERTICES = "vertices";
+    public static final String EDGES = "edges";
+
     private Computer(final Class<? extends GraphComputer> graphComputerClass) {
         this.graphComputerClass = graphComputerClass;
     }
 
+    private Computer() {
+
+    }
+
     public static Computer compute(final Configuration configuration) {
         try {
-            final Computer computer = new Computer(configuration.containsKey("graphComputer") ?
-                    (Class) Class.forName(configuration.getString("graphComputer")) :
-                    GraphComputer.class);
+            final Computer computer = new Computer();
             for (final String key : (List<String>) IteratorUtils.asList(configuration.getKeys())) {
-                if (key.equals("graphComputer")) {
-                    // do nothing
-                } else if (key.equals("workers"))
+                if (key.equals(GRAPH_COMPUTER))
+                    computer.graphComputerClass = (Class) Class.forName(configuration.getString("graphComputer"));
+                else if (key.equals(WORKERS))
                     computer.workers = configuration.getInt(key);
-                else if (key.equals("persist"))
+                else if (key.equals(PERSIST))
                     computer.persist = GraphComputer.Persist.valueOf(configuration.getString(key));
-                else if (key.equals("result"))
+                else if (key.equals(RESULT))
                     computer.resultGraph = GraphComputer.ResultGraph.valueOf(configuration.getString(key));
-                else if (key.equals("vertices"))
+                else if (key.equals(VERTICES))
                     computer.vertices = (Traversal) configuration.getProperty(key);
-                else if (key.equals("edges"))
+                else if (key.equals(EDGES))
                     computer.edges = (Traversal) configuration.getProperty(key);
                 else
                     computer.configuration.put(key, configuration.getProperty(key));

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/GraphComputerHelper.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/GraphComputerHelper.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/GraphComputerHelper.java
index 468791f..5787681 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/GraphComputerHelper.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/util/GraphComputerHelper.java
@@ -18,13 +18,19 @@
  */
 package org.apache.tinkerpop.gremlin.process.computer.util;
 
+import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.computer.MapReduce;
 import org.apache.tinkerpop.gremlin.process.computer.Memory;
 import org.apache.tinkerpop.gremlin.process.computer.VertexProgram;
+import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 
 import java.lang.reflect.Method;
+import java.util.List;
 import java.util.Optional;
 
 /**
@@ -77,4 +83,23 @@ public final class GraphComputerHelper {
         if (!(b instanceof MapReduce)) return false;
         return a.getClass().equals(b.getClass()) && a.getMemoryKey().equals(((MapReduce) b).getMemoryKey());
     }
+
+    public static TraversalStrategy[] getTraversalStrategies(final TraversalSource traversalSource, final Computer computer) {
+        Class<? extends GraphComputer> graphComputerClass;
+        if (computer.getGraphComputerClass().equals(GraphComputer.class)) {
+            try {
+                graphComputerClass = computer.apply(traversalSource.getGraph()).getClass();
+            } catch (final Exception e) {
+                graphComputerClass = GraphComputer.class;
+            }
+        } else
+            graphComputerClass = computer.getGraphComputerClass();
+        final List<TraversalStrategy<?>> graphComputerStrategies = TraversalStrategies.GlobalCache.getStrategies(graphComputerClass).toList();
+        final TraversalStrategy[] traversalStrategies = new TraversalStrategy[graphComputerStrategies.size() + 1];
+        traversalStrategies[0] = new VertexProgramStrategy(computer);
+        for (int i = 0; i < graphComputerStrategies.size(); i++) {
+            traversalStrategies[i + 1] = graphComputerStrategies.get(i);
+        }
+        return traversalStrategies;
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bytecode.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bytecode.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bytecode.java
index 3737cef..9443064 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bytecode.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bytecode.java
@@ -26,6 +26,7 @@ import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
 
@@ -249,7 +250,13 @@ public final class Bytecode implements Cloneable, Serializable {
     private final Object convertArgument(final Object argument) {
         if (argument instanceof Traversal)
             return ((Traversal) argument).asAdmin().getBytecode();
-
+        else if (argument instanceof Map) {
+            final Map<Object, Object> map = new LinkedHashMap<>(((Map) argument).size());
+            for (final Map.Entry<?, ?> entry : ((Map<?, ?>) argument).entrySet()) {
+                map.put(convertArgument(entry.getKey()), convertArgument(entry.getValue()));
+            }
+            return map;
+        }
         if (null != this.bindings) {
             final String variable = this.bindings.getBoundVariable(argument);
             if (null != variable)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
index a31b875..5b4e663 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalSource.java
@@ -24,22 +24,21 @@ import org.apache.commons.configuration.PropertiesConfiguration;
 import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy;
+import org.apache.tinkerpop.gremlin.process.computer.util.GraphComputerHelper;
 import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SackStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SideEffectStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
-import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
 import org.apache.tinkerpop.gremlin.util.function.ConstantSupplier;
 
 import java.io.Serializable;
 import java.lang.reflect.Constructor;
 import java.lang.reflect.InvocationTargetException;
-import java.util.HashMap;
+import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 import java.util.Optional;
 import java.util.function.BinaryOperator;
-import java.util.function.Function;
 import java.util.function.Supplier;
 import java.util.function.UnaryOperator;
 
@@ -98,54 +97,56 @@ public interface TraversalSource extends Cloneable, AutoCloseable {
         public static final String withComputer = "withComputer";
         public static final String withSideEffect = "withSideEffect";
         public static final String withRemote = "withRemote";
-        public static final String withStrategy = "withStrategy";
-        public static final String withoutStrategy = "withoutStrategy";
     }
 
     /////////////////////////////
 
     /**
-     * Add a {@link TraversalStrategy} to the traversal source given the strategy name and key/value pair creation arguments.
+     * Add an arbitrary collection of {@link TraversalStrategy} instances to the traversal source.
+     * The map configurations must have a <code>strategy</code> key that is the name of the strategy class.
      *
-     * @param strategyName   the name of the strategy (the full class name)
-     * @param namedArguments key/value pair arguments where the even indices are string keys
+     * @param traversalStrategyConfigurations a collection of traversal strategies to add by configuration
      * @return a new traversal source with updated strategies
      */
-    public default TraversalSource withStrategy(final String strategyName, final Object... namedArguments) {
-        ElementHelper.legalPropertyKeyValueArray(namedArguments);
-        final Map<String, Object> configuration = new HashMap<>();
-        for (int i = 0; i < namedArguments.length; i = i + 2) {
-            configuration.put((String) namedArguments[i], namedArguments[i + 1]);
-        }
-        try {
-            final TraversalStrategy<?> traversalStrategy = (TraversalStrategy) ((0 == namedArguments.length) ?
-                    Class.forName(strategyName).getMethod("instance").invoke(null) :
-                    Class.forName(strategyName).getMethod("create", Configuration.class).invoke(null, new MapConfiguration(configuration)));
-            final TraversalSource clone = this.clone();
-            clone.getStrategies().addStrategies(traversalStrategy);
-            clone.getBytecode().addSource(Symbols.withStrategy, strategyName, namedArguments);
-            return clone;
-        } catch (final ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
-            throw new IllegalArgumentException(e.getMessage(), e);
+    @SuppressWarnings({"unchecked"})
+    public default TraversalSource withStrategies(final Map<String, Object>... traversalStrategyConfigurations) {
+        final TraversalSource clone = this.clone();
+        final List<TraversalStrategy<?>> strategies = new ArrayList<>();
+        for (final Map<String, Object> map : traversalStrategyConfigurations) {
+            try {
+                final TraversalStrategy<?> traversalStrategy = (TraversalStrategy) ((1 == map.size()) ?
+                        Class.forName((String) map.get("strategy")).getMethod("instance").invoke(null) :
+                        Class.forName((String) map.get("strategy")).getMethod("create", Configuration.class).invoke(null, new MapConfiguration(map)));
+                strategies.add(traversalStrategy);
+            } catch (final ClassNotFoundException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) {
+                throw new IllegalArgumentException(e.getMessage(), e);
+            }
         }
+        clone.getStrategies().addStrategies(strategies.toArray(new TraversalStrategy[strategies.size()]));
+        clone.getBytecode().addSource(TraversalSource.Symbols.withStrategies, traversalStrategyConfigurations);
+        return clone;
     }
 
     /**
-     * Remove a {@link TraversalStrategy} from the travesal source given the strategy name.
+     * Remove an arbitrary collection of {@link TraversalStrategy} classes from the traversal source.
      *
-     * @param strategyName the name of the strategy (the full class name)
+     * @param traversalStrategyNames a collection of traversal strategy class names to remove
      * @return a new traversal source with updated strategies
      */
-    @SuppressWarnings({"unchecked", "varargs"})
-    public default TraversalSource withoutStrategy(final String strategyName) {
-        try {
-            final TraversalSource clone = this.clone();
-            clone.getStrategies().removeStrategies((Class<TraversalStrategy>) Class.forName(strategyName));
-            clone.getBytecode().addSource(TraversalSource.Symbols.withoutStrategy, strategyName);
-            return clone;
-        } catch (final ClassNotFoundException e) {
-            throw new IllegalArgumentException(e.getMessage(), e);
+    @SuppressWarnings({"unchecked"})
+    public default TraversalSource withoutStrategies(final String... traversalStrategyNames) {
+        final TraversalSource clone = this.clone();
+        final List<Class<TraversalStrategy>> strategies = new ArrayList<>();
+        for (final String name : traversalStrategyNames) {
+            try {
+                strategies.add((Class) Class.forName(name));
+            } catch (final ClassNotFoundException e) {
+                throw new IllegalArgumentException(e.getMessage(), e);
+            }
         }
+        clone.getStrategies().removeStrategies(strategies.toArray(new Class[strategies.size()]));
+        clone.getBytecode().addSource(Symbols.withoutStrategies, traversalStrategyNames);
+        return clone;
     }
 
     /**
@@ -190,59 +191,28 @@ public interface TraversalSource extends Cloneable, AutoCloseable {
 
     /**
      * Configure a {@link GraphComputer} to be used for the execution of subsequently spawned traversal.
+     * This adds a {@link VertexProgramStrategy} to the strategies.
      *
-     * @param namedArguments key/value pair arguments where the even indices are string keys
+     * @param computerConfiguration key/value pair map for configuring a {@link Computer}
      * @return a new traversal source with updated strategies
      */
-    public default TraversalSource withComputer(final Object... namedArguments) {
-        if (namedArguments.length == 1) {
-            if (namedArguments[0] instanceof Class)
-                return this.withComputer((Class<? extends GraphComputer>) namedArguments[1]);
-            else if (namedArguments[0] instanceof Computer)
-                return this.withComputer((Computer) namedArguments[1]);
-        }
-        ElementHelper.legalPropertyKeyValueArray(namedArguments);
-        final Map<String, Object> configuration = new HashMap<>();
-        for (int i = 0; i < namedArguments.length; i = i + 2) {
-            configuration.put((String) namedArguments[i], namedArguments[i + 1]);
-        }
-        final Computer computer = Computer.compute(new MapConfiguration(configuration));
-        final List<TraversalStrategy<?>> graphComputerStrategies = TraversalStrategies.GlobalCache.getStrategies(computer.apply(this.getGraph()).getClass()).toList();
-        final TraversalStrategy[] traversalStrategies = new TraversalStrategy[graphComputerStrategies.size() + 1];
-        traversalStrategies[0] = new VertexProgramStrategy(computer);
-        for (int i = 0; i < graphComputerStrategies.size(); i++) {
-            traversalStrategies[i + 1] = graphComputerStrategies.get(i);
-        }
-        ///
+    public default TraversalSource withComputer(final Map<String, Object> computerConfiguration) {
         final TraversalSource clone = this.clone();
-        clone.getStrategies().addStrategies(traversalStrategies);
-        clone.getBytecode().addSource(TraversalSource.Symbols.withComputer, computer);
+        clone.getStrategies().addStrategies(GraphComputerHelper.getTraversalStrategies(this, Computer.compute(new MapConfiguration(computerConfiguration))));
+        clone.getBytecode().addSource(TraversalSource.Symbols.withComputer, computerConfiguration);
         return clone;
     }
 
     /**
-     * Add a {@link Function} that will generate a {@link GraphComputer} from the {@link Graph} that will be used to execute the traversal.
+     * Add a {@link Computer} that will generate a {@link GraphComputer} from the {@link Graph} that will be used to execute the traversal.
      * This adds a {@link VertexProgramStrategy} to the strategies.
      *
      * @param computer a builder to generate a graph computer from the graph
      * @return a new traversal source with updated strategies
      */
     public default TraversalSource withComputer(final Computer computer) {
-        Class<? extends GraphComputer> graphComputerClass;
-        try {
-            graphComputerClass = computer.apply(this.getGraph()).getClass();
-        } catch (final Exception e) {
-            graphComputerClass = computer.getGraphComputerClass();
-        }
-        final List<TraversalStrategy<?>> graphComputerStrategies = TraversalStrategies.GlobalCache.getStrategies(graphComputerClass).toList();
-        final TraversalStrategy[] traversalStrategies = new TraversalStrategy[graphComputerStrategies.size() + 1];
-        traversalStrategies[0] = new VertexProgramStrategy(computer);
-        for (int i = 0; i < graphComputerStrategies.size(); i++) {
-            traversalStrategies[i + 1] = graphComputerStrategies.get(i);
-        }
-        ///
         final TraversalSource clone = this.clone();
-        clone.getStrategies().addStrategies(traversalStrategies);
+        clone.getStrategies().addStrategies(GraphComputerHelper.getTraversalStrategies(this, computer));
         clone.getBytecode().addSource(TraversalSource.Symbols.withComputer, computer);
         return clone;
     }
@@ -255,15 +225,8 @@ public interface TraversalSource extends Cloneable, AutoCloseable {
      * @return a new traversal source with updated strategies
      */
     public default TraversalSource withComputer(final Class<? extends GraphComputer> graphComputerClass) {
-        final List<TraversalStrategy<?>> graphComputerStrategies = TraversalStrategies.GlobalCache.getStrategies(graphComputerClass).toList();
-        final TraversalStrategy[] traversalStrategies = new TraversalStrategy[graphComputerStrategies.size() + 1];
-        traversalStrategies[0] = new VertexProgramStrategy(Computer.compute(graphComputerClass));
-        for (int i = 0; i < graphComputerStrategies.size(); i++) {
-            traversalStrategies[i + 1] = graphComputerStrategies.get(i);
-        }
-        ///
         final TraversalSource clone = this.clone();
-        clone.getStrategies().addStrategies(traversalStrategies);
+        clone.getStrategies().addStrategies(GraphComputerHelper.getTraversalStrategies(this, Computer.compute(graphComputerClass)));
         clone.getBytecode().addSource(TraversalSource.Symbols.withComputer, graphComputerClass);
         return clone;
     }
@@ -275,22 +238,8 @@ public interface TraversalSource extends Cloneable, AutoCloseable {
      * @return a new traversal source with updated strategies
      */
     public default TraversalSource withComputer() {
-        final Computer computer = Computer.compute();
-        Class<? extends GraphComputer> graphComputerClass;
-        try {
-            graphComputerClass = computer.apply(this.getGraph()).getClass();
-        } catch (final Exception e) {
-            graphComputerClass = computer.getGraphComputerClass();
-        }
-        final List<TraversalStrategy<?>> graphComputerStrategies = TraversalStrategies.GlobalCache.getStrategies(graphComputerClass).toList();
-        final TraversalStrategy[] traversalStrategies = new TraversalStrategy[graphComputerStrategies.size() + 1];
-        traversalStrategies[0] = new VertexProgramStrategy(computer);
-        for (int i = 0; i < graphComputerStrategies.size(); i++) {
-            traversalStrategies[i + 1] = graphComputerStrategies.get(i);
-        }
-        ///
         final TraversalSource clone = this.clone();
-        clone.getStrategies().addStrategies(traversalStrategies);
+        clone.getStrategies().addStrategies(GraphComputerHelper.getTraversalStrategies(this, Computer.compute()));
         clone.getBytecode().addSource(TraversalSource.Symbols.withComputer);
         return clone;
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategy.java
index f01f418..a04f304 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategy.java
@@ -43,6 +43,7 @@ import java.util.Set;
  */
 public interface TraversalStrategy<S extends TraversalStrategy> extends Serializable, Comparable<Class<? extends TraversalStrategy>> {
 
+    public static final String STRATEGY = "strategy";
 
     public void apply(final Traversal.Admin<?, ?> traversal);
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
index 2bd4bdf..8741894 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSource.java
@@ -45,6 +45,7 @@ import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 import java.util.Optional;
 import java.util.function.BinaryOperator;
 import java.util.function.Supplier;
@@ -122,49 +123,50 @@ public class GraphTraversalSource implements TraversalSource {
     //// CONFIGURATIONS
 
     @Override
-    public GraphTraversalSource withBindings(final Bindings bindings) {
-        return (GraphTraversalSource) TraversalSource.super.withBindings(bindings);
+    @SuppressWarnings({"unchecked"})
+    public GraphTraversalSource withStrategies(final Map<String, Object>... traversalStrategyConfigurations) {
+        return (GraphTraversalSource) TraversalSource.super.withStrategies(traversalStrategyConfigurations);
     }
 
     @Override
-    public GraphTraversalSource withComputer(final Object... namedArguments) {
-        return (GraphTraversalSource) TraversalSource.super.withComputer(namedArguments);
+    public GraphTraversalSource withoutStrategies(final String... traversalStrategyNames) {
+        return (GraphTraversalSource) TraversalSource.super.withoutStrategies(traversalStrategyNames);
     }
 
     @Override
-    public GraphTraversalSource withComputer(final Computer computer) {
-        return (GraphTraversalSource) TraversalSource.super.withComputer(computer);
+    public GraphTraversalSource withStrategies(final TraversalStrategy... traversalStrategies) {
+        return (GraphTraversalSource) TraversalSource.super.withStrategies(traversalStrategies);
     }
 
     @Override
-    public GraphTraversalSource withComputer(final Class<? extends GraphComputer> graphComputerClass) {
-        return (GraphTraversalSource) TraversalSource.super.withComputer(graphComputerClass);
+    @SuppressWarnings({"unchecked"})
+    public GraphTraversalSource withoutStrategies(final Class<? extends TraversalStrategy>... traversalStrategyClasses) {
+        return (GraphTraversalSource) TraversalSource.super.withoutStrategies(traversalStrategyClasses);
     }
 
     @Override
-    public GraphTraversalSource withComputer() {
-        return (GraphTraversalSource) TraversalSource.super.withComputer();
+    public GraphTraversalSource withBindings(final Bindings bindings) {
+        return (GraphTraversalSource) TraversalSource.super.withBindings(bindings);
     }
 
     @Override
-    public GraphTraversalSource withStrategy(final String strategyName, final Object... nameArguments) {
-        return (GraphTraversalSource) TraversalSource.super.withStrategy(strategyName, nameArguments);
+    public GraphTraversalSource withComputer(final Map<String,Object> computerConfiguration) {
+        return (GraphTraversalSource) TraversalSource.super.withComputer(computerConfiguration);
     }
 
     @Override
-    public GraphTraversalSource withoutStrategy(final String strategyName) {
-        return (GraphTraversalSource) TraversalSource.super.withoutStrategy(strategyName);
+    public GraphTraversalSource withComputer(final Computer computer) {
+        return (GraphTraversalSource) TraversalSource.super.withComputer(computer);
     }
 
     @Override
-    public GraphTraversalSource withStrategies(final TraversalStrategy... traversalStrategies) {
-        return (GraphTraversalSource) TraversalSource.super.withStrategies(traversalStrategies);
+    public GraphTraversalSource withComputer(final Class<? extends GraphComputer> graphComputerClass) {
+        return (GraphTraversalSource) TraversalSource.super.withComputer(graphComputerClass);
     }
 
     @Override
-    @SuppressWarnings({"unchecked", "varargs"})
-    public GraphTraversalSource withoutStrategies(final Class<? extends TraversalStrategy>... traversalStrategyClasses) {
-        return (GraphTraversalSource) TraversalSource.super.withoutStrategies(traversalStrategyClasses);
+    public GraphTraversalSource withComputer() {
+        return (GraphTraversalSource) TraversalSource.super.withComputer();
     }
 
     @Override

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
index cd5119b..ee1f017 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
@@ -59,9 +59,11 @@ public final class HaltedTraverserStrategy extends AbstractTraversalStrategy<Tra
         return traverser;
     }
 
+    public static final String HALTED_TRAVERSER_FACTORY = "haltedTraverserFactory";
+
     public static HaltedTraverserStrategy create(final Configuration configuration) {
         try {
-            return new HaltedTraverserStrategy(Class.forName((String) configuration.getProperty("haltedTraverserFactory")));
+            return new HaltedTraverserStrategy(Class.forName(configuration.getString(HALTED_TRAVERSER_FACTORY)));
         } catch (final ClassNotFoundException e) {
             throw new IllegalArgumentException(e.getMessage(), e);
         }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
index 1fa4105..2ee4bf3 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
@@ -324,20 +324,21 @@ public final class PartitionStrategy extends AbstractTraversalStrategy<Traversal
         }
     }
 
+    public static final String INCLUDE_META_PROPERTIES = "includeMetaProperties";
+    public static final String WRITE_PARTITION = "writePartition";
+    public static final String PARTITION_KEY = "partitionKey";
+    public static final String READ_PARTITIONS = "readPartitions";
+
     public static PartitionStrategy create(final Configuration configuration) {
         final PartitionStrategy.Builder builder = PartitionStrategy.build();
-        configuration.getKeys().forEachRemaining(key -> {
-            if (key.equals("includeMetaProperties"))
-                builder.includeMetaProperties((Boolean) configuration.getProperty(key));
-            else if (key.equals("writePartition"))
-                builder.writePartition((String) configuration.getProperty(key));
-            else if (key.equals("partitionKey"))
-                builder.partitionKey((String) configuration.getProperty(key));
-            else if (key.equals("readPartitions"))
-                builder.readPartitions((List<String>) configuration.getProperty(key));
-            else
-                throw new IllegalArgumentException("The following " + PartitionStrategy.class.getSimpleName() + " configuration is unknown: " + key + ":" + configuration.getProperty(key));
-        });
+        if (configuration.containsKey(INCLUDE_META_PROPERTIES))
+            builder.includeMetaProperties(configuration.getBoolean(INCLUDE_META_PROPERTIES));
+        if (configuration.containsKey(WRITE_PARTITION))
+            builder.writePartition(configuration.getString(WRITE_PARTITION));
+        if (configuration.containsKey(PARTITION_KEY))
+            builder.partitionKey(configuration.getString(PARTITION_KEY));
+        if (configuration.containsKey(READ_PARTITIONS))
+            builder.readPartitions((List) configuration.getList(READ_PARTITIONS));
         return builder.create();
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
index bccff9b..d7269aa 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
@@ -90,8 +90,8 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy<TraversalS
         } else {
             final Traversal.Admin<Edge, ?> vertexPredicate;
             vertexPredicate = __.<Edge>and(
-                    __.inV().filter(this.vertexCriterion.clone()),
-                    __.outV().filter(this.vertexCriterion.clone())).asAdmin();
+                    __.inV().filter(this.vertexCriterion),
+                    __.outV().filter(this.vertexCriterion)).asAdmin();
 
             // if there is a vertex predicate then there is an implied edge filter on vertices even if there is no
             // edge predicate provided by the user.
@@ -204,8 +204,8 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy<TraversalS
         if (null != this.vertexPropertyCriterion) {
             final OrStep<Object> checkPropertyCriterion = new OrStep(traversal,
                     new DefaultTraversal<>().addStep(new ClassFilterStep<>(traversal, VertexProperty.class, false)),
-                    new DefaultTraversal<>().addStep(new TraversalFilterStep<>(traversal, this.vertexPropertyCriterion.clone())));
-            final Traversal.Admin nonCheckPropertyCriterion = new DefaultTraversal<>().addStep(new TraversalFilterStep<>(traversal, this.vertexPropertyCriterion.clone()));
+                    new DefaultTraversal<>().addStep(new TraversalFilterStep<>(traversal, this.vertexPropertyCriterion)));
+            final Traversal.Admin nonCheckPropertyCriterion = new DefaultTraversal<>().addStep(new TraversalFilterStep<>(traversal, this.vertexPropertyCriterion));
 
             // turn all ElementValueTraversals into filters
             for (final Step<?, ?> step : traversal.getSteps()) {
@@ -291,18 +291,18 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy<TraversalS
         return this.vertexPropertyCriterion;
     }
 
+    public static final String VERTICES = "vertices";
+    public static final String EDGES = "edges";
+    public static final String VERTEX_PROPERTIES = "vertexProperties";
+
     public static SubgraphStrategy create(final Configuration configuration) {
         final Builder builder = SubgraphStrategy.build();
-        configuration.getKeys().forEachRemaining(key -> {
-            if (key.equals("vertices") || key.equals("vertexCriterion"))
-                builder.vertices((Traversal) configuration.getProperty(key));
-            else if (key.equals("edges") || key.equals("edgeCriterion"))
-                builder.edges((Traversal) configuration.getProperty(key));
-            else if (key.equals("vertexProperties"))
-                builder.vertexProperties((Traversal) configuration.getProperty(key));
-            else
-                throw new IllegalArgumentException("The following " + SubgraphStrategy.class.getSimpleName() + " configuration is unknown: " + key + ":" + configuration.getProperty(key));
-        });
+        if (configuration.containsKey(VERTICES))
+            builder.vertices((Traversal) configuration.getProperty(VERTICES));
+        if (configuration.containsKey(EDGES))
+            builder.edges((Traversal) configuration.getProperty(EDGES));
+        if (configuration.containsKey(VERTEX_PROPERTIES))
+            builder.vertexProperties((Traversal) configuration.getProperty(VERTEX_PROPERTIES));
         return builder.create();
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
index 917fab9..9f7f516 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
@@ -31,6 +31,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversal
 import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 
+import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Set;
 
@@ -52,7 +53,7 @@ public final class StandardVerificationStrategy extends AbstractTraversalStrateg
         }
 
         for (final Step<?, ?> step : traversal.getSteps()) {
-            for (String label : step.getLabels()) {
+            for (String label : new ArrayList<>(step.getLabels())) {
                 if (Graph.Hidden.isHidden(label))
                     step.removeLabel(label);
             }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
index 7604ab5..6efa4b5 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
@@ -24,6 +24,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.Read
 import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
 import org.junit.Test;
 
+import java.util.Collections;
+import java.util.HashMap;
+
 import static org.junit.Assert.assertFalse;
 import static org.junit.Assert.assertTrue;
 import static org.mockito.Mockito.mock;
@@ -59,18 +62,20 @@ public class GraphTraversalSourceTest {
     public void shouldSupportStringBasedStrategies() throws Exception {
         GraphTraversalSource g = EmptyGraph.instance().traversal();
         assertFalse(g.getStrategies().getStrategy(SubgraphStrategy.class).isPresent());
-        g = g.withStrategy(SubgraphStrategy.class.getCanonicalName(),
-                "vertices", __.hasLabel("person"),
-                "vertexProperties", __.limit(0),
-                "edges", __.hasLabel("knows"));
+        g = g.withStrategies(new HashMap<String, Object>() {{
+            put("strategy", SubgraphStrategy.class.getCanonicalName());
+            put("vertices", __.hasLabel("person"));
+            put("vertexProperties", __.limit(0));
+            put("edges", __.hasLabel("knows"));
+        }});
         assertTrue(g.getStrategies().getStrategy(SubgraphStrategy.class).isPresent());
-        g = g.withoutStrategy(SubgraphStrategy.class.getCanonicalName());
+        g = g.withoutStrategies(SubgraphStrategy.class.getCanonicalName());
         assertFalse(g.getStrategies().getStrategy(SubgraphStrategy.class).isPresent());
         //
         assertFalse(g.getStrategies().getStrategy(ReadOnlyStrategy.class).isPresent());
-        g = g.withStrategy(ReadOnlyStrategy.class.getCanonicalName());
+        g = g.withStrategies(Collections.singletonMap("strategy", ReadOnlyStrategy.class.getCanonicalName()));
         assertTrue(g.getStrategies().getStrategy(ReadOnlyStrategy.class).isPresent());
-        g = g.withoutStrategy(ReadOnlyStrategy.class.getCanonicalName());
+        g = g.withoutStrategies(ReadOnlyStrategy.class.getCanonicalName());
         assertFalse(g.getStrategies().getStrategy(ReadOnlyStrategy.class).isPresent());
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java
index 8060d39..df960c0 100644
--- a/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java
+++ b/gremlin-groovy-test/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslatorTest.java
@@ -21,16 +21,23 @@ package org.apache.tinkerpop.gremlin.groovy.jsr223;
 
 import org.apache.tinkerpop.gremlin.AbstractGremlinTest;
 import org.apache.tinkerpop.gremlin.LoadGraphWith;
-import org.apache.tinkerpop.gremlin.groovy.jsr223.GroovyTranslator;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.util.function.Lambda;
 import org.junit.Test;
 
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 
 import static org.junit.Assert.assertEquals;
@@ -43,6 +50,34 @@ public class GroovyTranslatorTest extends AbstractGremlinTest {
 
     @Test
     @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
+    public void shouldHandleStrategies() throws Exception {
+        GraphTraversalSource g = graph.traversal();
+        g = g.withStrategies(new HashMap<String, Object>() {{
+            put(SubgraphStrategy.STRATEGY, SubgraphStrategy.class.getCanonicalName());
+            put(SubgraphStrategy.VERTICES, __.has("name", "marko"));
+        }});
+        final Bindings bindings = new SimpleBindings();
+        bindings.put("g", g);
+        Traversal.Admin<Vertex, Object> traversal = new GremlinGroovyScriptEngine().eval(g.V().values("name").asAdmin().getBytecode(), bindings);
+        assertEquals("marko", traversal.next());
+        assertFalse(traversal.hasNext());
+        //
+        g = g.withoutStrategies(SubgraphStrategy.class.getCanonicalName());
+        traversal = new GremlinGroovyScriptEngine().eval(g.V().count().asAdmin().getBytecode(), bindings);
+        assertEquals(new Long(6), traversal.next());
+        assertFalse(traversal.hasNext());
+        //
+        g = graph.traversal().withStrategies(new HashMap<String, Object>() {{
+            put(SubgraphStrategy.STRATEGY, SubgraphStrategy.class.getCanonicalName());
+            put(SubgraphStrategy.VERTICES, __.has("name", "marko"));
+        }}, Collections.singletonMap(ReadOnlyStrategy.STRATEGY, ReadOnlyStrategy.class.getCanonicalName()));
+        traversal = new GremlinGroovyScriptEngine().eval(g.V().values("name").asAdmin().getBytecode(), bindings);
+        assertEquals("marko", traversal.next());
+        assertFalse(traversal.hasNext());
+    }
+
+    @Test
+    @LoadGraphWith(LoadGraphWith.GraphData.MODERN)
     public void shouldSupportStringSupplierLambdas() throws Exception {
         GraphTraversalSource g = graph.traversal();
         g = g.withStrategies(new TranslationStrategy(g, GroovyTranslator.of("g")));

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
index aba78bb..59a07b3 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
@@ -24,6 +24,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
 import org.apache.tinkerpop.gremlin.process.traversal.Translator;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
 import org.apache.tinkerpop.gremlin.process.traversal.util.OrP;
@@ -34,6 +35,7 @@ import org.apache.tinkerpop.gremlin.util.function.Lambda;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Map;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -80,7 +82,7 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
         final StringBuilder traversalScript = new StringBuilder(start);
         for (final Bytecode.Instruction instruction : bytecode.getInstructions()) {
             final String methodName = instruction.getOperator();
-            if(IS_TESTING && methodName.equals(TraversalSource.Symbols.withStrategies))
+            if (IS_TESTING && methodName.equals(TraversalSource.Symbols.withStrategies))
                 continue;
             if (0 == instruction.getArguments().length)
                 traversalScript.append(".").append(methodName).append("()");
@@ -100,13 +102,23 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
         if (object instanceof Bytecode.Binding)
             return ((Bytecode.Binding) object).variable();
         else if (object instanceof String)
-            return "\"" + object + "\"";
+            return ((String) object).contains("\"") ? "\"\"\"" + object + "\"\"\"" : "\"" + object + "\"";
         else if (object instanceof List) {
             final List<String> list = new ArrayList<>(((List) object).size());
             for (final Object item : (List) object) {
                 list.add(convertToString(item));
             }
             return list.toString();
+        } else if (object instanceof Map) {
+            final StringBuilder map = new StringBuilder("new LinkedHashMap(){{");
+            for (final Map.Entry<?, ?> entry : ((Map<?, ?>) object).entrySet()) {
+                map.append("put(").
+                        append(convertToString(entry.getKey())).
+                        append(",").
+                        append(convertToString(entry.getValue())).
+                        append(");");
+            }
+            return map.append("}}").toString();
         } else if (object instanceof Long)
             return object + "L";
         else if (object instanceof Double)
@@ -134,6 +146,8 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
             return lambdaString.startsWith("{") ? lambdaString : "{" + lambdaString + "}";
         } else if (object instanceof Bytecode)
             return this.internalTranslate("__", (Bytecode) object);
+        else if (object instanceof Traversal)
+            return this.internalTranslate("__", ((Traversal) object).asAdmin().getBytecode());
         else
             return null == object ? "null" : object.toString();
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
index 4952803..66aecf8 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/GremlinJythonScriptEngine.java
@@ -25,6 +25,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.util.CoreImports;
 import org.python.jsr223.PyScriptEngine;
 import org.python.jsr223.PyScriptEngineFactory;
@@ -66,8 +67,12 @@ public class GremlinJythonScriptEngine implements GremlinScriptEngine {
                     "  elif isinstance(index,slice):\n    return self.range(index.start,index.stop)\n" +
                     "  else:\n    return TypeError('Index must be int or slice')");
             this.pyScriptEngine.eval(GraphTraversal.class.getSimpleName() + ".__getitem__ = getitem_bypass");
-            this.pyScriptEngine.eval(GraphTraversal.class.getSimpleName() + ".__getattr__ = lambda self, key: self.values(key)");
-
+            this.pyScriptEngine.eval(GraphTraversal.class.getSimpleName() + ".__getattr__ = lambda self, key: self.values(key)\n");
+            // necessary cause of var args bug in Jython (http://bugs.jython.org/issue1615)
+            this.pyScriptEngine.eval("def withStrategies_bypass(self, *args):\n" +
+                    "  self.getBytecode().addSource(\"withStrategies\", *args)\n" +
+                    "  return self\n");
+            this.pyScriptEngine.eval(GraphTraversalSource.class.getSimpleName() + ".withStrategies = withStrategies_bypass\n");
             this.pyScriptEngine.eval("\n" +
                     "from java.lang import Long\n" +
                     "import org.apache.tinkerpop.gremlin.util.function.Lambda\n" + // todo: remove or remove imported subclass names? (choose)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
index 4744649..65042ab 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
@@ -43,6 +43,7 @@ import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
@@ -102,7 +103,7 @@ public class PythonTranslator implements Translator.ScriptTranslator {
         for (final Bytecode.Instruction instruction : bytecode.getInstructions()) {
             final String methodName = instruction.getOperator();
             final Object[] arguments = instruction.getArguments();
-            if (IS_TESTING && methodName.equals(TraversalSource.Symbols.withStrategies))
+            if (IS_TESTING && methodName.equals(TraversalSource.Symbols.withStrategies) && !(instruction.getArguments()[0] instanceof Map))
                 continue;
             else if (0 == arguments.length)
                 traversalScript.append(".").append(SymbolHelper.toPython(methodName)).append("()");
@@ -133,13 +134,22 @@ public class PythonTranslator implements Translator.ScriptTranslator {
         if (object instanceof Bytecode.Binding)
             return ((Bytecode.Binding) object).variable();
         else if (object instanceof String)
-            return "\"" + object + "\"";
+            return ((String) object).contains("\"") ? "\"\"\"" + object + "\"\"\"" : "\"" + object + "\"";
         else if (object instanceof List) {
             final List<String> list = new ArrayList<>(((List) object).size());
             for (final Object item : (List) object) {
                 list.add(convertToString(item));
             }
             return list.toString();
+        } else if (object instanceof Map) {
+            final StringBuilder map = new StringBuilder("{");
+            for (final Map.Entry<?, ?> entry : ((Map<?, ?>) object).entrySet()) {
+                map.append(convertToString(entry.getKey())).
+                        append(":").
+                        append(convertToString(entry.getValue())).
+                        append(",");
+            }
+            return map.length() > 1 ? map.substring(0, map.length() - 1) + "}" : map.append("}").toString();
         } else if (object instanceof Long)
             return object + "L";
         else if (object instanceof Boolean)
@@ -158,6 +168,8 @@ public class PythonTranslator implements Translator.ScriptTranslator {
             return convertToString(((Element) object).id()); // hack
         else if (object instanceof Bytecode)
             return this.internalTranslate("__", (Bytecode) object);
+        else if (object instanceof Traversal)
+            return this.internalTranslate("__", ((Traversal.Admin) object).asAdmin().getBytecode());
         else if (object instanceof Computer)
             return "";
         else if (object instanceof Lambda)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py b/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
index 46b6dee..35b9b71 100644
--- a/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
+++ b/gremlin-python/src/main/jython/gremlin_python/process/graph_traversal.py
@@ -57,18 +57,10 @@ class GraphTraversalSource(object):
     source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
     source.bytecode.add_source("withStrategies", *args)
     return source
-  def withStrategy(self, *args):
-    source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
-    source.bytecode.add_source("withStrategy", *args)
-    return source
   def withoutStrategies(self, *args):
     source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
     source.bytecode.add_source("withoutStrategies", *args)
     return source
-  def withoutStrategy(self, *args):
-    source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
-    source.bytecode.add_source("withoutStrategy", *args)
-    return source
   def withRemote(self, remote_connection):
     source = GraphTraversalSource(self.graph, TraversalStrategies(self.traversal_strategies), Bytecode(self.bytecode))
     source.traversal_strategies.add_strategies([RemoteStrategy(remote_connection)])

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
index 9914197..0524d74 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
@@ -29,6 +29,7 @@ from gremlin_python.process.traversal import Traverser
 from gremlin_python.process.graph_traversal import __
 from gremlin_python.structure.graph import Graph
 from gremlin_python.structure.graph import Vertex
+from gremlin_python.structure.io.graphson import GraphSONWriter
 
 
 class TestDriverRemoteConnection(TestCase):
@@ -63,16 +64,18 @@ class TestDriverRemoteConnection(TestCase):
     def test_strategies(self):
         statics.load_statics(globals())
         connection = DriverRemoteConnection('ws://localhost:8182/gremlin', 'g')
-        g = Graph().traversal().withRemote(connection).withStrategy(
-            "org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy",
-            "vertices", __.hasLabel("person"),
-            "edges", __.hasLabel("created"))
+        g = Graph().traversal().withRemote(connection).withStrategies(
+            {"strategy": "org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy",
+             "vertices": __.hasLabel("person"),
+             "edges": __.hasLabel("created")})
+        print GraphSONWriter.writeObject(g.bytecode)
         assert 4 == g.V().count().next()
         assert 0 == g.E().count().next()
         assert 1 == g.V().label().dedup().count().next()
         assert "person" == g.V().label().dedup().next()
         #
-        g = g.withoutStrategy("org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy").withComputer("workers", 4, "vertices", __.has("name", "marko"), "edges", __.limit(0))
+        g = g.withoutStrategies("org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy"). \
+            withComputer({"workers": 4, "vertices": __.has("name", "marko"), "edges": __.limit(0)})
         assert 1 == g.V().count().next()
         assert 0 == g.E().count().next()
         assert "person" == g.V().label().next()

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
index 9f6dd42..40aac5c 100644
--- a/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
+++ b/gremlin-python/src/test/java/org/apache/tinkerpop/gremlin/python/jsr223/JythonTranslatorTest.java
@@ -19,16 +19,26 @@
 
 package org.apache.tinkerpop.gremlin.python.jsr223;
 
+import org.apache.tinkerpop.gremlin.jsr223.GremlinScriptEngine;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerFactory;
+import org.apache.tinkerpop.gremlin.util.ScriptEngineCache;
 import org.apache.tinkerpop.gremlin.util.function.Lambda;
 import org.junit.Test;
 
+import javax.script.Bindings;
+import javax.script.SimpleBindings;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
 
 import static org.junit.Assert.assertEquals;
@@ -40,6 +50,30 @@ import static org.junit.Assert.assertFalse;
 public class JythonTranslatorTest {
 
     @Test
+    public void shouldHandleStrategies() throws Exception {
+        GraphTraversalSource g = TinkerFactory.createModern().traversal();
+        g = g.withStrategies(new HashMap<String, Object>() {{
+            put(SubgraphStrategy.STRATEGY, SubgraphStrategy.class.getCanonicalName());
+            put(SubgraphStrategy.VERTICES, __.has("name", "marko"));
+        }});
+        final Bindings bindings = new SimpleBindings();
+        bindings.put("g", g);
+        //System.out.println(JythonTranslator.of("g").translate(g.V().values("name").asAdmin().getBytecode()));
+        Traversal.Admin<Vertex, String> traversal = ((GremlinScriptEngine) ScriptEngineCache.get("gremlin-jython")).eval(g.V().values("name").asAdmin().getBytecode(), bindings);
+        assertEquals("marko", traversal.next());
+        assertFalse(traversal.hasNext());
+        //
+        g = g.withStrategies(new HashMap<String, Object>() {{
+            put(SubgraphStrategy.STRATEGY, SubgraphStrategy.class.getCanonicalName());
+            put(SubgraphStrategy.VERTICES, __.has("name", "marko"));
+        }}, Collections.singletonMap(ReadOnlyStrategy.STRATEGY, ReadOnlyStrategy.class.getCanonicalName()));
+        //System.out.println(JythonTranslator.of("g").translate(g.V().values("name").asAdmin().getBytecode()));
+        traversal = ((GremlinScriptEngine) ScriptEngineCache.get("gremlin-jython")).eval(g.V().values("name").asAdmin().getBytecode(), bindings);
+        assertEquals("marko", traversal.next());
+        assertFalse(traversal.hasNext());
+    }
+
+    @Test
     public void shouldSupportStringSupplierLambdas() throws Exception {
         GraphTraversalSource g = TinkerFactory.createModern().traversal();
         g = g.withStrategies(new TranslationStrategy(g, JythonTranslator.of("g")));

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
index 168e4fe..5d82e0e 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategyProcessTest.java
@@ -31,6 +31,7 @@ import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.junit.Test;
 
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
 import java.util.NoSuchElementException;
 import java.util.stream.Collectors;
@@ -419,17 +420,12 @@ public class PartitionStrategyProcessTest extends AbstractGremlinProcessTest {
                 .partitionKey(partition).writePartition("C").readPartitions("A").create();
         final GraphTraversalSource sourceCA = g.withStrategies(partitionStrategyCA);
 
-        final PartitionStrategy partitionStrategyCABC = PartitionStrategy.build()
-                .partitionKey(partition)
-                .writePartition("C")
-                .addReadPartition("A")
-                .addReadPartition("B")
-                .addReadPartition("C").create();
-        final GraphTraversalSource sourceCABC = g.withStrategy(PartitionStrategy.class.getCanonicalName(),
-                "writePartition", "C",
-                "partitionKey", partition,
-                "readPartitions", Arrays.asList("A", "B", "C"));
-
+        final GraphTraversalSource sourceCABC = g.withStrategies(new HashMap<String, Object>() {{
+            put(PartitionStrategy.STRATEGY, PartitionStrategy.class.getCanonicalName());
+            put(PartitionStrategy.WRITE_PARTITION, "C");
+            put(PartitionStrategy.PARTITION_KEY, partition);
+            put(PartitionStrategy.READ_PARTITIONS, Arrays.asList("A", "B", "C"));
+        }});
         final PartitionStrategy partitionStrategyCC = PartitionStrategy.build()
                 .partitionKey(partition).writePartition("C").addReadPartition("C").create();
         final GraphTraversalSource sourceCC = g.withStrategies(partitionStrategyCC);

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
index 2a79c3c..4d95c96 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategyProcessTest.java
@@ -36,6 +36,7 @@ import org.junit.Test;
 import org.junit.runner.RunWith;
 
 import java.util.Arrays;
+import java.util.HashMap;
 import java.util.List;
 import java.util.NoSuchElementException;
 
@@ -371,7 +372,10 @@ public class SubgraphStrategyProcessTest extends AbstractGremlinProcessTest {
     @Test
     @LoadGraphWith(CREW)
     public void shouldFilterVertexProperties() throws Exception {
-        GraphTraversalSource sg = g.withStrategy(SubgraphStrategy.class.getCanonicalName(), "vertexProperties", __.has("startTime", P.gt(2005)));
+        GraphTraversalSource sg = g.withStrategies(new HashMap<String, Object>() {{
+            put(SubgraphStrategy.STRATEGY, SubgraphStrategy.class.getCanonicalName());
+            put(SubgraphStrategy.VERTEX_PROPERTIES, __.has("startTime", P.gt(2005)));
+        }});
         checkResults(Arrays.asList("purcellville", "baltimore", "oakland", "seattle", "aachen"), sg.V().properties("location").value());
         checkResults(Arrays.asList("purcellville", "baltimore", "oakland", "seattle", "aachen"), sg.V().values("location"));
         if (sg.getStrategies().getStrategy(InlineFilterStrategy.class).isPresent())
@@ -397,7 +401,11 @@ public class SubgraphStrategyProcessTest extends AbstractGremlinProcessTest {
         sg = g.withStrategies(SubgraphStrategy.build().vertices(has("location")).vertexProperties(hasNot("endTime")).create());
         checkOrderedResults(Arrays.asList("aachen", "purcellville", "santa fe", "seattle"), sg.V().order().by("location", Order.incr).values("location"));
         //
-        sg = g.withStrategy(SubgraphStrategy.class.getCanonicalName(), "vertices", __.has("location"), "vertexProperties", __.hasNot("endTime"));
+        sg = g.withStrategies(new HashMap<String, Object>() {{
+            put(SubgraphStrategy.STRATEGY, SubgraphStrategy.class.getCanonicalName());
+            put(SubgraphStrategy.VERTICES, __.has("location"));
+            put(SubgraphStrategy.VERTEX_PROPERTIES, __.hasNot("endTime"));
+        }});
         checkResults(Arrays.asList("aachen", "purcellville", "santa fe", "seattle"), sg.V().valueMap("location").select(Column.values).unfold().unfold());
         checkResults(Arrays.asList("aachen", "purcellville", "santa fe", "seattle"), sg.V().propertyMap("location").select(Column.values).unfold().unfold().value());
         //

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
index 139384f..131a9c3 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
@@ -19,12 +19,14 @@
 package org.apache.tinkerpop.gremlin.tinkergraph.process;
 
 import org.apache.tinkerpop.gremlin.GraphProvider;
+import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.computer.GraphComputer;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider;
 import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer;
 
+import java.util.HashMap;
 import java.util.Random;
 
 /**
@@ -38,11 +40,12 @@ public class TinkerGraphComputerProvider extends TinkerGraphProvider {
     @Override
     public GraphTraversalSource traversal(final Graph graph) {
         return RANDOM.nextBoolean() ?
-                graph.traversal().withComputer(
-                        "workers", RANDOM.nextInt(Runtime.getRuntime().availableProcessors()) + 1,
-                        "graphComputer", RANDOM.nextBoolean() ?
-                                GraphComputer.class.getCanonicalName() :
-                                TinkerGraphComputer.class.getCanonicalName()) :
+                graph.traversal().withComputer(new HashMap<String, Object>() {{
+                    put(Computer.WORKERS, RANDOM.nextInt(Runtime.getRuntime().availableProcessors()) + 1);
+                    put(Computer.GRAPH_COMPUTER, RANDOM.nextBoolean() ?
+                            GraphComputer.class.getCanonicalName() :
+                            TinkerGraphComputer.class.getCanonicalName());
+                }}) :
                 graph.traversal(GraphTraversalSource.computer());
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/3e4075bd/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/decoration/HaltedTraverserStrategyTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/decoration/HaltedTraverserStrategyTest.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/decoration/HaltedTraverserStrategyTest.java
index fd3dfaa..c70a31e 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/decoration/HaltedTraverserStrategyTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/traversal/strategy/decoration/HaltedTraverserStrategyTest.java
@@ -38,6 +38,8 @@ import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 
+import java.util.HashMap;
+
 import static org.junit.Assert.assertEquals;
 
 /**
@@ -59,7 +61,10 @@ public class HaltedTraverserStrategyTest {
     @Test
     public void shouldReturnDetachedElements() {
         final Graph graph = TinkerFactory.createModern();
-        final GraphTraversalSource g = graph.traversal().withComputer().withStrategy(HaltedTraverserStrategy.class.getCanonicalName(), "haltedTraverserFactory", DetachedFactory.class.getCanonicalName());
+        final GraphTraversalSource g = graph.traversal().withComputer().withStrategies(new HashMap<String, Object>() {{
+            put(HaltedTraverserStrategy.STRATEGY, HaltedTraverserStrategy.class.getCanonicalName());
+            put(HaltedTraverserStrategy.HALTED_TRAVERSER_FACTORY, DetachedFactory.class.getCanonicalName());
+        }});
         g.V().out().forEachRemaining(vertex -> assertEquals(DetachedVertex.class, vertex.getClass()));
         g.V().out().properties("name").forEachRemaining(vertexProperty -> assertEquals(DetachedVertexProperty.class, vertexProperty.getClass()));
         g.V().out().values("name").forEachRemaining(value -> assertEquals(String.class, value.getClass()));


[08/14] tinkerpop git commit: so many bug fixes in the GLV/Translator world. So many more tests added. We are now testing translators against all the strategies (save Evenstrategy cause it requires Java objects). This is really becoming clean.

Posted by sp...@apache.org.
so many bug fixes in the GLV/Translator world. So many more tests added. We are now testing translators against all the strategies (save Evenstrategy cause it requires Java objects). This is really becoming clean.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/894ff3dc
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/894ff3dc
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/894ff3dc

Branch: refs/heads/TINKERPOP-1487
Commit: 894ff3dc0ccae16dae2fa314684aff7bbbcc139a
Parents: 3e4075b
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Thu Oct 6 10:07:15 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Thu Oct 6 10:07:15 2016 -0600

----------------------------------------------------------------------
 CHANGELOG.asciidoc                              | 11 +++-
 .../upgrade/release-3.2.x-incubating.asciidoc   | 63 +++++++++++++-----
 .../gremlin/jsr223/JavaTranslator.java          | 22 ++++++-
 .../gremlin/process/computer/Computer.java      | 22 ++++++-
 .../gremlin/process/traversal/Bindings.java     |  5 ++
 .../gremlin/process/traversal/Bytecode.java     | 69 +++++++++++++-------
 .../process/traversal/TraversalStrategy.java    | 12 ++++
 .../strategy/decoration/ElementIdStrategy.java  | 27 +++++---
 .../decoration/HaltedTraverserStrategy.java     | 12 ++++
 .../strategy/decoration/PartitionStrategy.java  | 18 ++++-
 .../strategy/decoration/SubgraphStrategy.java   | 27 ++++++--
 .../finalization/MatchAlgorithmStrategy.java    | 24 +++++++
 .../StandardVerificationStrategy.java           |  2 +-
 .../gremlin/jsr223/JavaTranslatorTest.java      | 68 +++++++++++++++++++
 .../gremlin/process/traversal/BytecodeTest.java | 42 ++++++++++++
 .../dsl/graph/GraphTraversalSourceTest.java     |  2 +-
 .../gremlin/groovy/jsr223/GroovyTranslator.java | 20 ++++--
 .../python/TraversalSourceGenerator.groovy      | 17 ++++-
 .../gremlin/python/jsr223/PythonTranslator.java | 19 ++++--
 .../jython/gremlin_python/process/traversal.py  | 17 ++++-
 .../gremlin_python/structure/io/graphson.py     |  5 +-
 .../TinkerGraphGroovyTranslatorProvider.java    |  3 +
 .../TinkerGraphJavaTranslatorProvider.java      |  3 +
 23 files changed, 429 insertions(+), 81 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/CHANGELOG.asciidoc
----------------------------------------------------------------------
diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc
index f25e095..7ec7d15 100644
--- a/CHANGELOG.asciidoc
+++ b/CHANGELOG.asciidoc
@@ -26,10 +26,15 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima
 TinkerPop 3.2.3 (Release Date: NOT OFFICIALLY RELEASED YET)
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
-* Fixed a `String` bug in `GroovyTranslator` and `PythonTranslator` where if the string has double-quotes, use """ """.
-* Fixed a `List` and `Map` bug in `JavaTranslator` where such collections were not being internally translated.
+* Fixed a `Set`, `List`, `Map` bug in the various `Translators` where such collections were not being internally translated.
+* Fixed a `Bytecode` bug where nested structures (map, list, set) were not being analyzed for bindings and bytecode conversions.
+* Fixed a `String` bug in `GroovyTranslator` and `PythonTranslator` where if the string has double-quotes it now uses """ """.
+* Added a default `TraversalStrategy.getConfiguration()` which returns the configuration needed to construct the strategy.
+* Gremlin-Java `TraversalStrategy` and `Computer` instances are now converted to `Map`-representations in `Bytecode`.
+* `Computer` instances can be created with `Computer.create(Configuration)` and accessed via `Computer.getConf()`.
+* Every `TraversalStrategy` can be created via a `Configuration` and a static `MyStrategy.create(Configuration)`.
 * Added `TraversalSource.withComputer(Map<String,Object>)` for better language variant support.
-* Added `TraversalSource.withStrategies(Map<String,Object>)`/`withoutStrategies(String...)` for better language variant support.
+* Added `TraversalSource.withStrategies(Map<String,Object>...)`/`withoutStrategies(String...)` for better language variant support.
 * Added `PartitionStrategy.Builder.readPartitions()` and deprecated `PartitionStrategy.Builder.addPartition()`.
 * `FilterRankStrategy` now propagates labels "right" over non-`Scoping` filters.
 * Fixed a bug in `ConnectiveP` where nested equivalent connectives should be inlined.

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 983c63e..5fbf4fe 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -163,7 +163,7 @@ Configurable Strategies
 
 `TraversalSource.withStrategies()` and `TraversalSource.withoutStrategies()` use Java objects. In order to make strategy
 manipulation possible from Gremlin language variants like Gremlin-Python, it is important to support non-JVM-based versions
-of these methods. As such, `TraversalSource.withStrategy(String,Object...)` and `TraversalSource.withoutStrategy(String)`
+of these methods. As such, `TraversalSource.withStrategies(Map<String,Object>...)` and `TraversalSource.withoutStrategies(String...)`
 were added.
 
 If the provider has non-configurable `TraversalStrategy` classes, those classes should expose a static `instance()`-method.
@@ -175,31 +175,60 @@ a `SubgraphStrategy`, it does the following:
 [source,python]
 ----
 g = Graph().traversal().withRemote(connection).
-        withStrategy('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy',
-            'vertices', __.hasLabel('person'),
-            'edges', __.has('weight',gt(0.5))
+        withStrategy({'strategy':'org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy',
+            'vertices': __.hasLabel('person'),
+            'edges': __.has('weight',gt(0.5))})
 ---
 
-`SubgraphStrategy.create(Configuration)`-method is defined as:
+The `SubgraphStrategy.create(Configuration)`-method is defined as:
 
 [source,java]
 ----
 public static SubgraphStrategy create(final Configuration configuration) {
     final Builder builder = SubgraphStrategy.build();
-    configuration.getKeys().forEachRemaining(key -> {
-        if (key.equals("vertices") || key.equals("vertexCriterion"))
-            builder.vertices((Traversal) configuration.getProperty(key));
-        else if (key.equals("edges") || key.equals("edgeCriterion"))
-            builder.edges((Traversal) configuration.getProperty(key));
-        else if (key.equals("vertexProperties"))
-            builder.vertexProperties((Traversal) configuration.getProperty(key));
-        else
-            throw new IllegalArgumentException("The following " + SubgraphStrategy.class.getSimpleName() + " configuration is unknown: " + key + ":" + configuration.getProperty(key));
-        });
-        return builder.create();
-    }
+    if (configuration.containsKey(VERTICES))
+        builder.vertices((Traversal) configuration.getProperty(VERTICES));
+    if (configuration.containsKey(EDGES))
+        builder.edges((Traversal) configuration.getProperty(EDGES));
+    if (configuration.containsKey(VERTEX_PROPERTIES))
+        builder.vertexProperties((Traversal) configuration.getProperty(VERTEX_PROPERTIES));
+    return builder.create();
+}
+----
+
+Finally, in order to make serialization possible from JVM-based Gremlin language variants, all strategies have a
+`TraverserStrategy.getConfiguration()` method which returns a `Configuration` that can be used to `create()` the
+`TraversalStrategy`.
+
+The `SubgraphStrategy.getConfiguration()`-method is defined as:
+
+[source,java]
+----
+@Override
+public Configuration getConfiguration() {
+    final Map<String, Object> map = new HashMap<>();
+    map.put(STRATEGY, SubgraphStrategy.class.getCanonicalName());
+    if (null != this.vertexCriterion)
+        map.put(VERTICES, this.vertexCriterion);
+    if (null != this.edgeCriterion)
+            map.put(EDGES, this.edgeCriterion);
+    if (null != this.vertexPropertyCriterion)
+        map.put(VERTEX_PROPERTIES, this.vertexPropertyCriterion);
+    return new MapConfiguration(map);
+}
 ----
 
+The default implementation of `TraversalStrategy.getConfiguration()` is defined as:
+
+[source,java]
+----
+public default Configuration getConfiguration() {
+    return new MapConfiguration(Collections.singletonMap(STRATEGY, this.getClass().getCanonicalName()));
+}
+----
+
+Thus, if the provider does not have any "builder"-based strategies, then no updates to their strategies are required.
+
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-1455[TINKERPOP-1455]
 
 Deprecated elementNotFound

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
index af245c5..d1e974d 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslator.java
@@ -23,6 +23,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.Translator;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
 import java.lang.reflect.Array;
@@ -31,8 +32,11 @@ import java.lang.reflect.Parameter;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.HashMap;
+import java.util.HashSet;
+import java.util.LinkedHashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 
 /**
@@ -40,6 +44,8 @@ import java.util.concurrent.ConcurrentHashMap;
  */
 public final class JavaTranslator<S extends TraversalSource, T extends Traversal.Admin<?, ?>> implements Translator.StepTranslator<S, T> {
 
+    private static final boolean IS_TESTING = Boolean.valueOf(System.getProperty("is.testing", "false"));
+
     private final S traversalSource;
     private final Class anonymousTraversal;
     private static final Map<Class<?>, Map<String, List<Method>>> GLOBAL_METHOD_CACHE = new ConcurrentHashMap<>();
@@ -64,6 +70,10 @@ public final class JavaTranslator<S extends TraversalSource, T extends Traversal
         TraversalSource dynamicSource = this.traversalSource;
         Traversal.Admin<?, ?> traversal = null;
         for (final Bytecode.Instruction instruction : bytecode.getSourceInstructions()) {
+            if (IS_TESTING &&
+                    instruction.getOperator().equals(TraversalSource.Symbols.withStrategies) &&
+                    ((Map) instruction.getArguments()[0]).get(TraversalStrategy.STRATEGY).toString().contains("TranslationStrategy"))
+                continue;
             dynamicSource = (TraversalSource) invokeMethod(dynamicSource, TraversalSource.class, instruction.getOperator(), instruction.getArguments());
         }
         boolean spawned = false;
@@ -91,7 +101,7 @@ public final class JavaTranslator<S extends TraversalSource, T extends Traversal
 
     private Object translateObject(final Object object) {
         if (object instanceof Bytecode.Binding)
-            return ((Bytecode.Binding) object).value();
+            return translateObject(((Bytecode.Binding) object).value());
         else if (object instanceof Bytecode) {
             try {
                 final Traversal.Admin<?, ?> traversal = (Traversal.Admin) this.anonymousTraversal.getMethod("start").invoke(null);
@@ -103,17 +113,23 @@ public final class JavaTranslator<S extends TraversalSource, T extends Traversal
                 throw new IllegalStateException(e.getMessage());
             }
         } else if (object instanceof Map) {
-            final Map<Object, Object> map = new HashMap<>(((Map) object).size());
+            final Map<Object, Object> map = new LinkedHashMap<>(((Map) object).size());
             for (final Map.Entry<?, ?> entry : ((Map<?, ?>) object).entrySet()) {
                 map.put(translateObject(entry.getKey()), translateObject(entry.getValue()));
             }
             return map;
         } else if (object instanceof List) {
-            final List<Object> list = new ArrayList<>();
+            final List<Object> list = new ArrayList<>(((List) object).size());
             for (final Object o : (List) object) {
                 list.add(translateObject(o));
             }
             return list;
+        } else if (object instanceof Set) {
+            final Set<Object> set = new HashSet<>(((Set) object).size());
+            for (final Object o : (Set) object) {
+                set.add(translateObject(o));
+            }
+            return set;
         } else
             return object;
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
index e06a62a..86e1a12 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/Computer.java
@@ -20,6 +20,7 @@
 package org.apache.tinkerpop.gremlin.process.computer;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.MapConfiguration;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.structure.Edge;
 import org.apache.tinkerpop.gremlin.structure.Graph;
@@ -65,7 +66,7 @@ public final class Computer implements Function<Graph, GraphComputer>, Serializa
             final Computer computer = new Computer();
             for (final String key : (List<String>) IteratorUtils.asList(configuration.getKeys())) {
                 if (key.equals(GRAPH_COMPUTER))
-                    computer.graphComputerClass = (Class) Class.forName(configuration.getString("graphComputer"));
+                    computer.graphComputerClass = (Class) Class.forName(configuration.getString(key));
                 else if (key.equals(WORKERS))
                     computer.workers = configuration.getInt(key);
                 else if (key.equals(PERSIST))
@@ -198,4 +199,23 @@ public final class Computer implements Function<Graph, GraphComputer>, Serializa
     public int getWorkers() {
         return this.workers;
     }
+
+    public Configuration getConf() {
+        final Map<String, Object> map = new HashMap<>();
+        if (-1 != this.workers)
+            map.put(WORKERS, this.workers);
+        if (null != this.persist)
+            map.put(PERSIST, this.persist.name());
+        if (null != this.resultGraph)
+            map.put(RESULT, this.resultGraph.name());
+        if (null != this.vertices)
+            map.put(RESULT, this.vertices);
+        if (null != this.edges)
+            map.put(EDGES, this.edges);
+        map.put(GRAPH_COMPUTER, this.graphComputerClass.getCanonicalName());
+        for (final Map.Entry<String, Object> entry : this.configuration.entrySet()) {
+            map.put(entry.getKey(), entry.getValue());
+        }
+        return new MapConfiguration(map);
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bindings.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bindings.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bindings.java
index ca830f1..ba31e21 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bindings.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bindings.java
@@ -55,4 +55,9 @@ public final class Bindings {
     protected void clear() {
         this.map.clear();
     }
+
+    @Override
+    public String toString() {
+        return this.map.toString();
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bytecode.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bytecode.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bytecode.java
index 9443064..f331d50 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bytecode.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Bytecode.java
@@ -19,6 +19,8 @@
 
 package org.apache.tinkerpop.gremlin.process.traversal;
 
+import org.apache.commons.configuration.ConfigurationConverter;
+import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 
@@ -44,6 +46,8 @@ import java.util.Map;
  */
 public final class Bytecode implements Cloneable, Serializable {
 
+    private static final Object[] EMPTY_ARRAY = new Object[]{};
+
     private List<Instruction> sourceInstructions = new ArrayList<>();
     private List<Instruction> stepInstructions = new ArrayList<>();
     private transient Bindings bindings = null;
@@ -111,21 +115,32 @@ public final class Bytecode implements Cloneable, Serializable {
     public Map<String, Object> getBindings() {
         final Map<String, Object> bindingsMap = new HashMap<>();
         for (final Instruction instruction : this.sourceInstructions) {
-            addInstructionBindings(bindingsMap, instruction);
+            for (final Object argument : instruction.getArguments()) {
+                addArgumentBinding(bindingsMap, argument);
+            }
         }
         for (final Instruction instruction : this.stepInstructions) {
-            addInstructionBindings(bindingsMap, instruction);
+            for (final Object argument : instruction.getArguments()) {
+                addArgumentBinding(bindingsMap, argument);
+            }
         }
         return bindingsMap;
     }
 
-    private static final void addInstructionBindings(final Map<String, Object> bindingsMap, final Instruction instruction) {
-        for (final Object argument : instruction.getArguments()) {
-            if (argument instanceof Binding)
-                bindingsMap.put(((Binding) argument).key, ((Binding) argument).value);
-            else if (argument instanceof Bytecode)
-                bindingsMap.putAll(((Bytecode) argument).getBindings());
-        }
+    private static final void addArgumentBinding(final Map<String, Object> bindingsMap, final Object argument) {
+        if (argument instanceof Binding)
+            bindingsMap.put(((Binding) argument).key, ((Binding) argument).value);
+        else if (argument instanceof Map) {
+            for (final Map.Entry<?, ?> entry : ((Map<?, ?>) argument).entrySet()) {
+                addArgumentBinding(bindingsMap, entry.getKey());
+                addArgumentBinding(bindingsMap, entry.getValue());
+            }
+        } else if (argument instanceof List) {
+            for (final Object item : (List) argument) {
+                addArgumentBinding(bindingsMap, item);
+            }
+        } else if (argument instanceof Bytecode)
+            bindingsMap.putAll(((Bytecode) argument).getBindings());
     }
 
     @Override
@@ -234,35 +249,45 @@ public final class Bytecode implements Cloneable, Serializable {
 
     private final Object[] flattenArguments(final Object... arguments) {
         if (arguments.length == 0)
-            return new Object[]{};
+            return EMPTY_ARRAY;
         final List<Object> flatArguments = new ArrayList<>();
         for (final Object object : arguments) {
             if (object instanceof Object[]) {
                 for (final Object nestObject : (Object[]) object) {
-                    flatArguments.add(convertArgument(nestObject));
+                    flatArguments.add(convertArgument(nestObject, true));
                 }
             } else
-                flatArguments.add(convertArgument(object));
+                flatArguments.add(convertArgument(object, true));
         }
         return flatArguments.toArray();
     }
 
-    private final Object convertArgument(final Object argument) {
+    private final Object convertArgument(final Object argument, final boolean searchBindings) {
+        if (searchBindings && null != this.bindings) {
+            final String variable = this.bindings.getBoundVariable(argument);
+            if (null != variable)
+                return new Binding<>(variable, convertArgument(argument, false));
+        }
+        //
         if (argument instanceof Traversal)
             return ((Traversal) argument).asAdmin().getBytecode();
+        else if (argument instanceof TraversalStrategy)
+            return convertArgument(ConfigurationConverter.getMap(((TraversalStrategy) argument).getConfiguration()), true);
+        else if (argument instanceof Computer)
+            return convertArgument(ConfigurationConverter.getMap(((Computer) argument).getConf()), true);
         else if (argument instanceof Map) {
             final Map<Object, Object> map = new LinkedHashMap<>(((Map) argument).size());
             for (final Map.Entry<?, ?> entry : ((Map<?, ?>) argument).entrySet()) {
-                map.put(convertArgument(entry.getKey()), convertArgument(entry.getValue()));
+                map.put(convertArgument(entry.getKey(), true), convertArgument(entry.getValue(), true));
             }
             return map;
-        }
-        if (null != this.bindings) {
-            final String variable = this.bindings.getBoundVariable(argument);
-            if (null != variable)
-                return new Binding<>(variable, argument);
-        }
-
-        return argument;
+        } else if (argument instanceof List) {
+            final List<Object> list = new ArrayList<>(((List) argument).size());
+            for (final Object item : (List) argument) {
+                list.add(convertArgument(item, true));
+            }
+            return list;
+        } else
+            return argument;
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategy.java
index a04f304..7943624 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/TraversalStrategy.java
@@ -18,6 +18,8 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal;
 
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.MapConfiguration;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.PartitionStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization.ProfileStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.optimization.RangeByIsCountStrategy;
@@ -76,6 +78,16 @@ public interface TraversalStrategy<S extends TraversalStrategy> extends Serializ
         return (Class) TraversalStrategy.class;
     }
 
+    /**
+     * Get the configuration representation of this strategy.
+     * This is useful for converting a strategy into a serialized form.
+     *
+     * @return the configuration used to create this strategy
+     */
+    public default Configuration getConfiguration() {
+        return new MapConfiguration(Collections.singletonMap(STRATEGY, this.getClass().getCanonicalName()));
+    }
+
     @Override
     public default int compareTo(final Class<? extends TraversalStrategy> otherTraversalCategory) {
         return 0;

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
index 396de49..32437e1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/ElementIdStrategy.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.MapConfiguration;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
@@ -40,6 +41,8 @@ import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
 import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
 import java.util.UUID;
 import java.util.function.Supplier;
 
@@ -152,16 +155,24 @@ public final class ElementIdStrategy extends AbstractTraversalStrategy<Traversal
         }
     }
 
+    public static final String ID_PROPERTY_KEY = "idPropertyKey";
+    public static final String ID_MAKER = "idMaker";
+
     public static ElementIdStrategy create(final Configuration configuration) {
         final ElementIdStrategy.Builder builder = ElementIdStrategy.build();
-        configuration.getKeys().forEachRemaining(key -> {
-            if (key.equals("idPropertyKey"))
-                builder.idPropertyKey((String) configuration.getProperty(key));
-            else if (key.equals("idMaker"))
-                builder.idMaker((Supplier) configuration.getProperty(key));
-            else
-                throw new IllegalArgumentException("The following " + ElementIdStrategy.class.getSimpleName() + " configuration is unknown: " + key + ":" + configuration.getProperty(key));
-        });
+        if (configuration.containsKey(ID_MAKER))
+            builder.idMaker((Supplier) configuration.getProperty(ID_MAKER));
+        if (configuration.containsKey(ID_PROPERTY_KEY))
+            builder.idPropertyKey(configuration.getString(ID_PROPERTY_KEY));
         return builder.create();
     }
+
+    @Override
+    public Configuration getConfiguration() {
+        final Map<String, Object> map = new HashMap<>();
+        map.put(STRATEGY, ElementIdStrategy.class.getCanonicalName());
+        map.put(ID_PROPERTY_KEY, this.idPropertyKey);
+        map.put(ID_MAKER, this.idMaker);
+        return new MapConfiguration(map);
+    }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
index ee1f017..3f02c40 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/HaltedTraverserStrategy.java
@@ -20,6 +20,7 @@
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.MapConfiguration;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
@@ -27,6 +28,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversal
 import org.apache.tinkerpop.gremlin.structure.util.detached.DetachedFactory;
 import org.apache.tinkerpop.gremlin.structure.util.reference.ReferenceFactory;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
@@ -69,6 +73,14 @@ public final class HaltedTraverserStrategy extends AbstractTraversalStrategy<Tra
         }
     }
 
+    @Override
+    public Configuration getConfiguration() {
+        final Map<String, Object> map = new HashMap<>();
+        map.put(STRATEGY, HaltedTraverserStrategy.class.getCanonicalName());
+        map.put(HALTED_TRAVERSER_FACTORY, this.haltedTraverserFactory.getCanonicalName());
+        return new MapConfiguration(map);
+    }
+
     ////////////
 
     public static HaltedTraverserStrategy detached() {

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
index 2ee4bf3..438d8b2 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/PartitionStrategy.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.MapConfiguration;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Parameterizing;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
@@ -55,6 +56,7 @@ import org.apache.tinkerpop.gremlin.structure.util.ElementHelper;
 import java.io.Serializable;
 import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -324,6 +326,20 @@ public final class PartitionStrategy extends AbstractTraversalStrategy<Traversal
         }
     }
 
+    @Override
+    public Configuration getConfiguration() {
+        final Map<String, Object> map = new HashMap<>();
+        map.put(STRATEGY, PartitionStrategy.class.getCanonicalName());
+        map.put(INCLUDE_META_PROPERTIES, this.includeMetaProperties);
+        if (null != this.writePartition)
+            map.put(WRITE_PARTITION, this.writePartition);
+        if (null != this.readPartitions)
+            map.put(READ_PARTITIONS, this.readPartitions);
+        if (null != this.partitionKey)
+            map.put(PARTITION_KEY, this.partitionKey);
+        return new MapConfiguration(map);
+    }
+
     public static final String INCLUDE_META_PROPERTIES = "includeMetaProperties";
     public static final String WRITE_PARTITION = "writePartition";
     public static final String PARTITION_KEY = "partitionKey";
@@ -338,7 +354,7 @@ public final class PartitionStrategy extends AbstractTraversalStrategy<Traversal
         if (configuration.containsKey(PARTITION_KEY))
             builder.partitionKey(configuration.getString(PARTITION_KEY));
         if (configuration.containsKey(READ_PARTITIONS))
-            builder.readPartitions((List) configuration.getList(READ_PARTITIONS));
+            builder.readPartitions(new ArrayList((Collection)configuration.getProperty(READ_PARTITIONS)));
         return builder.create();
     }
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
index d7269aa..e612bee 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/decoration/SubgraphStrategy.java
@@ -19,6 +19,7 @@
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration;
 
 import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.MapConfiguration;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -54,9 +55,10 @@ import org.apache.tinkerpop.gremlin.structure.VertexProperty;
 
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.HashMap;
 import java.util.List;
+import java.util.Map;
 import java.util.Set;
-import java.util.UUID;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -78,15 +80,15 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy<TraversalS
 
     private static final Set<Class<? extends DecorationStrategy>> POSTS = Collections.singleton(ConnectiveStrategy.class);
 
-    private final String MARKER = Graph.Hidden.hide(UUID.randomUUID().toString());
+    private final String MARKER = Graph.Hidden.hide("gremlin.subgraphStrategy");
 
     private SubgraphStrategy(final Traversal<Vertex, ?> vertexCriterion, final Traversal<Edge, ?> edgeCriterion, final Traversal<VertexProperty, ?> vertexPropertyCriterion) {
 
-        this.vertexCriterion = null == vertexCriterion ? null : vertexCriterion.asAdmin();
+        this.vertexCriterion = null == vertexCriterion ? null : vertexCriterion.asAdmin().clone();
 
         // if there is no vertex predicate there is no need to test either side of the edge
         if (null == this.vertexCriterion) {
-            this.edgeCriterion = null == edgeCriterion ? null : edgeCriterion.asAdmin();
+            this.edgeCriterion = null == edgeCriterion ? null : edgeCriterion.asAdmin().clone();
         } else {
             final Traversal.Admin<Edge, ?> vertexPredicate;
             vertexPredicate = __.<Edge>and(
@@ -97,10 +99,10 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy<TraversalS
             // edge predicate provided by the user.
             this.edgeCriterion = null == edgeCriterion ?
                     vertexPredicate :
-                    edgeCriterion.asAdmin().addStep(new TraversalFilterStep<>(edgeCriterion.asAdmin(), vertexPredicate));
+                    edgeCriterion.asAdmin().clone().addStep(new TraversalFilterStep<>(edgeCriterion.asAdmin(), vertexPredicate));
         }
 
-        this.vertexPropertyCriterion = null == vertexPropertyCriterion ? null : vertexPropertyCriterion.asAdmin();
+        this.vertexPropertyCriterion = null == vertexPropertyCriterion ? null : vertexPropertyCriterion.asAdmin().clone();
 
         if (null != this.vertexCriterion)
             this.addLabelMarker(this.vertexCriterion);
@@ -275,6 +277,19 @@ public final class SubgraphStrategy extends AbstractTraversalStrategy<TraversalS
     }
 
     @Override
+    public Configuration getConfiguration() {
+        final Map<String, Object> map = new HashMap<>();
+        map.put(STRATEGY, SubgraphStrategy.class.getCanonicalName());
+        if (null != this.vertexCriterion)
+            map.put(VERTICES, this.vertexCriterion);
+        if (null != this.edgeCriterion)
+            map.put(EDGES, this.edgeCriterion);
+        if (null != this.vertexPropertyCriterion)
+            map.put(VERTEX_PROPERTIES, this.vertexPropertyCriterion);
+        return new MapConfiguration(map);
+    }
+
+    @Override
     public Set<Class<? extends DecorationStrategy>> applyPost() {
         return POSTS;
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/MatchAlgorithmStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/MatchAlgorithmStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/MatchAlgorithmStrategy.java
index be31575..7b78295 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/MatchAlgorithmStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/finalization/MatchAlgorithmStrategy.java
@@ -18,6 +18,8 @@
  */
 package org.apache.tinkerpop.gremlin.process.traversal.strategy.finalization;
 
+import org.apache.commons.configuration.Configuration;
+import org.apache.commons.configuration.MapConfiguration;
 import org.apache.tinkerpop.gremlin.process.traversal.Step;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
@@ -25,11 +27,15 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.MatchStep;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.AbstractTraversalStrategy;
 import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 
+import java.util.HashMap;
+import java.util.Map;
+
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
 public final class MatchAlgorithmStrategy extends AbstractTraversalStrategy<TraversalStrategy.FinalizationStrategy> implements TraversalStrategy.FinalizationStrategy {
 
+    private static final String MATCH_ALGORITHM = "matchAlgorithm";
     private final Class<? extends MatchStep.MatchAlgorithm> matchAlgorithmClass;
 
     private MatchAlgorithmStrategy(final Class<? extends MatchStep.MatchAlgorithm> matchAlgorithmClass) {
@@ -45,6 +51,24 @@ public final class MatchAlgorithmStrategy extends AbstractTraversalStrategy<Trav
         }
     }
 
+    public static MatchAlgorithmStrategy create(final Configuration configuration) {
+        try {
+            return new MatchAlgorithmStrategy((Class) Class.forName(configuration.getString(MATCH_ALGORITHM)));
+        } catch (final ClassNotFoundException e) {
+            throw new IllegalArgumentException(e.getMessage(), e);
+        }
+    }
+
+    @Override
+    public Configuration getConfiguration() {
+        final Map<String, Object> map = new HashMap<>();
+        map.put(STRATEGY, MatchAlgorithmStrategy.class.getCanonicalName());
+        map.put(MATCH_ALGORITHM, null != this.matchAlgorithmClass.getDeclaringClass() ?
+                this.matchAlgorithmClass.getCanonicalName().replace("." + this.matchAlgorithmClass.getSimpleName(), "$" + this.matchAlgorithmClass.getSimpleName()) :
+                this.matchAlgorithmClass.getCanonicalName());
+        return new MapConfiguration(map);
+    }
+
     public static Builder build() {
         return new Builder();
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
index 9f7f516..f72de50 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/strategy/verification/StandardVerificationStrategy.java
@@ -53,7 +53,7 @@ public final class StandardVerificationStrategy extends AbstractTraversalStrateg
         }
 
         for (final Step<?, ?> step : traversal.getSteps()) {
-            for (String label : new ArrayList<>(step.getLabels())) {
+            for (String label : step.getLabels()) {
                 if (Graph.Hidden.isHidden(label))
                     step.removeLabel(label);
             }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslatorTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslatorTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslatorTest.java
new file mode 100644
index 0000000..ac8a645
--- /dev/null
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/jsr223/JavaTranslatorTest.java
@@ -0,0 +1,68 @@
+/*
+ *  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.jsr223;
+
+import org.apache.tinkerpop.gremlin.process.traversal.Bindings;
+import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
+import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.process.traversal.step.filter.TraversalFilterStep;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper;
+import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
+import org.junit.Test;
+
+import java.util.HashMap;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public class JavaTranslatorTest {
+
+    @Test
+    public void shouldTranslateNestedBindings() {
+        final Bindings b = new Bindings();
+        final GraphTraversalSource g = EmptyGraph.instance().traversal().withBindings(b);
+
+        final Bytecode bytecode = g.withStrategies(new HashMap<String, Object>() {{
+            put(SubgraphStrategy.STRATEGY, SubgraphStrategy.class.getCanonicalName());
+            put(SubgraphStrategy.VERTICES, b.of("a", __.has("name", "marko")));
+        }}).V().out(b.of("b", "created")).asAdmin().getBytecode();
+
+        Traversal.Admin<?, ?> traversal = JavaTranslator.of(EmptyGraph.instance().traversal()).translate(bytecode);
+        assertFalse(traversal.isLocked());
+        assertEquals(2, traversal.getSteps().size());
+        // assertEquals(traversal.getBytecode(),bytecode); TODO: bindings are removed -- should translated bytecode be the same bytecode?!
+        traversal.applyStrategies();
+        assertEquals(5, TraversalHelper.getStepsOfAssignableClassRecursively(TraversalFilterStep.class, traversal).size());
+
+        // JavaTranslator should not mutate original bytecode
+        assertTrue(bytecode.getBindings().containsKey("a"));
+        assertTrue(bytecode.getBindings().containsKey("b"));
+        assertEquals(2, bytecode.getBindings().size());
+        assertEquals(__.has("name", "marko").asAdmin().getBytecode(), bytecode.getBindings().get("a"));
+        assertEquals("created", bytecode.getBindings().get("b"));
+    }
+}

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/BytecodeTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/BytecodeTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/BytecodeTest.java
index 0b9c65a..6093dae 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/BytecodeTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/BytecodeTest.java
@@ -19,15 +19,24 @@
 
 package org.apache.tinkerpop.gremlin.process.traversal;
 
+import org.apache.commons.configuration.ConfigurationConverter;
+import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.verification.ReadOnlyStrategy;
 import org.apache.tinkerpop.gremlin.structure.Column;
 import org.apache.tinkerpop.gremlin.structure.util.empty.EmptyGraph;
 import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils;
 import org.junit.Test;
 
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertNotEquals;
+import static org.junit.Assert.assertTrue;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -92,6 +101,39 @@ public class BytecodeTest {
 
         assertEquals(1, bytecode1.getBindings().size());
         assertEquals("created", bytecode1.getBindings().get("a"));
+    }
+
+    @Test
+    public void shouldSupportNestedBindings() {
+        final Bindings b = new Bindings();
+        final GraphTraversalSource g = EmptyGraph.instance().traversal().withBindings(b);
 
+        final Bytecode bytecode = g.withStrategies(new HashMap<String, Object>() {{
+            put(SubgraphStrategy.STRATEGY, SubgraphStrategy.class.getCanonicalName());
+            put(SubgraphStrategy.VERTICES, b.of("a", __.has("name", "marko")));
+        }}).V().out(b.of("b", "created")).asAdmin().getBytecode();
+
+        assertTrue(bytecode.getBindings().containsKey("a"));
+        assertTrue(bytecode.getBindings().containsKey("b"));
+        assertEquals(2, bytecode.getBindings().size());
+        assertEquals(__.has("name", "marko").asAdmin().getBytecode(), bytecode.getBindings().get("a"));
+        assertEquals("created", bytecode.getBindings().get("b"));
+    }
+
+    @Test
+    public void shouldConvertStrategies() {
+        final GraphTraversalSource g = EmptyGraph.instance().traversal();
+        Bytecode bytecode = g.withStrategies(ReadOnlyStrategy.instance()).getBytecode();
+        assertEquals(Collections.singletonMap(ReadOnlyStrategy.STRATEGY, ReadOnlyStrategy.class.getCanonicalName()), bytecode.getSourceInstructions().iterator().next().getArguments()[0]);
+        bytecode = g.withStrategies(SubgraphStrategy.build().edges(__.hasLabel("knows")).create()).getBytecode();
+        assertEquals(SubgraphStrategy.build().edges(__.hasLabel("knows")).create().getEdgeCriterion().asAdmin().getBytecode(),
+                ((Map) bytecode.getSourceInstructions().iterator().next().getArguments()[0]).get(SubgraphStrategy.EDGES));
+    }
+
+    @Test
+    public void shouldConvertComputer() {
+        final GraphTraversalSource g = EmptyGraph.instance().traversal();
+        Bytecode bytecode = g.withComputer(Computer.compute().workers(10)).getBytecode();
+        assertEquals(ConfigurationConverter.getMap(Computer.compute().workers(10).getConf()), bytecode.getSourceInstructions().iterator().next().getArguments()[0]);
     }
 }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
index 6efa4b5..457747d 100644
--- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
+++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalSourceTest.java
@@ -59,7 +59,7 @@ public class GraphTraversalSourceTest {
     }
 
     @Test
-    public void shouldSupportStringBasedStrategies() throws Exception {
+    public void shouldSupportMapBasedStrategies() throws Exception {
         GraphTraversalSource g = EmptyGraph.instance().traversal();
         assertFalse(g.getStrategies().getStrategy(SubgraphStrategy.class).isPresent());
         g = g.withStrategies(new HashMap<String, Object>() {{

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
index 59a07b3..154c4a1 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
@@ -24,8 +24,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
 import org.apache.tinkerpop.gremlin.process.traversal.Translator;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
 import org.apache.tinkerpop.gremlin.process.traversal.util.OrP;
 import org.apache.tinkerpop.gremlin.structure.Element;
@@ -34,8 +34,10 @@ import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
 import org.apache.tinkerpop.gremlin.util.function.Lambda;
 
 import java.util.ArrayList;
+import java.util.HashSet;
 import java.util.List;
 import java.util.Map;
+import java.util.Set;
 
 /**
  * @author Marko A. Rodriguez (http://markorodriguez.com)
@@ -82,7 +84,9 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
         final StringBuilder traversalScript = new StringBuilder(start);
         for (final Bytecode.Instruction instruction : bytecode.getInstructions()) {
             final String methodName = instruction.getOperator();
-            if (IS_TESTING && methodName.equals(TraversalSource.Symbols.withStrategies))
+            if (IS_TESTING &&
+                    instruction.getOperator().equals(TraversalSource.Symbols.withStrategies) &&
+                    ((Map) instruction.getArguments()[0]).get(TraversalStrategy.STRATEGY).toString().contains("TranslationStrategy"))
                 continue;
             if (0 == instruction.getArguments().length)
                 traversalScript.append(".").append(methodName).append("()");
@@ -103,7 +107,13 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
             return ((Bytecode.Binding) object).variable();
         else if (object instanceof String)
             return ((String) object).contains("\"") ? "\"\"\"" + object + "\"\"\"" : "\"" + object + "\"";
-        else if (object instanceof List) {
+        else if (object instanceof Set) {
+            final Set<String> set = new HashSet<>(((Set) object).size());
+            for (final Object item : (Set) object) {
+                set.add(convertToString(item));
+            }
+            return set.toString() + " as Set";
+        } else if (object instanceof List) {
             final List<String> list = new ArrayList<>(((List) object).size());
             for (final Object item : (List) object) {
                 list.add(convertToString(item));
@@ -139,15 +149,11 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
             return ((Enum) object).getDeclaringClass().getSimpleName() + "." + object.toString();
         else if (object instanceof Element)
             return convertToString(((Element) object).id()); // hack
-        else if (object instanceof Computer)
-            return "";
         else if (object instanceof Lambda) {
             final String lambdaString = ((Lambda) object).getLambdaScript().trim();
             return lambdaString.startsWith("{") ? lambdaString : "{" + lambdaString + "}";
         } else if (object instanceof Bytecode)
             return this.internalTranslate("__", (Bytecode) object);
-        else if (object instanceof Traversal)
-            return this.internalTranslate("__", ((Traversal) object).asAdmin().getBytecode());
         else
             return null == object ? "null" : object.toString();
     }

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/TraversalSourceGenerator.groovy
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/TraversalSourceGenerator.groovy b/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/TraversalSourceGenerator.groovy
index e12c2cd..fe62685 100644
--- a/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/TraversalSourceGenerator.groovy
+++ b/gremlin-python/src/main/groovy/org/apache/tinkerpop/gremlin/python/TraversalSourceGenerator.groovy
@@ -254,9 +254,24 @@ class Bytecode(object):
         if isinstance(arg, Traversal):
             self.bindings.update(arg.bytecode.bindings)
             return arg.bytecode
+        elif isinstance(arg, dict):
+            newDict = {}
+            for key in arg:
+                newDict[self.__convertArgument(key)] = self.__convertArgument(arg[key])
+            return newDict
+        elif isinstance(arg, list):
+            newList = []
+            for item in arg:
+                newList.append(self.__convertArgument(item))
+            return newList
+        elif isinstance(arg, set):
+            newSet = set()
+            for item in arg:
+                newSet.add(self.__convertArgument(item))
+            return newSet
         elif isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
             self.bindings[arg[0]] = arg[1]
-            return Binding(arg[0],arg[1])
+            return Binding(arg[0],self.__convertArgument(arg[1]))
         else:
             return arg
     def __repr__(self):

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
index 65042ab..4bfdc45 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
@@ -19,7 +19,6 @@
 
 package org.apache.tinkerpop.gremlin.python.jsr223;
 
-import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.Operator;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
@@ -27,6 +26,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
 import org.apache.tinkerpop.gremlin.process.traversal.Translator;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource;
+import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
 import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP;
 import org.apache.tinkerpop.gremlin.process.traversal.util.OrP;
@@ -42,6 +42,7 @@ import java.lang.reflect.Method;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.HashSet;
+import java.util.LinkedHashSet;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -103,7 +104,9 @@ public class PythonTranslator implements Translator.ScriptTranslator {
         for (final Bytecode.Instruction instruction : bytecode.getInstructions()) {
             final String methodName = instruction.getOperator();
             final Object[] arguments = instruction.getArguments();
-            if (IS_TESTING && methodName.equals(TraversalSource.Symbols.withStrategies) && !(instruction.getArguments()[0] instanceof Map))
+            if (IS_TESTING &&
+                    instruction.getOperator().equals(TraversalSource.Symbols.withStrategies) &&
+                    ((Map) instruction.getArguments()[0]).get(TraversalStrategy.STRATEGY).toString().contains("TranslationStrategy"))
                 continue;
             else if (0 == arguments.length)
                 traversalScript.append(".").append(SymbolHelper.toPython(methodName)).append("()");
@@ -135,7 +138,13 @@ public class PythonTranslator implements Translator.ScriptTranslator {
             return ((Bytecode.Binding) object).variable();
         else if (object instanceof String)
             return ((String) object).contains("\"") ? "\"\"\"" + object + "\"\"\"" : "\"" + object + "\"";
-        else if (object instanceof List) {
+        else if (object instanceof Set) {
+            final Set<String> set = new LinkedHashSet<>(((Set) object).size());
+            for (final Object item : (Set) object) {
+                set.add(convertToString(item));
+            }
+            return "set(" + set.toString() + ")";
+        } else if (object instanceof List) {
             final List<String> list = new ArrayList<>(((List) object).size());
             for (final Object item : (List) object) {
                 list.add(convertToString(item));
@@ -168,10 +177,6 @@ public class PythonTranslator implements Translator.ScriptTranslator {
             return convertToString(((Element) object).id()); // hack
         else if (object instanceof Bytecode)
             return this.internalTranslate("__", (Bytecode) object);
-        else if (object instanceof Traversal)
-            return this.internalTranslate("__", ((Traversal.Admin) object).asAdmin().getBytecode());
-        else if (object instanceof Computer)
-            return "";
         else if (object instanceof Lambda)
             return convertLambdaToString((Lambda) object);
         else

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/process/traversal.py b/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
index 4c2f3b9..aa36869 100644
--- a/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
+++ b/gremlin-python/src/main/jython/gremlin_python/process/traversal.py
@@ -313,9 +313,24 @@ class Bytecode(object):
         if isinstance(arg, Traversal):
             self.bindings.update(arg.bytecode.bindings)
             return arg.bytecode
+        elif isinstance(arg, dict):
+            newDict = {}
+            for key in arg:
+                newDict[self.__convertArgument(key)] = self.__convertArgument(arg[key])
+            return newDict
+        elif isinstance(arg, list):
+            newList = []
+            for item in arg:
+                newList.append(self.__convertArgument(item))
+            return newList
+        elif isinstance(arg, set):
+            newSet = set()
+            for item in arg:
+                newSet.add(self.__convertArgument(item))
+            return newSet
         elif isinstance(arg, tuple) and 2 == len(arg) and isinstance(arg[0], str):
             self.bindings[arg[0]] = arg[1]
-            return Binding(arg[0],arg[1])
+            return Binding(arg[0],self.__convertArgument(arg[1]))
         else:
             return arg
     def __repr__(self):

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py
index a032032..7899925 100644
--- a/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py
+++ b/gremlin-python/src/main/jython/gremlin_python/structure/io/graphson.py
@@ -47,7 +47,7 @@ class GraphSONWriter(object):
             if isinstance(object, key):
                 return serializers[key]._dictify(object)
         # list and map are treated as normal json objects (could be isolated serializers)
-        if isinstance(object, list):
+        if isinstance(object, list) or isinstance(object, set):
             newList = []
             for item in object:
                 newList.append(GraphSONWriter._dictify(item))
@@ -181,7 +181,8 @@ class NumberSerializer(GraphSONSerializer):
     def _dictify(self, number):
         if isinstance(number, bool):  # python thinks that 0/1 integers are booleans
             return number
-        elif isinstance(number, long) or (abs(number) > 2147483647): # in python all numbers are int unless specified otherwise
+        elif isinstance(number, long) or (
+                    abs(number) > 2147483647):  # in python all numbers are int unless specified otherwise
             return _SymbolHelper.objectify("Int64", number)
         elif isinstance(number, int):
             return _SymbolHelper.objectify("Int32", number)

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProvider.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProvider.java
index 7591bf0..c086c3a 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProvider.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/groovy/jsr223/TinkerGraphGroovyTranslatorProvider.java
@@ -27,6 +27,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionTest;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategy;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider;
@@ -52,6 +54,7 @@ public class TinkerGraphGroovyTranslatorProvider extends TinkerGraphProvider {
             ProgramTest.Traversals.class.getCanonicalName(),
             TraversalInterruptionTest.class.getCanonicalName(),
             TraversalInterruptionComputerTest.class.getCanonicalName(),
+            EventStrategyProcessTest.class.getCanonicalName(),
             ElementIdStrategyProcessTest.class.getCanonicalName()));
 
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/894ff3dc/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProvider.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProvider.java
index 1e6645b..f40a8c7 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProvider.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/jsr223/TinkerGraphJavaTranslatorProvider.java
@@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSo
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.ProgramTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.ElementIdStrategyProcessTest;
+import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.EventStrategyProcessTest;
 import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategy;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider;
@@ -48,6 +49,8 @@ public class TinkerGraphJavaTranslatorProvider extends TinkerGraphProvider {
             TraversalInterruptionComputerTest.class.getCanonicalName(),
             "shouldNeverPropagateANoBulkTraverser",
             "shouldNeverPropagateANullValuedTraverser",
+            ElementIdStrategyProcessTest.class.getCanonicalName(),
+            EventStrategyProcessTest.class.getCanonicalName(),
             ProgramTest.Traversals.class.getCanonicalName()));
 
 


[11/14] tinkerpop git commit: Add IO Reference docs

Posted by sp...@apache.org.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/docs/src/dev/io/gryo.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/io/gryo.asciidoc b/docs/src/dev/io/gryo.asciidoc
new file mode 100644
index 0000000..61afdb0
--- /dev/null
+++ b/docs/src/dev/io/gryo.asciidoc
@@ -0,0 +1,63 @@
+////
+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.
+////
+[[gryo]]
+Gryo
+====
+
+image:gremlin-kryo.png[width=400,float=left] Gryo uses the popular link:https://github.com/EsotericSoftware/kryo[Kryo]
+library to handle binary serialization for the JVM. There currently aren't any Kryo implementations in other languages
+so the binding of this format to the JVM is a bit of a limitation, but if building a system on the JVM the use of
+Gryo over other serialization format should yield smaller data sizes than other formats like GraphSON or GraphML,
+improved serialization speed, as well as better support for the various Java data types that might not be supported
+otherwise.
+
+Gryo is useful both as a "graph" serialization format and as a generalized serialization format that can read or
+write any object. This characteristic makes it ideal for use in Gremlin Server, which is designed to return arbitrary
+results of varying types.
+
+It is unlikely that Gryo users will try to consume or produce Gryo without using TinkerPop and Kryo classes to help do
+it. Attempting to read or write a byte stream of Gryo without those tools would be challenging, so the depths of
+what the Gryo format looks like in a byte-by-byte perspective will not be discussed here. It is enough to know that
+TinkerPop has Kryo-based serializers for certain classes that it supports and that the bytes written or read must be
+Kryo compliant.
+
+While there is only one version of Gryo at the moment, 1.0, the format has generally expanded as new releases of
+TinkerPop have been produced. "Expansion" has generally meant that new types have come to be supported over time. The
+addition of new types means that while Gryo has remained at 1.0, older releases that produced Gryo files will not
+be compatible with newer TinkerPop releases if the newer types are utilized. On the flip side, newer release of
+TinkerPop are fully backward compatible with Gryo produced on older versions of TinkerPop.
+
+The full list of Gryo 1.0 types can be found in the `GryoMapper` source code. Looking at the source code for a specific
+release tag would show what types were compatible for a specific release. For example, the type listing for 3.2.2
+can be found link:https://github.com/apache/tinkerpop/blob/3.2.2/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoMapper.java#L249[here].
+
+One of the key aspects of Gryo is that, by default, it requires that all types expected to be used to be registered
+with the `GryoMapper`. There are two ways to do that:
+
+* On the `GryoMapper.Builder`, use the `addCustom` methods. These methods allow registration of single classes with
+an optional custom serializer.
+* Add a custom `IoRegistry` implementation with the `addRegistry` method on `GryoMapper.Builder`. The `IoRegistry`
+contains registrations that will be supplied to the `GryoMapper`. There is additional documentation on how this works
+in the link:http://tinkerpop.apache.org/docs/current/dev/provider/#io-implementations[provider documentation].
+
+When using `addCustom` or `addRegistry`, it is important to remember that the order in which those methods are called
+is important. The registrations get numeric "registration ids" and their order must match if the the Gryo is expected
+to be compatible. Calls to `addCustom` will be applied first, prior to calls to `addRegistry` (which internally call
+`addCustom`).
+
+It is possible to disable registration by setting `registrationRequired` on the `GryoMapper.Builder` to `false`, but
+Gryo is less efficient with this feature is turned off.
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/docs/src/dev/io/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/io/index.asciidoc b/docs/src/dev/io/index.asciidoc
new file mode 100644
index 0000000..9eaf02a
--- /dev/null
+++ b/docs/src/dev/io/index.asciidoc
@@ -0,0 +1,37 @@
+////
+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.
+////
+image::apache-tinkerpop-logo.png[width=500,link="http://tinkerpop.apache.org"]
+
+*x.y.z*
+
+:toc-position: left
+
+IO Reference
+============
+
+image:gremlin-io2.png[width=300]
+
+IO features, capabilities and use cases are initially discussed in the TinkerPop
+link:http://tinkerpop.apache.org/docs/x.y.z/reference/#_gremlin_i_o[Reference Documentation]. This document focuses
+more on the details of the implementations for both production and consumption of the various formats. It contains
+samples of the various formats and development details that provide deeper insight for their usage.
+
+include::graphml.asciidoc[]
+
+include::graphson.asciidoc[]
+
+include::gryo.asciidoc[]
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/docs/src/dev/provider/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/dev/provider/index.asciidoc b/docs/src/dev/provider/index.asciidoc
index bb41241..af1be4f 100644
--- a/docs/src/dev/provider/index.asciidoc
+++ b/docs/src/dev/provider/index.asciidoc
@@ -785,6 +785,9 @@ Gremlin Server will send:
 |599 |SERVER SERIALIZATION ERROR |The server was not capable of serializing an object that was returned from the script supplied on the request. Either transform the object into something Gremlin Server can process within the script or install mapper serialization classes to Gremlin Server.
 |=========================================================
 
+NOTE: Please refer to the link:http://tinkerpop.apache.org/docs/current/dev/io[IO Reference Documentation] for more
+examples of `RequestMessage` and `ResponseMessage` instances.
+
 OpProcessors Arguments
 ~~~~~~~~~~~~~~~~~~~~~~
 
@@ -827,6 +830,7 @@ evaluated and is committed when the script completes (or rolled back if an error
 |=========================================================
 |Key |Type |Description
 |sasl |byte[] | *Required* The response to the server authentication challenge.  This value is dependent on the SASL authentication mechanism required by the server.
+|saslMechanism |String | The SASL mechanism: `PLAIN` or `GSSAPI`. Note that it is up to the server implementation to use or disregard this setting (default implementation in Gremlin Server ignores it).
 |=========================================================
 
 '`eval` operation arguments'

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/docs/src/index.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/index.asciidoc b/docs/src/index.asciidoc
index 51d2105..09ffc2f 100644
--- a/docs/src/index.asciidoc
+++ b/docs/src/index.asciidoc
@@ -88,4 +88,6 @@ Developer
 Provides information on ways to contribute to TinkerPop as well as details on building the project and other specific information for contributors.
 |image:tinkerpop-enabled.png[width=200] |link:http://tinkerpop.apache.org/docs/x.y.z/dev/provider/[Providers] +
 Documentation for providers who implement the TinkerPop interfaces, develop plugins or drivers, or provide other third-party libraries for TinkerPop.
+|image:gremlin-io2.png[width=200] |link:http://tinkerpop.apache.org/docs/x.y.z/dev/io/[IO Reference] +
+Reference Documentation for providers and users of the various IO formats that TinkerPop has: GraphML, GraphSON and Gryo.
 |=========================================================
\ No newline at end of file

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/docs/src/upgrade/release-3.2.x-incubating.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/upgrade/release-3.2.x-incubating.asciidoc b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
index 5fbf4fe..c21f1a5 100644
--- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc
+++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc
@@ -152,6 +152,15 @@ there is no need to do that manually.
 
 See: link:https://issues.apache.org/jira/browse/TINKERPOP-790[TINKERPOP-790]
 
+IO Reference Documentation
+^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+There is new reference documentation for the various IO formats. The documentation provides more details and samples
+that should be helpful to users and providers who intend to work directly with the TinkerPop supported serialization
+formats: GraphML, GraphSON and Gryo.
+
+See: link:http://tinkerpop.apache.org/docs/3.2.3/dev/io/[IO Reference Documentation]
+
 Upgrading for Providers
 ~~~~~~~~~~~~~~~~~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/docs/static/images/gremlin-io2.png
----------------------------------------------------------------------
diff --git a/docs/static/images/gremlin-io2.png b/docs/static/images/gremlin-io2.png
new file mode 100755
index 0000000..99b8a30
Binary files /dev/null and b/docs/static/images/gremlin-io2.png differ

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
index 787867f..5fb84f1 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/GraphSONModule.java
@@ -101,7 +101,7 @@ abstract class GraphSONModule extends TinkerPopJacksonModule {
                     put(Property.class, "Property");
                     put(Path.class, "Path");
                     put(VertexProperty.class, "VertexProperty");
-                    put(Metrics.class, "metrics");
+                    put(Metrics.class, "Metrics");
                     put(TraversalMetrics.class, "TraversalMetrics");
                     put(Traverser.class, "Traverser");
                     put(Tree.class, "Tree");

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 632ed60..2e67eda 100644
--- a/pom.xml
+++ b/pom.xml
@@ -856,6 +856,31 @@ limitations under the License.
                                 </configuration>
                             </execution>
                             <execution>
+                                <id>io-book</id>
+                                <phase>generate-resources</phase>
+                                <goals>
+                                    <goal>process-asciidoc</goal>
+                                </goals>
+                                <configuration>
+                                    <sourceDirectory>${asciidoc.input.dir}/dev/io</sourceDirectory>
+                                    <sourceDocumentName>index.asciidoc</sourceDocumentName>
+                                    <outputDirectory>${htmlsingle.output.dir}/dev/io</outputDirectory>
+                                    <backend>html5</backend>
+                                    <doctype>book</doctype>
+                                    <attributes>
+                                        <imagesdir>../../images</imagesdir>
+                                        <encoding>UTF-8</encoding>
+                                        <toc>true</toc>
+                                        <toclevels>3</toclevels>
+                                        <toc-position>left</toc-position>
+                                        <stylesdir>${asciidoctor.style.dir}</stylesdir>
+                                        <stylesheet>tinkerpop.css</stylesheet>
+                                        <source-highlighter>coderay</source-highlighter>
+                                        <basedir>${project.basedir}</basedir>
+                                    </attributes>
+                                </configuration>
+                            </execution>
+                            <execution>
                                 <id>provider-book</id>
                                 <phase>generate-resources</phase>
                                 <goals>

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/17449e22/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV2d0.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV2d0.java b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV2d0.java
index da9edb5..0681ff1 100644
--- a/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV2d0.java
+++ b/tinkergraph-gremlin/src/main/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerIoRegistryV2d0.java
@@ -130,7 +130,7 @@ public final class TinkerIoRegistryV2d0 extends AbstractIoRegistry {
 
         @Override
         public String getTypeNamespace() {
-            return "gremlin";
+            return "tinker";
         }
     }
 


[03/14] tinkerpop git commit: updated gremlin-variants.asciidoc with new withStrategy()/withoutStrategy() method discussion. Built docs. Success.

Posted by sp...@apache.org.
updated gremlin-variants.asciidoc with new withStrategy()/withoutStrategy() method discussion. Built docs. Success.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/20dec207
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/20dec207
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/20dec207

Branch: refs/heads/TINKERPOP-1487
Commit: 20dec2076b79441c7dcf06827014ace72fcaea6c
Parents: 95557bf
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Oct 4 12:15:31 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Oct 4 12:15:31 2016 -0600

----------------------------------------------------------------------
 docs/src/reference/gremlin-variants.asciidoc     | 19 +++++++++++++++++++
 .../gremlin/groovy/jsr223/GroovyTranslator.java  |  5 ++++-
 .../gremlin/python/jsr223/PythonTranslator.java  |  3 +++
 .../driver/test_driver_remote_connection.py      |  2 +-
 4 files changed, 27 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/20dec207/docs/src/reference/gremlin-variants.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/gremlin-variants.asciidoc b/docs/src/reference/gremlin-variants.asciidoc
index bf9df2e..1d4099e 100644
--- a/docs/src/reference/gremlin-variants.asciidoc
+++ b/docs/src/reference/gremlin-variants.asciidoc
@@ -224,6 +224,25 @@ in statically typed languages where bindings need to have the same typing as the
 it is possible to use the `withBindings()`-model as Gremlin-Python's `Bindings.of()` simply returns a 2-tuple of `(str,object)`
 (see <<connecting-via-remotegraph,`Bindings`>>).
 
+Traversal Strategies
+~~~~~~~~~~~~~~~~~~~~
+
+In order to add and remove <<traversalstrategy,traversal strategies>> from a traversal source, the `withStrategy()` and
+`withoutStrategy()` steps should be used.
+
+[gremlin-python,modern]
+----
+g = g.withStrategy('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy','vertices',__.hasLabel('person'),'edges',__.has('weight',gt(0.5)))
+g.V().name.toList()
+g.V().outE().valueMap(True).toList()
+g = g.withoutStrategy('org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy')
+g.V().name.toList()
+g.V().outE().valueMap(True).toList()
+----
+
+IMPORTANT: While Gremlin is language agnostic, the executing traversal machine typically is not. Thus, strategies are
+traversal machine dependent and identified by the class name in the traversal machine's implementation language.
+
 The Lambda Solution
 ~~~~~~~~~~~~~~~~~~~
 

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/20dec207/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
index facb24f..aba78bb 100644
--- a/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
+++ b/gremlin-groovy/src/main/java/org/apache/tinkerpop/gremlin/groovy/jsr223/GroovyTranslator.java
@@ -19,6 +19,7 @@
 
 package org.apache.tinkerpop.gremlin.groovy.jsr223;
 
+import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.SackFunctions;
@@ -79,7 +80,7 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
         final StringBuilder traversalScript = new StringBuilder(start);
         for (final Bytecode.Instruction instruction : bytecode.getInstructions()) {
             final String methodName = instruction.getOperator();
-            if (IS_TESTING && methodName.equals(TraversalSource.Symbols.withStrategies))
+            if(IS_TESTING && methodName.equals(TraversalSource.Symbols.withStrategies))
                 continue;
             if (0 == instruction.getArguments().length)
                 traversalScript.append(".").append(methodName).append("()");
@@ -126,6 +127,8 @@ public final class GroovyTranslator implements Translator.ScriptTranslator {
             return ((Enum) object).getDeclaringClass().getSimpleName() + "." + object.toString();
         else if (object instanceof Element)
             return convertToString(((Element) object).id()); // hack
+        else if (object instanceof Computer)
+            return "";
         else if (object instanceof Lambda) {
             final String lambdaString = ((Lambda) object).getLambdaScript().trim();
             return lambdaString.startsWith("{") ? lambdaString : "{" + lambdaString + "}";

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/20dec207/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
index 19302e8..4744649 100644
--- a/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
+++ b/gremlin-python/src/main/java/org/apache/tinkerpop/gremlin/python/jsr223/PythonTranslator.java
@@ -19,6 +19,7 @@
 
 package org.apache.tinkerpop.gremlin.python.jsr223;
 
+import org.apache.tinkerpop.gremlin.process.computer.Computer;
 import org.apache.tinkerpop.gremlin.process.traversal.Bytecode;
 import org.apache.tinkerpop.gremlin.process.traversal.Operator;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
@@ -157,6 +158,8 @@ public class PythonTranslator implements Translator.ScriptTranslator {
             return convertToString(((Element) object).id()); // hack
         else if (object instanceof Bytecode)
             return this.internalTranslate("__", (Bytecode) object);
+        else if (object instanceof Computer)
+            return "";
         else if (object instanceof Lambda)
             return convertLambdaToString((Lambda) object);
         else

http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/20dec207/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
index 81ee886..9914197 100644
--- a/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
+++ b/gremlin-python/src/main/jython/tests/driver/test_driver_remote_connection.py
@@ -72,7 +72,7 @@ class TestDriverRemoteConnection(TestCase):
         assert 1 == g.V().label().dedup().count().next()
         assert "person" == g.V().label().dedup().next()
         #
-        g = g.withComputer("workers", 4, "vertices", __.has("name", "marko"))
+        g = g.withoutStrategy("org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.SubgraphStrategy").withComputer("workers", 4, "vertices", __.has("name", "marko"), "edges", __.limit(0))
         assert 1 == g.V().count().next()
         assert 0 == g.E().count().next()
         assert "person" == g.V().label().next()


[04/14] tinkerpop git commit: dah. bug that showed up in Jenkins testing.

Posted by sp...@apache.org.
dah. bug that showed up in Jenkins testing.


Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/71c7bece
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/71c7bece
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/71c7bece

Branch: refs/heads/TINKERPOP-1487
Commit: 71c7bece0a47878e81161667096b1eeab8a0f420
Parents: 20dec20
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Tue Oct 4 14:35:55 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Tue Oct 4 14:35:55 2016 -0600

----------------------------------------------------------------------
 .../gremlin/tinkergraph/process/TinkerGraphComputerProvider.java   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/71c7bece/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
index 3144211..139384f 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/process/TinkerGraphComputerProvider.java
@@ -39,7 +39,7 @@ public class TinkerGraphComputerProvider extends TinkerGraphProvider {
     public GraphTraversalSource traversal(final Graph graph) {
         return RANDOM.nextBoolean() ?
                 graph.traversal().withComputer(
-                        "workers", RANDOM.nextInt(4) + 1,
+                        "workers", RANDOM.nextInt(Runtime.getRuntime().availableProcessors()) + 1,
                         "graphComputer", RANDOM.nextBoolean() ?
                                 GraphComputer.class.getCanonicalName() :
                                 TinkerGraphComputer.class.getCanonicalName()) :