Search in sources :

Example 56 with GremlinPipeline

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

the class GatherStepTest method test_g_v1_out_gather.

public void test_g_v1_out_gather(final Pipe<Vertex, List<Vertex>> pipe) {
    super.test_g_v1_out_gather(new GremlinPipeline(g.getVertex(1)).out().gather());
    super.test_g_v1_out_gather(new GremlinPipeline(g.getVertex(1)).optimize(false).out().gather());
}
Also used : GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline)

Example 57 with GremlinPipeline

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

the class GatherStepTest method test_g_v1_out_gatherXget0X.

public void test_g_v1_out_gatherXget0X(final Pipe<Vertex, Vertex> pipe) {
    super.test_g_v1_out_gatherXget0X(new GremlinPipeline(g.getVertex(1)).out().gather(new PipeFunction<List, Vertex>() {

        public Vertex compute(List argument) {
            return (Vertex) argument.get(0);
        }
    }));
    super.test_g_v1_out_gatherXget0X(new GremlinPipeline(g.getVertex(1)).optimize(false).out().gather(new PipeFunction<List, Vertex>() {

        public Vertex compute(List argument) {
            return (Vertex) argument.get(0);
        }
    }));
}
Also used : Vertex(com.tinkerpop.blueprints.Vertex) GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline) PipeFunction(com.tinkerpop.pipes.PipeFunction) List(java.util.List)

Example 58 with GremlinPipeline

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

the class MapStepTest method test_g_v1_mapXname_idX.

public void test_g_v1_mapXname_idX() {
    super.test_g_v1_mapXname_idX(new GremlinPipeline(g.getVertex(1)).map("name", "id"));
    super.test_g_v1_mapXname_idX(new GremlinPipeline(g.getVertex(1)).optimize(false).map("name", "id"));
}
Also used : GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline)

Example 59 with GremlinPipeline

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

the class IfThenElseStepTest method test_g_v1_out_ifThenElseXlang_eq_java__it__outX_name.

public void test_g_v1_out_ifThenElseXlang_eq_java__it__outX_name() {
    super.test_g_v1_out_ifThenElseXlang_eq_java__it__outX_name(new GremlinPipeline(g.getVertex(1)).out().ifThenElse(new PipeFunction<Vertex, Boolean>() {

        public Boolean compute(Vertex vertex) {
            return vertex.getProperty("lang") != null && vertex.getProperty("lang").equals("java");
        }
    }, new PipeFunction<Vertex, Vertex>() {

        public Vertex compute(Vertex vertex) {
            return vertex;
        }
    }, new PipeFunction<Vertex, Iterable<Vertex>>() {

        public Iterable<Vertex> compute(Vertex vertex) {
            return new GremlinPipeline(vertex).out();
        }
    }));
    super.test_g_v1_out_ifThenElseXlang_eq_java__it__outX_name(new GremlinPipeline(g.getVertex(1)).optimize(false).out().ifThenElse(new PipeFunction<Vertex, Boolean>() {

        public Boolean compute(Vertex vertex) {
            return vertex.getProperty("lang") != null && vertex.getProperty("lang").equals("java");
        }
    }, new PipeFunction<Vertex, Vertex>() {

        public Vertex compute(Vertex vertex) {
            return vertex;
        }
    }, new PipeFunction<Vertex, Iterable<Vertex>>() {

        public Iterable<Vertex> compute(Vertex vertex) {
            return new GremlinPipeline(vertex).out();
        }
    }));
}
Also used : Vertex(com.tinkerpop.blueprints.Vertex) GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline) PipeFunction(com.tinkerpop.pipes.PipeFunction)

Example 60 with GremlinPipeline

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

the class SplitMergeStepsTest method test_g_v1_out_copySplitXpropertyXnameX__propertyXageXX_fairMerge.

public void test_g_v1_out_copySplitXpropertyXnameX__propertyXageXX_fairMerge() {
    super.test_g_v1_out_copySplitXpropertyXnameX__propertyXageXX_fairMerge(new GremlinPipeline(g.getVertex(1)).out().copySplit(new GremlinPipeline().property("name"), new GremlinPipeline().property("age")).fairMerge());
    super.test_g_v1_out_copySplitXpropertyXnameX__propertyXageXX_fairMerge(new GremlinPipeline(g.getVertex(1)).optimize(false).out().copySplit(new GremlinPipeline().optimize(false).property("name"), new GremlinPipeline().property("age")).fairMerge());
}
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