aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/rsacomb/RSA.scala
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2020-09-07 13:08:31 +0200
committerFederico Igne <federico.igne@cs.ox.ac.uk>2020-09-07 13:08:31 +0200
commit2b661f3ac6fdb5156168b6775ede24e4c7b53758 (patch)
tree0e3514c38fedf41febff82e9bf93aea2ab4d7a7f /src/main/scala/rsacomb/RSA.scala
parent7e126824e9a6cb456295d2f1535aef975bb63237 (diff)
downloadRSAComb-2b661f3ac6fdb5156168b6775ede24e4c7b53758.tar.gz
RSAComb-2b661f3ac6fdb5156168b6775ede24e4c7b53758.zip
Add setup code to compute the RSA filtering program
Not all rules of the filtering program have been implemented, but the code for the generation and reification of the rules seems to work.
Diffstat (limited to 'src/main/scala/rsacomb/RSA.scala')
-rw-r--r--src/main/scala/rsacomb/RSA.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/scala/rsacomb/RSA.scala b/src/main/scala/rsacomb/RSA.scala
index 79617c7..c0d4e51 100644
--- a/src/main/scala/rsacomb/RSA.scala
+++ b/src/main/scala/rsacomb/RSA.scala
@@ -8,6 +8,18 @@ import tech.oxfordsemantic.jrdfox.Prefixes
8import tech.oxfordsemantic.jrdfox.logic.IRI 8import tech.oxfordsemantic.jrdfox.logic.IRI
9import org.semanticweb.owlapi.apibinding.OWLManager 9import org.semanticweb.owlapi.apibinding.OWLManager
10import org.semanticweb.owlapi.model.OWLOntology 10import org.semanticweb.owlapi.model.OWLOntology
11import rsacomb.RSAOntology
12
13// Debug only
14import tech.oxfordsemantic.jrdfox.logic.{
15 Formula,
16 Atom,
17 Variable,
18 Query,
19 QueryType,
20 Conjunction
21}
22import scala.collection.JavaConverters._
11 23
12object RSA extends RSAOntology { 24object RSA extends RSAOntology {
13 25
@@ -18,6 +30,18 @@ object RSA extends RSAOntology {
18 Prefixes.declarePrefix("rdfs:", "http://www.w3.org/2000/01/rdf-schema#") 30 Prefixes.declarePrefix("rdfs:", "http://www.w3.org/2000/01/rdf-schema#")
19 Prefixes.declarePrefix("owl:", "http://www.w3.org/2002/07/owl#") 31 Prefixes.declarePrefix("owl:", "http://www.w3.org/2002/07/owl#")
20 32
33 val varX = Variable.create("X")
34 val varY = Variable.create("Y")
35 val varZ = Variable.create("Z")
36 val testAnswerVars = List[Variable](varX, varY, varZ).asJava;
37 val testFormula: Formula =
38 Conjunction.create(
39 Atom.rdf(varX, IRI.TOP_OBJECT_PROPERTY, varY),
40 Atom.rdf(varY, IRI.TOP_OBJECT_PROPERTY, varZ)
41 )
42 val test_query =
43 Query.create(QueryType.SELECT, false, testAnswerVars, testFormula)
44
21 def internal(name: String): IRI = 45 def internal(name: String): IRI =
22 IRI.create( 46 IRI.create(
23 Prefixes.getPrefixIRIsByPrefixName.get("internal:").getIRI + name 47 Prefixes.getPrefixIRIsByPrefixName.get("internal:").getIRI + name