diff options
Diffstat (limited to 'src/main/scala/rsacomb/RSASuffix.scala')
| -rw-r--r-- | src/main/scala/rsacomb/RSASuffix.scala | 21 |
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 | ||
| 9 | import tech.oxfordsemantic.jrdfox.logic.expression.{IRI} | ||
| 10 | import tech.oxfordsemantic.jrdfox.logic.datalog.{TupleTableAtom, TupleTableName} | ||
| 11 | |||
| 12 | object RSASuffix { | ||
| 13 | |||
| 14 | def apply(suffix: String => String): RSASuffix = new RSASuffix(suffix) | ||
| 15 | |||
| 16 | } | ||
| 17 | |||
| 9 | class RSASuffix(val suffix: String => String) { | 18 | class 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 | ||
| 24 | case object Empty extends RSASuffix((x) => x) | 27 | case object Empty extends RSASuffix(identity) |
| 25 | case object Forward extends RSASuffix((s) => s"${s}_f") | 28 | case object Forward extends RSASuffix((s) => s"${s}_f") |
| 26 | case object Backward extends RSASuffix((s) => s"${s}_b") | 29 | case object Backward extends RSASuffix((s) => s"${s}_b") |
| 27 | case object Inverse extends RSASuffix((s) => s"${s}_inv") | 30 | case object Inverse extends RSASuffix((s) => s"${s}_inv") |
