[1/2] tinkerpop git commit: Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`. [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/shortest-path-wip f1776cc20 -> 2b02a47cf (forced update) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2b02a47c/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ShortestPathTest.java -- diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ShortestPathTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ShortestPathTest.java new file mode 100644 index 000..71f4469 --- /dev/null +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ShortestPathTest.java @@ -0,0 +1,310 @@ +/* + * 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.LoadGraphWith; +import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest; +import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner; +import org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathTestHelper; +import org.apache.tinkerpop.gremlin.process.traversal.Path; +import org.apache.tinkerpop.gremlin.process.traversal.Traversal; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.CREW; +import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.GRATEFUL; +import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN; +import static org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathVertexProgramTest.ALL_SHORTEST_PATHS; +import static org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ShortestPathVertexProgramStep.ShortestPath.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +/** + * @author Daniel Kuppitz (http://gremlin.guru) + */ +@RunWith(GremlinProcessRunner.class) +public abstract class ShortestPathTest extends AbstractGremlinProcessTest { + +private ShortestPathTestHelper helper; + +@Before +public void initializeHelper() throws Exception { +this.helper = new ShortestPathTestHelper(this, g); +} + +public abstract Traversal get_g_V_shortestPath(); + +public abstract Traversal get_g_V_both_dedup_shortestPath(); + +public abstract Traversal get_g_V_shortestPath_edgesIncluded(); + +public abstract Traversal get_g_V_shortestPath_directionXINX(); + +public abstract Traversal get_g_V_shortestPath_edgesXoutEX(); + +public abstract Traversal get_g_V_shortestPath_edgesIncluded_edgesXoutEX(); + +public abstract Traversal get_g_V_hasXname_markoX_shortestPath(); + +public abstract Traversal get_g_V_shortestPath_targetXhasXname_markoXX(); + +public abstract Traversal get_g_V_shortestPath_targetXvaluesXnameX_isXmarkoXX(); + +public abstract Traversal get_g_V_hasXname_markoX_shortestPath_targetXhasLabelXsoftwareXX(); + +public abstract Traversal get_g_V_hasXname_markoX_shortestPath_targetXhasXname_joshXX_distanceXweightX(); + +public abstract Traversal get_g_V_hasXname_danielX_shortestPath_targetXhasXname_stephenXX_edgesXbothEXusesXX(); + +public abstract Traversal get_g_V_hasXsong_name_MIGHT_AS_WELLX_shortestPath_targetXhasXsong_name_MAYBE_YOU_KNOW_HOW_I_FEELXX_edgesXoutEXfollowedByXX_distanceXweightX(); + +@Test +@LoadGraphWith(MODERN) +public void g_V_shortestPath() { +final Traversal traversal = get_g_V_shortestPath(); +printTraversalForm(traversal); +final List expected = Arrays.stream(ALL_SHORTEST_PATHS).map(helper::makePath) +.collect(Collectors.toList()); +checkResults(expected, traversal); +} + +@Test +@LoadGraphWith(MODERN) +public
[2/2] tinkerpop git commit: Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`.
Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2b02a47c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2b02a47c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2b02a47c Branch: refs/heads/shortest-path-wip Commit: 2b02a47cf5438f3eff5b54eb1bdd77169aef91f2 Parents: 12b84a1 Author: Daniel Kuppitz Authored: Wed May 23 08:46:34 2018 -0400 Committer: Daniel Kuppitz Committed: Thu May 31 14:51:30 2018 -0700 -- .../tinkerpop/gremlin/jsr223/CoreImports.java | 4 + .../search/path/ShortestPathVertexProgram.java | 566 +++ .../step/map/ShortestPathVertexProgramStep.java | 259 + .../gremlin/process/remote/RemoteGraph.java | 8 + .../gremlin/process/traversal/Traversal.java| 16 +- .../traversal/dsl/graph/GraphTraversal.java | 20 + .../traversal/lambda/ColumnTraversal.java | 8 + .../traversal/lambda/ConstantTraversal.java | 9 +- .../traversal/lambda/ElementValueTraversal.java | 10 +- .../traversal/lambda/IdentityTraversal.java | 7 +- .../process/traversal/lambda/LoopTraversal.java | 6 + .../traversal/lambda/TokenTraversal.java| 8 + .../process/traversal/lambda/TrueTraversal.java | 5 + .../structure/io/graphson/GraphSONModule.java | 2 +- .../traversal/dsl/graph/GraphTraversalTest.java | 2 +- .../Process/Traversal/GraphTraversal.cs | 9 + .../lib/process/graph-traversal.js | 10 + .../gremlin_python/process/graph_traversal.py | 4 + .../tinkerpop/gremlin/AbstractGremlinTest.java | 4 + .../gremlin/process/ProcessComputerSuite.java | 5 + .../search/path/ShortestPathTestHelper.java | 72 +++ .../path/ShortestPathVertexProgramTest.java | 264 + .../traversal/step/map/ShortestPathTest.java| 310 ++ pom.xml | 3 + 24 files changed, 1599 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2b02a47c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java index 368b92d..d853b8f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java @@ -46,9 +46,11 @@ import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.Clu import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.PeerPressureVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankMapReduce; import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram; +import org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.traversal.MemoryTraversalSideEffects; import org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.PageRankVertexProgramStep; +import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ShortestPathVertexProgramStep; import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy; import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimization.GraphFilterStrategy; import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection; @@ -262,6 +264,8 @@ public final class CoreImports { CLASS_IMPORTS.add(PageRankMapReduce.class); CLASS_IMPORTS.add(PageRankVertexProgram.class); CLASS_IMPORTS.add(PageRankVertexProgramStep.PageRank.class); +CLASS_IMPORTS.add(ShortestPathVertexProgram.class); +CLASS_IMPORTS.add(ShortestPathVertexProgramStep.ShortestPath.class); CLASS_IMPORTS.add(GraphFilterStrategy.class); CLASS_IMPORTS.add(TraversalVertexProgram.class); CLASS_IMPORTS.add(VertexProgramStrategy.class); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2b02a47c/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/search/path/ShortestPathVertexProgram.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/search/path/ShortestPathVertexProgram.java
[1/2] tinkerpop git commit: Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`. [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/shortest-path-wip 27cf8e555 -> f1776cc20 (forced update) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1776cc2/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ShortestPathTest.java -- diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ShortestPathTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ShortestPathTest.java new file mode 100644 index 000..71f4469 --- /dev/null +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/ShortestPathTest.java @@ -0,0 +1,310 @@ +/* + * 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.LoadGraphWith; +import org.apache.tinkerpop.gremlin.process.AbstractGremlinProcessTest; +import org.apache.tinkerpop.gremlin.process.GremlinProcessRunner; +import org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathTestHelper; +import org.apache.tinkerpop.gremlin.process.traversal.Path; +import org.apache.tinkerpop.gremlin.process.traversal.Traversal; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; +import org.apache.tinkerpop.gremlin.structure.Direction; +import org.apache.tinkerpop.gremlin.structure.Vertex; +import org.junit.Before; +import org.junit.Test; +import org.junit.runner.RunWith; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + +import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.CREW; +import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.GRATEFUL; +import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN; +import static org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathVertexProgramTest.ALL_SHORTEST_PATHS; +import static org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ShortestPathVertexProgramStep.ShortestPath.*; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertFalse; +import static org.junit.Assert.assertTrue; + +/** + * @author Daniel Kuppitz (http://gremlin.guru) + */ +@RunWith(GremlinProcessRunner.class) +public abstract class ShortestPathTest extends AbstractGremlinProcessTest { + +private ShortestPathTestHelper helper; + +@Before +public void initializeHelper() throws Exception { +this.helper = new ShortestPathTestHelper(this, g); +} + +public abstract Traversal get_g_V_shortestPath(); + +public abstract Traversal get_g_V_both_dedup_shortestPath(); + +public abstract Traversal get_g_V_shortestPath_edgesIncluded(); + +public abstract Traversal get_g_V_shortestPath_directionXINX(); + +public abstract Traversal get_g_V_shortestPath_edgesXoutEX(); + +public abstract Traversal get_g_V_shortestPath_edgesIncluded_edgesXoutEX(); + +public abstract Traversal get_g_V_hasXname_markoX_shortestPath(); + +public abstract Traversal get_g_V_shortestPath_targetXhasXname_markoXX(); + +public abstract Traversal get_g_V_shortestPath_targetXvaluesXnameX_isXmarkoXX(); + +public abstract Traversal get_g_V_hasXname_markoX_shortestPath_targetXhasLabelXsoftwareXX(); + +public abstract Traversal get_g_V_hasXname_markoX_shortestPath_targetXhasXname_joshXX_distanceXweightX(); + +public abstract Traversal get_g_V_hasXname_danielX_shortestPath_targetXhasXname_stephenXX_edgesXbothEXusesXX(); + +public abstract Traversal get_g_V_hasXsong_name_MIGHT_AS_WELLX_shortestPath_targetXhasXsong_name_MAYBE_YOU_KNOW_HOW_I_FEELXX_edgesXoutEXfollowedByXX_distanceXweightX(); + +@Test +@LoadGraphWith(MODERN) +public void g_V_shortestPath() { +final Traversal traversal = get_g_V_shortestPath(); +printTraversalForm(traversal); +final List expected = Arrays.stream(ALL_SHORTEST_PATHS).map(helper::makePath) +.collect(Collectors.toList()); +checkResults(expected, traversal); +} + +@Test +@LoadGraphWith(MODERN) +public
[2/2] tinkerpop git commit: Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`.
Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f1776cc2 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f1776cc2 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f1776cc2 Branch: refs/heads/shortest-path-wip Commit: f1776cc20acf0582cbf8331caeecbc95e59f Parents: 12b84a1 Author: Stephen Mallette Authored: Wed May 23 08:46:34 2018 -0400 Committer: Daniel Kuppitz Committed: Thu May 31 14:42:02 2018 -0700 -- .../tinkerpop/gremlin/jsr223/CoreImports.java | 4 + .../search/path/ShortestPathVertexProgram.java | 566 +++ .../step/map/ShortestPathVertexProgramStep.java | 259 + .../gremlin/process/remote/RemoteGraph.java | 8 + .../gremlin/process/traversal/Traversal.java| 16 +- .../traversal/dsl/graph/GraphTraversal.java | 20 + .../traversal/lambda/ColumnTraversal.java | 8 + .../traversal/lambda/ConstantTraversal.java | 9 +- .../traversal/lambda/ElementValueTraversal.java | 10 +- .../traversal/lambda/IdentityTraversal.java | 7 +- .../process/traversal/lambda/LoopTraversal.java | 6 + .../traversal/lambda/TokenTraversal.java| 8 + .../process/traversal/lambda/TrueTraversal.java | 5 + .../structure/io/graphson/GraphSONModule.java | 2 +- .../traversal/dsl/graph/GraphTraversalTest.java | 2 +- .../Process/Traversal/GraphTraversal.cs | 9 + .../lib/process/graph-traversal.js | 10 + .../gremlin_python/process/graph_traversal.py | 4 + .../tinkerpop/gremlin/AbstractGremlinTest.java | 4 + .../gremlin/process/ProcessComputerSuite.java | 5 + .../search/path/ShortestPathTestHelper.java | 72 +++ .../path/ShortestPathVertexProgramTest.java | 264 + .../traversal/step/map/ShortestPathTest.java| 310 ++ pom.xml | 3 + 24 files changed, 1599 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1776cc2/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java index 368b92d..d853b8f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java @@ -46,9 +46,11 @@ import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.Clu import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.PeerPressureVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankMapReduce; import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram; +import org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.traversal.MemoryTraversalSideEffects; import org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.PageRankVertexProgramStep; +import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ShortestPathVertexProgramStep; import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy; import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimization.GraphFilterStrategy; import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection; @@ -262,6 +264,8 @@ public final class CoreImports { CLASS_IMPORTS.add(PageRankMapReduce.class); CLASS_IMPORTS.add(PageRankVertexProgram.class); CLASS_IMPORTS.add(PageRankVertexProgramStep.PageRank.class); +CLASS_IMPORTS.add(ShortestPathVertexProgram.class); +CLASS_IMPORTS.add(ShortestPathVertexProgramStep.ShortestPath.class); CLASS_IMPORTS.add(GraphFilterStrategy.class); CLASS_IMPORTS.add(TraversalVertexProgram.class); CLASS_IMPORTS.add(VertexProgramStrategy.class); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f1776cc2/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/search/path/ShortestPathVertexProgram.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/search/path/ShortestPathVertexProgram.java
[1/2] tinkerpop git commit: Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`. [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/shortest-path-wip c04b56fb0 -> 27cf8e555 (forced update) http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27cf8e55/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java index 59ba4a0..eaa7b0f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java @@ -27,8 +27,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.P; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy; import org.apache.tinkerpop.gremlin.process.traversal.Traverser; -import org.apache.tinkerpop.gremlin.process.traversal.step.StepConfiguration; -import org.apache.tinkerpop.gremlin.process.traversal.step.util.StepConfigurationProxy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.TraversalStrategyProxy; import org.apache.tinkerpop.gremlin.process.traversal.util.AndP; import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP; @@ -49,6 +47,7 @@ import org.apache.tinkerpop.shaded.jackson.databind.type.TypeFactory; import java.io.IOException; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collection; import java.util.List; import java.util.Map; @@ -236,23 +235,6 @@ final class TraversalSerializersV3d0 { } } -final static class StepConfigurationJacksonSerializer extends StdScalarSerializer { - -public StepConfigurationJacksonSerializer() { -super(StepConfiguration.class); -} - -@Override -public void serialize(final StepConfiguration stepConfiguration, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) -throws IOException { -jsonGenerator.writeStartObject(); -for (final Map.Entry entry : ConfigurationConverter.getMap(stepConfiguration.getConfiguration()).entrySet()) { -jsonGenerator.writeObjectField((String) entry.getKey(), entry.getValue()); -} -jsonGenerator.writeEndObject(); -} -} - /// // DESERIALIZERS // // @@ -502,18 +484,4 @@ final class TraversalSerializersV3d0 { return new TraversalStrategyProxy<>(this.clazz, new MapConfiguration(data)); } } - -final static class StepConfigurationProxyJacksonDeserializer extends AbstractObjectDeserializer { -private final Class clazz; - -public StepConfigurationProxyJacksonDeserializer(final Class clazz) { -super(StepConfigurationProxy.class); -this.clazz = clazz; -} - -@Override -public StepConfigurationProxy createObject(final Map data) { -return new StepConfigurationProxy<>(this.clazz, new MapConfiguration(data)); -} -} } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27cf8e55/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java index 9fdfd4e..ca7c241 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/gryo/GryoSerializersV1d0.java @@ -18,14 +18,11 @@ */ package org.apache.tinkerpop.gremlin.structure.io.gryo; -import org.apache.commons.configuration.Configuration; import org.apache.tinkerpop.gremlin.process.remote.traversal.DefaultRemoteTraverser; import org.apache.tinkerpop.gremlin.process.traversal.Bytecode; import org.apache.tinkerpop.gremlin.process.traversal.P; import org.apache.tinkerpop.gremlin.process.traversal.Path; -import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.TraversalSource; -import org.apache.tinkerpop.gremlin.process.traversal.step.util.DefaultStepConfiguration; import org.apache.tinkerpop.gremlin.process.traversal.util.AndP; import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP; import org.apache.tinkerpop.gremlin.process.traversal.util.OrP; @@ -47,10 +44,7 @@ import org.apache.tinkerpop.gremlin.util.function.Lambda;
[2/2] tinkerpop git commit: Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`.
Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/27cf8e55 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/27cf8e55 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/27cf8e55 Branch: refs/heads/shortest-path-wip Commit: 27cf8e555fbc59e0446c8b8ed27c483b9578c97f Parents: 939674a Author: Daniel Kuppitz Authored: Tue May 22 07:59:32 2018 -0700 Committer: Daniel Kuppitz Committed: Thu May 31 14:29:17 2018 -0700 -- .../tinkerpop/gremlin/jsr223/CoreImports.java | 4 + .../gremlin/jsr223/JavaTranslator.java | 37 -- .../search/path/ShortestPathVertexProgram.java | 566 +++ .../step/map/ShortestPathVertexProgramStep.java | 257 + .../gremlin/process/remote/RemoteGraph.java | 8 + .../gremlin/process/traversal/Bytecode.java | 16 +- .../gremlin/process/traversal/Traversal.java| 16 +- .../traversal/dsl/graph/GraphTraversal.java | 23 +- .../traversal/lambda/ColumnTraversal.java | 8 + .../traversal/lambda/ConstantTraversal.java | 9 +- .../traversal/lambda/ElementValueTraversal.java | 10 +- .../traversal/lambda/IdentityTraversal.java | 7 +- .../process/traversal/lambda/LoopTraversal.java | 6 + .../traversal/lambda/TokenTraversal.java| 8 + .../process/traversal/lambda/TrueTraversal.java | 5 + .../traversal/step/StepConfiguration.java | 51 -- .../step/util/DefaultStepConfiguration.java | 158 -- .../step/util/StepConfigurationProxy.java | 50 -- .../structure/io/graphson/GraphSONModule.java | 8 - .../io/graphson/TraversalSerializersV2d0.java | 37 +- .../io/graphson/TraversalSerializersV3d0.java | 34 +- .../structure/io/gryo/GryoSerializersV1d0.java | 32 -- .../structure/io/gryo/GryoSerializersV3d0.java | 2 +- .../gremlin/structure/io/gryo/GryoVersion.java | 7 +- .../traversal/dsl/graph/GraphTraversalTest.java | 2 +- .../process/traversal/step/StepTest.java| 2 +- .../step/util/DefaultStepConfigurationTest.java | 167 -- .../GraphSONMapperPartialEmbeddedTypeTest.java | 10 - .../structure/io/gryo/GryoMapperTest.java | 7 - gremlin-dotnet/glv/generate.groovy | 1 - .../Process/Traversal/GraphTraversal.cs | 9 + .../Process/Traversal/IStepConfiguration.cs | 32 -- .../gremlin/groovy/jsr223/GroovyTranslator.java | 9 +- .../lib/process/graph-traversal.js | 10 + gremlin-python/glv/generate.groovy | 1 - .../gremlin_python/process/graph_traversal.py | 4 + .../tinkerpop/gremlin/AbstractGremlinTest.java | 4 + .../gremlin/process/ProcessComputerSuite.java | 5 + .../search/path/ShortestPathTestHelper.java | 72 +++ .../path/ShortestPathVertexProgramTest.java | 264 + .../traversal/step/map/ShortestPathTest.java| 310 ++ pom.xml | 3 + 42 files changed, 1607 insertions(+), 664 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/27cf8e55/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java index 368b92d..d853b8f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java @@ -46,9 +46,11 @@ import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.Clu import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.PeerPressureVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankMapReduce; import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram; +import org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.traversal.MemoryTraversalSideEffects; import org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.PageRankVertexProgramStep; +import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ShortestPathVertexProgramStep; import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy; import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimization.GraphFilterStrategy; import
tinkerpop git commit: wip
Repository: tinkerpop Updated Branches: refs/heads/shortest-path-wip c42fb5a09 -> c04b56fb0 wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c04b56fb Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c04b56fb Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c04b56fb Branch: refs/heads/shortest-path-wip Commit: c04b56fb06fa704c162ad4bab95a616e4b0dcbb8 Parents: c42fb5a Author: Daniel Kuppitz Authored: Thu May 31 14:21:09 2018 -0700 Committer: Daniel Kuppitz Committed: Thu May 31 14:21:09 2018 -0700 -- .../traversal/dsl/graph/GraphTraversal.java | 24 +-- .../io/graphson/TraversalSerializersV2d0.java | 4 +++ .../io/graphson/TraversalSerializersV3d0.java | 1 + .../structure/io/gryo/GryoSerializersV1d0.java | 32 .../structure/io/gryo/GryoSerializersV3d0.java | 2 +- 5 files changed, 21 insertions(+), 42 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c04b56fb/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 5ec9564..28798ee 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 @@ -19,7 +19,10 @@ package org.apache.tinkerpop.gremlin.process.traversal.dsl.graph; import org.apache.tinkerpop.gremlin.process.computer.VertexProgram; -import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.*; +import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.PageRankVertexProgramStep; +import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.PeerPressureVertexProgramStep; +import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ProgramVertexProgramStep; +import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ShortestPathVertexProgramStep; import org.apache.tinkerpop.gremlin.process.traversal.Order; import org.apache.tinkerpop.gremlin.process.traversal.P; import org.apache.tinkerpop.gremlin.process.traversal.Path; @@ -155,7 +158,10 @@ import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Optional; -import java.util.function.*; +import java.util.function.BiFunction; +import java.util.function.Consumer; +import java.util.function.Function; +import java.util.function.Predicate; /** * @author Marko A. Rodriguez (http://markorodriguez.com) @@ -302,9 +308,9 @@ public interface GraphTraversal extends Traversal { } /** - * Map the {@link Vertex} to its adjacent vertices given a edgeTraversal and edge labels. + * Map the {@link Vertex} to its adjacent vertices given a direction and edge labels. * - * @param direction the edgeTraversal to traverse from the current vertex + * @param direction the direction to traverse from the current vertex * @param edgeLabels the edge labels to traverse * @return the traversal with an appended {@link VertexStep}. * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps; target="_blank">Reference Documentation - Vertex Step @@ -355,9 +361,9 @@ public interface GraphTraversal extends Traversal { } /** - * Map the {@link Vertex} to its incident edges given the edgeTraversal and edge labels. + * Map the {@link Vertex} to its incident edges given the direction and edge labels. * - * @param direction the edgeTraversal to traverse from the current vertex + * @param direction the direction to traverse from the current vertex * @param edgeLabels the edge labels to traverse * @return the traversal with an appended {@link VertexStep}. * @see http://tinkerpop.apache.org/docs/${project.version}/reference/#vertex-steps; target="_blank">Reference Documentation - Vertex Step @@ -408,9 +414,9 @@ public interface GraphTraversal extends Traversal { } /** - * Map the {@link Edge} to its incident vertices given the edgeTraversal. + * Map the {@link Edge} to its incident vertices given the direction. * - * @param direction the edgeTraversal to traverser from the current edge + * @param direction the direction to traverser from the current edge * @return the traversal with an appended {@link EdgeVertexStep}. * @see
[17/23] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/94d0c3ce Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/94d0c3ce Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/94d0c3ce Branch: refs/heads/shortest-path-wip Commit: 94d0c3ceca9e99f728bd43a6c4f9cab7a966ade0 Parents: 78d1a62 d258071 Author: Stephen Mallette Authored: Wed May 30 13:27:00 2018 -0400 Committer: Stephen Mallette Committed: Wed May 30 13:27:00 2018 -0400 -- ...ctTinkerGraphGraphSONTranslatorProvider.java | 115 +++ .../io/graphson/GraphSONTranslator.java | 26 - ...GraphGraphSONTranslatorComputerProvider.java | 37 -- ...phGraphSONTranslatorProcessComputerTest.java | 33 -- ...phGraphSONTranslatorProcessStandardTest.java | 33 -- .../TinkerGraphGraphSONTranslatorProvider.java | 78 - ...GraphSONv2TranslatorProcessComputerTest.java | 34 ++ ...GraphSONv2TranslatorProcessStandardTest.java | 34 ++ ...GraphSONv3TranslatorProcessComputerTest.java | 34 ++ ...GraphSONv3TranslatorProcessStandardTest.java | 34 ++ 10 files changed, 272 insertions(+), 186 deletions(-) --
[14/23] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/04969222 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/04969222 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/04969222 Branch: refs/heads/shortest-path-wip Commit: 04969222bf44ce5131d71fb8e53538af36747487 Parents: 2862ff9 1b59b9e Author: Stephen Mallette Authored: Tue May 29 16:15:13 2018 -0400 Committer: Stephen Mallette Committed: Tue May 29 16:15:13 2018 -0400 -- docs/src/reference/the-traversal.asciidoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/04969222/docs/src/reference/the-traversal.asciidoc --
[19/23] tinkerpop git commit: wip
wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4d1b3915 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4d1b3915 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4d1b3915 Branch: refs/heads/shortest-path-wip Commit: 4d1b3915a07692bd0b037c76ac7f4b85ca9edcf9 Parents: 12b84a1 Author: Stephen Mallette Authored: Wed May 23 08:46:34 2018 -0400 Committer: Daniel Kuppitz Committed: Thu May 31 12:37:59 2018 -0700 -- .../traversal/dsl/graph/GraphTraversal.java | 3 +++ .../process/traversal/step/WithModulating.java | 26 .../process/traversal/step/WithModulation.java | 26 3 files changed, 55 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4d1b3915/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 7d1e7e4..afc4767 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 @@ -41,6 +41,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.FromToModulating; import org.apache.tinkerpop.gremlin.process.traversal.step.Mutating; import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent; +import org.apache.tinkerpop.gremlin.process.traversal.step.WithModulating; +import org.apache.tinkerpop.gremlin.process.traversal.step.WithModulation; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.BranchStep; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.ChooseStep; import org.apache.tinkerpop.gremlin.process.traversal.step.branch.LocalStep; @@ -2824,6 +2826,7 @@ public interface GraphTraversal extends Traversal { public static final String times = "times"; public static final String as = "as"; public static final String option = "option"; +public static final String with = "with"; } } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4d1b3915/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulating.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulating.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulating.java new file mode 100644 index 000..2a81c45 --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulating.java @@ -0,0 +1,26 @@ +/* + * 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; + +/** + * @author Stephen Mallette (http://stephen.genoprime.com) + */ +public interface WithModulating { +public void modulateWith(final WithModulation configuration); +} http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4d1b3915/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulation.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulation.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulation.java new file mode 100644 index 000..404b02f --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/WithModulation.java @@ -0,0 +1,26 @@ +/* + * Licensed to the Apache Software
[12/23] tinkerpop git commit: Moved references to TinkerPop 2.x to upgrade docs
Moved references to TinkerPop 2.x to upgrade docs By now we're pretty much just "TinkerPop" - anything else is just sorta confusing. CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/849349af Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/849349af Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/849349af Branch: refs/heads/shortest-path-wip Commit: 849349afc901ef543e36726b276645cb74cb20d1 Parents: dbf3a0e Author: Stephen Mallette Authored: Tue May 29 16:13:01 2018 -0400 Committer: Stephen Mallette Committed: Tue May 29 16:13:01 2018 -0400 -- docs/src/dev/future/index.asciidoc | 4 +- docs/src/dev/provider/index.asciidoc| 24 ++-- .../src/reference/gremlin-applications.asciidoc | 8 +- .../implementations-hadoop-start.asciidoc | 8 +- .../reference/implementations-neo4j.asciidoc| 4 +- .../implementations-tinkergraph.asciidoc| 6 +- docs/src/reference/intro.asciidoc | 38 +++ docs/src/reference/preface.asciidoc | 10 +- docs/src/reference/the-graph.asciidoc | 90 ++- docs/src/reference/the-graphcomputer.asciidoc | 17 +-- docs/src/reference/the-traversal.asciidoc | 22 ++-- .../the-gremlin-console/index.asciidoc | 4 +- docs/src/upgrade/appendix.asciidoc | 113 +++ docs/src/upgrade/index.asciidoc | 2 + .../Process/Traversal/GraphTraversal.cs | 9 ++ .../lib/process/graph-traversal.js | 10 ++ .../gremlin_python/process/graph_traversal.py | 4 + 17 files changed, 216 insertions(+), 157 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/849349af/docs/src/dev/future/index.asciidoc -- diff --git a/docs/src/dev/future/index.asciidoc b/docs/src/dev/future/index.asciidoc index 5cf..6e41cf9 100644 --- a/docs/src/dev/future/index.asciidoc +++ b/docs/src/dev/future/index.asciidoc @@ -40,8 +40,8 @@ image:tp4-think.png[] == The Main Features -TinkerPop4 should focus on the most successful aspects of TinkerPop3 and it should avoid the traps realized in TinkerPop3. -These items include: +TinkerPop 4.x should focus on the most successful aspects of TinkerPop 3.x and it should avoid the traps realized in +TinkerPop 3.x. These items include: * The concept of Gremlin as both a virtual machine and language. ** A standard bytecode specification should be provided. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/849349af/docs/src/dev/provider/index.asciidoc -- diff --git a/docs/src/dev/provider/index.asciidoc b/docs/src/dev/provider/index.asciidoc index 467b3f3..f6a964b 100644 --- a/docs/src/dev/provider/index.asciidoc +++ b/docs/src/dev/provider/index.asciidoc @@ -39,17 +39,17 @@ This document attempts to address the needs of the different providers that have [[graph-system-provider-requirements]] == Graph System Provider Requirements -image:tinkerpop-enabled.png[width=140,float=left] At the core of TinkerPop3 is a Java8 API. The implementation of this +image:tinkerpop-enabled.png[width=140,float=left] At the core of TinkerPop 3.x is a Java8 API. The implementation of this core API and its validation via the `gremlin-test` suite is all that is required of a graph system provider wishing to -provide a TinkerPop3-enabled graph engine. Once a graph system has a valid implementation, then all the applications +provide a TinkerPop-enabled graph engine. Once a graph system has a valid implementation, then all the applications provided by TinkerPop (e.g. Gremlin Console, Gremlin Server, etc.) and 3rd-party developers (e.g. Gremlin-Scala, Gremlin-JS, etc.) will integrate properly. Finally, please feel free to use the logo on the left to promote your -TinkerPop3 implementation. +TinkerPop implementation. [[graph-structure-api]] === Graph Structure API -The graph structure API of TinkerPop3 provides the interfaces necessary to create a TinkerPop enabled system and +The graph structure API of TinkerPop provides the interfaces necessary to create a TinkerPop enabled system and exposes the basic components of a property graph to include `Graph`, `Vertex`, `Edge`, `VertexProperty` and `Property`. The structure API can be used directly as follows: @@ -77,11 +77,7 @@ In the above code all the vertices are created first and then their respective e `Graph.addVertex(Object...)` or `Vertex.addEdge(String,Vertex,Object...)`, the respective element is created along with the provided key/value pair properties appended to it. -Below is a sequence of basic graph mutation operations
[16/23] tinkerpop git commit: Added GraphSON 3.0 tests for translator CTR
Added GraphSON 3.0 tests for translator CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d2580714 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d2580714 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d2580714 Branch: refs/heads/shortest-path-wip Commit: d25807149c82d4b908a4486f709d050bc030d2d8 Parents: 0496922 Author: Stephen Mallette Authored: Wed May 30 13:26:24 2018 -0400 Committer: Stephen Mallette Committed: Wed May 30 13:26:24 2018 -0400 -- ...ctTinkerGraphGraphSONTranslatorProvider.java | 115 +++ .../io/graphson/GraphSONTranslator.java | 26 - ...GraphGraphSONTranslatorComputerProvider.java | 37 -- ...phGraphSONTranslatorProcessComputerTest.java | 33 -- ...phGraphSONTranslatorProcessStandardTest.java | 33 -- .../TinkerGraphGraphSONTranslatorProvider.java | 78 - ...GraphSONv2TranslatorProcessComputerTest.java | 34 ++ ...GraphSONv2TranslatorProcessStandardTest.java | 34 ++ ...GraphSONv3TranslatorProcessComputerTest.java | 34 ++ ...GraphSONv3TranslatorProcessStandardTest.java | 34 ++ 10 files changed, 272 insertions(+), 186 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d2580714/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/AbstractTinkerGraphGraphSONTranslatorProvider.java -- diff --git a/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/AbstractTinkerGraphGraphSONTranslatorProvider.java b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/AbstractTinkerGraphGraphSONTranslatorProvider.java new file mode 100644 index 000..c20ed11 --- /dev/null +++ b/tinkergraph-gremlin/src/test/java/org/apache/tinkerpop/gremlin/tinkergraph/structure/io/graphson/AbstractTinkerGraphGraphSONTranslatorProvider.java @@ -0,0 +1,115 @@ +/* + * 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.tinkergraph.structure.io.graphson; + +import org.apache.tinkerpop.gremlin.GraphProvider; +import org.apache.tinkerpop.gremlin.LoadGraphWith; +import org.apache.tinkerpop.gremlin.jsr223.JavaTranslator; +import org.apache.tinkerpop.gremlin.process.traversal.CoreTraversalTest; +import org.apache.tinkerpop.gremlin.process.traversal.TraversalInterruptionComputerTest; +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.dsl.graph.__; +import org.apache.tinkerpop.gremlin.process.traversal.step.map.PageRankTest; +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.PartitionStrategyProcessTest; +import org.apache.tinkerpop.gremlin.process.traversal.strategy.decoration.TranslationStrategy; +import org.apache.tinkerpop.gremlin.structure.Graph; +import org.apache.tinkerpop.gremlin.structure.io.graphson.GraphSONVersion; +import org.apache.tinkerpop.gremlin.tinkergraph.TinkerGraphProvider; +import org.apache.tinkerpop.gremlin.tinkergraph.process.computer.TinkerGraphComputer; + +import java.util.Arrays; +import java.util.HashSet; +import java.util.Map; +import java.util.Set; + +/** + * @author Marko A. Rodriguez (http://markorodriguez.com) + * @author Stephen Mallette (http://stephen.genoprime.com) + */ +public abstract class AbstractTinkerGraphGraphSONTranslatorProvider extends TinkerGraphProvider { + +private static Set SKIP_TESTS = new HashSet<>(Arrays.asList( +
[18/23] tinkerpop git commit: TINKERPOP-1975 Introduced with() step and Configuring interface
TINKERPOP-1975 Introduced with() step and Configuring interface Moved Parameterizing to the package containing the other step interfaces. Changed interface hierarchy with Parameterizing and Mutating now that Configuring is present. Both of those changes make this body of work a breaking change to existing APIs though it should really only affect graph providers and even then the fix is quite simple as described in the upgrade documentation. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/12b84a1c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/12b84a1c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/12b84a1c Branch: refs/heads/shortest-path-wip Commit: 12b84a1cdf056b35a9f286eb38db2369622b8a57 Parents: 94d0c3c Author: Stephen Mallette Authored: Thu May 31 12:55:13 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 15:28:35 2018 -0400 -- CHANGELOG.asciidoc | 4 ++ docs/src/reference/the-traversal.asciidoc | 30 ++-- docs/src/upgrade/release-3.4.x.asciidoc | 49 + .../tinkerpop/gremlin/jsr223/CoreImports.java | 2 + .../step/map/PageRankVertexProgramStep.java | 75 ++-- .../step/map/PeerPressureVertexProgramStep.java | 74 +-- .../process/traversal/Parameterizing.java | 37 -- .../traversal/dsl/graph/GraphTraversal.java | 24 ++- .../process/traversal/step/Configuring.java | 41 +++ .../process/traversal/step/Mutating.java| 5 +- .../process/traversal/step/Parameterizing.java | 39 ++ .../process/traversal/step/filter/DropStep.java | 9 ++- .../traversal/step/map/AddEdgeStartStep.java| 6 +- .../process/traversal/step/map/AddEdgeStep.java | 7 +- .../traversal/step/map/AddVertexStartStep.java | 7 +- .../traversal/step/map/AddVertexStep.java | 7 +- .../step/sideEffect/AddPropertyStep.java| 9 +-- .../process/traversal/step/util/Parameters.java | 2 + .../strategy/decoration/ElementIdStrategy.java | 2 +- .../strategy/decoration/PartitionStrategy.java | 6 +- .../traversal/dsl/graph/GraphTraversalTest.java | 2 +- .../Process/Traversal/GraphTraversal.cs | 4 +- gremlin-javascript/glv/generate.groovy | 3 +- .../lib/process/graph-traversal.js | 2 +- gremlin-python/glv/generate.groovy | 1 + .../gremlin_python/process/graph_traversal.py | 2 +- .../traversal/step/map/PageRankTest.java| 41 +++ .../traversal/step/map/PeerPressureTest.java| 31 +++- 28 files changed, 427 insertions(+), 94 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/12b84a1c/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 30fd966..41462fb 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,10 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Moved `Parameterizing` interface to the `org.apache.tinkerpop.gremlin.process.traversal.step` package with other marker interfaces of its type. +* Replaced `Parameterizing.addPropertyMutations()` with `Configuring.configure()`. +* Changed interface hierarchy for `Parameterizing` and `Mutating` interfaces as they are tightly related. +* Introduced the `with()` step modulator which can supply configuration options to `Configuring` steps. * Added `supportsUpsert()` option to `VertexFeatures` and `EdgeFeatures`. * `min()` and `max()` now support all types implementing `Comparable`. * Change the `toString()` of `Path` to be standardized as other graph elements are. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/12b84a1c/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index e28090a..4ded43e 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -1705,11 +1705,15 @@ g = graph.traversal().withComputer() g.V().pageRank().by('pageRank').values('pageRank') g.V().hasLabel('person'). pageRank(). -by(outE('knows')). -by('friendRank'). +with(PageRank.EDGES, __.outE('knows')). +with(PageRank.PROPERTY_NAME, 'friendRank'). order().by('friendRank',desc).valueMap('name','friendRank') +Note the use of the `with()` modulating step which provides configuration options to the algorithm. It takes +configuration keys from the static `PageRank` inner class on `PageRankVertexProgramStep` and is automatically +imported to the Gremlin
[23/23] tinkerpop git commit: Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`.
Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c42fb5a0 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c42fb5a0 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c42fb5a0 Branch: refs/heads/shortest-path-wip Commit: c42fb5a097a2de60943a31ba30e4bed942cfd640 Parents: 939674a Author: Daniel Kuppitz Authored: Tue May 22 07:59:32 2018 -0700 Committer: Daniel Kuppitz Committed: Thu May 31 14:07:12 2018 -0700 -- .../tinkerpop/gremlin/jsr223/CoreImports.java | 4 + .../gremlin/jsr223/JavaTranslator.java | 37 -- .../search/path/ShortestPathVertexProgram.java | 566 +++ .../step/map/ShortestPathVertexProgramStep.java | 257 + .../gremlin/process/remote/RemoteGraph.java | 8 + .../gremlin/process/traversal/Bytecode.java | 16 +- .../gremlin/process/traversal/Traversal.java| 16 +- .../traversal/dsl/graph/GraphTraversal.java | 43 +- .../traversal/lambda/ColumnTraversal.java | 8 + .../traversal/lambda/ConstantTraversal.java | 9 +- .../traversal/lambda/ElementValueTraversal.java | 10 +- .../traversal/lambda/IdentityTraversal.java | 7 +- .../process/traversal/lambda/LoopTraversal.java | 6 + .../traversal/lambda/TokenTraversal.java| 8 + .../process/traversal/lambda/TrueTraversal.java | 5 + .../traversal/step/StepConfiguration.java | 51 -- .../step/util/DefaultStepConfiguration.java | 158 -- .../step/util/StepConfigurationProxy.java | 50 -- .../structure/io/graphson/GraphSONModule.java | 8 - .../io/graphson/TraversalSerializersV2d0.java | 33 -- .../io/graphson/TraversalSerializersV3d0.java | 33 -- .../gremlin/structure/io/gryo/GryoVersion.java | 7 +- .../traversal/dsl/graph/GraphTraversalTest.java | 2 +- .../step/util/DefaultStepConfigurationTest.java | 167 -- .../GraphSONMapperPartialEmbeddedTypeTest.java | 10 - .../structure/io/gryo/GryoMapperTest.java | 7 - .../Process/Traversal/GraphTraversal.cs | 9 + .../Process/Traversal/IStepConfiguration.cs | 32 -- .../lib/process/graph-traversal.js | 10 + .../gremlin_python/process/graph_traversal.py | 4 + .../tinkerpop/gremlin/AbstractGremlinTest.java | 4 + .../gremlin/process/ProcessComputerSuite.java | 5 + .../search/path/ShortestPathTestHelper.java | 72 +++ .../path/ShortestPathVertexProgramTest.java | 264 + .../traversal/step/map/ShortestPathTest.java| 310 ++ pom.xml | 3 + .../structure/TinkerGraphPlayTest.java | 118 +++- 37 files changed, 1703 insertions(+), 654 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c42fb5a0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java index 368b92d..d853b8f 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java @@ -46,9 +46,11 @@ import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.Clu import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.PeerPressureVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankMapReduce; import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram; +import org.apache.tinkerpop.gremlin.process.computer.search.path.ShortestPathVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.traversal.MemoryTraversalSideEffects; import org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.PageRankVertexProgramStep; +import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.ShortestPathVertexProgramStep; import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy; import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimization.GraphFilterStrategy; import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection; @@ -262,6 +264,8 @@ public final class CoreImports { CLASS_IMPORTS.add(PageRankMapReduce.class); CLASS_IMPORTS.add(PageRankVertexProgram.class); CLASS_IMPORTS.add(PageRankVertexProgramStep.PageRank.class); +
[21/23] tinkerpop git commit: wip
wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/939674a5 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/939674a5 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/939674a5 Branch: refs/heads/shortest-path-wip Commit: 939674a5da218566628e54b63a30b98883367036 Parents: 6a40535 Author: Stephen Mallette Authored: Fri May 25 16:02:59 2018 -0400 Committer: Daniel Kuppitz Committed: Thu May 31 12:46:10 2018 -0700 -- .../step/util/DefaultStepConfiguration.java | 158 ++ .../step/util/StepConfigurationProxy.java | 50 ++ .../step/util/DefaultStepConfigurationTest.java | 167 +++ .../Process/Traversal/IStepConfiguration.cs | 32 4 files changed, 407 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/939674a5/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/DefaultStepConfiguration.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/DefaultStepConfiguration.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/DefaultStepConfiguration.java new file mode 100644 index 000..b75358f --- /dev/null +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/util/DefaultStepConfiguration.java @@ -0,0 +1,158 @@ +/* + * 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 org.apache.commons.configuration.Configuration; +import org.apache.commons.configuration.MapConfiguration; +import org.apache.commons.lang.reflect.MethodUtils; +import org.apache.tinkerpop.gremlin.process.remote.traversal.strategy.decoration.RemoteStrategy; +import org.apache.tinkerpop.gremlin.process.traversal.Step; +import org.apache.tinkerpop.gremlin.process.traversal.step.StepConfiguration; +import org.apache.tinkerpop.gremlin.util.iterator.IteratorUtils; + +import java.util.Arrays; +import java.util.Collections; +import java.util.Iterator; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * A basic {@link StepConfiguration} implementation that uses reflection to set methods on the step to which the + * configuration will be applied. While use of reflection isn't quite as nice as direct application of configuration + * options to a step, this implementation is serialization ready and thus requires no additional work from the + * developer to get a step option ready for usage. If using this implementation, it is of extreme importance that + * the developer implement solid test coverage to ensure that reflection calls will work at runtime as compilation + * errors will not be raised under this approach. + * + * @author Stephen Mallette (http://stephen.genoprime.com) + */ +public class DefaultStepConfiguration implements StepConfiguration { + +private final Map> conf; +private final Class expects; + +/** + * Creates a new {@code DefaultStepConfiguration}. + * + * @param method to call on the step + * @param args the arguments to pass to the method + */ +public DefaultStepConfiguration(final String method, final Object... args) { +this(null, method, args); +} + +/** + * Creates a new {@code DefaultStepConfiguration}. + * + * @param methods a map of methods to call when configuring a step where the keys are the method names and the + *values are the list of arguments to apply to that method + */ +public DefaultStepConfiguration(final LinkedHashMap> methods) { +this(null, methods); +} + +/** + * Creates a new {@code DefaultStepConfiguration} with a validation option to ensure that the configuration is + * applied to the right type of step. + * + * @param expects the step type that this
[09/23] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Conflicts: docs/src/tutorials/getting-started/index.asciidoc Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2862ff98 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2862ff98 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2862ff98 Branch: refs/heads/shortest-path-wip Commit: 2862ff989c810710583f3157a66cb9ef73f3d968 Parents: ae9d7f6 6feff18 Author: Stephen Mallette Authored: Tue May 29 12:53:22 2018 -0400 Committer: Stephen Mallette Committed: Tue May 29 12:53:22 2018 -0400 -- docs/src/dev/provider/index.asciidoc| 80 ++ .../src/reference/gremlin-applications.asciidoc | 5 +- .../reference/implementations-neo4j.asciidoc| 10 +- docs/src/reference/intro.asciidoc | 148 ++- docs/src/reference/the-graph.asciidoc | 40 ++--- 5 files changed, 126 insertions(+), 157 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2862ff98/docs/src/dev/provider/index.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2862ff98/docs/src/reference/gremlin-applications.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2862ff98/docs/src/reference/implementations-neo4j.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2862ff98/docs/src/reference/the-graph.asciidoc --
[11/23] tinkerpop git commit: Added exakat.io to powered by listing CTR
Added exakat.io to powered by listing CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/dbf3a0e9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/dbf3a0e9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/dbf3a0e9 Branch: refs/heads/shortest-path-wip Commit: dbf3a0e9d4d3952de534dd437507f367b78bc629 Parents: 51f0ae6 Author: Stephen Mallette Authored: Tue May 29 13:13:00 2018 -0400 Committer: Stephen Mallette Committed: Tue May 29 13:13:00 2018 -0400 -- docs/site/home/index.html | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/dbf3a0e9/docs/site/home/index.html -- diff --git a/docs/site/home/index.html b/docs/site/home/index.html index 73218e0..d882049 100644 --- a/docs/site/home/index.html +++ b/docs/site/home/index.html @@ -279,6 +279,7 @@ limitations under the License. Powered By +https://www.exakat.io/;>exakat.io - Static analysis engine for PHP, powered by Gremlin. https://bricaud.github.io/graphexp/graphexp.html;>Graphexp - Interactive visualization of the Gremlin graph database with D3.js. http://www.pitneybowes.com/us/customer-information-management/data-integration-management/spectrum-data-hub-module.html;>Pitney Bowes Spectrum Data Hub Module - Uses Gremlin OLTP to query Neo4j-powered master data management based graph database.
[03/23] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d975e191 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d975e191 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d975e191 Branch: refs/heads/shortest-path-wip Commit: d975e1917272ea12c019b77f72953345fa59036f Parents: 3891777 7c70013 Author: Daniel Kuppitz Authored: Tue May 22 08:44:12 2018 -0700 Committer: Daniel Kuppitz Committed: Tue May 22 08:44:12 2018 -0700 -- CHANGELOG.asciidoc | 1 + gremlin-test/features/map/Select.feature| 20 .../process/traversal/step/map/SelectTest.java | 15 .../optimization/TinkerGraphCountStrategy.java | 2 +- .../TinkerGraphCountStrategyTest.java | 25 5 files changed, 52 insertions(+), 11 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d975e191/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d975e191/gremlin-test/features/map/Select.feature -- diff --cc gremlin-test/features/map/Select.feature index 341a378,1e45a0e..788eda7 --- a/gremlin-test/features/map/Select.feature +++ b/gremlin-test/features/map/Select.feature @@@ -516,46 -516,22 +516,66 @@@ Feature: Step - select( | d[2].l | | d[2].l | + Scenario: g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX +Given the modern graph +And the traversal of + """ + g.V().as("a").group("m").by().by(__.bothE().count()).barrier().select("m").select(__.select("a")) + """ +When iterated to list +Then the result should be unordered + | result | + | d[3].l | + | d[1].l | + | d[3].l | + | d[3].l | + | d[1].l | + | d[1].l | + + Scenario: g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX_byXmathX_plus_XX +Given the modern graph +And the traversal of + """ + g.V().as("a").group("m").by().by(__.bothE().count()).barrier().select("m").select(__.select("a")).by(__.math("_+_")) + """ +When iterated to list +Then the result should be unordered + | result | + | d[6].d | + | d[2].d | + | d[6].d | + | d[6].d | + | d[2].d | + | d[2].d | + + Scenario: g_V_asXaX_outXknowsX_asXaX_selectXall_constantXaXX +Given the modern graph +And the traversal of + """ + g.V().as("a").out("knows").as("a").select(Pop.all, __.constant("a")) + """ +When iterated to list +Then the result should be unordered + | result | + | l[v[marko],v[vadas]] | + | l[v[marko],v[josh]] | ++ + Scenario: g_V_selectXaX + Given the modern graph + And the traversal of + """ + g.V().select("a") + """ + When iterated to list + Then the result should be empty + + Scenario: g_V_selectXaX_count + Given the modern graph + And the traversal of + """ + g.V().select("a").count() + """ + When iterated to list + Then the result should be unordered + | result | + | d[0].l | http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d975e191/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java -- diff --cc gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java index 72a1872,3d778e4..20eee0f --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/map/SelectTest.java @@@ -83,12 -83,8 +83,14 @@@ public abstract class SelectTest extend public abstract Traversal get_g_V_chooseXoutE_count_isX0X__asXaX__asXbXX_chooseXselectXaX__selectXaX__selectXbXX(); +public abstract Traversal get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX(); + +public abstract Traversal get_g_V_asXaX_groupXmX_by_byXbothE_countX_barrier_selectXmX_selectXselectXaXX_byXmathX_plus_XX(); + +public abstract Traversal> get_g_V_asXaX_outXknowsX_asXaX_selectXall_constantXaXX(); + + public abstract Traversal get_g_V_selectXaX_count(); + // below are original back()-tests public abstract Traversal get_g_VX1X_asXhereX_out_selectXhereX(final Object v1Id); @@@ -349,31 -348,12 +351,39 @@@ @Test @LoadGraphWith(MODERN) +public void
[06/23] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ae9d7f69 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ae9d7f69 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ae9d7f69 Branch: refs/heads/shortest-path-wip Commit: ae9d7f694a11c4dd7369e0de3651092802f78c2f Parents: d975e19 9830a3f Author: Florian Hockmann Authored: Sun May 27 19:50:29 2018 +0200 Committer: Florian Hockmann Committed: Sun May 27 19:50:29 2018 +0200 -- .../src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ae9d7f69/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs --
[20/23] tinkerpop git commit: wip
wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6a40535c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6a40535c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6a40535c Branch: refs/heads/shortest-path-wip Commit: 6a40535c69c88ae62887375a6eb0fa75496c15ae Parents: 4d1b391 Author: Stephen Mallette Authored: Fri May 25 13:38:32 2018 -0400 Committer: Daniel Kuppitz Committed: Thu May 31 12:46:10 2018 -0700 -- .../gremlin/jsr223/JavaTranslator.java | 37 ++ .../gremlin/process/traversal/Bytecode.java | 16 +- .../traversal/step/StepConfiguration.java | 51 .../process/traversal/step/WithModulating.java | 26 -- .../process/traversal/step/WithModulation.java | 26 -- .../structure/io/graphson/GraphSONModule.java | 10 +++- .../io/graphson/TraversalSerializersV2d0.java | 37 -- .../io/graphson/TraversalSerializersV3d0.java | 34 - .../structure/io/gryo/GryoSerializersV1d0.java | 32 .../structure/io/gryo/GryoSerializersV3d0.java | 2 +- .../gremlin/structure/io/gryo/GryoVersion.java | 7 ++- .../process/traversal/step/StepTest.java| 2 +- .../GraphSONMapperPartialEmbeddedTypeTest.java | 10 .../structure/io/gryo/GryoMapperTest.java | 7 +++ gremlin-dotnet/glv/generate.groovy | 1 + .../gremlin/groovy/jsr223/GroovyTranslator.java | 9 +++- gremlin-python/glv/generate.groovy | 1 + 17 files changed, 244 insertions(+), 64 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6a40535c/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 7480974..4813fab 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 @@ -25,7 +25,10 @@ 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.step.StepConfiguration; import org.apache.tinkerpop.gremlin.process.traversal.step.util.BulkSet; +import org.apache.tinkerpop.gremlin.process.traversal.step.util.DefaultStepConfiguration; +import org.apache.tinkerpop.gremlin.process.traversal.step.util.StepConfigurationProxy; import org.apache.tinkerpop.gremlin.process.traversal.step.util.Tree; import org.apache.tinkerpop.gremlin.process.traversal.strategy.TraversalStrategyProxy; import org.apache.tinkerpop.gremlin.structure.util.StringFactory; @@ -119,6 +122,16 @@ public final class JavaTranslator map.put(key, translateObject(configuration.getProperty(key; return invokeStrategyCreationMethod(object, map); +} else if (object instanceof DefaultStepConfiguration) { +final Map map = new LinkedHashMap<>(); +final Configuration configuration = ((DefaultStepConfiguration) object).getConfiguration(); +configuration.getKeys().forEachRemaining(key -> map.put(key, translateObject(configuration.getProperty(key; +return invokeStepConfigurationCreationMethod(object, map); +}else if (object instanceof StepConfigurationProxy) { +final Map map = new LinkedHashMap<>(); +final Configuration configuration = ((StepConfigurationProxy) object).getConfiguration(); +configuration.getKeys().forEachRemaining(key -> map.put(key, translateObject(configuration.getProperty(key; +return invokeStepConfigurationCreationMethod(object, map); } else if (object instanceof Map) { final Map map = object instanceof Tree ? new Tree() : @@ -184,6 +197,30 @@ public final class JavaTranslator map) { +final Class stepConfigurationClass = delegate instanceof DefaultStepConfiguration ? delegate.getClass() : ((StepConfigurationProxy) delegate).getStepConfigurationClass(); +final Map methodCache = localMethodCache.computeIfAbsent(stepConfigurationClass, k -> { +final Map cacheEntry = new HashMap<>(); + +try { +cacheEntry.put("create", stepConfigurationClass.getMethod("create", Configuration.class)); +} catch (NoSuchMethodException ignored) { +//
[10/23] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/51f0ae64 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/51f0ae64 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/51f0ae64 Branch: refs/heads/shortest-path-wip Commit: 51f0ae647c1e8ea9b1d8d04bfe4be299c3a8ce00 Parents: c22182b 2862ff9 Author: Stephen Mallette Authored: Tue May 29 12:53:33 2018 -0400 Committer: Stephen Mallette Committed: Tue May 29 12:53:33 2018 -0400 -- docs/src/dev/provider/index.asciidoc| 80 ++ .../src/reference/gremlin-applications.asciidoc | 5 +- .../reference/implementations-neo4j.asciidoc| 10 +- docs/src/reference/intro.asciidoc | 148 ++- docs/src/reference/the-graph.asciidoc | 40 ++--- 5 files changed, 126 insertions(+), 157 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/51f0ae64/docs/src/dev/provider/index.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/51f0ae64/docs/src/reference/gremlin-applications.asciidoc --
[02/23] tinkerpop git commit: Merge branch 'TINKERPOP-1958' into tp32
Merge branch 'TINKERPOP-1958' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/7c700139 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/7c700139 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/7c700139 Branch: refs/heads/shortest-path-wip Commit: 7c7001394a3dd5706c5ff38bcbf5c96dd6c611fc Parents: bd85e5f 2407739 Author: Daniel Kuppitz Authored: Tue May 22 08:04:24 2018 -0700 Committer: Daniel Kuppitz Committed: Tue May 22 08:04:24 2018 -0700 -- CHANGELOG.asciidoc | 1 + .../traversal/step/map/GroovySelectTest.groovy | 5 gremlin-test/features/map/Select.feature| 22 - .../process/traversal/step/map/SelectTest.java | 15 .../optimization/TinkerGraphCountStrategy.java | 2 +- .../TinkerGraphCountStrategyTest.java | 25 6 files changed, 58 insertions(+), 12 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/7c700139/CHANGELOG.asciidoc -- diff --cc CHANGELOG.asciidoc index 395bb55,23e130e..3d33c78 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@@ -23,10 -23,7 +23,11 @@@ image::https://raw.githubusercontent.co [[release-3-2-10]] === TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET) +* Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors. +* Improved performance of `TraversalVertexProgram` and related infrastructure. +* Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects. +* Added concrete configuration methods to `SparkGraphComputer` to make a more clear API for configuring it. + * Fixed a bug in `TinkerGraphCountStrategy`, which didn't consider that certain map steps may not emit an element. [[release-3-2-9]] === TinkerPop 3.2.9 (Release Date: May 8, 2018)
[05/23] tinkerpop git commit: Make GraphSONWriter.ToDict() public CTR
Make GraphSONWriter.ToDict() public CTR This method can be used to transform an object into its GraphSON representation which is done recusively on member data. So this method is necessary to serialize complex objects with their member data. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9830a3ff Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9830a3ff Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9830a3ff Branch: refs/heads/shortest-path-wip Commit: 9830a3fffe6ec38367ec9c684d25816476605ce6 Parents: 7c70013 Author: Florian Hockmann Authored: Sun May 27 19:49:56 2018 +0200 Committer: Florian Hockmann Committed: Sun May 27 19:49:56 2018 +0200 -- .../src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9830a3ff/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs -- diff --git a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs index 7185868..8926d23 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs @@ -93,7 +93,12 @@ namespace Gremlin.Net.Structure.IO.GraphSON return JsonConvert.SerializeObject(ToDict(objectData)); } -internal dynamic ToDict(dynamic objectData) +/// +/// Transforms an object into its GraphSON representation including type information. +/// +/// The object to transform. +/// A GraphSON representation of the object ready to be serialized. +public dynamic ToDict(dynamic objectData) { var type = objectData.GetType(); if (TryGetSerializerFor(out IGraphSONSerializer serializer, type))
[22/23] tinkerpop git commit: Implemented `ShortestPathVertexProgram` and `ShortestPathVertexProgramStep`.
http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c42fb5a0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java index bc105e6..2a07723 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV2d0.java @@ -27,8 +27,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.P; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy; import org.apache.tinkerpop.gremlin.process.traversal.Traverser; -import org.apache.tinkerpop.gremlin.process.traversal.step.StepConfiguration; -import org.apache.tinkerpop.gremlin.process.traversal.step.util.StepConfigurationProxy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.TraversalStrategyProxy; import org.apache.tinkerpop.gremlin.process.traversal.util.AndP; import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP; @@ -241,23 +239,6 @@ final class TraversalSerializersV2d0 { } } -final static class StepConfigurationJacksonSerializer extends StdScalarSerializer { - -public StepConfigurationJacksonSerializer() { -super(StepConfiguration.class); -} - -@Override -public void serialize(final StepConfiguration stepConfiguration, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) -throws IOException { -jsonGenerator.writeStartObject(); -for (final Map.Entry entry : ConfigurationConverter.getMap(stepConfiguration.getConfiguration()).entrySet()) { -jsonGenerator.writeObjectField((String) entry.getKey(), entry.getValue()); -} -jsonGenerator.writeEndObject(); -} -} - /// // DESERIALIZERS // // @@ -505,18 +486,4 @@ final class TraversalSerializersV2d0 { return new TraversalStrategyProxy<>(this.clazz, new MapConfiguration(data)); } } - -final static class StepConfigurationProxyJacksonDeserializer extends AbstractObjectDeserializer { -private final Class clazz; - -public StepConfigurationProxyJacksonDeserializer(final Class clazz) { -super(StepConfigurationProxy.class); -this.clazz = clazz; -} - -@Override -public StepConfigurationProxy createObject(final Map data) { -return new StepConfigurationProxy<>(this.clazz, new MapConfiguration(data)); -} -} } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c42fb5a0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java index 59ba4a0..8086b2a 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/structure/io/graphson/TraversalSerializersV3d0.java @@ -27,8 +27,6 @@ import org.apache.tinkerpop.gremlin.process.traversal.P; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategy; import org.apache.tinkerpop.gremlin.process.traversal.Traverser; -import org.apache.tinkerpop.gremlin.process.traversal.step.StepConfiguration; -import org.apache.tinkerpop.gremlin.process.traversal.step.util.StepConfigurationProxy; import org.apache.tinkerpop.gremlin.process.traversal.strategy.TraversalStrategyProxy; import org.apache.tinkerpop.gremlin.process.traversal.util.AndP; import org.apache.tinkerpop.gremlin.process.traversal.util.ConnectiveP; @@ -236,23 +234,6 @@ final class TraversalSerializersV3d0 { } } -final static class StepConfigurationJacksonSerializer extends StdScalarSerializer { - -public StepConfigurationJacksonSerializer() { -super(StepConfiguration.class); -} - -@Override -public void serialize(final StepConfiguration stepConfiguration, final JsonGenerator jsonGenerator, final SerializerProvider serializerProvider) -throws IOException { -jsonGenerator.writeStartObject(); -for
[15/23] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Conflicts: docs/src/reference/the-traversal.asciidoc Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/78d1a62b Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/78d1a62b Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/78d1a62b Branch: refs/heads/shortest-path-wip Commit: 78d1a62b2ab96eba657ebc018a926d9be641464c Parents: 849349a 0496922 Author: Stephen Mallette Authored: Tue May 29 16:16:08 2018 -0400 Committer: Stephen Mallette Committed: Tue May 29 16:16:08 2018 -0400 -- docs/src/reference/the-traversal.asciidoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/78d1a62b/docs/src/reference/the-traversal.asciidoc -- diff --cc docs/src/reference/the-traversal.asciidoc index d61da37,60357fe..e28090a --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@@ -2961,8 -2959,7 +2961,7 @@@ g.V().as('a').out('knows').as('b') WARNING: The anonymous traversal of `where()` processes the current object "locally". In OLAP, where the atomic unit of computing is the vertex and its local "star graph," it is important that the anonymous traversal does not leave the confines of the vertex's star graph. In other words, it can not traverse to an adjacent vertex's properties or - edges. Note that is only a temporary limitation that will be addressed in a future version of TinkerPop (see - link:https://issues.apache.org/jira/browse/TINKERPOP-693[TINKERPOP-693]). -edges. ++edges. *Additional References*
[08/23] tinkerpop git commit: Removed references to Structure API from "user docs"
Removed references to Structure API from "user docs" Restricted such references to Provider documentation CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6feff186 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6feff186 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6feff186 Branch: refs/heads/shortest-path-wip Commit: 6feff186984c6b1d71ba9dc6c9ace5e59e2d09e4 Parents: 9830a3f Author: Stephen Mallette Authored: Tue May 29 12:50:59 2018 -0400 Committer: Stephen Mallette Committed: Tue May 29 12:50:59 2018 -0400 -- docs/src/dev/provider/index.asciidoc| 80 ++ .../src/reference/gremlin-applications.asciidoc | 5 +- .../reference/implementations-neo4j.asciidoc| 10 +- docs/src/reference/intro.asciidoc | 148 ++- docs/src/reference/the-graph.asciidoc | 40 ++--- .../tutorials/getting-started/index.asciidoc| 27 ++-- 6 files changed, 140 insertions(+), 170 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6feff186/docs/src/dev/provider/index.asciidoc -- diff --git a/docs/src/dev/provider/index.asciidoc b/docs/src/dev/provider/index.asciidoc index 5bc4d9e..dddcb18 100644 --- a/docs/src/dev/provider/index.asciidoc +++ b/docs/src/dev/provider/index.asciidoc @@ -46,6 +46,86 @@ provided by TinkerPop (e.g. Gremlin Console, Gremlin Server, etc.) and 3rd-party Gremlin-JS, etc.) will integrate properly. Finally, please feel free to use the logo on the left to promote your TinkerPop3 implementation. +[[graph-structure-api]] +=== Graph Structure API + +The graph structure API of TinkerPop3 provides the interfaces necessary to create a TinkerPop enabled system and +exposes the basic components of a property graph to include `Graph`, `Vertex`, `Edge`, `VertexProperty` and `Property`. +The structure API can be used directly as follows: + +[source,java] +Graph graph = TinkerGraph.open(); <1> +Vertex marko = graph.addVertex(T.label, "person", T.id, 1, "name", "marko", "age", 29); <2> +Vertex vadas = graph.addVertex(T.label, "person", T.id, 2, "name", "vadas", "age", 27); +Vertex lop = graph.addVertex(T.label, "software", T.id, 3, "name", "lop", "lang", "java"); +Vertex josh = graph.addVertex(T.label, "person", T.id, 4, "name", "josh", "age", 32); +Vertex ripple = graph.addVertex(T.label, "software", T.id, 5, "name", "ripple", "lang", "java"); +Vertex peter = graph.addVertex(T.label, "person", T.id, 6, "name", "peter", "age", 35); +marko.addEdge("knows", vadas, T.id, 7, "weight", 0.5f); <3> +marko.addEdge("knows", josh, T.id, 8, "weight", 1.0f); +marko.addEdge("created", lop, T.id, 9, "weight", 0.4f); +josh.addEdge("created", ripple, T.id, 10, "weight", 1.0f); +josh.addEdge("created", lop, T.id, 11, "weight", 0.4f); +peter.addEdge("created", lop, T.id, 12, "weight", 0.2f); + +<1> Create a new in-memory `TinkerGraph` and assign it to the variable `graph`. +<2> Create a vertex along with a set of key/value pairs with `T.label` being the vertex label and `T.id` being the vertex id. +<3> Create an edge along with a set of key/value pairs with the edge label being specified as the first argument. + +In the above code all the vertices are created first and then their respective edges. There are two "accessor tokens": +`T.id` and `T.label`. When any of these, along with a set of other key value pairs is provided to +`Graph.addVertex(Object...)` or `Vertex.addEdge(String,Vertex,Object...)`, the respective element is created along +with the provided key/value pair properties appended to it. + +Below is a sequence of basic graph mutation operations represented in Java 8. One of the major differences between +TinkerPop2 and TinkerPop3 is that in TinkerPop3, the Java convention of using setters and getters has been abandoned +in favor of a syntax that is more aligned with the syntax of Gremlin-Groovy in TinkerPop2. Given that Gremlin-Java8 +and Gremlin-Groovy are nearly identical due to the inclusion of Java 8 lambdas, a big effort was made to ensure that +both languages are as similar as possible. + +image:basic-mutation.png[width=240,float=right] +[source,java] + +// create a new graph +Graph graph = TinkerGraph.open(); +// add a software vertex with a name property +Vertex gremlin = graph.addVertex(T.label, "software", + "name", "gremlin"); <1> +// only one vertex should exist +assert(IteratorUtils.count(graph.vertices()) == 1) +// no edges should exist as none have been created +assert(IteratorUtils.count(graph.edges()) == 0) +// add a new property +gremlin.property("created",2009) <2> +// add a new software vertex to the graph +Vertex blueprints = graph.addVertex(T.label,
[07/23] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c22182b8 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c22182b8 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c22182b8 Branch: refs/heads/shortest-path-wip Commit: c22182b8ca38c0c88f8ed1d6577b07cccdc429e1 Parents: f393633 ae9d7f6 Author: Florian Hockmann Authored: Sun May 27 19:50:52 2018 +0200 Committer: Florian Hockmann Committed: Sun May 27 19:50:52 2018 +0200 -- .../src/Gremlin.Net/Structure/IO/GraphSON/GraphSONWriter.cs | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) --
[13/23] tinkerpop git commit: Removed caveat from docs about stargraph limitation
Removed caveat from docs about stargraph limitation Note that TINKERPOP-693 as "crazy" so no point referencing that anymore CTR Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/1b59b9ef Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/1b59b9ef Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/1b59b9ef Branch: refs/heads/shortest-path-wip Commit: 1b59b9efdcb5c820622c15d483bae54caf2ff62a Parents: 6feff18 Author: Stephen Mallette Authored: Tue May 29 16:14:21 2018 -0400 Committer: Stephen Mallette Committed: Tue May 29 16:14:21 2018 -0400 -- docs/src/reference/the-traversal.asciidoc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/1b59b9ef/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index e2e3be2..0e7fa26 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -2845,8 +2845,7 @@ g.V().as('a').out('knows').as('b'). WARNING: The anonymous traversal of `where()` processes the current object "locally". In OLAP, where the atomic unit of computing is the vertex and its local "star graph," it is important that the anonymous traversal does not leave the confines of the vertex's star graph. In other words, it can not traverse to an adjacent vertex's properties or -edges. Note that is only a temporary limitation that will be addressed in a future version of TinkerPop3 (see -link:https://issues.apache.org/jira/browse/TINKERPOP-693[TINKERPOP-693]). +edges. *Additional References*
[13/16] tinkerpop git commit: TINKERPOP-1968 Changelog updates
TINKERPOP-1968 Changelog updates Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/2886eaff Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/2886eaff Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/2886eaff Branch: refs/heads/TINKERPOP-1968 Commit: 2886eaff212b7aa525378d8a494fe8b9138a03a2 Parents: 68ea100 Author: Stephen Mallette Authored: Tue May 22 06:17:22 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:19:43 2018 -0400 -- CHANGELOG.asciidoc | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/2886eaff/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 6a06a1a..6297210 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -27,6 +27,8 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors. * Improved performance of `TraversalVertexProgram` and related infrastructure. * Added `createGratefulDead()`to `TinkerFactory` to help make it easier to try to instantiate that toy graph. +* Added identifiers to edges in the Kitchen Sink toy graph. +* Refactored the Gremlin Server integration testing framework and streamlined that infrastructure. * Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects. * Added concrete configuration methods to `SparkGraphComputer` to make a more clear API for configuring it. * Fixed a bug in `TinkerGraphCountStrategy`, which didn't consider that certain map steps may not emit an element.
[16/16] tinkerpop git commit: TINKERPOP-1968 Javascript doesn't handle embedded list assertions.
TINKERPOP-1968 Javascript doesn't handle embedded list assertions. Had to ignore this test for now. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/68ea1009 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/68ea1009 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/68ea1009 Branch: refs/heads/TINKERPOP-1968 Commit: 68ea10091e8f529502fe4b8ee821555914d4f38c Parents: 8ff76ac Author: Stephen Mallette Authored: Mon May 21 08:56:15 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:19:43 2018 -0400 -- .../javascript/gremlin-javascript/test/cucumber/feature-steps.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68ea1009/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js index c4eaebc..53f457d 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/cucumber/feature-steps.js @@ -55,12 +55,13 @@ const parsers = [ const ignoreReason = { lambdaNotSupported: 'Lambdas are not supported on gremlin-javascript', + embeddedListAssertion: '"This test returns an embedded list in the result and the Gherkin processor does not parse that correctly"', needsFurtherInvestigation: '', }; const ignoredScenarios = { // An associative array containing the scenario name as key, for example: - // 'g_V_branchXlabel_eq_person': new IgnoreError(ignoreReason.lambdaNotSupported), + 'g_V_asXa_bX_out_asXcX_path_selectXkeysX': new IgnoreError(ignoreReason.embeddedListAssertion), }; defineSupportCode(function(methods) {
[11/16] tinkerpop git commit: TINKERPOP-1968 Open up a formerly ignored test
TINKERPOP-1968 Open up a formerly ignored test Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8ff76ac5 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8ff76ac5 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8ff76ac5 Branch: refs/heads/TINKERPOP-1968 Commit: 8ff76ac5b62781982a40d42f12132adddeb16184 Parents: d7d4652 Author: Stephen Mallette Authored: Mon May 21 08:32:03 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:19:43 2018 -0400 -- gremlin-test/features/map/Vertex.feature | 19 --- 1 file changed, 16 insertions(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ff76ac5/gremlin-test/features/map/Vertex.feature -- diff --git a/gremlin-test/features/map/Vertex.feature b/gremlin-test/features/map/Vertex.feature index 8642693..3f2a63b 100644 --- a/gremlin-test/features/map/Vertex.feature +++ b/gremlin-test/features/map/Vertex.feature @@ -449,12 +449,25 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE() | v[vadas] | | v[josh] | + # this test deviates from the setup of the java test, but the intent is the same. the java test drops lop and then + # tries to query it as part of the group of ids. here, rather than drop, we simply use an id that doesn't exist + # which is simulated by an edge identifier. Scenario: g_VX1_2_3_4X_name -Given an unsupported test -Then nothing should happen because +Given the modern graph +And using the parameter v1Id defined as "v[marko].id" +And using the parameter v2Id defined as "v[vadas].id" +And using the parameter v3Id defined as "e[marko-knows->josh].id" +And using the parameter v4Id defined as "v[josh].id" +And the traversal of """ - the test manipulates a static dataset which is not supported by the language of the feature files" + g.V(v1Id, v2Id, v3Id, v4Id).values("name") """ +When iterated to list +Then the result should be unordered + | result | + | marko | + | vadas | + | josh | Scenario: g_V_hasLabelXpersonX_V_hasLabelXsoftwareX_name Given the modern graph
[14/16] tinkerpop git commit: TINKERPOP-1968 Have one method of ignoring tests.
TINKERPOP-1968 Have one method of ignoring tests. Tests that should be ignored are "unsupported" in the .feature files. The validator doesn't need a second level of filtering for that. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/d7d46522 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/d7d46522 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/d7d46522 Branch: refs/heads/TINKERPOP-1968 Commit: d7d4652240df0c8cc419fc90435f89285c01613e Parents: 88f88d9 Author: Stephen Mallette Authored: Mon May 21 07:46:07 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:19:43 2018 -0400 -- gremlin-test/features/map/AddVertex.feature | 16 - gremlin-test/features/map/Properties.feature| 16 - gremlin-test/features/sideEffect/Sack.feature | 24 +++- .../gremlin/process/FeatureCoverageTest.java| 16 - 4 files changed, 53 insertions(+), 19 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d7d46522/gremlin-test/features/map/AddVertex.feature -- diff --git a/gremlin-test/features/map/AddVertex.feature b/gremlin-test/features/map/AddVertex.feature index 996521b..c684b3b 100644 --- a/gremlin-test/features/map/AddVertex.feature +++ b/gremlin-test/features/map/AddVertex.feature @@ -334,4 +334,18 @@ Feature: Step - addV() Then the result should be unordered | result | | marko | -And the graph should return 2 for count of "g.V().has(\"name\",\"marko\")" \ No newline at end of file +And the graph should return 2 for count of "g.V().has(\"name\",\"marko\")" + + Scenario: g_V_addVXlabel_animal_age_0X +Given an unsupported test +Then nothing should happen because + """ + This API is deprecated - will not test. + """ + + Scenario: g_addVXlabel_person_name_stephenX +Given an unsupported test +Then nothing should happen because + """ + This API is deprecated - will not test. + """ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d7d46522/gremlin-test/features/map/Properties.feature -- diff --git a/gremlin-test/features/map/Properties.feature b/gremlin-test/features/map/Properties.feature index 5e61615..52376ec 100644 --- a/gremlin-test/features/map/Properties.feature +++ b/gremlin-test/features/map/Properties.feature @@ -65,4 +65,18 @@ Feature: Step - properties() | josh | | d[32].i | | peter | - | d[35].i | \ No newline at end of file + | d[35].i | + + Scenario: g_V_hasXageX_properties_hasXid_nameIdX_value +Given an unsupported test +Then nothing should happen because + """ + GLV suite doesn't support property identifiers and related assertions + """ + + Scenario: g_V_hasXageX_properties_hasXid_nameIdAsStringX_value +Given an unsupported test +Then nothing should happen because + """ + GLV suite doesn't support property identifiers and related assertions + """ \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/d7d46522/gremlin-test/features/sideEffect/Sack.feature -- diff --git a/gremlin-test/features/sideEffect/Sack.feature b/gremlin-test/features/sideEffect/Sack.feature index 8d97c0c..aaf248d 100644 --- a/gremlin-test/features/sideEffect/Sack.feature +++ b/gremlin-test/features/sideEffect/Sack.feature @@ -108,4 +108,26 @@ Feature: Step - sack() Then the result should be unordered | result | | d[1.0].m | - | d[1.0].m | \ No newline at end of file + | d[1.0].m | + + Scenario: g_withSackXBigInteger_TEN_powX1000X_assignX_V_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack +Given an unsupported test +Then nothing should happen because + """ + GLV Suite does not support BigInteger assignments at this time. + """ + + Scenario: g_withSackXmap__map_cloneX_V_out_out_sackXmap_a_nameX_sack +Given an unsupported test +Then nothing should happen because + """ + This test is bound pretty tightly to the JVM in that it requires a UnaryOperator cast to get the right + withSack() method called. Not sure how that would work with a GLV. + """ + + Scenario: g_withSackX2X_V_sackXdivX_byXconstantX3_0XX_sack +Given an unsupported test +Then nothing should happen because + """ + Something strange happens with rounding that prevents GLVs from asserting this result properly. + """ \ No newline at end of file
[15/16] tinkerpop git commit: TINKERPOP-1968 Removed embedded list test from ignored validation
TINKERPOP-1968 Removed embedded list test from ignored validation Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/88f88d91 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/88f88d91 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/88f88d91 Branch: refs/heads/TINKERPOP-1968 Commit: 88f88d9109a9056c2675a87e5ac9cbcbd30b479d Parents: 35b1ff9 Author: Stephen Mallette Authored: Mon May 21 07:07:20 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:19:43 2018 -0400 -- .../org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java | 2 -- 1 file changed, 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/88f88d91/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java -- diff --git a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java index ceef0d6..181cd17 100644 --- a/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java +++ b/gremlin-test/src/test/java/org/apache/tinkerpop/gremlin/process/FeatureCoverageTest.java @@ -105,8 +105,6 @@ public class FeatureCoverageTest { // GLV suite doesn't support property identifiers and related assertions "g_V_hasXageX_properties_hasXid_nameIdX_value", "g_V_hasXageX_properties_hasXid_nameIdAsStringX_value", -// assertion doesn't seem to want to work right for embedded lists -"g_V_asXa_bX_out_asXcX_path_selectXkeysX", // ugh - BigInteger? "g_withSackXBigInteger_TEN_powX1000X_assignX_V_localXoutXknowsX_barrierXnormSackXX_inXknowsX_barrier_sack", // ugh - clone
[01/16] tinkerpop git commit: TINKERPOP-1963 Fixed branch() problems with reducing steps as options [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1968 646356d3b -> 2886eaff2 (forced update) TINKERPOP-1963 Fixed branch() problems with reducing steps as options Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9952bcf7 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9952bcf7 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9952bcf7 Branch: refs/heads/TINKERPOP-1968 Commit: 9952bcf7c2e5907276978fc02ad44329b11e1ce1 Parents: 7c69607 Author: Stephen Mallette Authored: Wed May 9 17:52:32 2018 -0400 Committer: Stephen Mallette Committed: Mon May 21 12:14:21 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../traversal/step/branch/BranchStep.java | 42 +--- .../step/util/ReducingBarrierStep.java | 1 - .../Gherkin/GherkinTestRunner.cs| 6 ++- .../step/branch/GroovyChooseTest.groovy | 11 + gremlin-test/features/branch/Choose.feature | 27 + .../traversal/step/branch/ChooseTest.java | 35 7 files changed, 115 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9952bcf7/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index b286dcb..0008a1a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -23,6 +23,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima [[release-3-2-10]] === TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET) +* Fixed bug in `branch()` where reducing steps as options would produce incorrect results. * Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors. * Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9952bcf7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java index 778722d..0b1a059 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java @@ -22,7 +22,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.Traverser; import org.apache.tinkerpop.gremlin.process.traversal.step.Barrier; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent; +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.IdentityStep; import org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep; import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException; import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper; @@ -62,7 +64,13 @@ public class BranchStep extends ComputerAwareStep implements Trav this.traversalOptions.get(pickToken).add(traversalOption); else this.traversalOptions.put(pickToken, new ArrayList<>(Collections.singletonList(traversalOption))); + +// adding an IdentityStep acts as a placeholder when reducing barriers get in the way - see the +// standardAlgorithm() method for more information. +if (TraversalHelper.hasStepOfAssignableClass(ReducingBarrierStep.class, traversalOption)) +traversalOption.addStep(0, new IdentityStep(traversalOption)); traversalOption.addStep(new EndStep(traversalOption)); + if (!this.hasBarrier && !TraversalHelper.getStepsOfAssignableClassRecursively(Barrier.class, traversalOption).isEmpty()) this.hasBarrier = true; this.integrateChild(traversalOption); @@ -89,32 +97,54 @@ public class BranchStep extends ComputerAwareStep implements Trav protected Iterator> standardAlgorithm() { while (true) { if (!this.first) { +// this block is ignored on the first pass through the while(true) giving the opportunity for +// the traversalOptions to be prepared. Iterate all of them and simply return the ones that yield +// results.
[03/16] tinkerpop git commit: TINKERPOP-1968 Simplified gremlin server test configuration
TINKERPOP-1968 Simplified gremlin server test configuration There was a fair bit of duplicated configuration for Gremlin Server testing - streamlined that to a single gremlin-server-integration.yaml file and script initializer. Tests had to become more specific as to the graphs that they were executing against as a result. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8e2749e7 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8e2749e7 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8e2749e7 Branch: refs/heads/TINKERPOP-1968 Commit: 8e2749e755db9b592878c065975f4da69e4a83ae Parents: 68bdaed Author: Stephen Mallette Authored: Fri May 18 14:38:04 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:18:08 2018 -0400 -- gremlin-dotnet/test/pom.xml | 2 +- gremlin-javascript/pom.xml | 2 +- .../test/integration/remote-connection-tests.js | 2 +- .../test/integration/traversal-test.js | 2 +- gremlin-python/pom.xml | 2 +- .../src/main/jython/tests/conftest.py | 6 +- .../src/main/jython/tests/driver/test_client.py | 14 ++--- .../driver/test_driver_remote_connection.py | 4 +- .../test_driver_remote_connection_threaded.py | 4 +- gremlin-server/scripts/generate-all.groovy | 63 gremlin-server/src/assembly/standalone.xml | 3 - .../driver/remote/RemoteGraphProvider.java | 2 +- .../server/GremlinResultSetIntegrateTest.java | 34 +-- .../server/GremlinServerHttpIntegrateTest.java | 18 ++ .../gremlin/server/ServerTestHelper.java| 7 ++- .../server/util/DefaultGraphManagerTest.java| 32 +++--- .../remote/gremlin-server-integration.yaml | 56 - .../server/gremlin-server-integration.yaml | 11 +++- .../src/test/scripts/generate-all.groovy| 31 +- .../src/test/scripts/neo4j-empty.properties | 33 ++ 20 files changed, 139 insertions(+), 189 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8e2749e7/gremlin-dotnet/test/pom.xml -- diff --git a/gremlin-dotnet/test/pom.xml b/gremlin-dotnet/test/pom.xml index db1f8ad..f8d3118 100644 --- a/gremlin-dotnet/test/pom.xml +++ b/gremlin-dotnet/test/pom.xml @@ -143,7 +143,7 @@ limitations under the License. settingsFile - ${gremlin.server.dir}/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml + ${gremlin.server.dir}/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml executionName http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8e2749e7/gremlin-javascript/pom.xml -- diff --git a/gremlin-javascript/pom.xml b/gremlin-javascript/pom.xml index a820f3b..b01b2b9 100644 --- a/gremlin-javascript/pom.xml +++ b/gremlin-javascript/pom.xml @@ -114,7 +114,7 @@ limitations under the License. settingsFile - ${gremlin.server.dir}/src/test/resources/org/apache/tinkerpop/gremlin/driver/remote/gremlin-server-integration.yaml + ${gremlin.server.dir}/src/test/resources/org/apache/tinkerpop/gremlin/server/gremlin-server-integration.yaml executionName http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8e2749e7/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js index 9e115be..afc0e58 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js +++ b/gremlin-javascript/src/main/javascript/gremlin-javascript/test/integration/remote-connection-tests.js @@ -31,7 +31,7 @@ let connection; describe('DriverRemoteConnection', function () { before(function () { -connection =
[05/16] tinkerpop git commit: TINKERPOP-1968 Stop ignoring test that passes for python GLV
TINKERPOP-1968 Stop ignoring test that passes for python GLV Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/225508f5 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/225508f5 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/225508f5 Branch: refs/heads/TINKERPOP-1968 Commit: 225508f586755c3d24b3af880df71e55c120051e Parents: fa631e9 Author: Stephen Mallette Authored: Sat May 19 07:57:07 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:18:09 2018 -0400 -- gremlin-python/src/main/jython/radish/feature_steps.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/225508f5/gremlin-python/src/main/jython/radish/feature_steps.py -- diff --git a/gremlin-python/src/main/jython/radish/feature_steps.py b/gremlin-python/src/main/jython/radish/feature_steps.py index 80137b0..fab35fd 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -43,9 +43,7 @@ inV = __.inV project = __.project tail = __.tail -ignores = [ -"g.V(v1Id).out().inject(v2).values(\"name\")", # bug in attachment won't connect v2 - ] +ignores = [] @given("the {graph_name:w} graph")
[04/16] tinkerpop git commit: TINKERPOP-1968 Added edge ids to sink and grateful generator
TINKERPOP-1968 Added edge ids to sink and grateful generator Edge ids should have always been statically defined - not sure how/why that was missed. Also added grateful dead dataset to TinkerFactory to make that easier to programmatically setup. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/68bdaed4 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/68bdaed4 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/68bdaed4 Branch: refs/heads/TINKERPOP-1968 Commit: 68bdaed44f120f30857930f927e5faf99379b83c Parents: f411f1d Author: Stephen Mallette Authored: Fri May 18 14:34:44 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:18:08 2018 -0400 -- CHANGELOG.asciidoc | 1 + data/tinkerpop-sink-typed.json | 6 +- data/tinkerpop-sink-v2d0-typed.json | 6 +- data/tinkerpop-sink-v2d0.json | 6 +- data/tinkerpop-sink.json| 6 +- data/tinkerpop-sink.kryo| Bin 234 -> 240 bytes .../io/graphson/tinkerpop-sink-typed.json | 6 +- .../io/graphson/tinkerpop-sink-v2d0-typed.json | 6 +- .../io/graphson/tinkerpop-sink-v2d0.json| 6 +- .../structure/io/graphson/tinkerpop-sink.json | 6 +- .../structure/io/gryo/tinkerpop-sink.kryo | Bin 234 -> 240 bytes .../tinkergraph/structure/TinkerFactory.java| 82 ++- 12 files changed, 104 insertions(+), 27 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68bdaed4/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 6251b6d..6a06a1a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -26,6 +26,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima * Fixed bug in `branch()` where reducing steps as options would produce incorrect results. * Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors. * Improved performance of `TraversalVertexProgram` and related infrastructure. +* Added `createGratefulDead()`to `TinkerFactory` to help make it easier to try to instantiate that toy graph. * Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects. * Added concrete configuration methods to `SparkGraphComputer` to make a more clear API for configuring it. * Fixed a bug in `TinkerGraphCountStrategy`, which didn't consider that certain map steps may not emit an element. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/68bdaed4/data/tinkerpop-sink-typed.json -- diff --git a/data/tinkerpop-sink-typed.json b/data/tinkerpop-sink-typed.json index 2e83384..9f16788 100644 --- a/data/tinkerpop-sink-typed.json +++ b/data/tinkerpop-sink-typed.json @@ -1,3 +1,3 @@ -{"@class":"java.util.HashMap","id":2000,"label":"message","inE":{"@class":"java.util.HashMap","link":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":5,"outV":2000}]]},"outE":{"@class":"java.util.HashMap","link":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"inV":2001},{"@class":"java.util.HashMap","id":5,"inV":2000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",2],"value":"a"}]]}} -{"@class":"java.util.HashMap","id":2001,"label":"message","inE":{"@class":"java.util.HashMap","link":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":4,"outV":2000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",3],"value":"b"}]]}} -{"@class":"java.util.HashMap","id":1000,"label":"loops","inE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":1,"outV":1000}]]},"outE":{"@class":"java.util.HashMap","self":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":1,"inV":1000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",0],"value":"loop"}]]}} +{"@class":"java.util.HashMap","id":2000,"label":"message","inE":{"@class":"java.util.HashMap","link":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":2003,"outV":2000}]]},"outE":{"@class":"java.util.HashMap","link":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":2002,"inV":2001},{"@class":"java.util.HashMap","id":2003,"inV":2000}]]},"properties":{"@class":"java.util.HashMap","name":["java.util.ArrayList",[{"@class":"java.util.HashMap","id":["java.lang.Long",1],"value":"a"}]]}}
[10/16] tinkerpop git commit: TINKERPOP-1968 Embedded list tests only pass for js at this point
TINKERPOP-1968 Embedded list tests only pass for js at this point Creating issues for .net and python. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/735f89b9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/735f89b9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/735f89b9 Branch: refs/heads/TINKERPOP-1968 Commit: 735f89b970dd208ebb83d80a906b8d27aacba418 Parents: 225508f Author: Stephen Mallette Authored: Mon May 21 06:57:36 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:19:43 2018 -0400 -- .../Gherkin/GherkinTestRunner.cs | 3 ++- .../Gherkin/IgnoreException.cs| 6 +- .../src/main/jython/radish/feature_steps.py | 2 +- gremlin-test/features/map/Select.feature | 18 +- gremlin-test/features/sideEffect/Group.feature| 1 - 5 files changed, 25 insertions(+), 5 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/735f89b9/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs -- diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs index 3802da5..787cca9 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs @@ -41,7 +41,8 @@ namespace Gremlin.Net.IntegrationTest.Gherkin new Dictionary() { { "g_injectX1X_chooseXisX1X__constantX10Xfold__foldX", IgnoreReason.NoReason }, -{ "g_injectX2X_chooseXisX1X__constantX10Xfold__foldX", IgnoreReason.NoReason } +{ "g_injectX2X_chooseXisX1X__constantX10Xfold__foldX", IgnoreReason.NoReason }, +{ "g_V_asXa_bX_out_asXcX_path_selectXkeysX", IgnoreReason.EmbeddedListAssertion } }; private static class Keywords http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/735f89b9/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs -- diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs index 860c11d..368713d 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/IgnoreException.cs @@ -40,6 +40,9 @@ namespace Gremlin.Net.IntegrationTest.Gherkin string reasonSuffix = null; switch (reason) { +case IgnoreReason.EmbeddedListAssertion: +reasonSuffix = "This test returns an embedded list in the result and the Gherkin processor does not parse that correctly"; +break; case IgnoreReason.NoReason: reasonSuffix = ""; break; @@ -50,6 +53,7 @@ namespace Gremlin.Net.IntegrationTest.Gherkin public enum IgnoreReason { -NoReason +NoReason, +EmbeddedListAssertion } } \ No newline at end of file http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/735f89b9/gremlin-python/src/main/jython/radish/feature_steps.py -- diff --git a/gremlin-python/src/main/jython/radish/feature_steps.py b/gremlin-python/src/main/jython/radish/feature_steps.py index fab35fd..5067d1b 100644 --- a/gremlin-python/src/main/jython/radish/feature_steps.py +++ b/gremlin-python/src/main/jython/radish/feature_steps.py @@ -43,7 +43,7 @@ inV = __.inV project = __.project tail = __.tail -ignores = [] +ignores = ["g.V().as(\"a\", \"b\").out().as(\"c\").path().select(Column.keys)"] @given("the {graph_name:w} graph") http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/735f89b9/gremlin-test/features/map/Select.feature -- diff --git a/gremlin-test/features/map/Select.feature b/gremlin-test/features/map/Select.feature index db79c15..4765f59 100644 --- a/gremlin-test/features/map/Select.feature +++ b/gremlin-test/features/map/Select.feature @@ -669,4 +669,20 @@ Feature: Step - select() g.V().valueMap().select(Pop.all, "a","b") """ When iterated to list -Then the result should be empty \ No newline at end of file +Then the result should be empty + + Scenario: g_V_asXa_bX_out_asXcX_path_selectXkeysX +Given the modern graph +And the traversal of + """ +
[09/16] tinkerpop git commit: TINKERPOP-1968 Make Pop tests more GLV friendly
TINKERPOP-1968 Make Pop tests more GLV friendly The java/groovy tests were nicer before, but they don't translate to GLV tests well. Had to change them to get them off the ignore list. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/fa631e98 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/fa631e98 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/fa631e98 Branch: refs/heads/TINKERPOP-1968 Commit: fa631e98381f283ef8d684c0a458fae8afe3529c Parents: f6d76f9 Author: Stephen Mallette Authored: Sat May 19 07:16:09 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:18:09 2018 -0400 -- .../traversal/step/map/GroovySelectTest.groovy | 80 +- gremlin-test/features/map/Select.feature| 135 ++ .../process/traversal/step/map/SelectTest.java | 245 --- .../gremlin/process/FeatureCoverageTest.java| 5 - 4 files changed, 409 insertions(+), 56 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/fa631e98/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySelectTest.groovy -- diff --git a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySelectTest.groovy b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySelectTest.groovy index 104322d..6f5b73b 100644 --- a/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySelectTest.groovy +++ b/gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/map/GroovySelectTest.groovy @@ -177,27 +177,83 @@ public abstract class GroovySelectTest { // TINKERPOP-619: select should not throw @Override -public Traversal get_g_V_selectXaX(final Pop pop) { -final String root = "g.V." -new ScriptTraversal<>(g, "gremlin-groovy", root + (null == pop ? "select('a')" : "select(${pop}, 'a')")) +public Traversal get_g_V_selectXaX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V.select('a')") } @Override -public Traversal> get_g_V_selectXa_bX(final Pop pop) { -final String root = "g.V." -new ScriptTraversal<>(g, "gremlin-groovy", root + (null == pop ? "select('a', 'b')" : "select(${pop}, 'a', 'b')")) +public Traversal> get_g_V_selectXa_bX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V.select('a', 'b')") } @Override -public Traversal get_g_V_valueMap_selectXpop_aX(final Pop pop) { -final String root = "g.V.valueMap." -new ScriptTraversal<>(g, "gremlin-groovy", root + (null == pop ? "select('a')" : "select(${pop}, 'a')")) +public Traversal get_g_V_valueMap_selectXaX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V.valueMap().select('a')") } @Override -public Traversal> get_g_V_valueMap_selectXpop_a_bX(final Pop pop) { -final String root = "g.V.valueMap." -new ScriptTraversal<>(g, "gremlin-groovy", root + (null == pop ? "select('a', 'b')" : "select(${pop}, 'a', 'b')")) +public Traversal> get_g_V_valueMap_selectXa_bX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V.valueMap().select('a', 'b')") +} + +@Override +public Traversal get_g_V_selectXfirst_aX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V.select(Pop.first, 'a')") +} + +@Override +public Traversal> get_g_V_selectXfirst_a_bX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V.select(Pop.first, 'a', 'b')") +} + +@Override +public Traversal get_g_V_valueMap_selectXfirst_aX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V.valueMap().select(Pop.first, 'a')") +} + +@Override +public Traversal> get_g_V_valueMap_selectXfirst_a_bX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V.valueMap().select(Pop.first, 'a', 'b')") +} + +@Override +public Traversal get_g_V_selectXlast_aX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V.select(Pop.last, 'a')") +} + +@Override +public Traversal> get_g_V_selectXlast_a_bX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V.select(Pop.last, 'a', 'b')") +} + +@Override +public Traversal get_g_V_valueMap_selectXlast_aX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V.valueMap().select(Pop.last, 'a')") +} + +@Override +
[08/16] tinkerpop git commit: TINKERPOP-1968 Configured all the match() tests for GLV
TINKERPOP-1968 Configured all the match() tests for GLV These were ignored because grateful dead wasn't an available graph, but it's been available for a while now so i'm not sure why those weren't setup. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/bd199349 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/bd199349 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/bd199349 Branch: refs/heads/TINKERPOP-1968 Commit: bd1993494c870f0f33b7b4120e6b4e2b461c86f4 Parents: 5c50772 Author: Stephen Mallette Authored: Fri May 18 16:17:11 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:18:09 2018 -0400 -- .../ModernGraphTypeInformation.cs | 3 +- gremlin-test/features/map/Match.feature | 134 ++ gremlin-test/features/map/Order.feature | 173 +++ gremlin-test/features/map/Properties.feature| 14 ++ .../gremlin/process/FeatureCoverageTest.java| 16 -- 5 files changed, 323 insertions(+), 17 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bd199349/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/ModernGraphTypeInformation.cs -- diff --git a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/ModernGraphTypeInformation.cs b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/ModernGraphTypeInformation.cs index 327a50a..7489b44 100644 --- a/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/ModernGraphTypeInformation.cs +++ b/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/TraversalEvaluation/ModernGraphTypeInformation.cs @@ -39,7 +39,8 @@ namespace Gremlin.Net.IntegrationTest.Gherkin.TraversalEvaluation {"lang", typeof(string)}, {"weight", typeof(float)}, {"foo", typeof(object)}, // used when for invalid property key lookups -{"friendWeight", typeof(float)} // used in an AddVertex.feature test +{"friendWeight", typeof(float)}, // used in an AddVertex.feature test +{"performances", typeof(int)} // grateful dead graph }; /// http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/bd199349/gremlin-test/features/map/Match.feature -- diff --git a/gremlin-test/features/map/Match.feature b/gremlin-test/features/map/Match.feature index 55dffcf..73afd71 100644 --- a/gremlin-test/features/map/Match.feature +++ b/gremlin-test/features/map/Match.feature @@ -393,3 +393,137 @@ Feature: Step - match() | d[0].l | | d[0].l | + Scenario: g_V_matchXa_0sungBy_b__a_0writtenBy_c__b_writtenBy_d__c_sungBy_d__d_hasXname_GarciaXX +Given the grateful graph +And the traversal of + """ + g.V().match(__.as("a").in("sungBy").as("b"), + __.as("a").in("writtenBy").as("c"), + __.as("b").out("writtenBy").as("d"), + __.as("c").out("sungBy").as("d"), + __.as("d").has("name", "Garcia")) + """ +When iterated to list +Then the result should be unordered + | result | + | m[{"a":"v[Garcia]","b":"v[CREAM PUFF WAR]","c":"v[CREAM PUFF WAR]","d":"v[Garcia]"}] | + | m[{"a":"v[Garcia]","b":"v[CREAM PUFF WAR]","c":"v[CRYPTICAL ENVELOPMENT]","d":"v[Garcia]"}] | + | m[{"a":"v[Garcia]","b":"v[CRYPTICAL ENVELOPMENT]","c":"v[CREAM PUFF WAR]","d":"v[Garcia]"}] | + | m[{"a":"v[Garcia]","b":"v[CRYPTICAL ENVELOPMENT]","c":"v[CRYPTICAL ENVELOPMENT]","d":"v[Garcia]"}] | + | m[{"a":"v[Grateful_Dead]","b":"v[CANT COME DOWN]","c":"v[DOWN SO LONG]","d":"v[Garcia]"}] | + | m[{"a":"v[Grateful_Dead]","b":"v[THE ONLY TIME IS NOW]","c":"v[DOWN SO LONG]","d":"v[Garcia]"}] | + + Scenario: g_V_matchXa_hasXsong_name_sunshineX__a_mapX0followedBy_weight_meanX_b__a_0followedBy_c__c_filterXweight_whereXgteXbXXX_outV_dX_selectXdX_byXnameX +Given the grateful graph +And the traversal of + """ + g.V().match(__.as("a").has("song", "name", "HERE COMES SUNSHINE"), + __.as("a").map(__.inE("followedBy").values("weight").mean()).as("b"), + __.as("a").inE("followedBy").as("c"), + __.as("c").filter(__.values("weight").where(P.gte("b"))).outV().as("d")). +select("d").by("name") + """ +When iterated to list +Then the result should be unordered + | result | + | THE MUSIC NEVER STOPPED | + | PROMISED LAND | + | PLAYING IN THE BAND | + | CASEY JONES | + | BIG RIVER | + | EL PASO
[06/16] tinkerpop git commit: TINKERPOP-1968 Enabled GLV tests for self loops
TINKERPOP-1968 Enabled GLV tests for self loops Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5c50772c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5c50772c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5c50772c Branch: refs/heads/TINKERPOP-1968 Commit: 5c50772cb6b3d1287ff9e726f89816f3de9562ce Parents: 8e2749e Author: Stephen Mallette Authored: Fri May 18 14:39:53 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:18:09 2018 -0400 -- .../traversal/step/map/GroovyVertexTest.groovy | 8 +++--- gremlin-test/features/map/Vertex.feature| 26 ++- .../process/traversal/step/map/VertexTest.java | 27 ++-- .../gremlin/process/FeatureCoverageTest.java| 3 --- 4 files changed, 42 insertions(+), 22 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5c50772c/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 ff6275d..cd43ad0 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 @@ -185,13 +185,13 @@ public abstract class GroovyVertexTest { } @Override -public Traversal get_g_V_bothEXselfX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V().bothE('self')") +public Traversal get_g_V_hasLabelXloopsX_bothEXselfX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V().hasLabel('loops').bothE('self')") } @Override -public Traversal get_g_V_bothXselfX() { -new ScriptTraversal<>(g, "gremlin-groovy", "g.V().both('self')") +public Traversal get_g_V_hasLabelXloopsX_bothXselfX() { +new ScriptTraversal<>(g, "gremlin-groovy", "g.V().hasLabel('loops').both('self')") } } } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5c50772c/gremlin-test/features/map/Vertex.feature -- diff --git a/gremlin-test/features/map/Vertex.feature b/gremlin-test/features/map/Vertex.feature index 569fb6f..8642693 100644 --- a/gremlin-test/features/map/Vertex.feature +++ b/gremlin-test/features/map/Vertex.feature @@ -472,4 +472,28 @@ Feature: Step - V(), E(), out(), in(), both(), inE(), outE(), bothE() | ripple | | ripple | | ripple | - | ripple | \ No newline at end of file + | ripple | + + Scenario: g_V_hasLabelXloopsX_bothEXselfX +Given the sink graph +And the traversal of +""" +g.V().hasLabel("loops").bothE("self") +""" +When iterated to list +Then the result should be unordered + | result | + | e[loop-self->loop] | + | e[loop-self->loop] | + + Scenario: g_V_hasLabelXloopsX_bothXselfX +Given the sink graph +And the traversal of +""" +g.V().hasLabel("loops").both("self") +""" +When iterated to list +Then the result should be unordered + | result | + | v[loop] | + | v[loop] | http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5c50772c/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 8a57535..7908952 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 @@ -41,6 +41,7 @@ import java.util.Map; import java.util.Set; import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.MODERN; +import static org.apache.tinkerpop.gremlin.LoadGraphWith.GraphData.SINK; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; @@ -113,9 +114,9 @@ public abstract class VertexTest extends AbstractGremlinProcessTest { public abstract Traversal get_g_V_hasLabelXpersonX_V_hasLabelXsoftwareX_name(); -public abstract Traversal
[07/16] tinkerpop git commit: TINKERPOP-1968 Minor change to loading Grateful from TinkerFactory
TINKERPOP-1968 Minor change to loading Grateful from TinkerFactory Decided to load it from a resources in tinkergraph-gremlin. Seemed to better than relying on the local file system. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f6d76f9f Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f6d76f9f Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f6d76f9f Branch: refs/heads/TINKERPOP-1968 Commit: f6d76f9fa16980f85e86b595d2e0c06e4d1cfc86 Parents: bd19934 Author: Stephen Mallette Authored: Fri May 18 18:39:39 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:18:09 2018 -0400 -- .../the-gremlin-console/index.asciidoc | 5 ++- .../upgrade/release-3.2.x-incubating.asciidoc | 8 + tinkergraph-gremlin/pom.xml | 19 +++ .../tinkergraph/structure/TinkerFactory.java| 32 --- .../tinkergraph/structure/grateful-dead.kryo| Bin 0 -> 332226 bytes 5 files changed, 36 insertions(+), 28 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6d76f9f/docs/src/tutorials/the-gremlin-console/index.asciidoc -- diff --git a/docs/src/tutorials/the-gremlin-console/index.asciidoc b/docs/src/tutorials/the-gremlin-console/index.asciidoc index da8bac3..cc090d9 100644 --- a/docs/src/tutorials/the-gremlin-console/index.asciidoc +++ b/docs/src/tutorials/the-gremlin-console/index.asciidoc @@ -117,9 +117,8 @@ However, if you find that a larger graph might be helpful, there is another opti [gremlin-groovy] -graph = TinkerGraph.open() -graph.io(gryo()).readGraph('data/grateful-dead.kryo') -graph +graph = TinkerFactory.createGratefulDead() +g = graph.traversal() The Grateful Dead graph ships with the Gremlin Console and the data can be found in several formats (along with the http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6d76f9f/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 112ce22..ccdf51a 100644 --- a/docs/src/upgrade/release-3.2.x-incubating.asciidoc +++ b/docs/src/upgrade/release-3.2.x-incubating.asciidoc @@ -27,6 +27,14 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima Please see the link:https://github.com/apache/tinkerpop/blob/3.2.10/CHANGELOG.asciidoc#release-3-2-10[changelog] for a complete list of all the modifications that are part of this release. +=== Upgrading for Users + + TinkerFactory.createGratefulDead() + +The Grateful Dead dataset has been with TinkerPop since the early days of 1.x. It has always been available as a +packaged dataset that needed to be loaded through the various IO options available, while other toy graphs had the +benefit of `TinkerFactory` to help get them bootstrapped. For 3.2.10, Grateful Dead is now more conveniently loaded +via that same method as the other toy graphs with `TinkerFactory.createGratefulDead()`. == TinkerPop 3.2.9 http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f6d76f9f/tinkergraph-gremlin/pom.xml -- diff --git a/tinkergraph-gremlin/pom.xml b/tinkergraph-gremlin/pom.xml index 1ff0aa0..1432ac5 100644 --- a/tinkergraph-gremlin/pom.xml +++ b/tinkergraph-gremlin/pom.xml @@ -127,6 +127,25 @@ limitations under the License. + copy-gratefuldead-to-tinkergraph-resources +prepare-package + +copy-resources + + + src/main/resources/org/apache/tinkerpop/gremlin/tinkergraph/structure + + + ${io.tmp.dir} +false + + grateful-dead.kryo + + + + + + copy-gio-from-tmp-to-resources prepare-package
[02/16] tinkerpop git commit: Merge branch 'TINKERPOP-1963' into tp32
Merge branch 'TINKERPOP-1963' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f411f1d4 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f411f1d4 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f411f1d4 Branch: refs/heads/TINKERPOP-1968 Commit: f411f1d4e90ca565d2a58fde6fa2d4a74db8ef4b Parents: 1b59b9e 9952bcf Author: Stephen Mallette Authored: Thu May 31 15:50:27 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 15:50:27 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../traversal/step/branch/BranchStep.java | 42 +--- .../step/util/ReducingBarrierStep.java | 1 - .../Gherkin/GherkinTestRunner.cs| 6 ++- .../step/branch/GroovyChooseTest.groovy | 11 + gremlin-test/features/branch/Choose.feature | 27 + .../traversal/step/branch/ChooseTest.java | 35 7 files changed, 115 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f411f1d4/CHANGELOG.asciidoc -- diff --cc CHANGELOG.asciidoc index 3d33c78,0008a1a..6251b6d --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@@ -23,11 -23,9 +23,12 @@@ image::https://raw.githubusercontent.co [[release-3-2-10]] === TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET) + * Fixed bug in `branch()` where reducing steps as options would produce incorrect results. * Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors. +* Improved performance of `TraversalVertexProgram` and related infrastructure. * Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects. +* Added concrete configuration methods to `SparkGraphComputer` to make a more clear API for configuring it. +* Fixed a bug in `TinkerGraphCountStrategy`, which didn't consider that certain map steps may not emit an element. [[release-3-2-9]] === TinkerPop 3.2.9 (Release Date: May 8, 2018)
[4/4] tinkerpop git commit: Merge branch 'tp33'
Merge branch 'tp33' Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/ff7e75d5 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/ff7e75d5 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/ff7e75d5 Branch: refs/heads/master Commit: ff7e75d5c635dfd999fd7b14abc52f03ef9ac501 Parents: 94d0c3c 6c98a30 Author: Stephen Mallette Authored: Thu May 31 16:15:59 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 16:15:59 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../traversal/step/branch/BranchStep.java | 42 +--- .../step/util/ReducingBarrierStep.java | 1 - .../Gherkin/GherkinTestRunner.cs| 6 ++- gremlin-test/features/branch/Choose.feature | 27 + .../traversal/step/branch/ChooseTest.java | 35 6 files changed, 104 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ff7e75d5/CHANGELOG.asciidoc -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/ff7e75d5/gremlin-dotnet/test/Gremlin.Net.IntegrationTest/Gherkin/GherkinTestRunner.cs --
[3/3] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Conflicts: gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyChooseTest.groovy Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6c98a303 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6c98a303 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6c98a303 Branch: refs/heads/tp33 Commit: 6c98a30364021138a2f244edbc88c3c40fc3d189 Parents: d258071 f411f1d Author: Stephen Mallette Authored: Thu May 31 15:51:02 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 15:51:02 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../traversal/step/branch/BranchStep.java | 42 +--- .../step/util/ReducingBarrierStep.java | 1 - .../Gherkin/GherkinTestRunner.cs| 6 ++- gremlin-test/features/branch/Choose.feature | 27 + .../traversal/step/branch/ChooseTest.java | 35 6 files changed, 104 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6c98a303/CHANGELOG.asciidoc --
[1/2] tinkerpop git commit: TINKERPOP-1963 Fixed branch() problems with reducing steps as options
Repository: tinkerpop Updated Branches: refs/heads/tp32 1b59b9efd -> f411f1d4e TINKERPOP-1963 Fixed branch() problems with reducing steps as options Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9952bcf7 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9952bcf7 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9952bcf7 Branch: refs/heads/tp32 Commit: 9952bcf7c2e5907276978fc02ad44329b11e1ce1 Parents: 7c69607 Author: Stephen Mallette Authored: Wed May 9 17:52:32 2018 -0400 Committer: Stephen Mallette Committed: Mon May 21 12:14:21 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../traversal/step/branch/BranchStep.java | 42 +--- .../step/util/ReducingBarrierStep.java | 1 - .../Gherkin/GherkinTestRunner.cs| 6 ++- .../step/branch/GroovyChooseTest.groovy | 11 + gremlin-test/features/branch/Choose.feature | 27 + .../traversal/step/branch/ChooseTest.java | 35 7 files changed, 115 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9952bcf7/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index b286dcb..0008a1a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -23,6 +23,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima [[release-3-2-10]] === TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET) +* Fixed bug in `branch()` where reducing steps as options would produce incorrect results. * Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors. * Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9952bcf7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java index 778722d..0b1a059 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java @@ -22,7 +22,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.Traverser; import org.apache.tinkerpop.gremlin.process.traversal.step.Barrier; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent; +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.IdentityStep; import org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep; import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException; import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper; @@ -62,7 +64,13 @@ public class BranchStep extends ComputerAwareStep implements Trav this.traversalOptions.get(pickToken).add(traversalOption); else this.traversalOptions.put(pickToken, new ArrayList<>(Collections.singletonList(traversalOption))); + +// adding an IdentityStep acts as a placeholder when reducing barriers get in the way - see the +// standardAlgorithm() method for more information. +if (TraversalHelper.hasStepOfAssignableClass(ReducingBarrierStep.class, traversalOption)) +traversalOption.addStep(0, new IdentityStep(traversalOption)); traversalOption.addStep(new EndStep(traversalOption)); + if (!this.hasBarrier && !TraversalHelper.getStepsOfAssignableClassRecursively(Barrier.class, traversalOption).isEmpty()) this.hasBarrier = true; this.integrateChild(traversalOption); @@ -89,32 +97,54 @@ public class BranchStep extends ComputerAwareStep implements Trav protected Iterator> standardAlgorithm() { while (true) { if (!this.first) { +// this block is ignored on the first pass through the while(true) giving the opportunity for +// the traversalOptions to be prepared. Iterate all of them and simply return the ones that yield +// results. applyCurrentTraverser() will have only injected
[2/4] tinkerpop git commit: Merge branch 'TINKERPOP-1963' into tp32
Merge branch 'TINKERPOP-1963' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f411f1d4 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f411f1d4 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f411f1d4 Branch: refs/heads/master Commit: f411f1d4e90ca565d2a58fde6fa2d4a74db8ef4b Parents: 1b59b9e 9952bcf Author: Stephen Mallette Authored: Thu May 31 15:50:27 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 15:50:27 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../traversal/step/branch/BranchStep.java | 42 +--- .../step/util/ReducingBarrierStep.java | 1 - .../Gherkin/GherkinTestRunner.cs| 6 ++- .../step/branch/GroovyChooseTest.groovy | 11 + gremlin-test/features/branch/Choose.feature | 27 + .../traversal/step/branch/ChooseTest.java | 35 7 files changed, 115 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f411f1d4/CHANGELOG.asciidoc -- diff --cc CHANGELOG.asciidoc index 3d33c78,0008a1a..6251b6d --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@@ -23,11 -23,9 +23,12 @@@ image::https://raw.githubusercontent.co [[release-3-2-10]] === TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET) + * Fixed bug in `branch()` where reducing steps as options would produce incorrect results. * Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors. +* Improved performance of `TraversalVertexProgram` and related infrastructure. * Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects. +* Added concrete configuration methods to `SparkGraphComputer` to make a more clear API for configuring it. +* Fixed a bug in `TinkerGraphCountStrategy`, which didn't consider that certain map steps may not emit an element. [[release-3-2-9]] === TinkerPop 3.2.9 (Release Date: May 8, 2018)
[3/4] tinkerpop git commit: Merge branch 'tp32' into tp33
Merge branch 'tp32' into tp33 Conflicts: gremlin-groovy-test/src/main/groovy/org/apache/tinkerpop/gremlin/process/traversal/step/branch/GroovyChooseTest.groovy Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/6c98a303 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/6c98a303 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/6c98a303 Branch: refs/heads/master Commit: 6c98a30364021138a2f244edbc88c3c40fc3d189 Parents: d258071 f411f1d Author: Stephen Mallette Authored: Thu May 31 15:51:02 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 15:51:02 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../traversal/step/branch/BranchStep.java | 42 +--- .../step/util/ReducingBarrierStep.java | 1 - .../Gherkin/GherkinTestRunner.cs| 6 ++- gremlin-test/features/branch/Choose.feature | 27 + .../traversal/step/branch/ChooseTest.java | 35 6 files changed, 104 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/6c98a303/CHANGELOG.asciidoc --
[1/3] tinkerpop git commit: TINKERPOP-1963 Fixed branch() problems with reducing steps as options
Repository: tinkerpop Updated Branches: refs/heads/tp33 d25807149 -> 6c98a3036 TINKERPOP-1963 Fixed branch() problems with reducing steps as options Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9952bcf7 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9952bcf7 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9952bcf7 Branch: refs/heads/tp33 Commit: 9952bcf7c2e5907276978fc02ad44329b11e1ce1 Parents: 7c69607 Author: Stephen Mallette Authored: Wed May 9 17:52:32 2018 -0400 Committer: Stephen Mallette Committed: Mon May 21 12:14:21 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../traversal/step/branch/BranchStep.java | 42 +--- .../step/util/ReducingBarrierStep.java | 1 - .../Gherkin/GherkinTestRunner.cs| 6 ++- .../step/branch/GroovyChooseTest.groovy | 11 + gremlin-test/features/branch/Choose.feature | 27 + .../traversal/step/branch/ChooseTest.java | 35 7 files changed, 115 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9952bcf7/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index b286dcb..0008a1a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -23,6 +23,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima [[release-3-2-10]] === TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET) +* Fixed bug in `branch()` where reducing steps as options would produce incorrect results. * Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors. * Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9952bcf7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java index 778722d..0b1a059 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java @@ -22,7 +22,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.Traverser; import org.apache.tinkerpop.gremlin.process.traversal.step.Barrier; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent; +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.IdentityStep; import org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep; import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException; import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper; @@ -62,7 +64,13 @@ public class BranchStep extends ComputerAwareStep implements Trav this.traversalOptions.get(pickToken).add(traversalOption); else this.traversalOptions.put(pickToken, new ArrayList<>(Collections.singletonList(traversalOption))); + +// adding an IdentityStep acts as a placeholder when reducing barriers get in the way - see the +// standardAlgorithm() method for more information. +if (TraversalHelper.hasStepOfAssignableClass(ReducingBarrierStep.class, traversalOption)) +traversalOption.addStep(0, new IdentityStep(traversalOption)); traversalOption.addStep(new EndStep(traversalOption)); + if (!this.hasBarrier && !TraversalHelper.getStepsOfAssignableClassRecursively(Barrier.class, traversalOption).isEmpty()) this.hasBarrier = true; this.integrateChild(traversalOption); @@ -89,32 +97,54 @@ public class BranchStep extends ComputerAwareStep implements Trav protected Iterator> standardAlgorithm() { while (true) { if (!this.first) { +// this block is ignored on the first pass through the while(true) giving the opportunity for +// the traversalOptions to be prepared. Iterate all of them and simply return the ones that yield +// results. applyCurrentTraverser() will have only injected
[1/4] tinkerpop git commit: TINKERPOP-1963 Fixed branch() problems with reducing steps as options
Repository: tinkerpop Updated Branches: refs/heads/master 94d0c3cec -> ff7e75d5c TINKERPOP-1963 Fixed branch() problems with reducing steps as options Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/9952bcf7 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/9952bcf7 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/9952bcf7 Branch: refs/heads/master Commit: 9952bcf7c2e5907276978fc02ad44329b11e1ce1 Parents: 7c69607 Author: Stephen Mallette Authored: Wed May 9 17:52:32 2018 -0400 Committer: Stephen Mallette Committed: Mon May 21 12:14:21 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../traversal/step/branch/BranchStep.java | 42 +--- .../step/util/ReducingBarrierStep.java | 1 - .../Gherkin/GherkinTestRunner.cs| 6 ++- .../step/branch/GroovyChooseTest.groovy | 11 + gremlin-test/features/branch/Choose.feature | 27 + .../traversal/step/branch/ChooseTest.java | 35 7 files changed, 115 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9952bcf7/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index b286dcb..0008a1a 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -23,6 +23,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima [[release-3-2-10]] === TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET) +* Fixed bug in `branch()` where reducing steps as options would produce incorrect results. * Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors. * Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/9952bcf7/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java index 778722d..0b1a059 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/branch/BranchStep.java @@ -22,7 +22,9 @@ import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.Traverser; import org.apache.tinkerpop.gremlin.process.traversal.step.Barrier; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalOptionParent; +import org.apache.tinkerpop.gremlin.process.traversal.step.sideEffect.IdentityStep; import org.apache.tinkerpop.gremlin.process.traversal.step.util.ComputerAwareStep; +import org.apache.tinkerpop.gremlin.process.traversal.step.util.ReducingBarrierStep; import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; import org.apache.tinkerpop.gremlin.process.traversal.util.FastNoSuchElementException; import org.apache.tinkerpop.gremlin.process.traversal.util.TraversalHelper; @@ -62,7 +64,13 @@ public class BranchStep extends ComputerAwareStep implements Trav this.traversalOptions.get(pickToken).add(traversalOption); else this.traversalOptions.put(pickToken, new ArrayList<>(Collections.singletonList(traversalOption))); + +// adding an IdentityStep acts as a placeholder when reducing barriers get in the way - see the +// standardAlgorithm() method for more information. +if (TraversalHelper.hasStepOfAssignableClass(ReducingBarrierStep.class, traversalOption)) +traversalOption.addStep(0, new IdentityStep(traversalOption)); traversalOption.addStep(new EndStep(traversalOption)); + if (!this.hasBarrier && !TraversalHelper.getStepsOfAssignableClassRecursively(Barrier.class, traversalOption).isEmpty()) this.hasBarrier = true; this.integrateChild(traversalOption); @@ -89,32 +97,54 @@ public class BranchStep extends ComputerAwareStep implements Trav protected Iterator> standardAlgorithm() { while (true) { if (!this.first) { +// this block is ignored on the first pass through the while(true) giving the opportunity for +// the traversalOptions to be prepared. Iterate all of them and simply return the ones that yield +// results. applyCurrentTraverser() will have only
[2/2] tinkerpop git commit: Merge branch 'TINKERPOP-1963' into tp32
Merge branch 'TINKERPOP-1963' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f411f1d4 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f411f1d4 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f411f1d4 Branch: refs/heads/tp32 Commit: f411f1d4e90ca565d2a58fde6fa2d4a74db8ef4b Parents: 1b59b9e 9952bcf Author: Stephen Mallette Authored: Thu May 31 15:50:27 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 15:50:27 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../traversal/step/branch/BranchStep.java | 42 +--- .../step/util/ReducingBarrierStep.java | 1 - .../Gherkin/GherkinTestRunner.cs| 6 ++- .../step/branch/GroovyChooseTest.groovy | 11 + gremlin-test/features/branch/Choose.feature | 27 + .../traversal/step/branch/ChooseTest.java | 35 7 files changed, 115 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f411f1d4/CHANGELOG.asciidoc -- diff --cc CHANGELOG.asciidoc index 3d33c78,0008a1a..6251b6d --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@@ -23,11 -23,9 +23,12 @@@ image::https://raw.githubusercontent.co [[release-3-2-10]] === TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET) + * Fixed bug in `branch()` where reducing steps as options would produce incorrect results. * Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors. +* Improved performance of `TraversalVertexProgram` and related infrastructure. * Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects. +* Added concrete configuration methods to `SparkGraphComputer` to make a more clear API for configuring it. +* Fixed a bug in `TinkerGraphCountStrategy`, which didn't consider that certain map steps may not emit an element. [[release-3-2-9]] === TinkerPop 3.2.9 (Release Date: May 8, 2018)
[2/3] tinkerpop git commit: Merge branch 'TINKERPOP-1963' into tp32
Merge branch 'TINKERPOP-1963' into tp32 Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/f411f1d4 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/f411f1d4 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/f411f1d4 Branch: refs/heads/tp33 Commit: f411f1d4e90ca565d2a58fde6fa2d4a74db8ef4b Parents: 1b59b9e 9952bcf Author: Stephen Mallette Authored: Thu May 31 15:50:27 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 15:50:27 2018 -0400 -- CHANGELOG.asciidoc | 1 + .../traversal/step/branch/BranchStep.java | 42 +--- .../step/util/ReducingBarrierStep.java | 1 - .../Gherkin/GherkinTestRunner.cs| 6 ++- .../step/branch/GroovyChooseTest.groovy | 11 + gremlin-test/features/branch/Choose.feature | 27 + .../traversal/step/branch/ChooseTest.java | 35 7 files changed, 115 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/f411f1d4/CHANGELOG.asciidoc -- diff --cc CHANGELOG.asciidoc index 3d33c78,0008a1a..6251b6d --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@@ -23,11 -23,9 +23,12 @@@ image::https://raw.githubusercontent.co [[release-3-2-10]] === TinkerPop 3.2.10 (Release Date: NOT OFFICIALLY RELEASED YET) + * Fixed bug in `branch()` where reducing steps as options would produce incorrect results. * Removed recursive handling of streaming results from Gremlin-Python driver to avoid max recursion depth errors. +* Improved performance of `TraversalVertexProgram` and related infrastructure. * Fixed bug in `GroovyTranslator` that didn't properly handle empty `Map` objects. +* Added concrete configuration methods to `SparkGraphComputer` to make a more clear API for configuring it. +* Fixed a bug in `TinkerGraphCountStrategy`, which didn't consider that certain map steps may not emit an element. [[release-3-2-9]] === TinkerPop 3.2.9 (Release Date: May 8, 2018)
tinkerpop git commit: TINKERPOP-1975 Introduced with() step and Configuring interface [Forced Update!]
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1975-x 5e31cbc75 -> 12b84a1cd (forced update) TINKERPOP-1975 Introduced with() step and Configuring interface Moved Parameterizing to the package containing the other step interfaces. Changed interface hierarchy with Parameterizing and Mutating now that Configuring is present. Both of those changes make this body of work a breaking change to existing APIs though it should really only affect graph providers and even then the fix is quite simple as described in the upgrade documentation. Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/12b84a1c Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/12b84a1c Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/12b84a1c Branch: refs/heads/TINKERPOP-1975-x Commit: 12b84a1cdf056b35a9f286eb38db2369622b8a57 Parents: 94d0c3c Author: Stephen Mallette Authored: Thu May 31 12:55:13 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 15:28:35 2018 -0400 -- CHANGELOG.asciidoc | 4 ++ docs/src/reference/the-traversal.asciidoc | 30 ++-- docs/src/upgrade/release-3.4.x.asciidoc | 49 + .../tinkerpop/gremlin/jsr223/CoreImports.java | 2 + .../step/map/PageRankVertexProgramStep.java | 75 ++-- .../step/map/PeerPressureVertexProgramStep.java | 74 +-- .../process/traversal/Parameterizing.java | 37 -- .../traversal/dsl/graph/GraphTraversal.java | 24 ++- .../process/traversal/step/Configuring.java | 41 +++ .../process/traversal/step/Mutating.java| 5 +- .../process/traversal/step/Parameterizing.java | 39 ++ .../process/traversal/step/filter/DropStep.java | 9 ++- .../traversal/step/map/AddEdgeStartStep.java| 6 +- .../process/traversal/step/map/AddEdgeStep.java | 7 +- .../traversal/step/map/AddVertexStartStep.java | 7 +- .../traversal/step/map/AddVertexStep.java | 7 +- .../step/sideEffect/AddPropertyStep.java| 9 +-- .../process/traversal/step/util/Parameters.java | 2 + .../strategy/decoration/ElementIdStrategy.java | 2 +- .../strategy/decoration/PartitionStrategy.java | 6 +- .../traversal/dsl/graph/GraphTraversalTest.java | 2 +- .../Process/Traversal/GraphTraversal.cs | 4 +- gremlin-javascript/glv/generate.groovy | 3 +- .../lib/process/graph-traversal.js | 2 +- gremlin-python/glv/generate.groovy | 1 + .../gremlin_python/process/graph_traversal.py | 2 +- .../traversal/step/map/PageRankTest.java| 41 +++ .../traversal/step/map/PeerPressureTest.java| 31 +++- 28 files changed, 427 insertions(+), 94 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/12b84a1c/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 30fd966..41462fb 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,10 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Moved `Parameterizing` interface to the `org.apache.tinkerpop.gremlin.process.traversal.step` package with other marker interfaces of its type. +* Replaced `Parameterizing.addPropertyMutations()` with `Configuring.configure()`. +* Changed interface hierarchy for `Parameterizing` and `Mutating` interfaces as they are tightly related. +* Introduced the `with()` step modulator which can supply configuration options to `Configuring` steps. * Added `supportsUpsert()` option to `VertexFeatures` and `EdgeFeatures`. * `min()` and `max()` now support all types implementing `Comparable`. * Change the `toString()` of `Path` to be standardized as other graph elements are. http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/12b84a1c/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index e28090a..4ded43e 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -1705,11 +1705,15 @@ g = graph.traversal().withComputer() g.V().pageRank().by('pageRank').values('pageRank') g.V().hasLabel('person'). pageRank(). -by(outE('knows')). -by('friendRank'). +with(PageRank.EDGES, __.outE('knows')). +with(PageRank.PROPERTY_NAME, 'friendRank'). order().by('friendRank',desc).valueMap('name','friendRank') +Note the use of the `with()` modulating step which provides configuration options to the algorithm. It takes +configuration keys from the
tinkerpop git commit: wip
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1975-x 19e723d94 -> 5e31cbc75 wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/5e31cbc7 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/5e31cbc7 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/5e31cbc7 Branch: refs/heads/TINKERPOP-1975-x Commit: 5e31cbc75808e9d6941ae8e91b49677cced7825c Parents: 19e723d Author: Stephen Mallette Authored: Thu May 31 15:25:06 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 15:25:06 2018 -0400 -- docs/src/reference/the-traversal.asciidoc | 11 +-- docs/src/upgrade/release-3.4.x.asciidoc | 14 ++ 2 files changed, 23 insertions(+), 2 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5e31cbc7/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index 56384f7..4ded43e 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -1816,10 +1816,17 @@ IMPORTANT: The `peerPressure()`-step is a `VertexComputing`-step and as such, ca g = graph.traversal().withComputer() g.V().peerPressure().by('cluster').values('cluster') g.V().hasLabel('person'). - peerPressure().by('cluster'). - group().by('cluster').by('name') + peerPressure(). +with(PeerPressure.PROPERTY_NAME, 'cluster'). + group(). +by('cluster'). +by('name') +Note the use of the `with()` modulating step which provides configuration options to the algorithm. It takes +configuration keys from the static `PeerPressure` inner class on `PeerPressureVertexProgramStep` and is automatically +imported to the Gremlin Console. + *Additional References* link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#peerPressure--++[`peerPressure()`] http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/5e31cbc7/docs/src/upgrade/release-3.4.x.asciidoc -- diff --git a/docs/src/upgrade/release-3.4.x.asciidoc b/docs/src/upgrade/release-3.4.x.asciidoc index 91668af..f99a6d5 100644 --- a/docs/src/upgrade/release-3.4.x.asciidoc +++ b/docs/src/upgrade/release-3.4.x.asciidoc @@ -47,6 +47,18 @@ g.V().hasLabel('person'). valueMap('name','friendRank') +A similar change was made for `peerPressure()` step: + +[groovy] + +g.V().hasLabel('person'). + peerPressure(). +with(PeerPressure.PROPERTY_NAME, 'cluster'). + group(). +by('cluster'). +by('name') + + Note that the `by()` modulators still work, but should be considered deprecated and open for removal in a future release where breaking changes are allowed. @@ -233,6 +245,8 @@ method could be removed in favor of the new `Configuring.configure()` method. All of the changes above basically mean, that if the `Mutating` interface was being used in prior versions, the `addPropertyMutations()` method simply needs to be changed to `configure()`. +See: link:https://issues.apache.org/jira/browse/TINKERPOP-1975[TINKERPOP-1975] + = Removed hadoop-gremlin Test Artifact The `hadoop-gremlin` module no longer generates a test jar that can be used as a test dependency in other modules.
[2/2] tinkerpop git commit: wip
wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/19e723d9 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/19e723d9 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/19e723d9 Branch: refs/heads/TINKERPOP-1975-x Commit: 19e723d9491bb8993d1add193b749f1cd1811b43 Parents: c1cf410 Author: Stephen Mallette Authored: Thu May 31 15:22:26 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 15:22:26 2018 -0400 -- .../step/map/PageRankVertexProgramStep.java | 2 +- .../step/map/PeerPressureVertexProgramStep.java | 74 ++-- .../traversal/step/map/PeerPressureTest.java| 31 +++- 3 files changed, 99 insertions(+), 8 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19e723d9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java index 5c96a1e..1c5b364 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java @@ -76,7 +76,7 @@ public final class PageRankVertexProgramStep extends VertexProgramStep this.pageRankProperty = (String) keyValues[1]; } else if (keyValues[0].equals(PageRank.TIMES)) { if (!(keyValues[1] instanceof Integer)) -throw new IllegalArgumentException("PageRank.TIMES requires a String as its argument"); +throw new IllegalArgumentException("PageRank.TIMES requires an Integer as its argument"); this.times = (int) keyValues[1]; }else { this.parameters.set(this, keyValues); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/19e723d9/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressureVertexProgramStep.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressureVertexProgramStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressureVertexProgramStep.java index 47d4160..be65f42 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressureVertexProgramStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PeerPressureVertexProgramStep.java @@ -25,10 +25,13 @@ import org.apache.tinkerpop.gremlin.process.computer.clustering.peerpressure.Pee import org.apache.tinkerpop.gremlin.process.computer.traversal.lambda.HaltedTraversersCountTraversal; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.process.traversal.step.ByModulating; +import org.apache.tinkerpop.gremlin.process.traversal.step.Configuring; import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent; +import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters; import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; import org.apache.tinkerpop.gremlin.process.traversal.util.PureTraversal; import org.apache.tinkerpop.gremlin.structure.Edge; @@ -42,16 +45,44 @@ import java.util.Set; /** * @author Marko A. Rodriguez (http://markorodriguez.com) + * @author Stephen Mallette (http://stephen.genoprime.com) */ -public final class PeerPressureVertexProgramStep extends VertexProgramStep implements TraversalParent, ByModulating, TimesModulating { +public final class PeerPressureVertexProgramStep extends VertexProgramStep +implements TraversalParent, ByModulating, TimesModulating, Configuring { +private Parameters parameters = new Parameters(); private PureTraversal edgeTraversal; private String clusterProperty = PeerPressureVertexProgram.CLUSTER; private int times = 30; public PeerPressureVertexProgramStep(final Traversal.Admin traversal) {
[1/2] tinkerpop git commit: wip
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1975-x 8ced62095 -> 19e723d94 wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/c1cf4105 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/c1cf4105 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/c1cf4105 Branch: refs/heads/TINKERPOP-1975-x Commit: c1cf4105c6c4cbe1ab4e8abdd7f5c167bab2f9a1 Parents: 8ced620 Author: Stephen Mallette Authored: Thu May 31 15:11:42 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 15:11:42 2018 -0400 -- docs/src/upgrade/release-3.4.x.asciidoc | 35 1 file changed, 35 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/c1cf4105/docs/src/upgrade/release-3.4.x.asciidoc -- diff --git a/docs/src/upgrade/release-3.4.x.asciidoc b/docs/src/upgrade/release-3.4.x.asciidoc index 3c881c3..91668af 100644 --- a/docs/src/upgrade/release-3.4.x.asciidoc +++ b/docs/src/upgrade/release-3.4.x.asciidoc @@ -29,6 +29,30 @@ Please see the link:https://github.com/apache/tinkerpop/blob/3.4.0/CHANGELOG.asc === Upgrading for Users + with() Step + +This version of TinkerPop introduces the `with()` step to Gremlin. It isn't really a step but is instead a step +modulator. This modulator allows the step it is modifying to accept configurations that can be used to alter the +behavior of the step itself. A good example of its usage is shown with the revised syntax of the `pageRank()` step +which now uses `with()` to replace the old `by()` options: + +[groovy] + +g.V().hasLabel('person'). + pageRank(). +with(PageRank.EDGES, __.outE('knows')). +with(PageRank.PROPERTY_NAME, 'friendRank'). + order(). +by('friendRank',desc). + valueMap('name','friendRank') + + +Note that the `by()` modulators still work, but should be considered deprecated and open for removal in a future +release where breaking changes are allowed. + +See: link:https://issues.apache.org/jira/browse/TINKERPOP-1975[TINKERPOP-1975], +link:http://tinkerpop.apache.org/docs/current/reference/#with-step[Reference Documentation] + Removal of Giraph Support Support for Giraph has been removed as of this version. There were a number of reasons for this decision which were @@ -198,6 +222,17 @@ See: link:https://issues.apache.org/jira/browse/TINKERPOP-1522[TINKERPOP-1522] Graph Database Providers += Configuring Interface + +There were some changes to interfaces that were related to `Step`. A new `Configuring` interface was added that was +helpful in the implementation of the `with()` step modulator. This new interface extends the `Parameterizing` interface +(which moved to the `org.apache.tinkerpop.gremlin.process.traversal.step` package with the other step interfaces) and +in turn is extended by the `Mutating` interface. Making this change meant that the `Mutating.addPropertyMutations()` +method could be removed in favor of the new `Configuring.configure()` method. + +All of the changes above basically mean, that if the `Mutating` interface was being used in prior versions, the +`addPropertyMutations()` method simply needs to be changed to `configure()`. + = Removed hadoop-gremlin Test Artifact The `hadoop-gremlin` module no longer generates a test jar that can be used as a test dependency in other modules.
tinkerpop git commit: wip
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1975-x 251fe79f5 -> 8ced62095 wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/8ced6209 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/8ced6209 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/8ced6209 Branch: refs/heads/TINKERPOP-1975-x Commit: 8ced62095809c0c64f4939f8d2d8ec191e67c3c1 Parents: 251fe79 Author: Stephen Mallette Authored: Thu May 31 14:53:07 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 14:53:07 2018 -0400 -- docs/src/reference/the-traversal.asciidoc| 19 +++ .../tinkerpop/gremlin/jsr223/CoreImports.java| 2 ++ .../step/map/PageRankVertexProgramStep.java | 15 +++ 3 files changed, 32 insertions(+), 4 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ced6209/docs/src/reference/the-traversal.asciidoc -- diff --git a/docs/src/reference/the-traversal.asciidoc b/docs/src/reference/the-traversal.asciidoc index e28090a..56384f7 100644 --- a/docs/src/reference/the-traversal.asciidoc +++ b/docs/src/reference/the-traversal.asciidoc @@ -1705,11 +1705,15 @@ g = graph.traversal().withComputer() g.V().pageRank().by('pageRank').values('pageRank') g.V().hasLabel('person'). pageRank(). -by(outE('knows')). -by('friendRank'). +with(PageRank.EDGES, __.outE('knows')). +with(PageRank.PROPERTY_NAME, 'friendRank'). order().by('friendRank',desc).valueMap('name','friendRank') +Note the use of the `with()` modulating step which provides configuration options to the algorithm. It takes +configuration keys from the static `PageRank` inner class on `PageRankVertexProgramStep` and is automatically +imported to the Gremlin Console. + The <>-step can be used to understand how the traversal is compiled into multiple `GraphComputer` jobs. [gremlin-groovy,modern] @@ -1717,8 +1721,8 @@ The <>-step can be used to understand how the traversa g = graph.traversal().withComputer() g.V().hasLabel('person'). pageRank(). -by(outE('knows')). -by('friendRank'). +with(PageRank.EDGES, __.outE('knows')). +with(PageRank.PROPERTY_NAME, 'friendRank'). order().by('friendRank',desc).valueMap('name','friendRank').explain() @@ -2970,6 +2974,13 @@ link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/grem link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversal.html#where-org.apache.tinkerpop.gremlin.process.traversal.Traversal-++[`where(Traversal)`], link:++http://tinkerpop.apache.org/javadocs/x.y.z/core/org/apache/tinkerpop/gremlin/process/traversal/P.html++[`P`] +[[with-step]] +=== With Step + +The `with()`-step is not an actual step, but is instead a "step modulator" which modifies the behavior of the step +prior to it. The `with()`-step provides additional "configuration" information to steps that implement the `Configuring` +interface. Steps that allow for this type of modulation will explicitly state so in their documentation. + [[a-note-on-predicates]] == A Note on Predicates http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/8ced6209/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java index 8839dcd..368b92d 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/jsr223/CoreImports.java @@ -48,6 +48,7 @@ import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankMa import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.traversal.MemoryTraversalSideEffects; import org.apache.tinkerpop.gremlin.process.computer.traversal.TraversalVertexProgram; +import org.apache.tinkerpop.gremlin.process.computer.traversal.step.map.PageRankVertexProgramStep; import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.decoration.VertexProgramStrategy; import org.apache.tinkerpop.gremlin.process.computer.traversal.strategy.optimization.GraphFilterStrategy; import org.apache.tinkerpop.gremlin.process.remote.RemoteConnection; @@ -260,6 +261,7 @@ public final class CoreImports { CLASS_IMPORTS.add(PeerPressureVertexProgram.class); CLASS_IMPORTS.add(PageRankMapReduce.class);
tinkerpop git commit: wip
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1975-x 142ea0988 -> 251fe79f5 wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/251fe79f Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/251fe79f Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/251fe79f Branch: refs/heads/TINKERPOP-1975-x Commit: 251fe79f5c2ed433638d01a8516bdcc599adbb4d Parents: 142ea09 Author: Stephen Mallette Authored: Thu May 31 14:04:37 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 14:04:37 2018 -0400 -- CHANGELOG.asciidoc | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/251fe79f/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 975e203..41462fb 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Moved `Parameterizing` interface to the `org.apache.tinkerpop.gremlin.process.traversal.step` package with other marker interfaces of its type. * Replaced `Parameterizing.addPropertyMutations()` with `Configuring.configure()`. * Changed interface hierarchy for `Parameterizing` and `Mutating` interfaces as they are tightly related. * Introduced the `with()` step modulator which can supply configuration options to `Configuring` steps.
tinkerpop git commit: wip
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1975-x 4e64e0662 -> 142ea0988 wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/142ea098 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/142ea098 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/142ea098 Branch: refs/heads/TINKERPOP-1975-x Commit: 142ea0988e7bfbaedc7acbc6bec17aac3df541c5 Parents: 4e64e06 Author: Stephen Mallette Authored: Thu May 31 14:03:01 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 14:03:01 2018 -0400 -- CHANGELOG.asciidoc | 2 ++ 1 file changed, 2 insertions(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/142ea098/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index bcdf2de..975e203 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,8 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Replaced `Parameterizing.addPropertyMutations()` with `Configuring.configure()`. +* Changed interface hierarchy for `Parameterizing` and `Mutating` interfaces as they are tightly related. * Introduced the `with()` step modulator which can supply configuration options to `Configuring` steps. * Added `supportsUpsert()` option to `VertexFeatures` and `EdgeFeatures`. * `min()` and `max()` now support all types implementing `Comparable`.
tinkerpop git commit: wip
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1975-x 25e219fe9 -> 4e64e0662 wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/4e64e066 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/4e64e066 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/4e64e066 Branch: refs/heads/TINKERPOP-1975-x Commit: 4e64e0662af12f6551fcf076ce5c40a626a5df44 Parents: 25e219f Author: Stephen Mallette Authored: Thu May 31 13:58:31 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 13:58:31 2018 -0400 -- .../gremlin/process/traversal/step/Configuring.java | 15 +++ .../process/traversal/step/Parameterizing.java | 3 ++- 2 files changed, 17 insertions(+), 1 deletion(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4e64e066/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Configuring.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Configuring.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Configuring.java index 4297ca9..4ac6280 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Configuring.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Configuring.java @@ -18,9 +18,24 @@ */ package org.apache.tinkerpop.gremlin.process.traversal.step; +import org.apache.tinkerpop.gremlin.process.traversal.Step; +import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal; +import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters; + /** + * Identifies a {@link Step} as one that can accept configurations via the {@link GraphTraversal#with(String, Object)} + * step modulator. The nature of the configuration allowed is specific to the implementation. + * * @author Stephen Mallette (http://stephen.genoprime.com) */ public interface Configuring extends Parameterizing { + +/** + * Accept a configuration to the {@link Step}. Note that this interface extends {@link Parameterizing} and so + * there is an expectation that the {@link Step} implementation will have a {@link Parameters} instance that will + * house any values passed to this method. Storing these configurations in {@link Parameters} is not a requirement + * however, IF the configuration is an expected option for the step and can be stored on a member field that can + * be accessed on the step by more direct means (i.e. like a getter method). + */ public void configure(final Object... keyValues); } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/4e64e066/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Parameterizing.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Parameterizing.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Parameterizing.java index a4d27aa..9d8dc22 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Parameterizing.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/traversal/step/Parameterizing.java @@ -24,7 +24,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters; /** * An interface for {@link Step} implementations that hold a {@link Parameters} object, which fold in arguments from * other steps. It is typically used on mutating steps, such as {@code addV()}, where calls to {@code property(k,v)} - * are folded in as parameters to that add vertex step. + * are folded in as parameters to that add vertex step, but it may be used for any step that could benefit from + * modulation. * * @author Marko A. Rodriguez (http://markorodriguez.com) * @author Stephen Mallette (http://stephen.genoprime.com)
tinkerpop git commit: wip
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1975-x 727941315 -> 25e219fe9 wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/25e219fe Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/25e219fe Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/25e219fe Branch: refs/heads/TINKERPOP-1975-x Commit: 25e219fe9bda491b8a720722f446e1ce54257567 Parents: 7279413 Author: Stephen Mallette Authored: Thu May 31 13:45:05 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 13:45:05 2018 -0400 -- CHANGELOG.asciidoc | 1 + 1 file changed, 1 insertion(+) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/25e219fe/CHANGELOG.asciidoc -- diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 30fd966..bcdf2de 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -25,6 +25,7 @@ image::https://raw.githubusercontent.com/apache/tinkerpop/master/docs/static/ima This release also includes changes from <>. +* Introduced the `with()` step modulator which can supply configuration options to `Configuring` steps. * Added `supportsUpsert()` option to `VertexFeatures` and `EdgeFeatures`. * `min()` and `max()` now support all types implementing `Comparable`. * Change the `toString()` of `Path` to be standardized as other graph elements are.
tinkerpop git commit: wip
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1975-x e1cd83d0f -> 727941315 wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/72794131 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/72794131 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/72794131 Branch: refs/heads/TINKERPOP-1975-x Commit: 7279413157351a20ea46db9b48d87d58b9281875 Parents: e1cd83d Author: Stephen Mallette Authored: Thu May 31 13:27:38 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 13:27:38 2018 -0400 -- .../gremlin/process/traversal/dsl/graph/GraphTraversalTest.java | 2 +- .../src/Gremlin.Net/Process/Traversal/GraphTraversal.cs | 4 ++-- gremlin-javascript/glv/generate.groovy | 3 ++- .../javascript/gremlin-javascript/lib/process/graph-traversal.js | 2 +- gremlin-python/glv/generate.groovy | 1 + .../src/main/jython/gremlin_python/process/graph_traversal.py| 2 +- 6 files changed, 8 insertions(+), 6 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72794131/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java -- diff --git a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java index 6decbe0..9009d0b 100644 --- a/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java +++ b/gremlin-core/src/test/java/org/apache/tinkerpop/gremlin/process/traversal/dsl/graph/GraphTraversalTest.java @@ -42,7 +42,7 @@ import static org.junit.Assert.assertEquals; public class GraphTraversalTest { private static final Logger logger = LoggerFactory.getLogger(GraphTraversalTest.class); -private static Set NO_GRAPH = new HashSet<>(Arrays.asList("asAdmin", "by", "option", "iterate", "to", "from", "profile", "pageRank", "peerPressure", "program", "none")); +private static Set NO_GRAPH = new HashSet<>(Arrays.asList("asAdmin", "by", "with", "option", "iterate", "to", "from", "profile", "pageRank", "peerPressure", "program", "none")); private static Set NO_ANONYMOUS = new HashSet<>(Arrays.asList("start", "__")); private static Set IGNORES_BYTECODE = new HashSet<>(Arrays.asList("asAdmin", "iterate", "mapValues", "mapKeys")); http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72794131/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs -- diff --git a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs index bb3d5d8..537cdbe 100644 --- a/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs +++ b/gremlin-dotnet/src/Gremlin.Net/Process/Traversal/GraphTraversal.cs @@ -1679,9 +1679,9 @@ namespace Gremlin.Net.Process.Traversal /// /// Adds the with step to this . /// -public GraphTraversal With (StepConfiguration modulation) +public GraphTraversal With (string key, object value) { -Bytecode.AddStep("with", modulation); +Bytecode.AddStep("with", key, value); return Wrap(this); } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72794131/gremlin-javascript/glv/generate.groovy -- diff --git a/gremlin-javascript/glv/generate.groovy b/gremlin-javascript/glv/generate.groovy index 8fd22e3..8778e89 100644 --- a/gremlin-javascript/glv/generate.groovy +++ b/gremlin-javascript/glv/generate.groovy @@ -28,7 +28,8 @@ import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__ import java.lang.reflect.Modifier def toJsMap = ["in": "in_", - "from": "from_"] + "from": "from_", + "with": "with_"] def toJs = { symbol -> toJsMap.getOrDefault(symbol, symbol) } http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/72794131/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js -- diff --git a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js b/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js index 901f9b0..f143542 100644 --- a/gremlin-javascript/src/main/javascript/gremlin-javascript/lib/process/graph-traversal.js +++
tinkerpop git commit: wip
Repository: tinkerpop Updated Branches: refs/heads/TINKERPOP-1975-x [created] e1cd83d0f wip Project: http://git-wip-us.apache.org/repos/asf/tinkerpop/repo Commit: http://git-wip-us.apache.org/repos/asf/tinkerpop/commit/e1cd83d0 Tree: http://git-wip-us.apache.org/repos/asf/tinkerpop/tree/e1cd83d0 Diff: http://git-wip-us.apache.org/repos/asf/tinkerpop/diff/e1cd83d0 Branch: refs/heads/TINKERPOP-1975-x Commit: e1cd83d0fc75d35a8443abcacba3aecb92a6d589 Parents: 94d0c3c Author: Stephen Mallette Authored: Thu May 31 12:55:13 2018 -0400 Committer: Stephen Mallette Committed: Thu May 31 12:55:13 2018 -0400 -- .../step/map/PageRankVertexProgramStep.java | 60 ++-- .../process/traversal/Parameterizing.java | 37 .../traversal/dsl/graph/GraphTraversal.java | 24 +++- .../process/traversal/step/Configuring.java | 26 + .../process/traversal/step/Mutating.java| 5 +- .../process/traversal/step/Parameterizing.java | 38 + .../process/traversal/step/filter/DropStep.java | 9 ++- .../traversal/step/map/AddEdgeStartStep.java| 6 +- .../process/traversal/step/map/AddEdgeStep.java | 7 +-- .../traversal/step/map/AddVertexStartStep.java | 7 +-- .../traversal/step/map/AddVertexStep.java | 7 +-- .../step/sideEffect/AddPropertyStep.java| 9 +-- .../process/traversal/step/util/Parameters.java | 2 + .../strategy/decoration/ElementIdStrategy.java | 2 +- .../strategy/decoration/PartitionStrategy.java | 6 +- .../traversal/step/map/PageRankTest.java| 41 + 16 files changed, 211 insertions(+), 75 deletions(-) -- http://git-wip-us.apache.org/repos/asf/tinkerpop/blob/e1cd83d0/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java -- diff --git a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java index 2f67aeb..a3c6238 100644 --- a/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java +++ b/gremlin-core/src/main/java/org/apache/tinkerpop/gremlin/process/computer/traversal/step/map/PageRankVertexProgramStep.java @@ -23,12 +23,15 @@ import org.apache.tinkerpop.gremlin.process.computer.GraphFilter; import org.apache.tinkerpop.gremlin.process.computer.Memory; import org.apache.tinkerpop.gremlin.process.computer.ranking.pagerank.PageRankVertexProgram; import org.apache.tinkerpop.gremlin.process.computer.traversal.lambda.HaltedTraversersCountTraversal; +import org.apache.tinkerpop.gremlin.process.traversal.step.Configuring; +import org.apache.tinkerpop.gremlin.process.traversal.step.Parameterizing; import org.apache.tinkerpop.gremlin.process.traversal.Traversal; import org.apache.tinkerpop.gremlin.process.traversal.TraversalStrategies; import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.__; import org.apache.tinkerpop.gremlin.process.traversal.step.ByModulating; import org.apache.tinkerpop.gremlin.process.traversal.step.TimesModulating; import org.apache.tinkerpop.gremlin.process.traversal.step.TraversalParent; +import org.apache.tinkerpop.gremlin.process.traversal.step.util.Parameters; import org.apache.tinkerpop.gremlin.process.traversal.traverser.TraverserRequirement; import org.apache.tinkerpop.gremlin.process.traversal.util.PureTraversal; import org.apache.tinkerpop.gremlin.structure.Edge; @@ -42,9 +45,12 @@ import java.util.Set; /** * @author Marko A. Rodriguez (http://markorodriguez.com) + * @author Stephen Mallette (http://stephen.genoprime.com) */ -public final class PageRankVertexProgramStep extends VertexProgramStep implements TraversalParent, ByModulating, TimesModulating { +public final class PageRankVertexProgramStep extends VertexProgramStep +implements TraversalParent, ByModulating, TimesModulating, Configuring { +private Parameters parameters = new Parameters(); private PureTraversal edgeTraversal; private String pageRankProperty = PageRankVertexProgram.PAGE_RANK; private int times = 20; @@ -53,23 +59,59 @@ public final class PageRankVertexProgramStep extends VertexProgramStep implement public PageRankVertexProgramStep(final Traversal.Admin traversal, final double alpha) { super(traversal); this.alpha = alpha; -this.modulateBy(__.outE().asAdmin()); +this.configure(PageRank.EDGES, __.outE().asAdmin()); } @Override +public void configure(final Object... keyValues) { +if (keyValues[0].equals(PageRank.EDGES)) { +