diff options
author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-04-02 11:03:22 +0100 |
---|---|---|
committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2021-04-02 11:03:22 +0100 |
commit | 80dbaf650804182e0db9f8bdfc9ba884a3a8a846 (patch) | |
tree | 3724edff63151017975a02d5f2dba890c2211b25 | |
parent | 5a7208dac91c31ffcec37955fff48f1046aac753 (diff) | |
download | RSAComb-80dbaf650804182e0db9f8bdfc9ba884a3a8a846.tar.gz RSAComb-80dbaf650804182e0db9f8bdfc9ba884a3a8a846.zip |
Apply minor tweaks
-rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala | 3 | ||||
-rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala | 22 |
2 files changed, 14 insertions, 11 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 909cfdd..2e7f586 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/Main.scala | |||
@@ -128,6 +128,7 @@ object RSAComb extends App { | |||
128 | 128 | ||
129 | val ontology = | 129 | val ontology = |
130 | RSAOntology(config('ontology).get[File], config('data).get[List[File]]: _*) | 130 | RSAOntology(config('ontology).get[File], config('data).get[List[File]]: _*) |
131 | |||
131 | if (ontology.isRSA) { | 132 | if (ontology.isRSA) { |
132 | 133 | ||
133 | Logger print "Ontology is RSA!" | 134 | Logger print "Ontology is RSA!" |
@@ -139,7 +140,7 @@ object RSAComb extends App { | |||
139 | ConjunctiveQuery.parse(query) match { | 140 | ConjunctiveQuery.parse(query) match { |
140 | case Some(query) => { | 141 | case Some(query) => { |
141 | val answers = ontology ask query | 142 | val answers = ontology ask query |
142 | Logger.print(s"$answers", Logger.QUIET) | 143 | //Logger.print(s"$answers", Logger.QUIET) |
143 | Logger print s"Number of answers: ${answers.length} (${answers.lengthWithMultiplicity})" | 144 | Logger print s"Number of answers: ${answers.length} (${answers.lengthWithMultiplicity})" |
144 | 145 | ||
145 | // /* Additional DEBUG information */ | 146 | // /* Additional DEBUG information */ |
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 4243b7b..763f4f5 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala | |||
@@ -454,6 +454,8 @@ class RSAOntology(_ontology: File, val datafiles: File*) { | |||
454 | /* Upload data from data file */ | 454 | /* Upload data from data file */ |
455 | RDFoxUtil.addData(data, datafiles: _*) | 455 | RDFoxUtil.addData(data, datafiles: _*) |
456 | 456 | ||
457 | RDFoxUtil printStatisticsFor data | ||
458 | |||
457 | /* Top / equality axiomatization */ | 459 | /* Top / equality axiomatization */ |
458 | RDFoxUtil.addRules(data, topAxioms ++ equalityAxioms) | 460 | RDFoxUtil.addRules(data, topAxioms ++ equalityAxioms) |
459 | 461 | ||
@@ -471,25 +473,25 @@ class RSAOntology(_ontology: File, val datafiles: File*) { | |||
471 | Logger print s"Canonical model facts: ${canon.facts.length}" | 473 | Logger print s"Canonical model facts: ${canon.facts.length}" |
472 | RDFoxUtil.addFacts(data, canon.facts) | 474 | RDFoxUtil.addFacts(data, canon.facts) |
473 | 475 | ||
476 | //{ | ||
477 | // import java.io.{PrintStream, FileOutputStream, File} | ||
478 | // val rules1 = new FileOutputStream(new File("rules1-lubm200.dlog")) | ||
479 | // val facts1 = new FileOutputStream(new File("facts1-lubm200.ttl")) | ||
480 | // RDFoxUtil.export(data, rules1, facts1) | ||
481 | // val rules2 = new PrintStream(new File("rules2-q34.dlog")) | ||
482 | // rules2.print(filter.rules.mkString("\n")) | ||
483 | //} | ||
484 | |||
474 | //canon.facts.foreach(println) | 485 | //canon.facts.foreach(println) |
475 | //canon.rules.foreach(println) | 486 | //filter.rules.foreach(println) |
476 | 487 | ||
477 | RDFoxUtil printStatisticsFor data | 488 | RDFoxUtil printStatisticsFor data |
478 | 489 | ||
479 | Logger print s"Filtering program rules: ${filter.rules.length}" | 490 | Logger print s"Filtering program rules: ${filter.rules.length}" |
480 | RDFoxUtil.addRules(data, filter.rules) | 491 | RDFoxUtil.addRules(data, filter.rules) |
481 | 492 | ||
482 | //data.commitTransaction() | ||
483 | |||
484 | RDFoxUtil printStatisticsFor data | 493 | RDFoxUtil printStatisticsFor data |
485 | 494 | ||
486 | //{ | ||
487 | // import java.io.{FileOutputStream, File} | ||
488 | // val rules = new FileOutputStream(new File("rules2.dlog")) | ||
489 | // val facts = new FileOutputStream(new File("facts2.ttl")) | ||
490 | // RDFoxUtil.export(data, rules, facts) | ||
491 | //} | ||
492 | |||
493 | val answers = { | 495 | val answers = { |
494 | val ans = filter.answerQuery | 496 | val ans = filter.answerQuery |
495 | RDFoxUtil | 497 | RDFoxUtil |