Package com.tinkerpop.blueprints.impls.tg

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


    ElementHelper.areEqual(vertex, vertex);
  }

  public void testAreEqualInvalid() {
    Graph graph = new TinkerGraph();
    Vertex vertex1 = graph.addVertex(null);
    Vertex vertex2 = graph.addVertex(null);

    ElementHelper.areEqual(vertex2, vertex1);
  }
View Full Code Here


  }

  public void testAreEqualInvalid() {
    Graph graph = new TinkerGraph();
    Vertex vertex1 = graph.addVertex(null);
    Vertex vertex2 = graph.addVertex(null);

    ElementHelper.areEqual(vertex2, vertex1);
  }

}
View Full Code Here

*/
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

    // cause parse errors for GraphMLReader.
    // However, this happens uncommonly enough that is not yet known which characters those are.
    public void testEncoding() throws Exception {

        Graph g = new TinkerGraph();
        Vertex v = g.addVertex(1);
        v.setProperty("text", "\u00E9");

        GMLWriter w = new GMLWriter(g);

        File f = File.createTempFile("test", "txt");
View Full Code Here

    public void testUTF8Query() throws Exception {
        TinkerGraph graph = new TinkerGraph();
        Index<Vertex> index = graph.createIndex("nodes", Vertex.class);

        Vertex nonUtf8 = graph.addVertex("1");
        nonUtf8.setProperty("name", "marko");
        nonUtf8.setProperty("age", 29);
        index.put("name", "marko", nonUtf8);

        Vertex utf8Name = graph.addVertex("2");
View Full Code Here

        Vertex nonUtf8 = graph.addVertex("1");
        nonUtf8.setProperty("name", "marko");
        nonUtf8.setProperty("age", 29);
        index.put("name", "marko", nonUtf8);

        Vertex utf8Name = graph.addVertex("2");
        utf8Name.setProperty("name", "轉注");
        utf8Name.setProperty("age", 32);
        index.put("name", "轉注", utf8Name);
        graph.addVertex(utf8Name);
View Full Code Here

        Vertex utf8Name = graph.addVertex("2");
        utf8Name.setProperty("name", "轉注");
        utf8Name.setProperty("age", 32);
        index.put("name", "轉注", utf8Name);
        graph.addVertex(utf8Name);

        graph.addEdge("12", nonUtf8, utf8Name, "created").setProperty("weight", 0.2f);

        ScriptEngine engine = new GremlinGroovyScriptEngine();
View Full Code Here

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

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.