Skip to content
Christopher Rost edited this page Mar 7, 2018 · 13 revisions

This section provides an overview of gradoop specific data sinks.

DOTDataSink

Writes an EPGM representation into one DOT file. For more information see the Wikipedia article of DOT. The Path can be local (file://) or HDFS (hdfs://). The format is documented at DOTFileFormat.

DOTDataSink example

LogicalGraph logicalGraph = ...
DataSink dataSink = new DOTDataSink("/path/to/out.dot", true);
dataSink.write(logicalGraph);

Example out.dot

digraph 0
{
   gradoopId1 [label="person",name="Bob",age="20"];
   gradoopId2 [label="person",name="Alice",age="20"];
   gradoopID3;
   gradoopID4;
   gradoopId1->gradoopId2 [label="knows",since="2003"];
   gradoopId2->gradoopId1 [label="knows",since="2003"];
   gradoopId3->gradoopId4;
}

HBaseDataSink

Converts runtime representation of EPGM elements into persistent representations and writes them to HBase.

To be done.

TLFDataSink

Writes an EPGM representation into one TLF file. See The vertex-transitive TLF-planar graphs for further details about TLF. Paths can be local (file://) or HDFS (hdfs://). The exact format is documented in TLFFileFormat.

TLFDataSink example

DataSource dataSource = ...
DataSink dataSink = new TLFDataSink("/path/to/out.tlf", config);
dataSink.write(dataSource.getGraphCollection(), true);

JSONDataSink

Write an EPGM representation into three separate JSON files: one for vertex declaration, one for edge declaration and one for the graph declaration.Paths can be local (file://) or HDFS (hdfs://). The exact format is documented in the classes GraphHeadToJSON, VertexToJSON, EdgeToJSON.

JSONDataSink example

String graphFile = "/path/to/graphs.json";
String vertexFile = "/path/to/nodes.json";
String edgeFile = "/path/to/edges.json";

DataSink jsonDataSink = new JSONDataSink(graphFile, vertexFile, edgeFile, config);
jsonDataSink.write(dataSource.getGraphCollection(), true);

CSVDataSink

A graph data sink to write the logical graph as CSV files. Paths can be local (file://) or HDFS (hdfs://).

JSONDataSink example

LogicalGraph logicalGraph = ...
DataSink csvDataSink = new CSVDataSink("/path/to/csv/out/", config);
csvDataSink.write(logicalGraph, true);

If a metadata file already exists, it can be reused.

JSONDataSink example (with existing metadata file)

LogicalGraph logicalGraph = ...
DataSink csvDataSink = new CSVDataSink("/path/to/csv/out/", "/path/to/metadata.csv" config);
csvDataSink.write(logicalGraph, true);

Clone this wiki locally