diff options
Diffstat (limited to 'src/main/scala/rsacomb/RDFoxClassExprConverter.scala')
| -rw-r--r-- | src/main/scala/rsacomb/RDFoxClassExprConverter.scala | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/scala/rsacomb/RDFoxClassExprConverter.scala b/src/main/scala/rsacomb/RDFoxClassExprConverter.scala index b9d3ea2..a319d86 100644 --- a/src/main/scala/rsacomb/RDFoxClassExprConverter.scala +++ b/src/main/scala/rsacomb/RDFoxClassExprConverter.scala | |||
| @@ -34,7 +34,7 @@ import org.semanticweb.owlapi.model.OWLObjectProperty | |||
| 34 | object RDFoxClassExprConverter { | 34 | object RDFoxClassExprConverter { |
| 35 | 35 | ||
| 36 | def apply( | 36 | def apply( |
| 37 | term: Term = Variable.create("x"), | 37 | term: Term, |
| 38 | skolem: SkolemStrategy = SkolemStrategy.None, | 38 | skolem: SkolemStrategy = SkolemStrategy.None, |
| 39 | unsafe: List[OWLObjectPropertyExpression] = List() | 39 | unsafe: List[OWLObjectPropertyExpression] = List() |
| 40 | ): RDFoxClassExprConverter = | 40 | ): RDFoxClassExprConverter = |
| @@ -61,7 +61,8 @@ class RDFoxClassExprConverter( | |||
| 61 | 61 | ||
| 62 | // OWLClass | 62 | // OWLClass |
| 63 | override def visit(expr: OWLClass): RDFoxRuleShards = { | 63 | override def visit(expr: OWLClass): RDFoxRuleShards = { |
| 64 | val atom = List(Atom.rdf(term, IRI.RDF_TYPE, expr.getIRI())) | 64 | val iri: IRI = if (expr.isTopEntity()) IRI.THING else expr.getIRI() |
| 65 | val atom = List(Atom.rdf(term, IRI.RDF_TYPE, iri)) | ||
| 65 | RDFoxRuleShards(atom, List()) | 66 | RDFoxRuleShards(atom, List()) |
| 66 | } | 67 | } |
| 67 | 68 | ||
| @@ -94,9 +95,8 @@ class RDFoxClassExprConverter( | |||
| 94 | 95 | ||
| 95 | // OWLObjectSomeValuesFrom | 96 | // OWLObjectSomeValuesFrom |
| 96 | override def visit(expr: OWLObjectSomeValuesFrom): RDFoxRuleShards = { | 97 | override def visit(expr: OWLObjectSomeValuesFrom): RDFoxRuleShards = { |
| 97 | // TODO: variables needs to be handled at visitor level. Hardcoding | 98 | val y = RSA.getFreshVariable() |
| 98 | // the name of the varibles might lead to errors for complex cases. | 99 | // Here we are assuming a role name |
| 99 | val y = Variable.create("y") | ||
| 100 | val prop = expr.getProperty() | 100 | val prop = expr.getProperty() |
| 101 | // Computes the result of rule skolemization. Depending on the used | 101 | // Computes the result of rule skolemization. Depending on the used |
| 102 | // technique it might involve the introduction of additional atoms, | 102 | // technique it might involve the introduction of additional atoms, |
| @@ -139,7 +139,7 @@ class RDFoxClassExprConverter( | |||
| 139 | // OWLObjectMaxCardinality | 139 | // OWLObjectMaxCardinality |
| 140 | override def visit(expr: OWLObjectMaxCardinality): RDFoxRuleShards = { | 140 | override def visit(expr: OWLObjectMaxCardinality): RDFoxRuleShards = { |
| 141 | // TODO: again, no hardcoded variables | 141 | // TODO: again, no hardcoded variables |
| 142 | val vars = List(Variable.create("y"), Variable.create("z")) | 142 | val vars = List(RSA.getFreshVariable(), RSA.getFreshVariable()) |
| 143 | val classResult = RDFoxClassExprConverter.merge( | 143 | val classResult = RDFoxClassExprConverter.merge( |
| 144 | vars | 144 | vars |
| 145 | .map(new RDFoxClassExprConverter(_, skolem, unsafe)) | 145 | .map(new RDFoxClassExprConverter(_, skolem, unsafe)) |
