Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several changes for version 2.0 #123

Merged
merged 1 commit into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>[email protected]:phenoscape/owlet.git</url>
<connection>scm:git:[email protected]:phenoscape/owlet.git</connection>
Expand All @@ -58,4 +59,3 @@ pomExtra := (
<email>[email protected]</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
Loading