diff options
Diffstat (limited to 'src/main/scala/rsacomb/SkolemStrategy.scala')
| -rw-r--r-- | src/main/scala/rsacomb/SkolemStrategy.scala | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/src/main/scala/rsacomb/SkolemStrategy.scala b/src/main/scala/rsacomb/SkolemStrategy.scala index b05cd17..a2ad0a1 100644 --- a/src/main/scala/rsacomb/SkolemStrategy.scala +++ b/src/main/scala/rsacomb/SkolemStrategy.scala | |||
| @@ -1,6 +1,7 @@ | |||
| 1 | package rsacomb | 1 | package rsacomb |
| 2 | 2 | ||
| 3 | import tech.oxfordsemantic.jrdfox.logic.expression.IRI | 3 | import tech.oxfordsemantic.jrdfox.logic.Datatype |
| 4 | import tech.oxfordsemantic.jrdfox.logic.expression.{Literal, IRI} | ||
| 4 | 5 | ||
| 5 | sealed trait SkolemStrategy | 6 | sealed trait SkolemStrategy |
| 6 | 7 | ||
| @@ -22,13 +23,24 @@ object SkolemStrategy { | |||
| 22 | * From | 23 | * From |
| 23 | * A ⊑ ∃R.B | 24 | * A ⊑ ∃R.B |
| 24 | * to | 25 | * to |
| 25 | * A(y) -> R(x,f(x)), B(f(x)) | 26 | * A(x) -> R(x,f(x)), B(f(x)) |
| 26 | * for f, fresh function associated with the input axiom | 27 | * for f, fresh function associated with the input axiom |
| 28 | * | ||
| 29 | * In RDFox this can represented combining the BIND operator with the | ||
| 30 | * SKOLEM operator as such: | ||
| 31 | * A(x), BIND(y, SKOLEM("f", x)) -> R(x,y), B(y) | ||
| 32 | * The first argument of a SKOLEM call is a literal string (ideally | ||
| 33 | * identifing the simulated function name). | ||
| 34 | * | ||
| 35 | * NOTE: this requirement for the SKOLEM operator is not enforced by | ||
| 36 | * RDFox, that will fail silently if omitted. | ||
| 27 | */ | 37 | */ |
| 28 | case class Standard(func: IRI) extends SkolemStrategy | 38 | case class Standard(func: Literal) extends SkolemStrategy |
| 29 | object Standard { | 39 | object Standard { |
| 30 | def apply(axiom: String) = | 40 | def apply(axiom: String) = |
| 31 | new Standard(IRI.create(genFunctionString(axiom))) | 41 | new Standard( |
| 42 | Literal.create(genFunctionString(axiom), Datatype.XSD_STRING) | ||
| 43 | ) | ||
| 32 | def genFunctionString(str: String) = "f_" ++ str.hashCode.toString | 44 | def genFunctionString(str: String) = "f_" ++ str.hashCode.toString |
| 33 | } | 45 | } |
| 34 | 46 | ||
