diff options
Diffstat (limited to 'src/main/scala/rsacomb/RSA.scala')
-rw-r--r-- | src/main/scala/rsacomb/RSA.scala | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/main/scala/rsacomb/RSA.scala b/src/main/scala/rsacomb/RSA.scala index a6f4b88..66de974 100644 --- a/src/main/scala/rsacomb/RSA.scala +++ b/src/main/scala/rsacomb/RSA.scala | |||
@@ -9,12 +9,17 @@ import tech.oxfordsemantic.jrdfox.Prefixes | |||
9 | import tech.oxfordsemantic.jrdfox.logic.expression.{Variable, IRI} | 9 | import tech.oxfordsemantic.jrdfox.logic.expression.{Variable, IRI} |
10 | import org.semanticweb.owlapi.apibinding.OWLManager | 10 | import org.semanticweb.owlapi.apibinding.OWLManager |
11 | import org.semanticweb.owlapi.model.OWLOntology | 11 | import org.semanticweb.owlapi.model.OWLOntology |
12 | import org.semanticweb.owlapi.model.{ | ||
13 | OWLAxiom, | ||
14 | OWLClass, | ||
15 | OWLObjectPropertyExpression | ||
16 | } | ||
12 | import rsacomb.RSAOntology | 17 | import rsacomb.RSAOntology |
13 | 18 | ||
14 | // Debug only | 19 | // Debug only |
15 | import scala.collection.JavaConverters._ | 20 | import scala.collection.JavaConverters._ |
16 | 21 | ||
17 | object RSA extends RSAOntology { | 22 | object RSA extends RSAOntology with RSAAxiom { |
18 | 23 | ||
19 | val Prefixes = new Prefixes() | 24 | val Prefixes = new Prefixes() |
20 | Prefixes.declarePrefix(":", "http://example.com/rsa_example.owl#") | 25 | Prefixes.declarePrefix(":", "http://example.com/rsa_example.owl#") |
@@ -43,6 +48,18 @@ object RSA extends RSAOntology { | |||
43 | + name.toString | 48 | + name.toString |
44 | ) | 49 | ) |
45 | 50 | ||
51 | def hashed( | ||
52 | cls1: OWLClass, | ||
53 | prop: OWLObjectPropertyExpression, | ||
54 | cls2: OWLClass | ||
55 | ): String = | ||
56 | (cls1, prop, cls2).hashCode.toString | ||
57 | |||
58 | def hashed(axiom: OWLAxiom): String = { | ||
59 | val (cls1, prop, cls2) = axiom.toTriple.get | ||
60 | this.hashed(cls1, prop, cls2) | ||
61 | } | ||
62 | |||
46 | // TODO: move this somewhere else... maybe an OntoUtils class or something. | 63 | // TODO: move this somewhere else... maybe an OntoUtils class or something. |
47 | def loadOntology(onto: File): OWLOntology = { | 64 | def loadOntology(onto: File): OWLOntology = { |
48 | val manager = OWLManager.createOWLOntologyManager() | 65 | val manager = OWLManager.createOWLOntologyManager() |