Package com.tinkerpop.frames.modules.typedgraph

Examples of com.tinkerpop.frames.modules.typedgraph.TypedGraphModuleBuilder


        // Create a FramedGraphFactory, which we'll use to wrap our metadata graph vertices and edges.
        this.frameFactory = new FramedGraphFactory(
                new GremlinGroovyModule(),
                new JavaHandlerModule(),
                new TypedGraphModuleBuilder()
                        .withClass(ProjectMetadata.class)
                        .withClass(BranchMetadata.class)
                        .withClass(GraphMetadata.class)
                        .withClass(JobMetadata.class)
                        .build()
View Full Code Here


        <T extends Base> T getInVertex();
  };

  public void testSerializeVertexType() {
    Graph graph = new TinkerGraph();
    FramedGraphFactory factory = new FramedGraphFactory(new TypedGraphModuleBuilder().withClass(A.class).withClass(B.class)
        .withClass(C.class).build());
    FramedGraph<Graph> framedGraph = factory.create(graph);
    A a = framedGraph.addVertex(null, A.class);
    C c = framedGraph.addVertex(null, C.class);
    assertEquals("A", ((VertexFrame) a).asVertex().getProperty("type"));
View Full Code Here

    assertEquals("C", ((VertexFrame) c).asVertex().getProperty("type"));
  }

  public void testDeserializeVertexType() {
    Graph graph = new TinkerGraph();
    FramedGraphFactory factory = new FramedGraphFactory(new TypedGraphModuleBuilder().withClass(A.class).withClass(B.class)
        .withClass(C.class).build());
    FramedGraph<Graph> framedGraph = factory.create(graph);
    Vertex cV = graph.addVertex(null);
    cV.setProperty("type", "C");
    cV.setProperty("label", "C Label");
View Full Code Here

    assertEquals("new label", cV.getProperty("label"));
  }

  public void testSerializeEdgeType() {
    Graph graph = new TinkerGraph();
    FramedGraphFactory factory = new FramedGraphFactory(new TypedGraphModuleBuilder().withClass(A.class).withClass(B.class)
        .withClass(C.class).build());
    FramedGraph<Graph> framedGraph = factory.create(graph);
    Vertex v1 = graph.addVertex(null);
    Vertex v2 = graph.addVertex(null);
    A a = framedGraph.addEdge(null, v1, v2, "label", Direction.OUT, A.class);
View Full Code Here

    assertEquals("C", ((EdgeFrame) c).asEdge().getProperty("type"));
  }

  public void testDeserializeEdgeType() {
    Graph graph = new TinkerGraph();
    FramedGraphFactory factory = new FramedGraphFactory(new TypedGraphModuleBuilder().withClass(A.class).withClass(B.class)
        .withClass(C.class).build());
    FramedGraph<Graph> framedGraph = factory.create(graph);
    Vertex v1 = graph.addVertex(null);
    Vertex v2 = graph.addVertex(null);
    Edge cE = graph.addEdge(null, v1, v2, "label");
View Full Code Here

    assertTrue(c instanceof C);
  }

    public void testWildcard() {
        Graph graph = new TinkerGraph();
        FramedGraphFactory factory = new FramedGraphFactory(new TypedGraphModuleBuilder().withClass(A.class).withClass(B.class)
                .withClass(C.class).build());
        FramedGraph<Graph> framedGraph = factory.create(graph);
        Vertex v1 = graph.addVertex(null);

        Vertex v2 = graph.addVertex(null);
View Full Code Here

TOP

Related Classes of com.tinkerpop.frames.modules.typedgraph.TypedGraphModuleBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.