aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2020-10-02 11:51:56 +0200
committerFederico Igne <federico.igne@cs.ox.ac.uk>2020-10-02 11:51:56 +0200
commit015e0a233eb3a10e9d291c0bdb871394354177b0 (patch)
tree49fb86ccdb19a39aadc22eab8ed5375ac2100c55 /src
parent9ad95a1a08fb441a5594292c20ff2ac38bb8fb4f (diff)
downloadRSAComb-015e0a233eb3a10e9d291c0bdb871394354177b0.tar.gz
RSAComb-015e0a233eb3a10e9d291c0bdb871394354177b0.zip
Implement `self()` method for the computation of canonical models
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/rsacomb/RSAOntology.scala18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/main/scala/rsacomb/RSAOntology.scala b/src/main/scala/rsacomb/RSAOntology.scala
index 26b56d7..fbb5f8a 100644
--- a/src/main/scala/rsacomb/RSAOntology.scala
+++ b/src/main/scala/rsacomb/RSAOntology.scala
@@ -7,7 +7,8 @@ import java.util.stream.{Collectors, Stream}
7import org.semanticweb.owlapi.model.OWLOntology 7import org.semanticweb.owlapi.model.OWLOntology
8import org.semanticweb.owlapi.model.{ 8import org.semanticweb.owlapi.model.{
9 OWLObjectProperty, 9 OWLObjectProperty,
10 OWLObjectPropertyExpression 10 OWLObjectPropertyExpression,
11 OWLSubClassOfAxiom
11} 12}
12import org.semanticweb.owlapi.model.parameters.Imports 13import org.semanticweb.owlapi.model.parameters.Imports
13import org.semanticweb.owlapi.reasoner.structural.StructuralReasonerFactory 14import org.semanticweb.owlapi.reasoner.structural.StructuralReasonerFactory
@@ -216,7 +217,7 @@ trait RSAOntology {
216 def filteringProgram(query: Query): List[Rule] = 217 def filteringProgram(query: Query): List[Rule] =
217 FilteringProgram(query, individuals).rules 218 FilteringProgram(query, individuals).rules
218 219
219 // TODO: needs testing 220 // TODO: the following functions needs testing
220 def confl( 221 def confl(
221 role: OWLObjectPropertyExpression 222 role: OWLObjectPropertyExpression
222 ): Set[OWLObjectPropertyExpression] = { 223 ): Set[OWLObjectPropertyExpression] = {
@@ -238,6 +239,19 @@ trait RSAOntology {
238 ) 239 )
239 } 240 }
240 241
242 def self(axiom: OWLSubClassOfAxiom): Set[Term] = {
243 // Assuming just one role in the signature of a T5 axiom
244 val role = axiom.objectPropertyExpressionsInSignature(0)
245 if (this.confl(role).contains(role)) {
246 Set(
247 RSA.internal("v0_" ++ axiom.hashCode.toString()),
248 RSA.internal("v1_" ++ axiom.hashCode.toString())
249 )
250 } else {
251 Set()
252 }
253 }
254
241 } // implicit class RSAOntology 255 } // implicit class RSAOntology
242 256
243} // trait RSAOntology 257} // trait RSAOntology