diff options
author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-12-11 17:54:21 +0000 |
---|---|---|
committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-12-17 17:44:11 +0000 |
commit | 548ad06610dabeafec983449da597f1279bf6def (patch) | |
tree | ba00752cd6c0d536ec1a2100abe48e6d62b42f33 /src/main/scala/uk/ac/ox/cs/rsacomb/converter | |
parent | 12ff20661c1848345473a5a4a9c200f3e7c2939a (diff) | |
download | RSAComb-548ad06610dabeafec983449da597f1279bf6def.tar.gz RSAComb-548ad06610dabeafec983449da597f1279bf6def.zip |
Port code to RDFox v4.1.0
Diffstat (limited to 'src/main/scala/uk/ac/ox/cs/rsacomb/converter')
-rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/converter/RDFoxConverter.scala | 12 | ||||
-rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/converter/SkolemStrategy.scala | 3 |
2 files changed, 4 insertions, 11 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/converter/RDFoxConverter.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/converter/RDFoxConverter.scala index b4f5adb..845ec1f 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/converter/RDFoxConverter.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/converter/RDFoxConverter.scala | |||
@@ -40,7 +40,7 @@ import tech.oxfordsemantic.jrdfox.logic.datalog.{ | |||
40 | import tech.oxfordsemantic.jrdfox.logic.expression.{Term, IRI, FunctionCall} | 40 | import tech.oxfordsemantic.jrdfox.logic.expression.{Term, IRI, FunctionCall} |
41 | import uk.ac.ox.cs.rsacomb.RSAOntology | 41 | import uk.ac.ox.cs.rsacomb.RSAOntology |
42 | import uk.ac.ox.cs.rsacomb.suffix.{Empty, Inverse, RSASuffix} | 42 | import uk.ac.ox.cs.rsacomb.suffix.{Empty, Inverse, RSASuffix} |
43 | import uk.ac.ox.cs.rsacomb.util.RSA | 43 | import uk.ac.ox.cs.rsacomb.util.{RSA, RDFoxUtil} |
44 | 44 | ||
45 | /** Horn-ALCHOIQ to RDFox axiom converter. | 45 | /** Horn-ALCHOIQ to RDFox axiom converter. |
46 | * | 46 | * |
@@ -328,10 +328,7 @@ trait RDFoxConverter { | |||
328 | val (bind, term1) = skolem match { | 328 | val (bind, term1) = skolem match { |
329 | case NoSkolem => (None, varX) | 329 | case NoSkolem => (None, varX) |
330 | case c: Constant => (None, c.iri) | 330 | case c: Constant => (None, c.iri) |
331 | case s: Standard => { | 331 | case s: Standard => (Some(RDFoxUtil.skolem(s.name, term, varX)), varX) |
332 | val func = FunctionCall.create("SKOLEM", s.literal, term) | ||
333 | (Some(BindAtom.create(func, varX)), varX) | ||
334 | } | ||
335 | } | 332 | } |
336 | val (res, ext) = convert(cls, term1, unsafe, skolem, suffix) | 333 | val (res, ext) = convert(cls, term1, unsafe, skolem, suffix) |
337 | val prop = convert(role, term, term1, suffix) | 334 | val prop = convert(role, term, term1, suffix) |
@@ -359,10 +356,7 @@ trait RDFoxConverter { | |||
359 | val (bind, term1) = skolem match { | 356 | val (bind, term1) = skolem match { |
360 | case NoSkolem => (None, varX) | 357 | case NoSkolem => (None, varX) |
361 | case c: Constant => (None, c.iri) | 358 | case c: Constant => (None, c.iri) |
362 | case s: Standard => { | 359 | case s: Standard => (Some(RDFoxUtil.skolem(s.name, term, varX)), varX) |
363 | val func = FunctionCall.create("SKOLEM", s.literal, term) | ||
364 | (Some(BindAtom.create(func, varX)), varX) | ||
365 | } | ||
366 | } | 360 | } |
367 | val prop = convert(role, term, term1, suffix) | 361 | val prop = convert(role, term, term1, suffix) |
368 | (List(prop), bind.toList) | 362 | (List(prop), bind.toList) |
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/converter/SkolemStrategy.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/converter/SkolemStrategy.scala index 2142ff3..426a327 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/converter/SkolemStrategy.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/converter/SkolemStrategy.scala | |||
@@ -53,8 +53,7 @@ case object NoSkolem extends SkolemStrategy { | |||
53 | case class Standard(axiom: OWLAxiom)(implicit toString: (OWLAxiom) => String) | 53 | case class Standard(axiom: OWLAxiom)(implicit toString: (OWLAxiom) => String) |
54 | extends SkolemStrategy { | 54 | extends SkolemStrategy { |
55 | def dup(_axiom: OWLAxiom): Standard = copy(axiom = _axiom)(toString) | 55 | def dup(_axiom: OWLAxiom): Standard = copy(axiom = _axiom)(toString) |
56 | lazy val literal = | 56 | lazy val name = s"f_${toString(axiom)}" |
57 | Literal.create(s"f_${toString(axiom)}", Datatype.XSD_STRING) | ||
58 | } | 57 | } |
59 | 58 | ||
60 | /** Constant skolemization | 59 | /** Constant skolemization |