@Override public GraphCollection getGraphCollection() throws IOException { return config.getGraphCollectionFactory().fromGraph(getLogicalGraph()); } }
@Override public GraphCollection getGraphCollection() throws IOException { return config.getGraphCollectionFactory().fromGraph(getLogicalGraph()); } }
@Override public GraphCollection getGraphCollection() { return config.getGraphCollectionFactory().fromGraph(getLogicalGraph()); } }
@Override public GraphCollection getGraphCollection() throws IOException { return getConfig().getGraphCollectionFactory().fromGraph(getLogicalGraph()); } }
@Override public GraphCollection getGraphCollection() throws IOException { return getConfig().getGraphCollectionFactory().fromGraph(getLogicalGraph()); } }
/** * Prints the logical graph to the standard output. * * @param logicalGraph The logical graph that is supposed to be printed. * @throws Exception Forwarded from flink execute. */ public static void print(LogicalGraph logicalGraph) throws Exception { GraphCollectionFactory collectionFactory = logicalGraph.getConfig().getGraphCollectionFactory(); GraphCollection graphCollection = collectionFactory.fromGraph(logicalGraph); print(graphCollection); }
@Override public GraphCollection getGraphCollection() { return getConfig().getGraphCollectionFactory().fromGraph(getLogicalGraph()); } }
@Override public GraphCollection getGraphCollection() { return getConfig().getGraphCollectionFactory().fromGraph(getLogicalGraph()); } }
/** * add graph to output * @param caption output caption * @param graph graph */ public void add(String caption, LogicalGraph graph) { add(caption, graph.getConfig().getGraphCollectionFactory().fromGraph(graph)); }
@Override public DataSet<Boolean> execute(LogicalGraph firstGraph, LogicalGraph secondGraph) { GraphCollectionFactory collectionFactory = firstGraph.getConfig() .getGraphCollectionFactory(); return collectionEquality .execute(collectionFactory.fromGraph(firstGraph), collectionFactory.fromGraph(secondGraph)); }
@Override public GraphCollection executeForTxLayout(GraphCollection collection) { DataSet<GraphTransaction> updatedTransactions = collection.getGraphTransactions() .map(new AggregateTransactions(aggregateFunctions)); return collection.getConfig().getGraphCollectionFactory().fromTransactions(updatedTransactions); }
@Override public GraphCollection execute(GraphCollection collection) { // convert Gradoop graph collection to DIMSpan input format DataSet<LabeledGraphStringString> input = collection .getGraphTransactions() .map(new EPGMGraphTransactionToLabeledGraph()); // run DIMSpan DataSet<GraphTransaction> output = dimSpan.execute(input); // convert to Gradoop graph collection return collection.getConfig().getGraphCollectionFactory().fromTransactions(output); }
@Override public GraphCollection execute(GraphCollection collection) { // convert Gradoop graph collection to DIMSpan input format DataSet<LabeledGraphStringString> input = collection .getGraphTransactions() .map(new EPGMGraphTransactionToLabeledGraph()); // run DIMSpan DataSet<GraphTransaction> output = dimSpan.execute(input); // convert to Gradoop graph collection return collection.getConfig().getGraphCollectionFactory().fromTransactions(output); }
public static void printUndirectedCanonicalAdjacencyMatrix(LogicalGraph graph) throws Exception { printUndirectedCanonicalAdjacencyMatrix(graph.getConfig().getGraphCollectionFactory() .fromGraph(graph)); }
@Override public GraphCollection execute(GraphCollection collection) { return collection.getConfig().getGraphCollectionFactory().fromDataSets( collection.getGraphHeads().distinct(new Id<>()), collection.getVertices(), collection.getEdges()); }
/** * Test writing and reading the given graph to and from IndexedCSV. * * @param tmpPath path to write csv * @param input logical graph * @throws Exception if the execution or IO fails. */ private void checkIndexedCSVWrite(String tmpPath, LogicalGraph input) throws Exception { checkIndexedCSVWrite(tmpPath, input.getConfig().getGraphCollectionFactory().fromGraph(input)); }
public static void printDirectedCanonicalAdjacencyMatrix(LogicalGraph graph) throws Exception { printDirectedCanonicalAdjacencyMatrix(graph.getConfig().getGraphCollectionFactory() .fromGraph(graph)); }
@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))); }
@Test public void testEmpty() throws Exception { GraphCollection inputCollection = getConfig().getGraphCollectionFactory() .createEmptyCollection(); int limit = 4; int expectedCount = 0; GraphCollection outputCollection = inputCollection.limit(limit); assertEquals(expectedCount, outputCollection.getGraphHeads().count()); }
@Test(expected = InvalidProgramException.class) public void testNegativeLimit() throws Exception { GraphCollection inputCollection = getConfig().getGraphCollectionFactory() .createEmptyCollection(); int limit = -1; int expectedCount = 0; GraphCollection outputCollection = inputCollection.limit(limit); assertEquals(expectedCount, outputCollection.getGraphHeads().count()); }