Package com.tinkerpop.blueprints

Examples of com.tinkerpop.blueprints.Vertex.removeProperty()


            vertex.setProperty("c", 4);
            assertEquals(vertex.getProperty("a"), 1);
            assertEquals(vertex.getProperty("b"), 3);
            assertEquals(vertex.getProperty("c"), 4);
            assertEquals(vertex.getPropertyKeys().size(), 3);
            assertEquals(vertex.removeProperty("a"), 1);
            assertNull(vertex.getProperty("a"));
            assertEquals(vertex.getProperty("b"), 3);
            assertEquals(vertex.getProperty("c"), 4);
            assertEquals(vertex.getPropertyKeys().size(), 2);
            vertexIds.add((Long) vertex.getId());
View Full Code Here


    }

    public void testRemoveVertexProperties() {
        SailGraph graph = (SailGraph) graphTest.generateGraph();
        Vertex v1 = graph.addVertex("\"1\"^^<http://www.w3.org/2001/XMLSchema#int>");
        assertEquals("http://www.w3.org/2001/XMLSchema#int", v1.removeProperty("type"));
        assertEquals("1", v1.getProperty("value"));
        assertNull(v1.getProperty("lang"));
        assertNull(v1.getProperty("random something"));

        Vertex v2 = graph.addVertex("\"hello\"@en");
View Full Code Here

        assertEquals("1", v1.getProperty("value"));
        assertNull(v1.getProperty("lang"));
        assertNull(v1.getProperty("random something"));

        Vertex v2 = graph.addVertex("\"hello\"@en");
        assertEquals("en", v2.removeProperty("lang"));
        assertEquals("hello", v2.getProperty("value"));
        assertNull(v2.getProperty("type"));
        assertNull(v2.getProperty("random something"));

        graph.shutdown();
View Full Code Here

    public void testFireVertexPropertyRemoved() {
        graph.addListener(graphChangedListener);

        Vertex vertex = createVertex();
        vertex.setProperty("name", "marko");
        vertex.removeProperty("name");

        assertEquals(1, graphChangedListener.vertexPropertyRemovedEventRecorded());
    }

    public void testFireVertexRemoved() {
View Full Code Here

    public void testFireVertexPropertyRemoved() {
        graph.addListener(graphChangedListener);

        Vertex vertex = createVertex();
        vertex.setProperty("name", "marko");
        vertex.removeProperty("name");

        assertEquals(0, graphChangedListener.vertexPropertyRemovedEventRecorded());
        ((EventTransactionalGraph) graph).commit();
        assertEquals(1, graphChangedListener.vertexPropertyRemovedEventRecorded());
    }
View Full Code Here

        graph.addListener(new ConsoleGraphChangedListener(graph));

        Vertex v1 = graph.addVertex(10);
        v1.setProperty("aaa", "bbb");
        v1.setProperty("ccc", "ddd");
        v1.removeProperty("aaa");

        Vertex v2 = graph.addVertex(20);
        Vertex v3 = graph.addVertex(30);

        Edge e1 = graph.addEdge(100, v1, v2, "friend");
View Full Code Here

            final Vertex vertex = graph.getVertex(id);
            if (null != vertex) {
                if (keys.size() > 0) {
                    // delete vertex properites
                    for (final String key : keys) {
                        vertex.removeProperty(key);
                    }
                } else {
                    // delete vertex
                    graph.removeVertex(vertex);
                }
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.