Package com.tinkerpop.blueprints

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


public class VertexToFaunusBinaryTest extends BaseTest {

    public void testConversion() throws IOException {

        Graph graph = new TinkerGraph();
        Vertex marko = graph.addVertex(1);
        marko.setProperty("name", "marko");
        marko.setProperty("age", 32);
        Vertex stephen = graph.addVertex(3);
        stephen.setProperty("name", "stephen");
        stephen.setProperty("weight", 160.42);
View Full Code Here


        Graph graph = new TinkerGraph();
        Vertex marko = graph.addVertex(1);
        marko.setProperty("name", "marko");
        marko.setProperty("age", 32);
        Vertex stephen = graph.addVertex(3);
        stephen.setProperty("name", "stephen");
        stephen.setProperty("weight", 160.42);
        stephen.setProperty("male", true);
        Edge e = graph.addEdge(null, marko, stephen, "knows");
        e.setProperty("weight", 0.2);
View Full Code Here

    @Test
    public void convertIteratorNotPagedWithEmbeddedMap() throws Exception {
        final JSONResultConverter converter = new JSONResultConverter(GraphSONMode.EXTENDED, 0, Long.MAX_VALUE, null);
        final Graph g = new TinkerGraph();
        final Vertex v = g.addVertex(1);
        Map<String, Object> map = new HashMap<String, Object>();
        map.put("x", 500);
        map.put("y", "some");

        ArrayList friends = new ArrayList();
View Full Code Here

            Vertex vertex = id == null ? null : graph.getVertex(id);

            final JSONObject theRequestObject = this.getRequestObject();

            if (null == vertex) {
                vertex = graph.addVertex(id);
            } else {
                if (!RequestObjectHelper.hasElementProperties(theRequestObject)) {
                    // if the edge exists there better be some properties to assign
                    // this really isn't a BAD_REQUEST, but CONFLICT isn't much better...bah
                    JSONObject error = generateErrorObjectJsonFail(new Exception("Vertex with id " + id + " already exists"));
View Full Code Here

  }

  @Test
  public void jsonFromElementNullsNoKeysNoTypes() {
    Graph g = new TinkerGraph();
    Vertex v = g.addVertex(1);
    v.setProperty("key", null);

    Map<String, Object> map = new HashMap<String, Object>();
    map.put("innerkey", null);
View Full Code Here

  }

  @Test
  public void jsonFromElementNullsNoKeysWithTypes() {
    Graph g = new TinkerGraph();
    Vertex v = g.addVertex(1);
    v.setProperty("key", null);

    Map<String, Object> map = new HashMap<String, Object>();
    map.put("innerkey", null);
View Full Code Here

       
        if (doTest.equals("true")) {
            final Graph g = generateGraph();
            this.resetGraph();

            final Vertex v = g.addVertex(null);
            v.setProperty("test", "déja-vu");

            Assert.assertEquals("déja-vu", g.getVertex(v.getId()).getProperty("test"));
        }
    }
View Full Code Here

        final String doTest = System.getProperty("testKVGraph", "true");
        if (doTest.equals("true")) {
            final Graph g = generateGraph();
            this.resetGraph();

            final Vertex v = g.addVertex(null);
            v.setProperty("test", "(sometext)");

            Assert.assertEquals("(sometext)", g.getVertex(v.getId()).getProperty("test"));
        }
    }
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.