diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-11-10 10:43:49 +0000 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-11-10 10:43:49 +0000 |
| commit | cbc3f81b75296bd92ebddf5acb74542d89d78b1e (patch) | |
| tree | 7d6e0f826d236730898db7d4eb1e614202453d44 | |
| parent | 2b85ac2d3bb318bc9d64b22eb81ff1518428398d (diff) | |
| download | RSAComb-cbc3f81b75296bd92ebddf5acb74542d89d78b1e.tar.gz RSAComb-cbc3f81b75296bd92ebddf5acb74542d89d78b1e.zip | |
Add OWLClassAssertionAxiom to axioms handled during translation
| -rw-r--r-- | src/main/scala/rsacomb/RDFoxAxiomConverter.scala | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/main/scala/rsacomb/RDFoxAxiomConverter.scala b/src/main/scala/rsacomb/RDFoxAxiomConverter.scala index 2d04c56..15a7cd1 100644 --- a/src/main/scala/rsacomb/RDFoxAxiomConverter.scala +++ b/src/main/scala/rsacomb/RDFoxAxiomConverter.scala | |||
| @@ -14,7 +14,12 @@ import tech.oxfordsemantic.jrdfox.logic.datalog.{ | |||
| 14 | TupleTableAtom, | 14 | TupleTableAtom, |
| 15 | TupleTableName | 15 | TupleTableName |
| 16 | } | 16 | } |
| 17 | import tech.oxfordsemantic.jrdfox.logic.expression.{Term, Variable, Literal} | 17 | import tech.oxfordsemantic.jrdfox.logic.expression.{ |
| 18 | Term, | ||
| 19 | IRI, | ||
| 20 | Variable, | ||
| 21 | Literal | ||
| 22 | } | ||
| 18 | 23 | ||
| 19 | import scala.collection.JavaConverters._ | 24 | import scala.collection.JavaConverters._ |
| 20 | 25 | ||
| @@ -22,6 +27,7 @@ import rsacomb.SkolemStrategy | |||
| 22 | import rsacomb.RDFoxRuleShards | 27 | import rsacomb.RDFoxRuleShards |
| 23 | import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom | 28 | import org.semanticweb.owlapi.model.OWLSubObjectPropertyOfAxiom |
| 24 | import org.semanticweb.owlapi.model.OWLObjectProperty | 29 | import org.semanticweb.owlapi.model.OWLObjectProperty |
| 30 | import org.semanticweb.owlapi.model.OWLClassAssertionAxiom | ||
| 25 | 31 | ||
| 26 | object RDFoxAxiomConverter { | 32 | object RDFoxAxiomConverter { |
| 27 | 33 | ||
| @@ -79,6 +85,21 @@ class RDFoxAxiomConverter( | |||
| 79 | List(Rule.create(head.asJava, body.asJava)) | 85 | List(Rule.create(head.asJava, body.asJava)) |
| 80 | } | 86 | } |
| 81 | 87 | ||
| 88 | override def visit(axiom: OWLClassAssertionAxiom): List[Rule] = { | ||
| 89 | val ind = axiom.getIndividual | ||
| 90 | if (ind.isNamed) { | ||
| 91 | val term = IRI.create(ind.asOWLNamedIndividual().getIRI.getIRIString) | ||
| 92 | println("This is executed") | ||
| 93 | val cls = axiom.getClassExpression | ||
| 94 | val visitor = | ||
| 95 | new RDFoxClassExprConverter(term, unsafe, SkolemStrategy.None, suffix) | ||
| 96 | val shard = cls.accept(visitor) | ||
| 97 | List(Rule.create(shard.res.asJava, shard.ext.asJava)) | ||
| 98 | } else { | ||
| 99 | List() | ||
| 100 | } | ||
| 101 | } | ||
| 102 | |||
| 82 | def doDefault(axiom: OWLAxiom): List[Rule] = List() | 103 | def doDefault(axiom: OWLAxiom): List[Rule] = List() |
| 83 | 104 | ||
| 84 | } // class RDFoxAxiomConverter | 105 | } // class RDFoxAxiomConverter |
