From 981670c89d38ab37cc57007f0bd37f4ac559a772 Mon Sep 17 00:00:00 2001 From: Jim Balhoff Date: Wed, 8 Mar 2017 20:28:49 -0500 Subject: [PATCH] Formatting. --- .../scala/org/geneontology/rules/util/Bridge.scala | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) 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],