diff options
author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-08-04 11:11:57 +0100 |
---|---|---|
committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-08-04 11:11:57 +0100 |
commit | e8518528a77edf6a28449a57bd96048a6232a5db (patch) | |
tree | 1dca0e5f8cb1b465e85096f4e5699dd75e77b0f0 /src/main/scala/rsacomb/RSAComb.scala | |
parent | 88597503975804e3cb83d116f3cc9a3f12c57461 (diff) | |
download | RSAComb-e8518528a77edf6a28449a57bd96048a6232a5db.tar.gz RSAComb-e8518528a77edf6a28449a57bd96048a6232a5db.zip |
Adapt LP conversion to RSA check
Part of the process involves the search of unsafe roles in the input
ontology. This is still to be implemented and for now the set of unsafe
roles for the testing example is hardcoded.
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 | ||