aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/rsacomb/RSA.scala
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2020-11-10 15:18:35 +0000
committerFederico Igne <federico.igne@cs.ox.ac.uk>2020-11-10 15:18:35 +0000
commit159605a3b8b55a8394600a9c73d0c8bccba0546f (patch)
treee7a72e786a26bd66785e74a961cc68686e4021f2 /src/main/scala/rsacomb/RSA.scala
parent7b902bbd2670db841f6bef0d648812a5ac42e1a1 (diff)
downloadRSAComb-159605a3b8b55a8394600a9c73d0c8bccba0546f.tar.gz
RSAComb-159605a3b8b55a8394600a9c73d0c8bccba0546f.zip
Generalize axiom hashing for constant generation
Diffstat (limited to 'src/main/scala/rsacomb/RSA.scala')
-rw-r--r--src/main/scala/rsacomb/RSA.scala19
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
9import tech.oxfordsemantic.jrdfox.logic.expression.{Variable, IRI} 9import tech.oxfordsemantic.jrdfox.logic.expression.{Variable, IRI}
10import org.semanticweb.owlapi.apibinding.OWLManager 10import org.semanticweb.owlapi.apibinding.OWLManager
11import org.semanticweb.owlapi.model.OWLOntology 11import org.semanticweb.owlapi.model.OWLOntology
12import org.semanticweb.owlapi.model.{
13 OWLAxiom,
14 OWLClass,
15 OWLObjectPropertyExpression
16}
12import rsacomb.RSAOntology 17import rsacomb.RSAOntology
13 18
14// Debug only 19// Debug only
15import scala.collection.JavaConverters._ 20import scala.collection.JavaConverters._
16 21
17object RSA extends RSAOntology { 22object 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()