diff --git a/src/main/scala/org/geneontology/rules/util/Bridge.scala b/src/main/scala/org/geneontology/rules/util/Bridge.scala index 2a6f160..a87ee5f 100644 --- a/src/main/scala/org/geneontology/rules/util/Bridge.scala +++ b/src/main/scala/org/geneontology/rules/util/Bridge.scala @@ -20,14 +20,12 @@ object Bridge { def rulesFromJena(jenaRules: Iterable[JenaRule]): Iterable[Rule] = jenaRules.flatMap(ruleFromJena) - def ruleFromJena(jenaRule: JenaRule): Option[Rule] = { - for { - body <- jenaRule.getBody.map(patternFromJena).toList.sequence - head <- jenaRule.getHead.map(patternFromJena).toList.sequence - } yield Rule(Option(jenaRule.getName), body, head) - } + def ruleFromJena(jenaRule: JenaRule): Option[Rule] = for { + body <- jenaRule.getBody.map(patternFromJena).toList.sequence + head <- jenaRule.getHead.map(patternFromJena).toList.sequence + } yield Rule(Option(jenaRule.getName), body, head) - def patternFromJena(clauseEntry: ClauseEntry): Option[TriplePattern] = { + def patternFromJena(clauseEntry: ClauseEntry): Option[TriplePattern] = if (clauseEntry.isInstanceOf[JenaTriplePattern]) { val pattern = clauseEntry.asInstanceOf[JenaTriplePattern] Option(TriplePattern(nodeFromJena(pattern.getSubject), @@ -35,8 +33,6 @@ object Bridge { nodeFromJena(pattern.getObject))) } else None - } - def tripleFromJena(triple: JenaTriple): Triple = Triple(nodeFromJena(triple.getSubject).asInstanceOf[Resource], nodeFromJena(triple.getPredicate).asInstanceOf[URI],