Skip to content
This repository was archived by the owner on Oct 8, 2020. It is now read-only.

Commit 1ae94cb

Browse files
Flink writer single file/sorted output options added.
1 parent 752e661 commit 1ae94cb

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

sansa-inference-flink/src/main/scala/net/sansa_stack/inference/flink/RDFGraphMaterializer.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ object RDFGraphMaterializer {
5757
println(s"|G_inf| = ${inferredGraph.size()}")
5858

5959
// write triples to disk
60-
RDFGraphWriter.writeToDisk(inferredGraph, output)
60+
RDFGraphWriter.writeToDisk(inferredGraph, output, writeToSingleFile, sortedOutput)
6161

6262
// println(env.getExecutionPlan())
6363

sansa-inference-flink/src/main/scala/net/sansa_stack/inference/flink/data/RDFGraphWriter.scala

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,15 @@ object RDFGraphWriter {
3333
logger.info("finished writing triples to disk in " + (System.currentTimeMillis()-startTime) + "ms.")
3434
}
3535

36-
def writeToDisk(graph: RDFGraph, path: File): Unit = {
36+
/**
37+
* Write the graph to disk in N-Triple format.
38+
*
39+
* @param graph the RDF graph
40+
* @param path the output directory
41+
* @param singleFile whether to put all data into a single file
42+
* @param sorted whether to sort the triples by subject, predicate, object
43+
*/
44+
def writeToDisk(graph: RDFGraph, path: File, singleFile: Boolean = false, sorted: Boolean = false): Unit = {
3745
logger.info("writing triples to disk...")
3846
val startTime = System.currentTimeMillis()
3947

0 commit comments

Comments
 (0)