aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/rsacomb/RSASuffix.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/rsacomb/RSASuffix.scala')
-rw-r--r--src/main/scala/rsacomb/RSASuffix.scala21
1 files changed, 12 insertions, 9 deletions
diff --git a/src/main/scala/rsacomb/RSASuffix.scala b/src/main/scala/rsacomb/RSASuffix.scala
index 7650ae0..ce36b10 100644
--- a/src/main/scala/rsacomb/RSASuffix.scala
+++ b/src/main/scala/rsacomb/RSASuffix.scala
@@ -6,22 +6,25 @@ import org.semanticweb.owlapi.model.{
6 OWLObjectProperty 6 OWLObjectProperty
7} 7}
8 8
9import tech.oxfordsemantic.jrdfox.logic.expression.{IRI}
10import tech.oxfordsemantic.jrdfox.logic.datalog.{TupleTableAtom, TupleTableName}
11
12object RSASuffix {
13
14 def apply(suffix: String => String): RSASuffix = new RSASuffix(suffix)
15
16}
17
9class RSASuffix(val suffix: String => String) { 18class RSASuffix(val suffix: String => String) {
10 19
11 def +(other: RSASuffix): RSASuffix = 20 def +(that: RSASuffix): RSASuffix =
12 new RSASuffix((s: String) => other suffix (this suffix s)) 21 new RSASuffix(this.suffix andThen that.suffix)
13 22
14 def ::(str: String): String = this suffix str 23 def ::(str: String): String = this suffix str
15 24
16 def ::(expr: OWLPropertyExpression): String =
17 expr match {
18 case e: OWLObjectProperty => e.getIRI.getIRIString :: this
19 case e: OWLObjectInverseOf => e.getInverse :: this
20 }
21
22} 25}
23 26
24case object Empty extends RSASuffix((x) => x) 27case object Empty extends RSASuffix(identity)
25case object Forward extends RSASuffix((s) => s"${s}_f") 28case object Forward extends RSASuffix((s) => s"${s}_f")
26case object Backward extends RSASuffix((s) => s"${s}_b") 29case object Backward extends RSASuffix((s) => s"${s}_b")
27case object Inverse extends RSASuffix((s) => s"${s}_inv") 30case object Inverse extends RSASuffix((s) => s"${s}_inv")