org.umlg.sqlg.test.graph.MidTraversalGraphTest Maven / Gradle / Ivy
package org.umlg.sqlg.test.graph;
import org.apache.tinkerpop.gremlin.process.traversal.Step;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.DefaultGraphTraversal;
import org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversal;
import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;
import org.umlg.sqlg.test.BaseTest;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import static org.junit.Assert.assertEquals;
/**
* test graph steps in the middle of traversal
*
* @author jpmoresmau
*/
public class MidTraversalGraphTest extends BaseTest {
@Test
public void g_V_hasLabelXpersonX_V_hasLabelXsoftwareX_name() {
loadModern();
GraphTraversal t = this.sqlgGraph.traversal().V().hasLabel("person").V().hasLabel("software").values("name");
printTraversalForm(t);
checkResults(Arrays.asList("lop", "lop", "lop", "lop", "ripple", "ripple", "ripple", "ripple"), t);
}
@Test
public void testMidTraversalV() {
Vertex a1 = this.sqlgGraph.addVertex(T.label, "A", "name", "a1");
Vertex b1 = this.sqlgGraph.addVertex(T.label, "B", "name", "b1");
this.sqlgGraph.addVertex(T.label, "C", "name", "c1");
GraphTraversal> g = this.sqlgGraph.traversal().V().hasLabel("A").as("a").V().hasLabel("B").as("b").select("a", "b");
List
© 2015 - 2025 Weber Informatics LLC | Privacy Policy