diff options
author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-06-23 16:30:45 +0100 |
---|---|---|
committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-06-23 16:31:07 +0100 |
commit | b4ddcd3f489aa217cda56140274c5b6d91a75c10 (patch) | |
tree | 2f9b77ca5e9a15b3a8456798ab1bef4888be9c93 /src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala | |
parent | 7ab2d819947c03a6618e273d5996a171f0217119 (diff) | |
download | RSAComb-b4ddcd3f489aa217cda56140274c5b6d91a75c10.tar.gz RSAComb-b4ddcd3f489aa217cda56140274c5b6d91a75c10.zip |
Fix automatic query building
The API for the SKOLEM operator is changed in RDFox but the helper
functions using it were not ported to the new syntax.
Diffstat (limited to 'src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala')
-rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala index 74084af..f9de801 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala | |||
@@ -119,9 +119,23 @@ object RSAComb extends App { | |||
119 | 119 | ||
120 | ConjunctiveQuery.parse(query) match { | 120 | ConjunctiveQuery.parse(query) match { |
121 | case Some(query) => { | 121 | case Some(query) => { |
122 | // Retrieve answers | ||
122 | val answers = rsa ask query | 123 | val answers = rsa ask query |
123 | Logger.print(s"$answers", Logger.VERBOSE) | 124 | Logger.print(s"$answers", Logger.VERBOSE) |
124 | Logger print s"Number of answers: ${answers.length} (${answers.lengthWithMultiplicity})" | 125 | Logger print s"Number of answers: ${answers.length} (${answers.lengthWithMultiplicity})" |
126 | // Retrieve unfiltered answers | ||
127 | val unfiltered = rsa.queryDataStore( | ||
128 | """ | ||
129 | SELECT (count(?K) as ?COUNT) | ||
130 | WHERE { | ||
131 | ?K a rsa:QM . | ||
132 | } | ||
133 | """, | ||
134 | RSA.Prefixes | ||
135 | ) | ||
136 | unfiltered.foreach((u) => | ||
137 | Logger print s"Number of unfiltered answers: ${u.head._2}" | ||
138 | ) | ||
125 | } | 139 | } |
126 | case None => | 140 | case None => |
127 | throw new RuntimeException("Submitted query is not conjunctive") | 141 | throw new RuntimeException("Submitted query is not conjunctive") |