Skip to content

Commit

Permalink
Add direct predicate options. Remove SPARQL federated query and SPARQ…
Browse files Browse the repository at this point in the history
…L composer API. Remove OWL/XML syntax. (#123)
  • Loading branch information
balhoff authored Sep 8, 2023
1 parent 9952bfd commit 415da2e
Show file tree
Hide file tree
Showing 14 changed files with 436 additions and 1,129 deletions.
24 changes: 12 additions & 12 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ organization := "org.phenoscape"

name := "owlet"

version := "1.9"
version := "2.0-SNAPSHOT"

publishMavenStyle := true

Expand All @@ -15,38 +15,39 @@ publishTo := {
Some("releases" at nexus + "service/local/staging/deploy/maven2")
}

publishArtifact in Test := false
Test / publishArtifact := false

licenses := Seq("MIT" -> url("https://opensource.org/licenses/MIT"))

homepage := Some(url("https://github.com/phenoscape/owlet"))

scalaVersion := "2.12.18"
scalaVersion := "2.13.11"

crossScalaVersions := Seq("2.12.18", "2.13.11")
//crossScalaVersions := Seq("2.13.11", "3")

scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8")

scalacOptions in Test ++= Seq("-Yrangepos")
Test / scalacOptions ++= Seq("-Yrangepos")

testFrameworks += new TestFramework("utest.runner.Framework")

Test / parallelExecution := false

lazy val jenaVersion = "4.9.0"

libraryDependencies ++= {
Seq(
"org.scalaz" %% "scalaz-core" % "7.3.7",
"net.sourceforge.owlapi" % "owlapi-distribution" % "4.5.26",
"org.apache.jena" % "jena-core" % jenaVersion,
"org.apache.jena" % "jena-arq" % jenaVersion,
"com.typesafe.scala-logging" %% "scala-logging" % "3.9.5",
"org.scala-lang.modules" %% "scala-xml" % "2.2.0",
"org.slf4j" % "slf4j-log4j12" % "1.7.36" % Test,
"org.slf4j" % "slf4j-log4j12" % "2.0.9" % Test,
"org.semanticweb.elk" % "elk-owlapi" % "0.4.3" % Test,
"junit" % "junit" % "4.13.2" % Test,
"com.github.sbt" % "junit-interface" % "0.13.3" % Test
"com.lihaoyi" %% "utest" % "0.8.1" % Test
)
}

pomExtra := (
pomExtra :=
<scm>
<url>git@github.com:phenoscape/owlet.git</url>
<connection>scm:git:git@github.com:phenoscape/owlet.git</connection>
Expand All @@ -58,4 +59,3 @@ pomExtra := (
<email>jim@balhoff.org</email>
</developer>
</developers>
)
2 changes: 1 addition & 1 deletion project/build.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
sbt.version=1.9.3
sbt.version=1.9.4
Original file line number Diff line number Diff line change
Expand Up @@ -3,32 +3,31 @@ package org.phenoscape.owlet
import org.semanticweb.owlapi.apibinding.OWLManager
import org.semanticweb.owlapi.manchestersyntax.parser.ManchesterOWLSyntaxClassExpressionParser
import org.semanticweb.owlapi.model._
import scalaz._

import scala.collection.JavaConverters._
import scala.collection.Map
import scala.jdk.CollectionConverters._
import scala.util.Try

object ManchesterSyntaxClassExpressionParser {

def parse(expression: String): Validation[String, OWLClassExpression] = parse(expression, Map[String, String]())
def parse(expression: String): Either[String, OWLClassExpression] = parse(expression, Map[String, String]())

def parse(expression: String, prefixes: Map[String, String]): Validation[String, OWLClassExpression] = {
def parse(expression: String, prefixes: Map[String, String]): Either[String, OWLClassExpression] = {
val checker = new StandaloneEntityChecker(prefixes)
val parser = new ManchesterOWLSyntaxClassExpressionParser(OWLManager.getOWLDataFactory, checker)
Validation.fromTryCatchNonFatal(parser.parse(expression)).leftMap(_.getMessage)
Try(parser.parse(expression)).toEither.left.map(_.getMessage)
}

def parse(expression: String, prefixes: java.util.Map[String, String]): Validation[String, OWLClassExpression] =
def parse(expression: String, prefixes: java.util.Map[String, String]): Either[String, OWLClassExpression] =
parse(expression, prefixes.asScala)

def parseIRI(input: String, prefixes: Map[String, String] = Map.empty): Validation[String, IRI] = {
def parseIRI(input: String, prefixes: Map[String, String] = Map.empty): Either[String, IRI] =
StandaloneEntityChecker.nameToIRI(input, prefixes) match {
case Some(iri) => Validation.success(iri)
case None => Validation.failure("Invalid IRI")
case Some(iri) => Right(iri)
case None => Left("Invalid IRI")
}
}

def parseIRI(input: String, prefixes: java.util.Map[String, String]): Validation[String, IRI] =
def parseIRI(input: String, prefixes: java.util.Map[String, String]): Either[String, IRI] =
parseIRI(input, prefixes.asScala)

}
176 changes: 0 additions & 176 deletions src/main/scala/org/phenoscape/owlet/OWLXMLClassExpressionParser.scala

This file was deleted.

Loading

0 comments on commit 415da2e

Please sign in to comment.