aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/rsacomb/Main.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/rsacomb/Main.scala')
-rw-r--r--src/main/scala/rsacomb/Main.scala21
1 files changed, 16 insertions, 5 deletions
diff --git a/src/main/scala/rsacomb/Main.scala b/src/main/scala/rsacomb/Main.scala
index 596ef33..3963981 100644
--- a/src/main/scala/rsacomb/Main.scala
+++ b/src/main/scala/rsacomb/Main.scala
@@ -91,7 +91,7 @@ object RSAComb extends App {
91 // Step 2. Computing the canonical model 91 // Step 2. Computing the canonical model
92 val nis = { 92 val nis = {
93 val query = 93 val query =
94 "SELECT ?Y WHERE { ?X internal:EquivTo ?Y ; a internal:NAMED . }" 94 "SELECT ?Y WHERE { ?X rsa:EquivTo ?Y ; a rsa:NAMED . }"
95 val cursor = 95 val cursor =
96 data.createCursor( 96 data.createCursor(
97 RSA.Prefixes, 97 RSA.Prefixes,
@@ -126,7 +126,7 @@ object RSAComb extends App {
126 } 126 }
127 query ++= " WHERE {" 127 query ++= " WHERE {"
128 for (i <- 0 until arity) { 128 for (i <- 0 until arity) {
129 query ++= s" ?S internal:${pred}_$i ?X$i ." 129 query ++= s" ?S rsa:${pred}_$i ?X$i ."
130 } 130 }
131 query ++= " }" 131 query ++= " }"
132 // Collect answers 132 // Collect answers
@@ -159,7 +159,7 @@ object RSAComb extends App {
159 RDFoxUtil.submitQuery( 159 RDFoxUtil.submitQuery(
160 data, 160 data,
161 RSA.Prefixes, 161 RSA.Prefixes,
162 "SELECT ?X { ?X a internal:NAMED }", 162 "SELECT ?X { ?X a rsa:NAMED }",
163 1 163 1
164 ) 164 )
165 165
@@ -167,7 +167,7 @@ object RSAComb extends App {
167 RDFoxUtil.submitQuery( 167 RDFoxUtil.submitQuery(
168 data, 168 data,
169 RSA.Prefixes, 169 RSA.Prefixes,
170 "SELECT ?X { ?X a internal:NI }", 170 "SELECT ?X { ?X a rsa:NI }",
171 1 171 1
172 ) 172 )
173 173
@@ -179,7 +179,7 @@ object RSAComb extends App {
179 RDFoxUtil.submitQuery( 179 RDFoxUtil.submitQuery(
180 data, 180 data,
181 RSA.Prefixes, 181 RSA.Prefixes,
182 "SELECT ?X ?Y { ?X internal:EquivTo ?Y }", 182 "SELECT ?X ?Y { ?X rsa:EquivTo ?Y }",
183 2 183 2
184 ) 184 )
185 185
@@ -200,6 +200,17 @@ object RSAComb extends App {
200 println("\nSpurious answers") 200 println("\nSpurious answers")
201 retrieveInstances("SP", filter.variables.length) 201 retrieveInstances("SP", filter.variables.length)
202 202
203 {
204 val cursor = data.createCursor(
205 RSA.Prefixes,
206 "ASK { :a a :D }",
207 new HashMap[String, String]()
208 );
209 var mul = cursor.open()
210 println(s"Answer: ${mul > 0}")
211 cursor.close();
212 }
213
203 // Close connection to RDFox 214 // Close connection to RDFox
204 RDFoxUtil.closeConnection(server, data) 215 RDFoxUtil.closeConnection(server, data)
205 } 216 }