Package com.tinkerpop.blueprints.impls.orient

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


    for (int i = 0; i < 10; i++) {
      OrientVertex v1 = graph.addVertex("class:TestVertex");
      OrientVertex v2 = graph.addVertex("class:TestVertex");
      OrientVertex v3 = graph.addVertex("class:TestVertex");
      OrientVertex v4 = graph.addVertex("class:TestVertex");

      Map<String, Object> p1 = new HashMap<String, Object>();
      p1.put("based_on", "0001");
      OrientEdge e1 = v1.addEdge(null, v2, "TestEdge", null, p1);
      e1.save();
View Full Code Here


  @Test
  public void t() {
    OrientGraph graph = new OrientGraph("memory:" + TestOutInChain.class.getSimpleName(), "admin", "admin");

    Vertex vUser = graph.addVertex("class:User");
    Vertex vCar = graph.addVertex("class:Car");
    graph.addEdge("class:Owns", vUser, vCar, null);

    graph.commit();
View Full Code Here

  @Test
  public void t() {
    OrientGraph graph = new OrientGraph("memory:" + TestOutInChain.class.getSimpleName(), "admin", "admin");

    Vertex vUser = graph.addVertex("class:User");
    Vertex vCar = graph.addVertex("class:Car");
    graph.addEdge("class:Owns", vUser, vCar, null);

    graph.commit();

    Iterable<Vertex> res = graph.command(new OCommandSQL("select expand( out('Owns') ) from User")).execute();
View Full Code Here

    startedOn = System.currentTimeMillis();

    OrientBaseGraph graphPool = new OrientGraph(url);

    graphPool.setThreadMode(OrientBaseGraph.THREAD_MODE.ALWAYS_AUTOSET);
    OrientVertex superNode = graphPool.addVertex(null, "pessimisticSuperNode", true);
    graphPool.commit();

    PessimisticThread[] ops = new PessimisticThread[THREADS];
    for (int i = 0; i < THREADS; ++i)
      ops[i] = new PessimisticThread(url, superNode, i, "thread" + i);
View Full Code Here

    counter.set(0);
    startedOn = System.currentTimeMillis();

    OrientBaseGraph graphPool = new OrientGraph(url);

    OrientVertex superNode = graphPool.addVertex(null, "optimisticSuperNode", true);
    graphPool.commit();

    OptimisticThread[] ops = new OptimisticThread[THREADS];
    for (int i = 0; i < THREADS; ++i)
      ops[i] = new OptimisticThread(url, superNode, i, "thread" + i);
View Full Code Here

    outVertexType.createIndex("uniqueLinkIndex", "unique", "out_link");

    graph.setAutoStartTx(true);


    Vertex vertexOutOne = graph.addVertex("class:IndexedOutVertex");

    Vertex vertexInOne = graph.addVertex(null);
    Vertex vertexInTwo = graph.addVertex(null);

    vertexOutOne.addEdge("link", vertexInOne);
View Full Code Here

    graph.setAutoStartTx(true);


    Vertex vertexOutOne = graph.addVertex("class:IndexedOutVertex");

    Vertex vertexInOne = graph.addVertex(null);
    Vertex vertexInTwo = graph.addVertex(null);

    vertexOutOne.addEdge("link", vertexInOne);
    vertexOutOne.addEdge("link", vertexInTwo);
    graph.commit();
View Full Code Here


    Vertex vertexOutOne = graph.addVertex("class:IndexedOutVertex");

    Vertex vertexInOne = graph.addVertex(null);
    Vertex vertexInTwo = graph.addVertex(null);

    vertexOutOne.addEdge("link", vertexInOne);
    vertexOutOne.addEdge("link", vertexInTwo);
    graph.commit();
View Full Code Here

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

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

    try {
      graph.commit();
View Full Code Here

    ocb.createProperty("map", OType.EMBEDDEDMAP);
    ocb.createIndex("vertexB_name_idx", OClass.INDEX_TYPE.UNIQUE, "name");
    graph.setAutoStartTx(true);

    // FIRST: create a root vertex
    ODocument docA = graph.addVertex("class:vertexA").getRecord();
    docA.field("name", "valueA");
    docA.save();

    Map<String, String> map = new HashMap<String, String>();
    map.put("key", "value");
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.