Search in sources :

Example 6 with GremlinPipeline

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

the class SelectStepTest method test_g_v1_asXaX_outXknowsX_asXbX_selectXnameX.

public void test_g_v1_asXaX_outXknowsX_asXbX_selectXnameX() {
    super.test_g_v1_asXaX_outXknowsX_asXbX_selectXnameX(new GremlinPipeline(g.getVertex(1)).as("a").out("knows").as("b").select(new PipeFunction<Vertex, String>() {

        public String compute(Vertex vertex) {
            return (String) vertex.getProperty("name");
        }
    }));
    super.test_g_v1_asXaX_outXknowsX_asXbX_selectXnameX(new GremlinPipeline(g.getVertex(1)).optimize(false).as("a").out("knows").as("b").select(new PipeFunction<Vertex, String>() {

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

Example 7 with GremlinPipeline

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

the class SelectStepTest method test_g_v1_asXaX_outXknowsX_asXbX_select.

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

Example 8 with GremlinPipeline

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

the class TransformStepTest method test_g_v1_out_transformXnameX_transformXlengthX.

public void test_g_v1_out_transformXnameX_transformXlengthX() {
    super.test_g_v1_out_transformXnameX_transformXlengthX(new GremlinPipeline(g.getVertex(1)).out().transform(new PipeFunction<Vertex, String>() {

        public String compute(Vertex vertex) {
            return (String) vertex.getProperty("name");
        }
    }).transform(new PipeFunction<String, Integer>() {

        public Integer compute(String name) {
            return name.length();
        }
    }));
    super.test_g_v1_out_transformXnameX_transformXlengthX(new GremlinPipeline(g.getVertex(1)).optimize(false).out().transform(new PipeFunction<Vertex, String>() {

        public String compute(Vertex vertex) {
            return (String) vertex.getProperty("name");
        }
    }).transform(new PipeFunction<String, Integer>() {

        public Integer compute(String name) {
            return name.length();
        }
    }));
}
Also used : Vertex(com.tinkerpop.blueprints.Vertex) GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline) PipeFunction(com.tinkerpop.pipes.PipeFunction)

Example 9 with GremlinPipeline

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

the class TransformStepTest method test_g_v1_outE_label_transformXlengthX.

public void test_g_v1_outE_label_transformXlengthX() {
    super.test_g_v1_outE_label_transformXlengthX(new GremlinPipeline(g.getVertex(1)).outE().label().transform(new PipeFunction<String, Integer>() {

        public Integer compute(String name) {
            return name.length();
        }
    }));
    super.test_g_v1_outE_label_transformXlengthX(new GremlinPipeline(g.getVertex(1)).optimize(false).outE().label().transform(new PipeFunction<String, Integer>() {

        public Integer compute(String name) {
            return name.length();
        }
    }));
}
Also used : GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline) PipeFunction(com.tinkerpop.pipes.PipeFunction)

Example 10 with GremlinPipeline

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

the class TransformStepTest method test_g_V_asXaX_out_transformXa_nameX.

public void test_g_V_asXaX_out_transformXa_nameX() {
    super.test_g_V_asXaX_out_transformXa_nameX(new GremlinPipeline(g).V().as("a").out().transform(new PipesFunction() {

        public Object compute(Object argument) {
            return ((Vertex) this.asMap.get("a")).getProperty("name");
        }
    }));
    super.test_g_V_asXaX_out_transformXa_nameX(new GremlinPipeline(g.getVertices()).optimize(false).as("a").out().transform(new PipesFunction() {

        public Object compute(Object argument) {
            return ((Vertex) this.asMap.get("a")).getProperty("name");
        }
    }));
}
Also used : Vertex(com.tinkerpop.blueprints.Vertex) GremlinPipeline(com.tinkerpop.gremlin.java.GremlinPipeline) PipesFunction(com.tinkerpop.pipes.util.PipesFunction)

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