Skip to content
This repository has been archived by the owner. It is now read-only.
Switch branches/tags
Go to file
Cannot retrieve contributors at this time
53 lines (37 sloc) 1.71 KB
import scala.collection.mutable
import{ RDFByModularityClustering => RDFByModularityClusteringAlg }
import org.apache.flink.api.scala._
import org.apache.flink.api.scala.ExecutionEnvironment
object RDFByModularityClustering {
def main(args: Array[String]) {
parser.parse(args, Config()) match {
case Some(config) =>
run(, config.out, config.numIterations)
case None =>
def run(input: String, output: String, numIterations: Int): Unit = {
println("| RDF By Modularity Clustering example |")
val env = ExecutionEnvironment.getExecutionEnvironment
RDFByModularityClusteringAlg(env, numIterations, input, output)
case class Config(in: String = "", out: String = "", numIterations: Int = 100)
val defaultParams = Config()
val parser = new scopt.OptionParser[Config]("RDF By Modularity Clustering") {
head("RDF By Modularity Clustering: an example RDF By Modularity Clustering app using RDF Graph.")
opt[String]('i', "input").required().valueName("<path>")
.text(s"path to file that contains the input files (in N-Triple format)")
.action((x, c) => c.copy(in = x))
opt[String]('o', "output").valueName("<directory>")
.text("the output directory")
.action((x, c) => c.copy(out = x))
.text(s"number of iterations, default: ${defaultParams.numIterations}")
.action((x, c) => c.copy(numIterations = x))
help("help").text("prints this usage text")