aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2020-08-16 17:09:24 +0100
committerFederico Igne <federico.igne@cs.ox.ac.uk>2020-08-16 17:09:24 +0100
commit4df0005e2b56a8d37ce449774aea2ab8c2808bcb (patch)
tree21c721d1b8a0fa7070de0b0ddcb08418d0dbd5f1 /src
parent798c9f3635d14eff636bc3c89e3c1015e90244d9 (diff)
downloadRSAComb-4df0005e2b56a8d37ce449774aea2ab8c2808bcb.tar.gz
RSAComb-4df0005e2b56a8d37ce449774aea2ab8c2808bcb.zip
Add code to access query answers programmatically
Diffstat (limited to 'src')
-rw-r--r--src/main/scala/rsacomb/RSAOntology.scala22
1 files changed, 10 insertions, 12 deletions
diff --git a/src/main/scala/rsacomb/RSAOntology.scala b/src/main/scala/rsacomb/RSAOntology.scala
index 06752ef..8303dd4 100644
--- a/src/main/scala/rsacomb/RSAOntology.scala
+++ b/src/main/scala/rsacomb/RSAOntology.scala
@@ -112,21 +112,19 @@ trait RSAOntology {
112 112
113 // Retrieve all instances of PE 113 // Retrieve all instances of PE
114 println("\nQuery results:") 114 println("\nQuery results:")
115 data.evaluateQuery( 115 val cursor = data.createCursor(
116 prefixes, 116 prefixes,
117 "SELECT ?X ?Y WHERE { ?X <internal:PE> ?Y }", 117 "SELECT ?X ?Y WHERE { ?X <internal:PE> ?Y }",
118 new HashMap[String, String](), 118 new HashMap[String, String]()
119 System.out,
120 "text/csv"
121 );
122
123 data.evaluateQuery(
124 prefixes,
125 "SELECT ?X ?Y WHERE { ?X <internal:E> ?Y }",
126 new HashMap[String, String](),
127 System.out,
128 "text/csv"
129 ); 119 );
120 var mul = cursor.open()
121 while (mul > 0) {
122 val res0 = cursor.getResource(0)
123 val res1 = cursor.getResource(1)
124 println(s"Answer: $res0 $res1")
125 mul = cursor.advance()
126 }
127 cursor.close();
130 128
131 // Close connection to RDFox 129 // Close connection to RDFox
132 RDFoxUtil.closeConnection(server, data) 130 RDFoxUtil.closeConnection(server, data)