aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/rsacomb/RSAAxiom.scala
blob: 032b7f9a46b1627a5dcb97c8ee123a92caae59f5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
package rsacomb

/* Java imports */
// import java.io.File
// import java.util.stream.{Collectors,Stream}

// import org.semanticweb.owlapi.apibinding.OWLManager
// import org.semanticweb.owlapi.model.{OWLOntologyManager,OWLOntology}
// import org.semanticweb.owlapi.model.{OWLAxiom,OWLObjectPropertyExpression}
import org.semanticweb.owlapi.model.{OWLAxiom,OWLSubClassOfAxiom, OWLEquivalentClassesAxiom}
import org.semanticweb.owlapi.model.OWLAxiomVisitorEx
// import org.semanticweb.owlapi.model.parameters.Imports
// import org.semanticweb.owlapi.reasoner.OWLReasoner
// import org.semanticweb.owlapi.reasoner.structural.StructuralReasonerFactory

// import tech.oxfordsemantic.jrdfox.logic.Variable

/* Scala imports */
// import scala.collection.JavaConverters._

/* Local imports */
// import rsacomb.RSAAxiom 

/* Debug only */
// import org.semanticweb.owlapi.dlsyntax.renderer.DLSyntaxObjectRenderer

// import java.util.HashMap
// import java.util.stream.{Stream,Collectors}

// import org.semanticweb.owlapi.model.{AxiomType, ClassExpressionType, OWLObjectSomeValuesFrom}
// import org.semanticweb.owlapi.model.OWLClassExpression
// import org.semanticweb.owlapi.model.IRI
// import org.semanticweb.owlapi.reasoner.{OWLReasonerFactory, OWLReasoner}
// import uk.ac.manchester.cs.owl.owlapi.OWLObjectPropertyImpl

// import tech.oxfordsemantic.jrdfox.Prefixes
// import tech.oxfordsemantic.jrdfox.client.{ConnectionFactory, ServerConnection, DataStoreConnection}
// import tech.oxfordsemantic.jrdfox.client.UpdateType
// import tech.oxfordsemantic.jrdfox.logic.{Rule, Atom, Literal, Term, Variable}
// import tech.oxfordsemantic.jrdfox.logic.{BuiltinFunctionCall, TupleTableName}
// import tech.oxfordsemantic.jrdfox.logic.{LogicFormat}


// import rsacomb.SkolemStrategy
//import org.semanticweb.owlapi.model.{OWLAxiom,OWLObjectPropertyExpression}

trait RSAAxiom {

  sealed trait RSAAxiomType
  object RSAAxiomType {
    case object T3 extends RSAAxiomType
    case object T4 extends RSAAxiomType
    case object T5 extends RSAAxiomType
  }

  implicit class RSAAxiom(axiom: OWLAxiom) {

    private class RSAAxiomTypeDetector(t: RSAAxiomType)
      extends OWLAxiomVisitorEx[Boolean]
    {

      override
      def visit(axiom: OWLSubClassOfAxiom): Boolean = {
        true
      }

      override
      def visit(axiom: OWLEquivalentClassesAxiom): Boolean = {
        true
      }

      def doDefault(axiom : OWLAxiom): Boolean = false

    }

    private def isOfType(t: RSAAxiomType): Boolean = {
      val visitor = new RSAAxiomTypeDetector(t)
      axiom.accept(visitor)
    }

    def isT3: Boolean = isOfType(RSAAxiomType.T3)
    def isT4: Boolean = isOfType(RSAAxiomType.T4)
    def isT5: Boolean = isOfType(RSAAxiomType.T5)
  }

}