Examples of addEdge()


Examples of com.thinkaurelius.faunus.FaunusVertex.addEdge()

                FaunusVertex vertex = this.map.get(outId);
                if (null == vertex) {
                    vertex = new FaunusVertex(outId);
                    this.map.put(outId, vertex);
                }
                vertex.addEdge(OUT, WritableUtils.clone((FaunusEdge) value, context.getConfiguration()));
                this.counter++;

                vertex = this.map.get(inId);
                if (null == vertex) {
                    vertex = new FaunusVertex(inId);
View Full Code Here

Examples of com.thinkaurelius.titan.core.TitanGraph.addEdge()

                TitanVertex old = null;
                for (int i = 0; i < numVertices; i++) {
                    TitanVertex next = (TitanVertex) graph.addVertex(null);
                    InternalRelation edge = null;
                    if (old != null) {
                        edge = (InternalRelation) graph.addEdge(null, old, next, "knows");
                    }
                    InternalRelation property = (InternalRelation) next.addProperty("age", 25);
                    if (flush) {
                        idAssigner.assignID((InternalVertex) next);
                        idAssigner.assignID(property);
View Full Code Here

Examples of com.thinkaurelius.titan.core.TitanVertex.addEdge()

                            TitanVertex v = tx.addVertex();
                            long uid = uidCounter.incrementAndGet();
                            v.setProperty("uid", uid);
                            v.setProperty("name", "user" + uid);
                            if (previous != null) {
                                v.addEdge("friend", previous).setProperty("time", Math.abs(random.nextInt()));
                            }
                            previous = v;
                        }
                        tx.commit();
                    }
View Full Code Here

Examples of com.tinkerpop.blueprints.Graph.addEdge()

    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");
    cE.setProperty("type", "C");
    Base c = framedGraph.getEdge(cE.getId(), Direction.OUT, Base.class);
    assertTrue(c instanceof C);
  }
View Full Code Here

Examples of com.tinkerpop.blueprints.KeyIndexableGraph.addEdge()

            assertEquals(count(graph.getVertices("name", "marko")), 1);
            assertEquals(graph.getVertices("name", "marko").iterator().next(), vertex);
        }

        if (graph.getFeatures().supportsEdgeKeyIndex) {
            Edge edge = graph.addEdge(null, graph.addVertex(null), graph.addVertex(null), graphTest.convertLabel("knows"));
            edge.setProperty("date", 2012);
            assertEquals(count(graph.getEdges("date", 2012)), 1);
            assertEquals(graph.getEdges("date", 2012).iterator().next(), edge);
            graph.createKeyIndex("date", Edge.class);
            assertEquals(count(graph.getEdges("date", 2012)), 1);
View Full Code Here

Examples of com.tinkerpop.blueprints.Vertex.addEdge()

    vertexOutOne.addEdge("link", vertexInOne);
    vertexOutOne.addEdge("link", vertexInTwo);
    graph.commit();

    Vertex vertexOutTwo = graph.addVertex("class:IndexedOutVertex");
    vertexOutTwo.addEdge("link", vertexInTwo);

    try {
      graph.commit();

      //in vertex can be linked by only one out vertex.
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.orient.OrientBaseGraph.addEdge()

          boolean reloaded = false;

          for (int retry = 0;; retry++) {
            try {

              final OrientEdge e = g.addEdge(null, vOut, vIn, iEdgeLabel);

              addInCache(vOut.getProperty(keyFieldName), vOut.getVertexInstance());
              addInCache(vIn.getProperty(keyFieldName), vIn.getVertexInstance());

              edgesCreated.incrementAndGet();
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.orient.OrientGraph.addEdge()

    ODocument missionImpossible = graph.addVertex("class:Movie", "name", "Mission: Impossible", "year", 1996).getRecord();
    totalElements++;
    ODocument youHaveGotMail = graph.addVertex("class:Movie", "name", "You've Got Mail","year", 1998).getRecord();
    totalElements++;

    graph.addEdge(null,graph.getVertex(tomCruise), graph.getVertex(topGun), "actorIn");
    totalElements++;
    graph.addEdge(null, graph.getVertex(megRyan), graph.getVertex(topGun), "actorIn");
    totalElements++;
    graph.addEdge(null, graph.getVertex(tomCruise), graph.getVertex(missionImpossible), "actorIn");
    totalElements++;
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.orient.OrientVertex.addEdge()

      parentEdge.remove();
    // get vertex again
    childVertex = db.getVertex(childVertex.getId());
    Vertex parentVertex = db.getVertex(parent.getId());
    // add new edge to b
    childVertex.addEdge("hasParent", parentVertex);
    db.commit();
  }
}
View Full Code Here

Examples of com.tinkerpop.blueprints.impls.tg.TinkerGraph.addEdge()

    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");
    cE.setProperty("type", "C");
    Base c = framedGraph.getEdge(cE.getId(), Direction.OUT, Base.class);
    assertTrue(c instanceof C);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.