You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tinkerpop.apache.org by ok...@apache.org on 2016/10/10 17:58:59 UTC
tinkerpop git commit: all Python strategies must not require
arguments at construction so that withoutStrategies() will work. Also added a
new V() test case for a corner case I want to ensure works. Minor nothing.
CTR.
Repository: tinkerpop
Updated Branches:
refs/heads/master 31044a280 -> 43ceaaf9b
all Python strategies must not require arguments at construction so that withoutStrategies() will work. Also added a new V() test case for a corner case I want to ensure works. Minor nothing. CTR.
Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo
Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/43ceaaf9
Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/43ceaaf9
Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/43ceaaf9
Branch: refs/heads/master
Commit: 43ceaaf9b9a48e162acffc728f76467aa2289f01
Parents: 31044a2
Author: Marko A. Rodriguez <ok...@gmail.com>
Authored: Mon Oct 10 11:58:55 2016 -0600
Committer: Marko A. Rodriguez <ok...@gmail.com>
Committed: Mon Oct 10 11:58:55 2016 -0600
----------------------------------------------------------------------
.../traversal/step/map/GroovyVertexTest.groovy | 5 +++++
.../jython/gremlin_python/process/strategies.py | 15 +++++++++-----
.../process/traversal/step/map/VertexTest.java | 21 +++++++++++++++++---
3 files changed, 33 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/43ceaaf9/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
----------------------------------------------------------------------
diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
index 3c4f8b4..ce5fe6f 100644
--- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
+++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovyVertexTest.groovy
@@ -178,5 +178,10 @@ public abstract class GroovyVertexTest {
g.V(v3Id).drop().iterate();
new ScriptTraversal<>(g, "gremlin-groovy", "g.V(v1Id, v2Id, v4Id, v3Id).name", "v1Id", v1Id, "v2Id", v2Id, "v3Id", v3Id, "v4Id", v4Id)
}
+
+ @Override
+ public Traversal<Vertex, String> get_g_V_hasLabelXpersonX_V_hasLabelXsoftwareX_name() {
+ new ScriptTraversal<>(g, "gremlin-groovy", "g.V.hasLabel('person').V.hasLabel('software').name")
+ }
}
}
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/43ceaaf9/gremlin-python/src/main/jython/gremlin_python/process/strategies.py
----------------------------------------------------------------------
diff --git a/gremlin-python/src/main/jython/gremlin_python/process/strategies.py b/gremlin-python/src/main/jython/gremlin_python/process/strategies.py
index 437b4c0..4d4cbda 100644
--- a/gremlin-python/src/main/jython/gremlin_python/process/strategies.py
+++ b/gremlin-python/src/main/jython/gremlin_python/process/strategies.py
@@ -39,18 +39,23 @@ class ElementIdStrategy(TraversalStrategy):
# EventStrategy doesn't make sense outside JVM traversal machine
class HaltedTraverserStrategy(TraversalStrategy):
- def __init__(self, halted_traverser_factory):
- TraversalStrategy.__init__(self, configuration={"haltedTraverserFactory": halted_traverser_factory})
+ def __init__(self, halted_traverser_factory=None):
+ TraversalStrategy.__init__(self)
+ if halted_traverser_factory is not None:
+ self.configuration["haltedTraverserFactory"] = halted_traverser_factory
class PartitionStrategy(TraversalStrategy):
- def __init__(self, partition_key, write_partition=None, read_partitions=None, include_meta_properties=False):
- TraversalStrategy.__init__(self, configuration={"partitionKey": partition_key,
- "includeMetaProperties": include_meta_properties})
+ def __init__(self, partition_key=None, write_partition=None, read_partitions=None, include_meta_properties=None):
+ TraversalStrategy.__init__(self)
+ if partition_key is not None:
+ self.configuration["partitionKey"] = partition_key
if write_partition is not None:
self.configuration["writePartition"] = write_partition
if write_partition is not None:
self.configuration["readPartitions"] = read_partitions
+ if include_meta_properties is not None:
+ self.configuration["includeMetaProperties"] = include_meta_properties
class SubgraphStrategy(TraversalStrategy):
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/43ceaaf9/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
index fbc735a..6db7442 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/VertexTest.java
@@ -47,7 +47,7 @@ import static org.junit.Assert.assertTrue;
/**
* @author Marko A. Rodriguez (http://markorodriguez.com)
- * @author Stephen Mallette (http://traversalhen.genoprime.com)
+ * @author Stephen Mallette (http://stephen.genoprime.com)
* @author Daniel Kuppitz (http://gremlin.guru)
*/
@RunWith(GremlinProcessRunner.class)
@@ -111,12 +111,14 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
public abstract Traversal<Vertex, String> get_g_VX1_2_3_4X_name(final Object v1Id, final Object v2Id, final Object v3Id, final Object v4Id);
+ public abstract Traversal<Vertex, String> get_g_V_hasLabelXpersonX_V_hasLabelXsoftwareX_name();
+
// GRAPH VERTEX/EDGE
@Test
@LoadGraphWith(MODERN)
public void g_VXlistX1_2_3XX_name() {
- final Traversal<Vertex,String> traversal = get_g_VXlistX1_2_3XX_name(convertToVertexId(graph, "marko"), convertToVertexId(graph, "vadas"), convertToVertexId(graph, "lop"));
+ final Traversal<Vertex, String> traversal = get_g_VXlistX1_2_3XX_name(convertToVertexId(graph, "marko"), convertToVertexId(graph, "vadas"), convertToVertexId(graph, "lop"));
printTraversalForm(traversal);
checkResults(Arrays.asList("marko", "vadas", "lop"), traversal);
}
@@ -124,7 +126,7 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
@Test
@LoadGraphWith(MODERN)
public void g_VXlistXv1_v2_v3XX_name() {
- final Traversal<Vertex,String> traversal = get_g_VXlistXv1_v2_v3XX_name(convertToVertex(graph, "marko"), convertToVertex(graph, "vadas"), convertToVertex(graph, "lop"));
+ final Traversal<Vertex, String> traversal = get_g_VXlistXv1_v2_v3XX_name(convertToVertex(graph, "marko"), convertToVertex(graph, "vadas"), convertToVertex(graph, "lop"));
printTraversalForm(traversal);
checkResults(Arrays.asList("marko", "vadas", "lop"), traversal);
}
@@ -560,6 +562,14 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
assertFalse(traversal.hasNext());
}
+ @Test
+ @LoadGraphWith(MODERN)
+ public void g_V_hasLabelXpersonX_V_hasLabelXsoftwareX_name() {
+ final Traversal<Vertex, String> traversal = get_g_V_hasLabelXpersonX_V_hasLabelXsoftwareX_name();
+ printTraversalForm(traversal);
+ checkResults(Arrays.asList("lop", "lop", "lop", "lop", "ripple", "ripple", "ripple", "ripple"), traversal);
+ }
+
public static class Traversals extends VertexTest {
@Override
@@ -706,5 +716,10 @@ public abstract class VertexTest extends AbstractGremlinProcessTest {
public Traversal<Edge, Edge> get_g_EX11X(final Object e11Id) {
return g.E(e11Id);
}
+
+ @Override
+ public Traversal<Vertex, String> get_g_V_hasLabelXpersonX_V_hasLabelXsoftwareX_name() {
+ return g.V().hasLabel("person").V().hasLabel("software").values("name");
+ }
}
}