@Test public void testGraphQueryEdgeWithTermsAggregationAlterElementVisibility() { graph.prepareVertex("v1", VISIBILITY_EMPTY) .save(AUTHORIZATIONS_A_AND_B); graph.prepareVertex("v2", VISIBILITY_EMPTY) .save(AUTHORIZATIONS_A_AND_B); graph.prepareEdge("e1", "v1", "v2", LABEL_LABEL1, VISIBILITY_A) .addPropertyValue("k1", "age", 25, VISIBILITY_EMPTY) .save(AUTHORIZATIONS_A_AND_B); graph.flush(); Edge e1 = graph.getEdge("e1", AUTHORIZATIONS_A_AND_B); e1.prepareMutation() .alterElementVisibility(VISIBILITY_B) .save(AUTHORIZATIONS_A_AND_B); graph.flush(); Map<Object, Long> propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_A_AND_B); assumeTrue("terms aggregation not supported", propertyCountByValue != null); assertEquals(1, propertyCountByValue.size()); propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_A); assumeTrue("terms aggregation not supported", propertyCountByValue != null); assertEquals(0, propertyCountByValue.size()); propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_B); assumeTrue("terms aggregation not supported", propertyCountByValue != null); assertEquals(1, propertyCountByValue.size()); }
for (Edge edge : edges) { ExistingEdgeMutation m = edge.prepareMutation(); m.setIndexHint(IndexHint.DO_NOT_INDEX); m.save(authorizations);
.alterEdgeLabel(LABEL_LABEL2) .save(AUTHORIZATIONS_A); graph.flush();
Property edgeProperty = e1.getProperty("key1", "prop1"); e1.prepareMutation() .deleteProperties("key1", "prop1") .save(AUTHORIZATIONS_A_AND_B); graph.flush();
.alterPropertyVisibility("k2", "prop2", VISIBILITY_B) .save(AUTHORIZATIONS_A_AND_B); graph.flush();
.alterEdgeLabel(LABEL_LABEL2) .save(AUTHORIZATIONS_A); graph.flush();
Property edgeProperty = e1.getProperty("key1", "prop1"); e1.prepareMutation() .deleteProperties("key1", "prop1") .save(AUTHORIZATIONS_A_AND_B); graph.flush();
.alterPropertyVisibility("k2", "prop2", VISIBILITY_B) .save(AUTHORIZATIONS_A_AND_B); graph.flush();
@Test public void testGraphQueryEdgeWithTermsAggregationAlterElementVisibility() { graph.prepareVertex("v1", VISIBILITY_EMPTY) .save(AUTHORIZATIONS_A_AND_B); graph.prepareVertex("v2", VISIBILITY_EMPTY) .save(AUTHORIZATIONS_A_AND_B); graph.prepareEdge("e1", "v1", "v2", LABEL_LABEL1, VISIBILITY_A) .addPropertyValue("k1", "age", 25, VISIBILITY_EMPTY) .save(AUTHORIZATIONS_A_AND_B); graph.flush(); Edge e1 = graph.getEdge("e1", AUTHORIZATIONS_A_AND_B); e1.prepareMutation() .alterElementVisibility(VISIBILITY_B) .save(AUTHORIZATIONS_A_AND_B); graph.flush(); Map<Object, Long> propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_A_AND_B); assumeTrue("terms aggregation not supported", propertyCountByValue != null); assertEquals(1, propertyCountByValue.size()); propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_A); assumeTrue("terms aggregation not supported", propertyCountByValue != null); assertEquals(0, propertyCountByValue.size()); propertyCountByValue = queryGraphQueryWithTermsAggregation("age", ElementType.EDGE, AUTHORIZATIONS_B); assumeTrue("terms aggregation not supported", propertyCountByValue != null); assertEquals(1, propertyCountByValue.size()); }
.alterElementVisibility(VISIBILITY_B) .save(AUTHORIZATIONS_A_AND_B); graph.flush(); .alterElementVisibility(VISIBILITY_B) .save(AUTHORIZATIONS_A_AND_B);
.alterElementVisibility(VISIBILITY_B) .save(AUTHORIZATIONS_A_AND_B); graph.flush(); .alterElementVisibility(VISIBILITY_B) .save(AUTHORIZATIONS_A_AND_B);
.alterElementVisibility(VISIBILITY_A) .save(AUTHORIZATIONS_A);
.alterElementVisibility(VISIBILITY_A) .save(AUTHORIZATIONS_A);