diff options
Diffstat (limited to 'src/main/scala/rsacomb/RSAComb.scala')
| -rw-r--r-- | src/main/scala/rsacomb/RSAComb.scala | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main/scala/rsacomb/RSAComb.scala b/src/main/scala/rsacomb/RSAComb.scala index a6f237f..62414e9 100644 --- a/src/main/scala/rsacomb/RSAComb.scala +++ b/src/main/scala/rsacomb/RSAComb.scala | |||
| @@ -10,7 +10,9 @@ import org.semanticweb.owlapi.model.{OWLAxiom, OWLSubClassOfAxiom, OWLEquivalent | |||
| 10 | import org.semanticweb.owlapi.model.OWLClassExpression | 10 | import org.semanticweb.owlapi.model.OWLClassExpression |
| 11 | import org.semanticweb.owlapi.model.OWLOntology | 11 | import org.semanticweb.owlapi.model.OWLOntology |
| 12 | import org.semanticweb.owlapi.model.OWLOntologyManager | 12 | import org.semanticweb.owlapi.model.OWLOntologyManager |
| 13 | import org.semanticweb.owlapi.model.IRI | ||
| 13 | import org.semanticweb.owlapi.model.parameters.Imports | 14 | import org.semanticweb.owlapi.model.parameters.Imports |
| 15 | import uk.ac.manchester.cs.owl.owlapi.OWLObjectPropertyImpl | ||
| 14 | 16 | ||
| 15 | import tech.oxfordsemantic.jrdfox.Prefixes | 17 | import tech.oxfordsemantic.jrdfox.Prefixes |
| 16 | import tech.oxfordsemantic.jrdfox.client.{ConnectionFactory, ServerConnection, DataStoreConnection} | 18 | import tech.oxfordsemantic.jrdfox.client.{ConnectionFactory, ServerConnection, DataStoreConnection} |
| @@ -55,6 +57,11 @@ object RSA { | |||
| 55 | 57 | ||
| 56 | val renderer = new DLSyntaxObjectRenderer() | 58 | val renderer = new DLSyntaxObjectRenderer() |
| 57 | 59 | ||
| 60 | // Here we need to compute the unsafe roles. This is hardcoded for now. | ||
| 61 | val unsafe = List( | ||
| 62 | new OWLObjectPropertyImpl(IRI.create("http://example.com/rsa_example.owl#S")).getInverseProperty() | ||
| 63 | ) | ||
| 64 | |||
| 58 | /* Print TBox axioms */ | 65 | /* Print TBox axioms */ |
| 59 | println("TBox/RBox:") | 66 | println("TBox/RBox:") |
| 60 | for { | 67 | for { |
| @@ -68,12 +75,12 @@ object RSA { | |||
| 68 | println("Logic rules:") | 75 | println("Logic rules:") |
| 69 | for { | 76 | for { |
| 70 | axiom <- onto.tboxAxioms(Imports.EXCLUDED).collect(Collectors.toList()).asScala | 77 | axiom <- onto.tboxAxioms(Imports.EXCLUDED).collect(Collectors.toList()).asScala |
| 71 | visitor = new RDFoxAxiomConverter(Variable.create("x"), SkolemStrategy.Constant(axiom.toString)) | 78 | visitor = new RDFoxAxiomConverter(Variable.create("x"), SkolemStrategy.ConstantRSA(axiom.toString), unsafe) |
| 72 | rule <- axiom.accept(visitor) | 79 | rule <- axiom.accept(visitor) |
| 73 | } yield println(rule) | 80 | } yield println(rule) |
| 74 | for { | 81 | for { |
| 75 | axiom <- onto.rboxAxioms(Imports.EXCLUDED).collect(Collectors.toList()).asScala | 82 | axiom <- onto.rboxAxioms(Imports.EXCLUDED).collect(Collectors.toList()).asScala |
| 76 | visitor = new RDFoxAxiomConverter(Variable.create("x"), SkolemStrategy.Constant(axiom.toString)) | 83 | visitor = new RDFoxAxiomConverter(Variable.create("x"), SkolemStrategy.ConstantRSA(axiom.toString), unsafe) |
| 77 | rule <- axiom.accept(visitor) | 84 | rule <- axiom.accept(visitor) |
| 78 | } yield println(rule) | 85 | } yield println(rule) |
| 79 | 86 | ||
