/
Utils.scala
45 lines (37 loc) · 1.05 KB
/
Utils.scala
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
package info.kwarc.mmt.owl
import info.kwarc.mmt.api._
import info.kwarc.mmt.api.objects._
import org.semanticweb.owlapi.model._
object Utils {
def IRILast(i: IRI): String = {
val uri = utils.URI.fromJava(i.toURI)
uri.fragment match {
case Some(s) => s
case None => uri.path.last
}
}
}
object OWLOMS {
val path = new DPath(utils.URI("http", "latin.omdoc.org") / "logics" / "description" / "owl" / "owl.omdoc")
def apply(m: String, n: String) = {
OMID(path ? m ? n)
}
def unapply(t: Term): Option[(String, String)] = {
t match {
case OMID((this.path ? !(SimpleStep(m))) ?? !(SimpleStep(n))) => Some((m, n))
case _ => None
}
}
}
object OWL2OMS {
val path = new DPath(utils.URI("http", "latin.omdoc.org") / "logics" / "description" / "owl" / "owl2.omdoc")
def apply(m: String, n: String) = {
OMID(path ? m ? n)
}
def unapply(t: Term): Option[(String, String)] = {
t match {
case OMID((this.path ? !(SimpleStep(m))) ?? !(SimpleStep(n))) => Some((m, n))
case _ => None
}
}
}