@Test public void testUndirected() throws Exception { FlinkAsciiGraphLoader loader = new FlinkAsciiGraphLoader(getConfig()); loader.initDatabaseFromFile(getFilePath("/data/gdl/cam_test.gdl")); GraphCollection g = loader.getGraphCollection(); CanonicalAdjacencyMatrixBuilder<EPGMGraphHead, EPGMVertex, EPGMEdge, LogicalGraph, GraphCollection> cam = new CanonicalAdjacencyMatrixBuilder<>( new GraphHeadToDataString<>(), new VertexToDataString<>(), new EdgeToDataString<>(), false); String result = cam.execute(g).collect().get(0); String expectation = FileUtils.readFileToString( FileUtils.getFile(getFilePath("/data/expected/cam_test_undirected"))); assertEquals(expectation, result); }
@Override public DataSet<String> execute(GC collection) { DataSet<GraphHeadString> graphHeadLabels = getGraphHeadStrings(collection); graphHeadLabels = graphHeadLabels .union(collection .getConfig() .getExecutionEnvironment() .fromElements(new GraphHeadString(GradoopId.get(), ""))); return graphHeadLabels .reduceGroup(new ConcatGraphHeadStrings()); }
CanonicalAdjacencyMatrixBuilder implements UnaryBaseGraphCollectionToValueOperator<GC, DataSet<String>> { @Override public DataSet<String> execute(GC collection) { DataSet<GraphHeadString> graphHeadLabels = getGraphHeadStrings(collection); graphHeadLabels = graphHeadLabels .union(collection .getConfig() .getExecutionEnvironment() .fromElements(new GraphHeadString(GradoopId.get(), ""))); return graphHeadLabels .reduceGroup(new ConcatGraphHeadStrings()); } }
CanonicalAdjacencyMatrixBuilder implements UnaryBaseGraphCollectionToValueOperator<GC, DataSet<String>> { @Override public DataSet<String> execute(GC collection) { DataSet<GraphHeadString> graphHeadLabels = getGraphHeadStrings(collection); graphHeadLabels = graphHeadLabels .union(collection .getConfig() .getExecutionEnvironment() .fromElements(new GraphHeadString(GradoopId.get(), ""))); return graphHeadLabels .reduceGroup(new ConcatGraphHeadStrings()); } CanonicalAdjacencyMatrixBuilder(
    GraphHeadToString<G> graphHeadToString,
    VertexToString<V> vertexToString,
    EdgeToString<E> edgeLabelingFunction,
    boolean directed
  ); }
CanonicalAdjacencyMatrixBuilder implements UnaryBaseGraphCollectionToValueOperator<GC, DataSet<String>> { @Override public DataSet<String> execute(GC collection) { DataSet<GraphHeadString> graphHeadLabels = getGraphHeadStrings(collection); graphHeadLabels = graphHeadLabels .union(collection .getConfig() .getExecutionEnvironment() .fromElements(new GraphHeadString(GradoopId.get(), ""))); return graphHeadLabels .reduceGroup(new ConcatGraphHeadStrings()); } CanonicalAdjacencyMatrixBuilder(
    GraphHeadToString<G> graphHeadToString,
    VertexToString<V> vertexToString,
    EdgeToString<E> edgeLabelingFunction,
    boolean directed
  ); @Override DataSet<String> execute(GC collection); DataSet<GraphHeadString> getGraphHeadStrings(GC collection); }
CanonicalAdjacencyMatrixBuilder implements UnaryBaseGraphCollectionToValueOperator<GC, DataSet<String>> { @Override public DataSet<String> execute(GC collection) { DataSet<GraphHeadString> graphHeadLabels = getGraphHeadStrings(collection); graphHeadLabels = graphHeadLabels .union(collection .getConfig() .getExecutionEnvironment() .fromElements(new GraphHeadString(GradoopId.get(), ""))); return graphHeadLabels .reduceGroup(new ConcatGraphHeadStrings()); } CanonicalAdjacencyMatrixBuilder(
    GraphHeadToString<G> graphHeadToString,
    VertexToString<V> vertexToString,
    EdgeToString<E> edgeLabelingFunction,
    boolean directed
  ); @Override DataSet<String> execute(GC collection); DataSet<GraphHeadString> getGraphHeadStrings(GC collection);  }