tinkerpop-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ok...@apache.org
Subject [03/13] incubator-tinkerpop git commit: Column enum now implements Function. SelectColumnStep goes away as now select(column) is simply (un(ddadhe covers) map(column) -- bam. Order.valueDecr/etc. goes away in favor of order().by(values, decr). This means
Date Thu, 03 Dec 2015 19:49:22 GMT
Column enum now implements Function. SelectColumnStep goes away as now select(column) is simply
 (un(ddadhe covers) map(column) -- bam. Order.valueDecr/etc. goes away in favor of order().by(values,decr).
This means we have decoupled the selector from the comparator so people can do other things
besides decr and incr on values.


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

Branch: refs/heads/master
Commit: b7c6041cf01fce0258f11faa1e405364e606fbf2
Parents: 0e43bdd
Author: Marko A. Rodriguez <okrammarko@gmail.com>
Authored: Tue Nov 24 15:04:02 2015 -0700
Committer: Marko A. Rodriguez <okrammarko@gmail.com>
Committed: Thu Dec 3 12:47:52 2015 -0700

----------------------------------------------------------------------
 docs/src/reference/the-traversal.asciidoc       | 16 ++---
 .../gremlin/process/traversal/Order.java        | 28 ++++++--
 .../traversal/dsl/graph/GraphTraversal.java     | 12 ++--
 .../traversal/step/map/SelectColumnStep.java    | 68 --------------------
 .../traversal/step/util/FunctionComparator.java | 56 ++++++++++++++++
 .../tinkerpop/gremlin/structure/Column.java     | 37 ++++++++++-
 .../process/traversal/step/map/OrderTest.java   |  3 +-
 .../structure/TinkerGraphPlayTest.java          |  7 +-
 8 files changed, 137 insertions(+), 90 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b7c6041c/docs/src/reference/the-traversal.asciidoc
----------------------------------------------------------------------
diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc
index 8d0b2fb..6ce4541 100644
--- a/docs/src/reference/the-traversal.asciidoc
+++ b/docs/src/reference/the-traversal.asciidoc
@@ -1573,11 +1573,11 @@ ranking.
 graph.io(graphml()).readGraph('data/grateful-dead.xml')
 g = graph.traversal()
 g.V().hasLabel('song').out('followedBy').groupCount().by('name').
-      order(local).by(valueDecr).limit(local, 5)
+      order(local).by(values,decr).limit(local, 5)
 g.V().hasLabel('song').out('followedBy').groupCount().by('name').
-      order(local).by(valueDecr).limit(local, 5).select(keys)
+      order(local).by(values,decr).limit(local, 5).select(keys)
 g.V().hasLabel('song').out('followedBy').groupCount().by('name').
-      order(local).by(valueDecr).limit(local, 5).select(keys).unfold()
+      order(local).by(values,decr).limit(local, 5).select(keys).unfold()
 ----
 
 Similarly, for extracting the values from a path or map.
@@ -1589,7 +1589,7 @@ g = graph.traversal()
 g.V().hasLabel('song').out('sungBy').groupCount().by('name') <1>
 g.V().hasLabel('song').out('sungBy').groupCount().by('name').select(values) <2>
 g.V().hasLabel('song').out('sungBy').groupCount().by('name').select(values).unfold().
-      groupCount().order(local).by(valueDecr).limit(local, 5) <3>
+      groupCount().order(local).by(values,decr).limit(local, 5) <3>
 ----
 
 <1> Which artist sung how many songs?
@@ -1779,10 +1779,10 @@ that can be used to time execution of a body of code.
 
 [gremlin-groovy,modern]
 ----
-g.V().repeat(both().groupCount('m')).times(16).cap('m').order(local).by(valueDecr).next()
-clock(1) {g.V().repeat(both().groupCount('m')).times(16).cap('m').order(local).by(valueDecr).next()}
-g.V().repeat(timeLimit(2).both().groupCount('m')).times(16).cap('m').order(local).by(valueDecr).next()
-clock(1) {g.V().repeat(timeLimit(2).both().groupCount('m')).times(16).cap('m').order(local).by(valueDecr).next()}
+g.V().repeat(both().groupCount('m')).times(16).cap('m').order(local).by(values,decr).next()
+clock(1) {g.V().repeat(both().groupCount('m')).times(16).cap('m').order(local).by(values,decr).next()}
+g.V().repeat(timeLimit(2).both().groupCount('m')).times(16).cap('m').order(local).by(values,decr).next()
+clock(1) {g.V().repeat(timeLimit(2).both().groupCount('m')).times(16).cap('m').order(local).by(values,decr).next()}
 ----
 
 In essence, the relative order is respected, even through the number of traversers at each
vertex is not. The primary

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b7c6041c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
index e04863b..4e3801a 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/Order.java
@@ -47,7 +47,12 @@ public enum Order implements Comparator<Object> {
         public Order reversed() {
             return incr;
         }
-    }, keyIncr {
+    },
+    /**
+     * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#keys};
+     */
+    @Deprecated
+    keyIncr {
         @Override
         public int compare(final Object first, final Object second) {
             return Comparator.<Comparable>naturalOrder().compare(((Map.Entry<Comparable,
?>) first).getKey(), ((Map.Entry<Comparable, ?>) second).getKey());
@@ -57,7 +62,12 @@ public enum Order implements Comparator<Object> {
         public Order reversed() {
             return keyDecr;
         }
-    }, valueIncr {
+    },
+    /**
+     * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#values};
+     */
+    @Deprecated
+    valueIncr {
         @Override
         public int compare(final Object first, final Object second) {
             return Comparator.<Comparable>naturalOrder().compare(((Map.Entry<?,
Comparable>) first).getValue(), ((Map.Entry<?, Comparable>) second).getValue());
@@ -67,7 +77,12 @@ public enum Order implements Comparator<Object> {
         public Order reversed() {
             return valueDecr;
         }
-    }, keyDecr {
+    },
+    /**
+     * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#keys};
+     */
+    @Deprecated
+    keyDecr {
         @Override
         public int compare(final Object first, final Object second) {
             return Comparator.<Comparable>reverseOrder().compare(((Map.Entry<Comparable,
?>) first).getKey(), ((Map.Entry<Comparable, ?>) second).getKey());
@@ -77,7 +92,12 @@ public enum Order implements Comparator<Object> {
         public Order reversed() {
             return keyIncr;
         }
-    }, valueDecr {
+    },
+    /**
+     * @deprecated Use {@link org.apache.tinkerpop.gremlin.structure.Column#values};
+     */
+    @Deprecated
+    valueDecr {
         @Override
         public int compare(final Object first, final Object second) {
             return Comparator.<Comparable>reverseOrder().compare(((Map.Entry<?,
Comparable>) first).getValue(), ((Map.Entry<?, Comparable>) second).getValue());

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b7c6041c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
index 97d0c53..3673bce 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.java
@@ -99,7 +99,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.map.PropertyValueStep
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.RangeLocalStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.SackStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.SampleLocalStep;
-import org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectColumnStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectOneStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.SelectStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.map.SumGlobalStep;
@@ -128,6 +127,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TraversalS
 import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.TreeSideEffectStep;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.ElementFunctionComparator;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.ElementValueComparator;
+import org.apache.tinkerpop.gremlin.process.traversal.step.util.FunctionComparator;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.HasContainer;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.TraversalComparator;
 import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree;
@@ -472,11 +472,11 @@ public interface GraphTraversal<S, E> extends Traversal<S,
E> {
     }
 
     public default <E2> GraphTraversal<S, Collection<E2>> select(final
Column column) {
-        return this.asAdmin().addStep(new SelectColumnStep<>(this.asAdmin(), column));
+        return this.map(new FunctionTraverser<>((Function) column));
     }
 
     /**
-     * @deprecated As of release 3.1.0, replaced by {@link #select(SelectColumnStep.Column)}
+     * @deprecated As of release 3.1.0, replaced by {@link GraphTraversal#select(Column)}
      */
     @Deprecated
     public default <E2> GraphTraversal<S, E2> mapValues() {
@@ -484,7 +484,7 @@ public interface GraphTraversal<S, E> extends Traversal<S, E>
{
     }
 
     /**
-     * @deprecated As of release 3.1.0, replaced by {@link #select(SelectColumnStep.Column)}
+     * @deprecated As of release 3.1.0, replaced by {@link GraphTraversal#select(Column)}
      */
     @Deprecated
     public default <E2> GraphTraversal<S, E2> mapKeys() {
@@ -1198,6 +1198,10 @@ public interface GraphTraversal<S, E> extends Traversal<S,
E> {
         return this.by((Comparator) order);
     }
 
+    public default <V> GraphTraversal<S, E> by(final Column column, final Comparator<V>
objectComparator) {
+        return this.by(new FunctionComparator(column, objectComparator));
+    }
+
     public default <V> GraphTraversal<S, E> by(final Function<Element, V>
elementFunctionProjection,
                                                final Comparator<V> elementFunctionValueComparator)
{
         return this.by((Comparator) new ElementFunctionComparator<>(elementFunctionProjection,
elementFunctionValueComparator));

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b7c6041c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectColumnStep.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectColumnStep.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectColumnStep.java
deleted file mode 100644
index 1c28003..0000000
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectColumnStep.java
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements.  See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership.  The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License.  You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied.  See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.tinkerpop.gremlin.process.traversal.step.map;
-
-import org.apache.tinkerpop.gremlin.structure.Column;
-import org.apache.tinkerpop.gremlin.process.traversal.Path;
-import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
-import org.apache.tinkerpop.gremlin.process.traversal.Traverser;
-import org.apache.tinkerpop.gremlin.structure.util.StringFactory;
-import org.apache.tinkerpop.gremlin.util.function.ArrayListSupplier;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Collections;
-import java.util.Map;
-
-/**
- * @author Marko A. Rodriguez (http://markorodriguez.com)
- */
-public final class SelectColumnStep<S, E> extends MapStep<S, Collection<E>>
{
-
-    private final Column column;
-
-    public SelectColumnStep(final Traversal.Admin traversal, final Column column) {
-        super(traversal);
-        this.column = column;
-    }
-
-    @Override
-    protected Collection<E> map(Traverser.Admin<S> traverser) {
-        final S start = traverser.get();
-        if (start instanceof Map)
-            return this.column.equals(Column.keys) ? ((Map<E, ?>) start).keySet() :
((Map<?, E>) start).values();
-        else if (start instanceof Path)
-            return (Collection<E>) (this.column.equals(Column.keys) ? new ArrayList<>(((Path)
start).labels()) : new ArrayList(((Path) start).objects()));  // necessary for serialization
in complex GraphComputers (find fix)
-        else if (start instanceof Map.Entry)   // TODO: remove support for this?
-            return Collections.singleton(this.column.equals(Column.keys) ? ((Map.Entry<E,
?>) start).getKey() : ((Map.Entry<?, E>) start).getValue());
-        else
-            throw new IllegalStateException("The traverser does not reference a map or path:
" + traverser);
-    }
-
-    @Override
-    public String toString() {
-        return StringFactory.stepString(this, this.column);
-    }
-
-    @Override
-    public int hashCode() {
-        return super.hashCode() ^ this.column.hashCode();
-    }
-}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b7c6041c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/FunctionComparator.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/FunctionComparator.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/FunctionComparator.java
new file mode 100644
index 0000000..a133e38
--- /dev/null
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/FunctionComparator.java
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.tinkerpop.gremlin.process.traversal.step.util;
+
+import java.io.Serializable;
+import java.util.Comparator;
+import java.util.function.Function;
+
+/**
+ * @author Marko A. Rodriguez (http://markorodriguez.com)
+ */
+public final class FunctionComparator<A, B> implements Comparator<A>, Serializable
{
+
+    private final Function<A, B> function;
+    private final Comparator<B> comparator;
+
+    public FunctionComparator(final Function<A, B> function, final Comparator<B>
comparator) {
+        this.function = function;
+        this.comparator = comparator;
+    }
+
+    public Function<A, B> getFunction() {
+        return this.function;
+    }
+
+    public Comparator<B> getComparator() {
+        return this.comparator;
+    }
+
+    @Override
+    public int compare(final A first, final A second) {
+        return this.comparator.compare(this.function.apply(first), this.function.apply(second));
+    }
+
+    @Override
+    public String toString() {
+        return this.comparator.toString() + "(" + this.function + ')';
+    }
+}

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b7c6041c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Column.java
----------------------------------------------------------------------
diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Column.java
b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Column.java
index 1ab49fa..fca90d7 100644
--- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Column.java
+++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/Column.java
@@ -19,19 +19,50 @@
 
 package org.apache.tinkerpop.gremlin.structure;
 
+import org.apache.tinkerpop.gremlin.process.traversal.Path;
+
+import java.util.Map;
+import java.util.function.Function;
+
 /**
  * Column references a particular type of column in a complex data structure such as a {@link
java.util.Map} or a {@link org.apache.tinkerpop.gremlin.process.traversal.Path}.
  *
  * @author Marko A. Rodriguez (http://markorodriguez.com)
  */
-public enum Column {
+public enum Column implements Function<Object, Object> {
 
     /**
      * The keys associated with the data structure.
      */
-    keys,
+    keys {
+        @Override
+        public Object apply(final Object object) {
+            if (object instanceof Map)
+                return ((Map) object).keySet();
+            else if (object instanceof Map.Entry)
+                return ((Map.Entry) object).getKey();
+            else if (object instanceof Path)
+                return ((Path) object).labels();
+            else
+                throw new IllegalArgumentException("The provided object does not have accessible
keys: " + object.getClass());
+        }
+    },
     /**
      * The values associated with the data structure.
      */
-    values
+    values {
+        @Override
+        public Object apply(final Object object) {
+            if (object instanceof Map)
+                return ((Map) object).values();
+            else if (object instanceof Map.Entry)
+                return ((Map.Entry) object).getValue();
+            else if (object instanceof Path)
+                return ((Path) object).objects();
+            else
+                throw new IllegalArgumentException("The provided object does not have accessible
keys: " + object.getClass());
+        }
+    }
+
+
 }

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b7c6041c/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
----------------------------------------------------------------------
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
index 2eec7ac..3f08d60 100644
--- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
+++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/OrderTest.java
@@ -27,6 +27,7 @@ import org.apache.tinkerpop.gremlin.process.traversal.Scope;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 import org.apache.tinkerpop.gremlin.process.traversal.TraversalEngine;
 import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__;
+import org.apache.tinkerpop.gremlin.structure.Column;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
 import org.junit.Test;
@@ -363,7 +364,7 @@ public abstract class OrderTest extends AbstractGremlinProcessTest {
                 map.put(3, (int) v.get().value("age") * 3);
                 map.put(4, (int) v.get().value("age"));
                 return map;
-            }).order(Scope.local).by(Order.valueDecr).by(Order.keyIncr);
+            }).order(Scope.local).by(Column.values, Order.decr).by(Column.keys,Order.incr);
         }
 
         @Override

http://git-wip-us.apache.org/repos/asf/incubator-tinkerpop/blob/b7c6041c/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
----------------------------------------------------------------------
diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
index fdb44ad..64c2e84 100644
--- a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
+++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/TinkerGraphPlayTest.java
@@ -20,13 +20,14 @@ package org.apache.tinkerpop.gremlin.tinkergraph.structure;
 
 import org.apache.tinkerpop.gremlin.process.computer.bulkloading.BulkLoaderVertexProgram;
 import org.apache.tinkerpop.gremlin.process.traversal.Operator;
+import org.apache.tinkerpop.gremlin.process.traversal.Order;
 import org.apache.tinkerpop.gremlin.process.traversal.P;
 import org.apache.tinkerpop.gremlin.process.traversal.Scope;
 import org.apache.tinkerpop.gremlin.process.traversal.Traversal;
 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.util.TraversalMetrics;
+import org.apache.tinkerpop.gremlin.structure.Column;
 import org.apache.tinkerpop.gremlin.structure.Graph;
 import org.apache.tinkerpop.gremlin.structure.T;
 import org.apache.tinkerpop.gremlin.structure.Vertex;
@@ -39,6 +40,7 @@ import org.junit.Test;
 import java.io.File;
 import java.util.Arrays;
 import java.util.List;
+import java.util.function.Function;
 import java.util.function.Supplier;
 
 import static org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__.*;
@@ -53,7 +55,8 @@ public class TinkerGraphPlayTest {
     public void testPlay8() throws Exception {
         Graph graph = TinkerFactory.createModern();
         GraphTraversalSource g = graph.traversal(); //GraphTraversalSource.computer());
-        System.out.println(g.V().outE("knows").identity().inV().count().is(P.eq(5)).explain());
+        //System.out.println(g.V().outE("knows").identity().inV().count().is(P.eq(5)).explain());
+        System.out.println(g.V().both().both().groupCount().order(Scope.local).by(Column.values,
Order.incr).toList());
 
     }
 


Mime
View raw message