aboutsummaryrefslogtreecommitdiff
path: root/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala
diff options
context:
space:
mode:
authorFederico Igne <federico.igne@cs.ox.ac.uk>2020-12-09 11:19:27 +0000
committerFederico Igne <federico.igne@cs.ox.ac.uk>2020-12-09 11:19:27 +0000
commit43327d8a986e41ba26b6f2b5c911646c7c9a254b (patch)
treebcecccf1358326905604c25edc1f22e7a5f0e75f /src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala
parent2b0f0d0079484b00a1b788414ff1499282a86aeb (diff)
downloadRSAComb-43327d8a986e41ba26b6f2b5c911646c7c9a254b.tar.gz
RSAComb-43327d8a986e41ba26b6f2b5c911646c7c9a254b.zip
Keep track of answer multiplicity
Diffstat (limited to 'src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala')
-rw-r--r--src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala
index dc64c79..0f1cd5e 100644
--- a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala
+++ b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala
@@ -298,9 +298,8 @@ class RSAOntology(val ontology: OWLOntology) {
298 ): Graph[Resource, UnDiEdge] = { 298 ): Graph[Resource, UnDiEdge] = {
299 val query = "SELECT ?X ?Y WHERE { ?X rsa:E ?Y }" 299 val query = "SELECT ?X ?Y WHERE { ?X rsa:E ?Y }"
300 val answers = RDFoxUtil.submitQuery(data, query, RSA.Prefixes).get 300 val answers = RDFoxUtil.submitQuery(data, query, RSA.Prefixes).get
301 var edges: Seq[UnDiEdge[Resource]] = answers.map { case Seq(n1, n2) => 301 var edges: Seq[UnDiEdge[Resource]] =
302 UnDiEdge(n1, n2) 302 answers.collect { case (_, Seq(n1, n2)) => UnDiEdge(n1, n2) }
303 }
304 Graph(edges: _*) 303 Graph(edges: _*)
305 } 304 }
306 305
@@ -402,7 +401,7 @@ class RSAOntology(val ontology: OWLOntology) {
402 query: String, 401 query: String,
403 prefixes: Prefixes = new Prefixes(), 402 prefixes: Prefixes = new Prefixes(),
404 opts: ju.Map[String, String] = new ju.HashMap[String, String]() 403 opts: ju.Map[String, String] = new ju.HashMap[String, String]()
405 ): Option[Seq[Seq[Resource]]] = { 404 ): Option[Seq[(Long, Seq[Resource])]] = {
406 val (server, data) = RDFoxUtil.openConnection(RSAOntology.DataStore) 405 val (server, data) = RDFoxUtil.openConnection(RSAOntology.DataStore)
407 val answers = RDFoxUtil.submitQuery(data, query, prefixes, opts) 406 val answers = RDFoxUtil.submitQuery(data, query, prefixes, opts)
408 RDFoxUtil.closeConnection(server, data) 407 RDFoxUtil.closeConnection(server, data)
@@ -418,7 +417,9 @@ class RSAOntology(val ontology: OWLOntology) {
418 * [[uk.ac.ox.cs.rsacomb.RSAOntology.ask RSAOntology.ask]] 417 * [[uk.ac.ox.cs.rsacomb.RSAOntology.ask RSAOntology.ask]]
419 * for the corresponding query has been called. 418 * for the corresponding query has been called.
420 */ 419 */
421 def askUnfiltered(cq: ConjunctiveQuery): Option[Seq[Seq[Resource]]] = { 420 def askUnfiltered(
421 cq: ConjunctiveQuery
422 ): Option[Seq[(Long, Seq[Resource])]] = {
422 val query = RDFoxUtil.buildDescriptionQuery("QM", cq.variables.length) 423 val query = RDFoxUtil.buildDescriptionQuery("QM", cq.variables.length)
423 queryDataStore(cq, query, RSA.Prefixes) 424 queryDataStore(cq, query, RSA.Prefixes)
424 } 425 }