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

Commit ba9aab7

Browse files
Minor
1 parent bfc19cd commit ba9aab7

2 files changed

Lines changed: 18 additions & 7 deletions

File tree

sansa-inference-common/src/main/scala/net/sansa_stack/inference/rules/minimizer/MinimizationRuleExecutor.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ abstract class MinimizationRuleExecutor extends Logging {
6464
while (continue) {
6565
curGraph = batch.rules.foldLeft(curGraph) {
6666
case (graph, rule) =>
67+
debug(
68+
s"""
69+
|=== Applying Rule ${rule.ruleName} ===
70+
""".stripMargin)
6771
val startTime = System.nanoTime()
6872
val result = rule(graph)
6973
val runTime = System.nanoTime() - startTime
@@ -108,4 +112,6 @@ abstract class MinimizationRuleExecutor extends Logging {
108112

109113
curGraph
110114
}
115+
116+
override def debug(msg: => String): Unit = println(msg)
111117
}

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

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ import scala.io.Source
99
import com.typesafe.config.ConfigFactory
1010
import org.apache.flink.api.java.utils.ParameterTool
1111
import org.apache.flink.api.scala.ExecutionEnvironment
12+
import org.apache.flink.configuration.Configuration
1213
import org.apache.flink.runtime.webmonitor.WebMonitorUtils
1314

1415
import net.sansa_stack.inference.flink.data.{RDFGraphLoader, RDFGraphWriter}
@@ -53,14 +54,20 @@ object RDFGraphMaterializer {
5354
jobName: String): Unit = {
5455

5556
// read reasoner optimization properties
56-
val reasonerConf = if (propertiesFile != null) ConfigFactory.parseFile(propertiesFile) else ConfigFactory.load("reasoner")
57+
val reasonerConf =
58+
if (propertiesFile != null) ConfigFactory.parseFile(propertiesFile)
59+
else ConfigFactory.load("reasoner")
5760

5861
// get params
5962
val params: ParameterTool = ParameterTool.fromArgs(args)
6063

64+
val conf = new Configuration()
65+
conf.setInteger("taskmanager.network.numberOfBuffers", 3000)
66+
6167
// set up the execution environment
6268
val env = ExecutionEnvironment.getExecutionEnvironment
6369
env.getConfig.disableSysoutLogging()
70+
// env.setParallelism(4)
6471

6572
// make parameters available in the web interface
6673
env.getConfig.setGlobalJobParameters(params)
@@ -74,21 +81,19 @@ object RDFGraphMaterializer {
7481
case RDFS | RDFS_SIMPLE =>
7582
val r = new ForwardRuleReasonerRDFS(env)
7683
r.useSchemaBroadCasting = reasonerConf.getBoolean("reasoner.rdfs.schema.broadcast")
77-
r.extractSchemaTriplesInAdvance = reasonerConf.getBoolean("reasoner.rdfs.schema.extractTriplesInAdvance")
84+
r.extractSchemaTriplesInAdvance =
85+
reasonerConf.getBoolean("reasoner.rdfs.schema.extractTriplesInAdvance")
7886
if (profile == RDFS_SIMPLE) r.level = RDFSLevel.SIMPLE
7987
r
8088
case OWL_HORST => new ForwardRuleReasonerOWLHorst(env)
8189
}
8290

8391
// compute inferred graph
8492
val inferredGraph = reasoner.apply(graph)
85-
// println(s"|G_inf| = ${inferredGraph.size()}")
93+
println(s"|G_inf| = ${inferredGraph.size()}")
8694

8795
// write triples to disk
88-
RDFGraphWriter.writeToDisk(inferredGraph,
89-
output,
90-
writeToSingleFile,
91-
sortedOutput)
96+
// RDFGraphWriter.writeToDisk(inferredGraph, output, writeToSingleFile, sortedOutput)
9297

9398
// println(env.getExecutionPlan())
9499

0 commit comments

Comments
 (0)