use of uk.gov.gchq.gaffer.data.graph.function.walk.ExtractWalkEntities in project gaffer-doc by gchq.
the class ExtractWalkEntitiesExample method extractEntitiesFromWalk.
public void extractEntitiesFromWalk() {
// ---------------------------------------------------------
final ExtractWalkEntities function = new ExtractWalkEntities();
// ---------------------------------------------------------
runExample(function, null, new Walk.Builder().entity(new Entity.Builder().group("BasicEntity").vertex("A").build()).edge(new Edge.Builder().group("BasicEdge").source("A").dest("B").directed(true).build()).entity(new Entity.Builder().group("BasicEntity").vertex("B").build()).entity(new Entity.Builder().group("EnhancedEntity").vertex("B").build()).edge(new Edge.Builder().group("BasicEdge").source("B").dest("C").directed(true).build()).entity(new Entity.Builder().group("BasicEntity").vertex("C").build()).edge(new Edge.Builder().group("BasicEdge").source("C").dest("A").directed(true).build()).entity(new Entity.Builder().group("BasicEntity").vertex("A").build()).build());
}
use of uk.gov.gchq.gaffer.data.graph.function.walk.ExtractWalkEntities in project Gaffer by gchq.
the class GetWalksIT method shouldNotFilterWalksWhenNoPredicateSupplied.
@Test
public void shouldNotFilterWalksWhenNoPredicateSupplied() throws Exception {
final Conditional conditional = new Conditional();
conditional.setTransform(new OperationChain.Builder().first(new Map.Builder<>().first(new ExtractWalkEntities()).then(new IterableConcat()).build()).then(new ForEach.Builder<>().operation(new Map.Builder<>().first(new ExtractProperty(TestPropertyNames.PROP_1)).build()).build()).build());
final Iterable<Walk> walks = executeGetWalksApplyingConditional(conditional);
assertThat(getPaths(walks)).isEqualTo("AED,ABC");
}
use of uk.gov.gchq.gaffer.data.graph.function.walk.ExtractWalkEntities in project Gaffer by gchq.
the class GetWalksIT method getWalksThatPassPredicateTest.
private Iterable<Walk> getWalksThatPassPredicateTest(final Predicate predicate) throws Exception {
final Conditional conditional = new Conditional();
conditional.setTransform(new OperationChain.Builder().first(new Map.Builder<>().first(new ExtractWalkEntities()).then(new IterableConcat()).build()).then(new ForEach.Builder<>().operation(new Map.Builder<>().first(new ExtractProperty(TestPropertyNames.PROP_1)).build()).build()).build());
conditional.setPredicate(predicate);
return executeGetWalksApplyingConditional(conditional);
}
Aggregations