diff options
Diffstat (limited to 'src/main/scala/rsacomb/RDFoxClassExprConverter.scala')
| -rw-r--r-- | src/main/scala/rsacomb/RDFoxClassExprConverter.scala | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/src/main/scala/rsacomb/RDFoxClassExprConverter.scala b/src/main/scala/rsacomb/RDFoxClassExprConverter.scala index f3a0dfc..f4187ed 100644 --- a/src/main/scala/rsacomb/RDFoxClassExprConverter.scala +++ b/src/main/scala/rsacomb/RDFoxClassExprConverter.scala | |||
| @@ -26,12 +26,11 @@ import tech.oxfordsemantic.jrdfox.logic.expression.{ | |||
| 26 | IRI | 26 | IRI |
| 27 | } | 27 | } |
| 28 | 28 | ||
| 29 | import rsacomb.SkolemStrategy | ||
| 30 | import rsacomb.RDFoxRuleShards | ||
| 31 | import org.semanticweb.owlapi.model.OWLObjectPropertyExpression | 29 | import org.semanticweb.owlapi.model.OWLObjectPropertyExpression |
| 32 | import org.semanticweb.owlapi.model.OWLObjectProperty | 30 | import org.semanticweb.owlapi.model.OWLObjectProperty |
| 33 | 31 | ||
| 34 | import suffix.{RSASuffix, Empty} | 32 | import suffix.{RSASuffix, Empty} |
| 33 | import util.RSA | ||
| 35 | 34 | ||
| 36 | object RDFoxClassExprConverter { | 35 | object RDFoxClassExprConverter { |
| 37 | 36 | ||
| @@ -61,7 +60,7 @@ class RDFoxClassExprConverter( | |||
| 61 | suffix: RSASuffix | 60 | suffix: RSASuffix |
| 62 | ) extends OWLClassExpressionVisitorEx[RDFoxRuleShards] { | 61 | ) extends OWLClassExpressionVisitorEx[RDFoxRuleShards] { |
| 63 | 62 | ||
| 64 | import RDFoxUtil.owlapi2rdfox; | 63 | import implicits.RDFox._ |
| 65 | 64 | ||
| 66 | // OWLClass | 65 | // OWLClass |
| 67 | override def visit(expr: OWLClass): RDFoxRuleShards = { | 66 | override def visit(expr: OWLClass): RDFoxRuleShards = { |
| @@ -99,7 +98,7 @@ class RDFoxClassExprConverter( | |||
| 99 | 98 | ||
| 100 | // OWLObjectSomeValuesFrom | 99 | // OWLObjectSomeValuesFrom |
| 101 | override def visit(expr: OWLObjectSomeValuesFrom): RDFoxRuleShards = { | 100 | override def visit(expr: OWLObjectSomeValuesFrom): RDFoxRuleShards = { |
| 102 | val y = RSA.getFreshVariable() | 101 | val y = RSAOntology.genFreshVariable() |
| 103 | // Here we are assuming a role name | 102 | // Here we are assuming a role name |
| 104 | val prop = expr.getProperty() | 103 | val prop = expr.getProperty() |
| 105 | // Computes the result of rule skolemization. Depending on the used | 104 | // Computes the result of rule skolemization. Depending on the used |
| @@ -110,14 +109,7 @@ class RDFoxClassExprConverter( | |||
| 110 | case SkolemStrategy.Constant(c) => (List(), List(), c) | 109 | case SkolemStrategy.Constant(c) => (List(), List(), c) |
| 111 | case SkolemStrategy.ConstantRSA(c) => { | 110 | case SkolemStrategy.ConstantRSA(c) => { |
| 112 | if (unsafe.contains(prop)) | 111 | if (unsafe.contains(prop)) |
| 113 | ( | 112 | (List(RSA.PE(term, c), RSA.U(c)), List(), c) |
| 114 | List( | ||
| 115 | TupleTableAtom.rdf(term, RSA.rsa("PE"), c), | ||
| 116 | TupleTableAtom.rdf(c, IRI.RDF_TYPE, RSA.rsa("U")) | ||
| 117 | ), | ||
| 118 | List(), | ||
| 119 | c | ||
| 120 | ) | ||
| 121 | else | 113 | else |
| 122 | (List(), List(), c) | 114 | (List(), List(), c) |
| 123 | } | 115 | } |
| @@ -143,7 +135,8 @@ class RDFoxClassExprConverter( | |||
| 143 | // OWLObjectMaxCardinality | 135 | // OWLObjectMaxCardinality |
| 144 | override def visit(expr: OWLObjectMaxCardinality): RDFoxRuleShards = { | 136 | override def visit(expr: OWLObjectMaxCardinality): RDFoxRuleShards = { |
| 145 | // TODO: again, no hardcoded variables | 137 | // TODO: again, no hardcoded variables |
| 146 | val vars = List(RSA.getFreshVariable(), RSA.getFreshVariable()) | 138 | val vars = |
| 139 | List(RSAOntology.genFreshVariable(), RSAOntology.genFreshVariable()) | ||
| 147 | val classResult = RDFoxClassExprConverter.merge( | 140 | val classResult = RDFoxClassExprConverter.merge( |
| 148 | vars | 141 | vars |
| 149 | .map(new RDFoxClassExprConverter(_, unsafe, skolem, suffix)) | 142 | .map(new RDFoxClassExprConverter(_, unsafe, skolem, suffix)) |
