diff options
Diffstat (limited to 'src/main/scala/rsacomb/RSAAxiom.scala')
| -rw-r--r-- | src/main/scala/rsacomb/RSAAxiom.scala | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/main/scala/rsacomb/RSAAxiom.scala b/src/main/scala/rsacomb/RSAAxiom.scala new file mode 100644 index 0000000..032b7f9 --- /dev/null +++ b/src/main/scala/rsacomb/RSAAxiom.scala | |||
| @@ -0,0 +1,86 @@ | |||
| 1 | package rsacomb | ||
| 2 | |||
| 3 | /* Java imports */ | ||
| 4 | // import java.io.File | ||
| 5 | // import java.util.stream.{Collectors,Stream} | ||
| 6 | |||
| 7 | // import org.semanticweb.owlapi.apibinding.OWLManager | ||
| 8 | // import org.semanticweb.owlapi.model.{OWLOntologyManager,OWLOntology} | ||
| 9 | // import org.semanticweb.owlapi.model.{OWLAxiom,OWLObjectPropertyExpression} | ||
| 10 | import org.semanticweb.owlapi.model.{OWLAxiom,OWLSubClassOfAxiom, OWLEquivalentClassesAxiom} | ||
| 11 | import org.semanticweb.owlapi.model.OWLAxiomVisitorEx | ||
| 12 | // import org.semanticweb.owlapi.model.parameters.Imports | ||
| 13 | // import org.semanticweb.owlapi.reasoner.OWLReasoner | ||
| 14 | // import org.semanticweb.owlapi.reasoner.structural.StructuralReasonerFactory | ||
| 15 | |||
| 16 | // import tech.oxfordsemantic.jrdfox.logic.Variable | ||
| 17 | |||
| 18 | /* Scala imports */ | ||
| 19 | // import scala.collection.JavaConverters._ | ||
| 20 | |||
| 21 | /* Local imports */ | ||
| 22 | // import rsacomb.RSAAxiom | ||
| 23 | |||
| 24 | /* Debug only */ | ||
| 25 | // import org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxObjectRenderer | ||
| 26 | |||
| 27 | // import java.util.HashMap | ||
| 28 | // import java.util.stream.{Stream,Collectors} | ||
| 29 | |||
| 30 | // import org.semanticweb.owlapi.model.{AxiomType, ClassExpressionType, OWLObjectSomeValuesFrom} | ||
| 31 | // import org.semanticweb.owlapi.model.OWLClassExpression | ||
| 32 | // import org.semanticweb.owlapi.model.IRI | ||
| 33 | // import org.semanticweb.owlapi.reasoner.{OWLReasonerFactory, OWLReasoner} | ||
| 34 | // import uk.ac.manchester.cs.owl.owlapi.OWLObjectPropertyImpl | ||
| 35 | |||
| 36 | // import tech.oxfordsemantic.jrdfox.Prefixes | ||
| 37 | // import tech.oxfordsemantic.jrdfox.client.{ConnectionFactory, ServerConnection, DataStoreConnection} | ||
| 38 | // import tech.oxfordsemantic.jrdfox.client.UpdateType | ||
| 39 | // import tech.oxfordsemantic.jrdfox.logic.{Rule, Atom, Literal, Term, Variable} | ||
| 40 | // import tech.oxfordsemantic.jrdfox.logic.{BuiltinFunctionCall, TupleTableName} | ||
| 41 | // import tech.oxfordsemantic.jrdfox.logic.{LogicFormat} | ||
| 42 | |||
| 43 | |||
| 44 | // import rsacomb.SkolemStrategy | ||
| 45 | //import org.semanticweb.owlapi.model.{OWLAxiom,OWLObjectPropertyExpression} | ||
| 46 | |||
| 47 | trait RSAAxiom { | ||
| 48 | |||
| 49 | sealed trait RSAAxiomType | ||
| 50 | object RSAAxiomType { | ||
| 51 | case object T3 extends RSAAxiomType | ||
| 52 | case object T4 extends RSAAxiomType | ||
| 53 | case object T5 extends RSAAxiomType | ||
| 54 | } | ||
| 55 | |||
| 56 | implicit class RSAAxiom(axiom: OWLAxiom) { | ||
| 57 | |||
| 58 | private class RSAAxiomTypeDetector(t: RSAAxiomType) | ||
| 59 | extends OWLAxiomVisitorEx[Boolean] | ||
| 60 | { | ||
| 61 | |||
| 62 | override | ||
| 63 | def visit(axiom: OWLSubClassOfAxiom): Boolean = { | ||
| 64 | true | ||
| 65 | } | ||
| 66 | |||
| 67 | override | ||
| 68 | def visit(axiom: OWLEquivalentClassesAxiom): Boolean = { | ||
| 69 | true | ||
| 70 | } | ||
| 71 | |||
| 72 | def doDefault(axiom : OWLAxiom): Boolean = false | ||
| 73 | |||
| 74 | } | ||
| 75 | |||
| 76 | private def isOfType(t: RSAAxiomType): Boolean = { | ||
| 77 | val visitor = new RSAAxiomTypeDetector(t) | ||
| 78 | axiom.accept(visitor) | ||
| 79 | } | ||
| 80 | |||
| 81 | def isT3: Boolean = isOfType(RSAAxiomType.T3) | ||
| 82 | def isT4: Boolean = isOfType(RSAAxiomType.T4) | ||
| 83 | def isT5: Boolean = isOfType(RSAAxiomType.T5) | ||
| 84 | } | ||
| 85 | |||
| 86 | } | ||
