diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-11-10 15:18:35 +0000 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-11-10 15:18:35 +0000 |
| commit | 159605a3b8b55a8394600a9c73d0c8bccba0546f (patch) | |
| tree | e7a72e786a26bd66785e74a961cc68686e4021f2 /src/main/scala/rsacomb/RSAAxiom.scala | |
| parent | 7b902bbd2670db841f6bef0d648812a5ac42e1a1 (diff) | |
| download | RSAComb-159605a3b8b55a8394600a9c73d0c8bccba0546f.tar.gz RSAComb-159605a3b8b55a8394600a9c73d0c8bccba0546f.zip | |
Generalize axiom hashing for constant generation
Diffstat (limited to 'src/main/scala/rsacomb/RSAAxiom.scala')
| -rw-r--r-- | src/main/scala/rsacomb/RSAAxiom.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/scala/rsacomb/RSAAxiom.scala b/src/main/scala/rsacomb/RSAAxiom.scala index aca44b1..f504bbe 100644 --- a/src/main/scala/rsacomb/RSAAxiom.scala +++ b/src/main/scala/rsacomb/RSAAxiom.scala | |||
| @@ -19,6 +19,7 @@ import org.semanticweb.owlapi.model.{ | |||
| 19 | OWLAxiomVisitorEx, | 19 | OWLAxiomVisitorEx, |
| 20 | OWLClassExpressionVisitorEx | 20 | OWLClassExpressionVisitorEx |
| 21 | } | 21 | } |
| 22 | import org.semanticweb.owlapi.model.OWLObjectProperty | ||
| 22 | 23 | ||
| 23 | /* Wrapper trait for the implicit class `RSAAxiom`. | 24 | /* Wrapper trait for the implicit class `RSAAxiom`. |
| 24 | */ | 25 | */ |
| @@ -163,6 +164,19 @@ trait RSAAxiom { | |||
| 163 | val visitor = new RSAAxiomRoleExtractor() | 164 | val visitor = new RSAAxiomRoleExtractor() |
| 164 | axiom.accept(visitor) | 165 | axiom.accept(visitor) |
| 165 | } | 166 | } |
| 167 | |||
| 168 | lazy val toTriple: Option[(OWLClass, OWLObjectProperty, OWLClass)] = | ||
| 169 | for { | ||
| 170 | subClass <- Some(axiom) collect { case a: OWLSubClassOfAxiom => a } | ||
| 171 | cls1 <- Some(subClass.getSubClass) collect { case a: OWLClass => a } | ||
| 172 | someValues <- Some(subClass.getSuperClass) collect { | ||
| 173 | case a: OWLObjectSomeValuesFrom => a | ||
| 174 | } | ||
| 175 | prop <- Some(someValues.getProperty) collect { | ||
| 176 | case a: OWLObjectProperty => a | ||
| 177 | } | ||
| 178 | cls2 <- Some(someValues.getFiller) collect { case a: OWLClass => a } | ||
| 179 | } yield (cls1, prop, cls2) | ||
| 166 | } | 180 | } |
| 167 | 181 | ||
| 168 | } // trait RSAAxiom | 182 | } // trait RSAAxiom |
