Search in sources :

Example 76 with GremlinPipeline

use of com.tinkerpop.gremlin.java.GremlinPipeline in project gremlin by tinkerpop.

the class GroupCountStepTest method test_g_V_outXcreatedX_groupCountXm__nameX.

public void test_g_V_outXcreatedX_groupCountXm__nameX() {
    Map<String, Number> m = new HashMap<String, Number>();
    super.test_g_V_outXcreatedX_groupCountXm__nameX(new GremlinPipeline(g.getVertices()).out("created").groupCount(m, new PipeFunction<Vertex, String>() {

        public String compute(Vertex vertex) {
            return (String) vertex.getProperty("name");
        }
    }), m);
    m = new HashMap<String, Number>();
    super.test_g_V_outXcreatedX_groupCountXm__nameX(new GremlinPipeline(g).optimize(false).V().out("created").groupCount(m, new PipeFunction<Vertex, String>() {

        public String compute(Vertex vertex) {
            return (String) vertex.getProperty("name");
        }
    }), m);
}
Also used : Vertex(com.tinkerpop.blueprints.Vertex) GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline) HashMap(java.util.HashMap) PipeFunction(com.tinkerpop.pipes.PipeFunction)

Example 77 with GremlinPipeline

use of com.tinkerpop.gremlin.java.GremlinPipeline in project gremlin by tinkerpop.

the class SideEffectStepTest method test_g_v1_out_sideEffectXfalseX_propertyXnameX.

public void test_g_v1_out_sideEffectXfalseX_propertyXnameX() {
    super.test_g_v1_out_sideEffectXfalseX_propertyXnameX(new GremlinPipeline(g.getVertex(1)).out().sideEffect(new PipeFunction<Vertex, Object>() {

        public Object compute(Vertex vertex) {
            return false;
        }
    }).property("name"));
    super.test_g_v1_out_sideEffectXfalseX_propertyXnameX(new GremlinPipeline(g.getVertex(1)).optimize(false).out().sideEffect(new PipeFunction<Vertex, Object>() {

        public Object compute(Vertex vertex) {
            return false;
        }
    }).property("name"));
}
Also used : Vertex(com.tinkerpop.blueprints.Vertex) GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline)

Example 78 with GremlinPipeline

use of com.tinkerpop.gremlin.java.GremlinPipeline in project gremlin by tinkerpop.

the class TraversalStepsTest method test_g_V.

public void test_g_V() {
    super.test_g_V(new GremlinPipeline(g.getVertices()));
    super.test_g_V(new GremlinPipeline(g).V());
    super.test_g_V(new GremlinPipeline(g.getVertices()).optimize(false));
    super.test_g_V(new GremlinPipeline(g).optimize(false).V());
}
Also used : GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline)

Example 79 with GremlinPipeline

use of com.tinkerpop.gremlin.java.GremlinPipeline in project gremlin by tinkerpop.

the class TraversalStepsTest method test_g_v1_outXknowsX.

public void test_g_v1_outXknowsX() {
    super.test_g_v1_outXknowsX(new GremlinPipeline(g.getVertex(1)).out("knows"));
    super.test_g_v1_outXknowsX(new GremlinPipeline(g.getVertex(1)).optimize(false).out("knows"));
}
Also used : GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline)

Example 80 with GremlinPipeline

use of com.tinkerpop.gremlin.java.GremlinPipeline in project gremlin by tinkerpop.

the class TraversalStepsTest method test_g_v4_both.

public void test_g_v4_both() {
    super.test_g_v4_both(new GremlinPipeline(g.getVertex(4)).both());
    super.test_g_v4_both(new GremlinPipeline(g.getVertex(4)).optimize(false).both());
}
Also used : GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline)

Aggregations

GremlinPipeline (com.tinkerpop.gremlin.java.GremlinPipeline)93 Vertex (com.tinkerpop.blueprints.Vertex)28 PipeFunction (com.tinkerpop.pipes.PipeFunction)13 Pipe (com.tinkerpop.pipes.Pipe)6 HashMap (java.util.HashMap)4 Request (org.apache.atlas.catalog.Request)3 VertexWrapper (org.apache.atlas.catalog.VertexWrapper)3 ResourceDefinition (org.apache.atlas.catalog.definition.ResourceDefinition)3 AtlasGraph (org.apache.atlas.repository.graphdb.AtlasGraph)3 Test (org.testng.annotations.Test)3 LoopPipe (com.tinkerpop.pipes.branch.LoopPipe)2 PropertyFilterPipe (com.tinkerpop.pipes.filter.PropertyFilterPipe)2 Table (com.tinkerpop.pipes.util.structures.Table)2 ArrayList (java.util.ArrayList)2 HashSet (java.util.HashSet)2 List (java.util.List)2 Test (org.junit.Test)2 OException (com.orientechnologies.common.exception.OException)1 OIdentifiable (com.orientechnologies.orient.core.db.record.OIdentifiable)1 OCommandExecutionException (com.orientechnologies.orient.core.exception.OCommandExecutionException)1