Examples of addVertex()


Examples of com.thinkaurelius.titan.graphdb.database.StandardTitanGraph.addVertex()

    public void testValueOrdering() {
        StandardTitanGraph graph = (StandardTitanGraph) StorageSetup.getInMemoryGraph();
        TitanLabel father = graph.makeLabel("father").manyToOne().make();
        for (int i=1;i<=5;i++) graph.makeKey("key"+i).single().dataType(Integer.class).make();

        TitanVertex v1 = graph.addVertex(null), v2 = graph.addVertex(null);
        TitanEdge e1 = v1.addEdge("father",v2);
        for (int i=1;i<=5;i++) e1.setProperty("key"+i,i);

        graph.commit();
View Full Code Here

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

        Created markoCreatedLop = framedGraph.getEdge(9, Direction.OUT, Created.class);
        assertEquals(markoCreatedLop.getWeight(), 0.4f, 0.1f);
        CreatedBy lopCreatedByMarko = framedGraph.getEdge(9, Direction.IN, CreatedBy.class);
        assertEquals(lopCreatedByMarko.getWeight(), 0.4f, 0.1f);

        Person temp = framedGraph.frame(graph.addVertex(null), Person.class);
        assertNull(temp.getName());
        assertNull(temp.getAge());

    }
View Full Code Here

Examples of com.tinkerpop.blueprints.IndexableGraph.addVertex()

*/
public class IndexableGraphHelperTest extends BaseTest {

    public void testAddUniqueVertex() {
        IndexableGraph graph = new TinkerGraph();
        Vertex marko = graph.addVertex(0);
        marko.setProperty("name", "marko");
        Index<Vertex> index = graph.createIndex("txIdx", Vertex.class);
        index.put("name", "marko", marko);
        Vertex vertex = IndexableGraphHelper.addUniqueVertex(graph, null, index, "name", "marko");
        assertEquals(vertex.getProperty("name"), "marko");
View Full Code Here

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

    }

    public void testReIndexingOfElements() {
        KeyIndexableGraph graph = (KeyIndexableGraph) graphTest.generateGraph();
        if (graph.getFeatures().supportsVertexKeyIndex) {
            Vertex vertex = graph.addVertex(null);
            vertex.setProperty("name", "marko");
            assertEquals(count(graph.getVertices("name", "marko")), 1);
            assertEquals(graph.getVertices("name", "marko").iterator().next(), vertex);
            graph.createKeyIndex("name", Vertex.class);
            assertEquals(count(graph.getVertices("name", "marko")), 1);
View Full Code Here

Examples of com.tinkerpop.blueprints.TransactionalGraph.addVertex()

        ((SparkseeGraph) graph).typeScope.set(true);
        this.stopWatch();

        graph.commit();

        graph.addVertex(null).setProperty("name", "sergio");
        graph.addVertex(null).setProperty("name", "marko");
        assertTrue(graph.getVertices("name", "sergio").iterator().next()
                .getProperty("name").equals("sergio"));
        graph.commit();
        assertTrue(((SparkseeGraph) graph).getRawSession(false) == null);
View Full Code Here

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

      final OrientVertex product;
      final OrientVertex fishing;

      OrientBaseGraph graph = localFactory.getTx();
      try {
        product = graph.addVertex("class:Product");

        fishing = graph.addVertex("class:Hobby");
        fishing.setProperty("name", "Fishing");
      } finally {
        graph.shutdown();
View Full Code Here

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


    graph.createVertexType("Movie");
    graph.createVertexType("Actor");

    tomCruise = graph.addVertex("class:Actor", "name", "Tom Cruise").getRecord();
    totalElements++;
    megRyan = graph.addVertex("class:Actor", "name", "Meg Ryan").getRecord();
    totalElements++;
    nicoleKidman = graph.addVertex("class:Actor", "name", "Nicol Kidman").getRecord();
    totalElements++;
View Full Code Here

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

      OrientGraphNoTx g = factory.getNoTx();

      try {
        for (int i = 0; i < SERVERS; ++i) {
          try {
            final OrientVertex v = g.addVertex("class:" + "Client" + i);
            Assert.assertTrue(false);
          } catch (OValidationException e) {
            // EXPECTED
          }
        }
View Full Code Here

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

  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");

    Base c = framedGraph.getVertex(cV.getId(), Base.class);
    assertTrue(c instanceof C);
View Full Code Here

Examples of com.tinkerpop.blueprints.pgm.IndexableGraph.addVertex()

    // it's in fact an object creation
    if(objectVertex==null) {
      if (logger.isLoggable(Level.FINER)) {
        logger.log(Level.FINER, "object "+objectVertexId.toString()+" has never before been seen in graph, so create central node for it");
      }
      objectVertex = database.addVertex(objectVertexId);
      // As an aside, we add some indications regarding object id
      objectVertex.setProperty(Properties.vertexId.name(), objectVertexId);
      objectVertex.setProperty(Properties.kind.name(), nodeKind.name());
      objectVertex.setProperty(Properties.type.name(), valueClass.getName());
    }
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.