diff options
Diffstat (limited to 'src/main/scala/rsacomb/RSAComb.scala')
| -rw-r--r-- | src/main/scala/rsacomb/RSAComb.scala | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/src/main/scala/rsacomb/RSAComb.scala b/src/main/scala/rsacomb/RSAComb.scala index 16d7a04..a6f237f 100644 --- a/src/main/scala/rsacomb/RSAComb.scala +++ b/src/main/scala/rsacomb/RSAComb.scala | |||
| @@ -22,6 +22,7 @@ import tech.oxfordsemantic.jrdfox.logic.{LogicFormat} | |||
| 22 | import scala.collection.JavaConverters._ | 22 | import scala.collection.JavaConverters._ |
| 23 | 23 | ||
| 24 | import rsacomb.SkolemStrategy | 24 | import rsacomb.SkolemStrategy |
| 25 | import org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxObjectRenderer | ||
| 25 | 26 | ||
| 26 | class RSA(ontology : OWLOntology) { | 27 | class RSA(ontology : OWLOntology) { |
| 27 | 28 | ||
| @@ -52,12 +53,29 @@ object RSA { | |||
| 52 | * step of approximation of an Horn-ALCHOIQ to RSA | 53 | * step of approximation of an Horn-ALCHOIQ to RSA |
| 53 | */ | 54 | */ |
| 54 | 55 | ||
| 56 | val renderer = new DLSyntaxObjectRenderer() | ||
| 57 | |||
| 58 | /* Print TBox axioms */ | ||
| 59 | println("TBox/RBox:") | ||
| 60 | for { | ||
| 61 | axiom <- onto.tboxAxioms(Imports.EXCLUDED).collect(Collectors.toList()).asScala | ||
| 62 | } yield println(renderer.render(axiom)) | ||
| 63 | for { | ||
| 64 | axiom <- onto.rboxAxioms(Imports.EXCLUDED).collect(Collectors.toList()).asScala | ||
| 65 | } yield println(renderer.render(axiom)) | ||
| 66 | |||
| 55 | /* Ontology axiom convertion into LP rules */ | 67 | /* Ontology axiom convertion into LP rules */ |
| 56 | for { | 68 | println("Logic rules:") |
| 69 | for { | ||
| 57 | axiom <- onto.tboxAxioms(Imports.EXCLUDED).collect(Collectors.toList()).asScala | 70 | axiom <- onto.tboxAxioms(Imports.EXCLUDED).collect(Collectors.toList()).asScala |
| 58 | visitor = new RDFoxAxiomConverter(Variable.create("x"), SkolemStrategy.Constant(axiom.toString)) | 71 | visitor = new RDFoxAxiomConverter(Variable.create("x"), SkolemStrategy.Constant(axiom.toString)) |
| 59 | rule <- axiom.accept(visitor) | 72 | rule <- axiom.accept(visitor) |
| 60 | } yield println(rule) | 73 | } yield println(rule) |
| 74 | for { | ||
| 75 | axiom <- onto.rboxAxioms(Imports.EXCLUDED).collect(Collectors.toList()).asScala | ||
| 76 | visitor = new RDFoxAxiomConverter(Variable.create("x"), SkolemStrategy.Constant(axiom.toString)) | ||
| 77 | rule <- axiom.accept(visitor) | ||
| 78 | } yield println(rule) | ||
| 61 | 79 | ||
| 62 | /* Return true for now... */ | 80 | /* Return true for now... */ |
| 63 | true | 81 | true |
