diff options
| author | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-12-07 16:20:31 +0000 |
|---|---|---|
| committer | Federico Igne <federico.igne@cs.ox.ac.uk> | 2020-12-07 16:20:31 +0000 |
| commit | 2506ce08cb6660305922fc649c221226332d5783 (patch) | |
| tree | 8e4a4d55871194a7aa1b1e5f9230f0c2a0ff94e2 /src | |
| parent | 333e4f36e787f93c4c9547b17004da1574b5f991 (diff) | |
| download | RSAComb-2506ce08cb6660305922fc649c221226332d5783.tar.gz RSAComb-2506ce08cb6660305922fc649c221226332d5783.zip | |
Add additional diagnostics
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala | 8 | ||||
| -rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala | 4 |
2 files changed, 11 insertions, 1 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 87a2312..8a40e1e 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala | |||
| @@ -108,6 +108,10 @@ class RSAOntology(val ontology: OWLOntology) { | |||
| 108 | 108 | ||
| 109 | val axioms: List[OWLLogicalAxiom] = abox ::: tbox ::: rbox | 109 | val axioms: List[OWLLogicalAxiom] = abox ::: tbox ::: rbox |
| 110 | 110 | ||
| 111 | Logger.print(s"Original TBox: ${tbox.length} axioms", Logger.DEBUG) | ||
| 112 | Logger.print(s"Original RBox: ${tbox.length} axioms", Logger.DEBUG) | ||
| 113 | Logger.print(s"Original ABox: ${tbox.length} axioms", Logger.DEBUG) | ||
| 114 | |||
| 111 | /* Retrieve individuals in the original ontology | 115 | /* Retrieve individuals in the original ontology |
| 112 | */ | 116 | */ |
| 113 | val individuals: List[IRI] = | 117 | val individuals: List[IRI] = |
| @@ -347,6 +351,7 @@ class RSAOntology(val ontology: OWLOntology) { | |||
| 347 | Logger print s"Canonical model: ${canon.facts.length} facts" | 351 | Logger print s"Canonical model: ${canon.facts.length} facts" |
| 348 | RDFoxUtil.addFacts(data, this.canonicalModel.facts) | 352 | RDFoxUtil.addFacts(data, this.canonicalModel.facts) |
| 349 | 353 | ||
| 354 | RDFoxUtil materialize data | ||
| 350 | RDFoxUtil printStatisticsFor data | 355 | RDFoxUtil printStatisticsFor data |
| 351 | 356 | ||
| 352 | Logger print s"Filtering program: ${filter.rules.length} rules" | 357 | Logger print s"Filtering program: ${filter.rules.length} rules" |
| @@ -355,7 +360,8 @@ class RSAOntology(val ontology: OWLOntology) { | |||
| 355 | Logger print s"Filtering program: ${filter.facts.length} facts" | 360 | Logger print s"Filtering program: ${filter.facts.length} facts" |
| 356 | RDFoxUtil.addFacts(data, filter.facts) | 361 | RDFoxUtil.addFacts(data, filter.facts) |
| 357 | 362 | ||
| 358 | RDFoxUtil printStatistics data | 363 | RDFoxUtil materialize data |
| 364 | RDFoxUtil printStatisticsFor data | ||
| 359 | 365 | ||
| 360 | val answers = { | 366 | val answers = { |
| 361 | val ans = RDFoxUtil.buildDescriptionQuery("Ans", query.answer.size) | 367 | val ans = RDFoxUtil.buildDescriptionQuery("Ans", query.answer.size) |
diff --git a/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala b/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala index 51ef903..31cc850 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/util/RDFoxUtil.scala | |||
| @@ -114,6 +114,10 @@ object RDFoxUtil { | |||
| 114 | Logger.DEBUG | 114 | Logger.DEBUG |
| 115 | ) | 115 | ) |
| 116 | 116 | ||
| 117 | /** Force materialization in RDFox. */ | ||
| 118 | def materialize(data: DataStoreConnection): Unit = | ||
| 119 | Logger.timed(data.updateMaterialization(), "Materialization", Logger.DEBUG) | ||
| 120 | |||
| 117 | /** Load SPARQL query from file. */ | 121 | /** Load SPARQL query from file. */ |
| 118 | def loadQueryFromFile(file: File): String = { | 122 | def loadQueryFromFile(file: File): String = { |
| 119 | val source = io.Source.fromFile(file) | 123 | val source = io.Source.fromFile(file) |
