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

Commit e128a05

Browse files
Minor optimization in EL FC reasoner
1 parent 4350eb6 commit e128a05

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

sansa-inference-spark/src/main/scala/net/sansa_stack/inference/spark/forwardchaining/triples/ForwardRuleReasonerEL.scala

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,11 @@ class ForwardRuleReasonerEL (sc: SparkContext, parallelism: Int = 2) extends Tra
310310
val newCount = triplesRDD.count()
311311
logger.debug("New overall count: " + newCount)
312312
if (newCount > oldCount) {
313-
rule.getInfluencedRules().foreach(rulesQueue.enqueue(_))
313+
rule.getInfluencedRules().foreach(rule => {
314+
if (!rulesQueue.contains(rule)) {
315+
rulesQueue.enqueue(rule)
316+
}
317+
})
314318
}
315319
}
316320
}

0 commit comments

Comments
 (0)