All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.umlg.sqlg.test.TestVertexEdgeSameName Maven / Gradle / Ivy

There is a newer version: 3.1.0
Show newest version
package org.umlg.sqlg.test;

import org.apache.tinkerpop.gremlin.structure.T;
import org.apache.tinkerpop.gremlin.structure.Vertex;
import org.junit.Test;

/**
 * Date: 2014/07/26
 * Time: 1:49 PM
 */
public class TestVertexEdgeSameName extends BaseTest {

    @Test
    public void testVertexEdgeSameNAme() {
        Vertex v1 = this.sqlgGraph.addVertex(T.label, "Person", "name", "marko");
        Vertex v2 = this.sqlgGraph.addVertex(T.label, "Person", "name", "pieter");
        v1.addEdge("Person", v2);
        this.sqlgGraph.tx().commit();
    }

    @Test
    public void addForeignKey() {
        Vertex v1 =  this.sqlgGraph.addVertex(T.label, "Person");
        Vertex v2 =  this.sqlgGraph.addVertex(T.label, "Product");
        v1.addEdge("e1", v2);
        this.sqlgGraph.tx().commit();
        Vertex v3 =  this.sqlgGraph.addVertex(T.label, "Company");
        v1.addEdge("e1", v3);
        this.sqlgGraph.tx().commit();
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy