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

Commit 50a4d5a

Browse files
Check for empty RDD
1 parent 7a8be6d commit 50a4d5a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ trait TransitiveReasoner extends Profiler{
5050
* @return an RDD containing the transitive closure of the triples
5151
*/
5252
def computeTransitiveClosure(triples: RDD[RDFTriple]): RDD[RDFTriple] = {
53+
if (triples.isEmpty()) return triples
54+
5355
// get the predicate
5456
val predicate = triples.take(1)(0).predicate
5557

0 commit comments

Comments
 (0)