/** * {@inheritDoc} */ @Override public LogicalGraph sample(SamplingAlgorithm algorithm) { return callForGraph(algorithm); }
/** * {@inheritDoc} */ @Override public LogicalGraph reduceOnNeighbors( VertexAggregateFunction function, Neighborhood.EdgeDirection edgeDirection) { return callForGraph(new ReduceVertexNeighborhood(function, edgeDirection)); }
/** * {@inheritDoc} */ @Override public LogicalGraph combine(LogicalGraph otherGraph) { return callForGraph(new Combination(), otherGraph); }
/** * {@inheritDoc} */ @Override public LogicalGraph subgraph(FilterFunction<Vertex> vertexFilterFunction, FilterFunction<Edge> edgeFilterFunction, Subgraph.Strategy strategy) { return callForGraph( new Subgraph<>(vertexFilterFunction, edgeFilterFunction, strategy)); }
/** * {@inheritDoc} */ @Override public LogicalGraph aggregate(AggregateFunction... aggregateFunctions) { return callForGraph(new Aggregation(aggregateFunctions)); }
@Override public LogicalGraph edgeInducedSubgraph( FilterFunction<Edge> edgeFilterFunction) { Objects.requireNonNull(edgeFilterFunction); return callForGraph(new Subgraph<>(null, edgeFilterFunction, Subgraph.Strategy.EDGE_INDUCED)); }
@Override public LogicalGraph transform( TransformationFunction<GraphHead> graphHeadTransformationFunction, TransformationFunction<Vertex> vertexTransformationFunction, TransformationFunction<Edge> edgeTransformationFunction) { return callForGraph(new Transformation<>( graphHeadTransformationFunction, vertexTransformationFunction, edgeTransformationFunction)); }
/** * {@inheritDoc} */ @Override public LogicalGraph reduceOnEdges( EdgeAggregateFunction function, Neighborhood.EdgeDirection edgeDirection) { return callForGraph(new ReduceEdgeNeighborhood(function, edgeDirection)); }
/** * {@inheritDoc} */ @Override public LogicalGraph overlap(LogicalGraph otherGraph) { return callForGraph(new Overlap(), otherGraph); }
@Override public LogicalGraph reduceOnEdges( EdgeAggregateFunction function, Neighborhood.EdgeDirection edgeDirection) { return callForGraph(new ReduceEdgeNeighborhood(function, edgeDirection)); }
/** * {@inheritDoc} */ @Override public LogicalGraph copy() { return callForGraph(new Cloning()); }
/** * {@inheritDoc} */ @Override public LogicalGraph vertexInducedSubgraph( FilterFunction<Vertex> vertexFilterFunction) { Objects.requireNonNull(vertexFilterFunction); return callForGraph( new Subgraph<>(vertexFilterFunction, null, Subgraph.Strategy.VERTEX_INDUCED)); }
/** * {@inheritDoc} */ @Override public LogicalGraph edgeInducedSubgraph( FilterFunction<Edge> edgeFilterFunction) { Objects.requireNonNull(edgeFilterFunction); return callForGraph(new Subgraph<>(null, edgeFilterFunction, Subgraph.Strategy.EDGE_INDUCED)); }
/** * {@inheritDoc} */ @Override public LogicalGraph exclude(LogicalGraph otherGraph) { return callForGraph(new Exclusion(), otherGraph); }
@Override public LogicalGraph vertexInducedSubgraph( FilterFunction<Vertex> vertexFilterFunction) { Objects.requireNonNull(vertexFilterFunction); return callForGraph( new Subgraph<>(vertexFilterFunction, null, Subgraph.Strategy.VERTEX_INDUCED)); }
@Override public LogicalGraph reduceOnNeighbors( VertexAggregateFunction function, Neighborhood.EdgeDirection edgeDirection) { return callForGraph(new ReduceVertexNeighborhood(function, edgeDirection)); }
@Override public DataSet<Tuple3<String, Long, Long>> execute(LogicalGraph graph) { LogicalGraph graphWithWccIds = graph.callForGraph(new AnnotateWeaklyConnectedComponents( propertyKey, maxIterations, annotateEdges)); graphWithWccIds = graphWithWccIds.aggregate(new AggregateListOfWccVertices(propertyKey)); if (annotateEdges) { graphWithWccIds = graphWithWccIds.aggregate(new AggregateListOfWccEdges(propertyKey)); } return graphWithWccIds.getGraphHead().flatMap( new GetConnectedComponentDistributionFlatMap(propertyKey, annotateEdges)); }
@Override public DataSet<Tuple3<String, Long, Long>> execute(LogicalGraph graph) { LogicalGraph graphWithWccIds = graph.callForGraph(new AnnotateWeaklyConnectedComponents( propertyKey, maxIterations, annotateEdges)); graphWithWccIds = graphWithWccIds.aggregate(new AggregateListOfWccVertices(propertyKey)); if (annotateEdges) { graphWithWccIds = graphWithWccIds.aggregate(new AggregateListOfWccEdges(propertyKey)); } return graphWithWccIds.getGraphHead().flatMap( new GetConnectedComponentDistributionFlatMap(propertyKey, annotateEdges)); } }
@Override public GraphCollection execute(LogicalGraph graph) { LogicalGraph graphWithWccIds = graph.callForGraph(new AnnotateWeaklyConnectedComponents( propertyKey, maxIterations)); GraphCollection split = graphWithWccIds.splitBy(propertyKey); return graph.getConfig().getGraphCollectionFactory().fromDataSets( split.getGraphHeads(), split.getVertices().map(new PropertyRemover<>(propertyKey)), split.getEdges().map(new PropertyRemover<>(propertyKey))); } }
@Override public GraphCollection execute(LogicalGraph graph) { LogicalGraph graphWithWccIds = graph.callForGraph(new AnnotateWeaklyConnectedComponents( propertyKey, maxIterations)); GraphCollection split = graphWithWccIds.splitBy(propertyKey); return graph.getConfig().getGraphCollectionFactory().fromDataSets( split.getGraphHeads(), split.getVertices().map(new PropertyRemover<>(propertyKey)), split.getEdges().map(new PropertyRemover<>(propertyKey))); }