Skip to content

Commit

Permalink
Formatting.
Browse files Browse the repository at this point in the history
  • Loading branch information
balhoff committed Mar 9, 2017
1 parent 2319533 commit 981670c
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/main/scala/org/geneontology/rules/util/Bridge.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,23 +20,19 @@ 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),
nodeFromJena(pattern.getPredicate),
nodeFromJena(pattern.getObject)))
} else None

}

def tripleFromJena(triple: JenaTriple): Triple =
Triple(nodeFromJena(triple.getSubject).asInstanceOf[Resource],
nodeFromJena(triple.getPredicate).asInstanceOf[URI],
Expand Down

0 comments on commit 981670c

Please sign in to comment.