Skip to content

Commit

Permalink
Update to Jena 4.9.0. (#114)
Browse files Browse the repository at this point in the history
  • Loading branch information
balhoff authored Aug 7, 2023
1 parent 6227e61 commit 627b470
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ libraryDependencies ++= {
Seq(
"org.scalaz" %% "scalaz-core" % "7.3.7",
"net.sourceforge.owlapi" % "owlapi-distribution" % "4.5.26",
"org.apache.jena" % "apache-jena-libs" % "4.1.0",
"org.apache.jena" % "apache-jena-libs" % "4.9.0",
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
"org.scala-lang.modules" %% "scala-xml" % "2.0.1",
"org.slf4j" % "slf4j-log4j12" % "1.7.32" % Test,
Expand Down
12 changes: 5 additions & 7 deletions src/main/scala/org/phenoscape/owlet/Owlet.scala
Original file line number Diff line number Diff line change
@@ -1,7 +1,5 @@
package org.phenoscape.owlet

import java.util.UUID

import org.apache.jena.graph._
import org.apache.jena.graph.impl.GraphBase
import org.apache.jena.query._
Expand All @@ -17,9 +15,9 @@ import org.semanticweb.owlapi.apibinding.OWLManager
import org.semanticweb.owlapi.model._
import org.semanticweb.owlapi.reasoner.OWLReasoner

import java.util.UUID
import scala.collection.JavaConverters._
import scala.collection.Map
import scala.collection.immutable.Set

/**
* Processes SPARQL queries containing triple patterns with embedded OWL class expressions.
Expand All @@ -42,16 +40,16 @@ class Owlet(reasoner: OWLReasoner) {
newQuery
}

private class SPARQLVisitor(prefixes: Map[String, String], asValues: Boolean) extends RecursiveElementVisitor(new ElementVisitorBase()) {
private class SPARQLVisitor(prefixes: Map[String, String], asValues: Boolean) extends ElementVisitorBase {

override def endElement(filter: ElementFilter): Unit = filter.getExpr match {
override def visit(filter: ElementFilter): Unit = filter.getExpr match {
case existsLike: ExprFunctionOp => existsLike.getElement.visit(this)
case _ => ()
}

override def endElement(subquery: ElementSubQuery): Unit = subquery.getQuery.getQueryPattern.visit(this)
override def visit(subquery: ElementSubQuery): Unit = subquery.getQuery.getQueryPattern.visit(this)

override def endElement(group: ElementGroup): Unit = {
override def visit(group: ElementGroup): Unit = {
for (pathBlock <- group.getElements.asScala.collect({ case pb: ElementPathBlock => pb })) {
val patterns = pathBlock.getPattern.iterator
while (patterns.hasNext) {
Expand Down

0 comments on commit 627b470

Please sign in to comment.