@Test public void testDeleteGeoLocationProperty() { graph.defineProperty("prop1").dataType(String.class).textIndexHint(TextIndexHint.ALL).define(); graph.defineProperty("prop2").dataType(GeoPoint.class).textIndexHint(TextIndexHint.ALL).define(); graph.prepareVertex("v1", VISIBILITY_EMPTY) .addPropertyValue("key1", "prop1", "value1", VISIBILITY_A) .addPropertyValue("key1", "prop2", new GeoPoint(38.9186, -77.2297, "Reston, VA"), VISIBILITY_A) .save(AUTHORIZATIONS_A_AND_B); graph.flush(); Vertex v1 = graph.getVertex("v1", FetchHints.ALL, AUTHORIZATIONS_A); v1.prepareMutation() .deleteProperties("key1", "prop1") .deleteProperties("key1", "prop2") .save(AUTHORIZATIONS_A_AND_B); graph.flush(); QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A).has("prop1", "value1").vertices(); assertResultsCount(0, 0, vertices); vertices = graph.query(AUTHORIZATIONS_A).has("prop2", "reston, va").vertices(); assertResultsCount(0, 0, vertices); vertices = graph.query(AUTHORIZATIONS_A).has("prop2", GeoCompare.WITHIN, new GeoCircle(38.9186, -77.2297, 1)).vertices(); assertResultsCount(0, 0, vertices); QueryResultsIterable<String> vertexIds = graph.query(AUTHORIZATIONS_A).has("prop2", GeoCompare.WITHIN, new GeoCircle(38.9186, -77.2297, 1)).vertexIds(); assertResultsCount(0, 0, vertexIds); }
@Test public void testDeleteGeoLocationProperty() { graph.defineProperty("prop1").dataType(String.class).textIndexHint(TextIndexHint.ALL).define(); graph.defineProperty("prop2").dataType(GeoPoint.class).textIndexHint(TextIndexHint.ALL).define(); graph.prepareVertex("v1", VISIBILITY_EMPTY) .addPropertyValue("key1", "prop1", "value1", VISIBILITY_A) .addPropertyValue("key1", "prop2", new GeoPoint(38.9186, -77.2297, "Reston, VA"), VISIBILITY_A) .save(AUTHORIZATIONS_A_AND_B); graph.flush(); Vertex v1 = graph.getVertex("v1", FetchHints.ALL, AUTHORIZATIONS_A); v1.prepareMutation() .deleteProperties("key1", "prop1") .deleteProperties("key1", "prop2") .save(AUTHORIZATIONS_A_AND_B); graph.flush(); QueryResultsIterable<Vertex> vertices = graph.query(AUTHORIZATIONS_A).has("prop1", "value1").vertices(); assertResultsCount(0, 0, vertices); vertices = graph.query(AUTHORIZATIONS_A).has("prop2", "reston, va").vertices(); assertResultsCount(0, 0, vertices); vertices = graph.query(AUTHORIZATIONS_A).has("prop2", GeoCompare.WITHIN, new GeoCircle(38.9186, -77.2297, 1)).vertices(); assertResultsCount(0, 0, vertices); QueryResultsIterable<String> vertexIds = graph.query(AUTHORIZATIONS_A).has("prop2", GeoCompare.WITHIN, new GeoCircle(38.9186, -77.2297, 1)).vertexIds(); assertResultsCount(0, 0, vertexIds); }
Property prop1_propid1b = v1.getProperty("propid1b", "prop1"); v1.prepareMutation() .deleteProperties("prop1") .save(AUTHORIZATIONS_A_AND_B); graph.flush(); .deleteProperties("propid2a", "prop2") .save(AUTHORIZATIONS_A_AND_B); graph.flush();
Property prop1_propid1b = v1.getProperty("propid1b", "prop1"); v1.prepareMutation() .deleteProperties("prop1") .save(AUTHORIZATIONS_A_AND_B); graph.flush(); .deleteProperties("propid2a", "prop2") .save(AUTHORIZATIONS_A_AND_B); graph.flush();