diff options
| -rw-r--r-- | src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala | 21 |
1 files changed, 17 insertions, 4 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 0f1cd5e..4ac5a77 100644 --- a/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala +++ b/src/main/scala/uk/ac/ox/cs/rsacomb/RSAOntology.scala | |||
| @@ -24,7 +24,11 @@ import org.semanticweb.owlapi.reasoner.structural.StructuralReasonerFactory | |||
| 24 | import org.semanticweb.owlapi.model.{IRI => OWLIRI} | 24 | import org.semanticweb.owlapi.model.{IRI => OWLIRI} |
| 25 | import uk.ac.manchester.cs.owl.owlapi.OWLObjectPropertyImpl | 25 | import uk.ac.manchester.cs.owl.owlapi.OWLObjectPropertyImpl |
| 26 | 26 | ||
| 27 | import tech.oxfordsemantic.jrdfox.client.{UpdateType, DataStoreConnection} | 27 | import tech.oxfordsemantic.jrdfox.client.{ |
| 28 | DataStoreConnection, | ||
| 29 | TransactionType, | ||
| 30 | UpdateType | ||
| 31 | } | ||
| 28 | import tech.oxfordsemantic.jrdfox.Prefixes | 32 | import tech.oxfordsemantic.jrdfox.Prefixes |
| 29 | import tech.oxfordsemantic.jrdfox.logic.datalog.{ | 33 | import tech.oxfordsemantic.jrdfox.logic.datalog.{ |
| 30 | Rule, | 34 | Rule, |
| @@ -352,22 +356,31 @@ class RSAOntology(val ontology: OWLOntology) { | |||
| 352 | val canon = this.canonicalModel | 356 | val canon = this.canonicalModel |
| 353 | val filter = this.filteringProgram(query) | 357 | val filter = this.filteringProgram(query) |
| 354 | 358 | ||
| 359 | //data.beginTransaction(TransactionType.READ_WRITE) | ||
| 360 | |||
| 355 | Logger print s"Canonical model: ${canon.rules.length} rules" | 361 | Logger print s"Canonical model: ${canon.rules.length} rules" |
| 356 | RDFoxUtil.addRules(data, this.canonicalModel.rules) | 362 | RDFoxUtil.addRules(data, this.canonicalModel.rules) |
| 357 | 363 | ||
| 358 | Logger print s"Canonical model: ${canon.facts.length} facts" | 364 | Logger print s"Canonical model: ${canon.facts.length} facts" |
| 359 | RDFoxUtil.addFacts(data, this.canonicalModel.facts) | 365 | RDFoxUtil.addFacts(data, this.canonicalModel.facts) |
| 360 | 366 | ||
| 361 | RDFoxUtil printStatisticsFor data | 367 | Logger print s"Filtering program: ${filter.facts.length} facts" |
| 368 | RDFoxUtil.addFacts(data, filter.facts) | ||
| 362 | 369 | ||
| 363 | Logger print s"Filtering program: ${filter.rules.length} rules" | 370 | Logger print s"Filtering program: ${filter.rules.length} rules" |
| 364 | RDFoxUtil.addRules(data, filter.rules) | 371 | RDFoxUtil.addRules(data, filter.rules) |
| 365 | 372 | ||
| 366 | Logger print s"Filtering program: ${filter.facts.length} facts" | 373 | //data.commitTransaction() |
| 367 | RDFoxUtil.addFacts(data, filter.facts) | ||
| 368 | 374 | ||
| 369 | RDFoxUtil printStatisticsFor data | 375 | RDFoxUtil printStatisticsFor data |
| 370 | 376 | ||
| 377 | //{ | ||
| 378 | // import java.io.{FileOutputStream, File} | ||
| 379 | // val rules = new FileOutputStream(new File("rules2.dlog")) | ||
| 380 | // val facts = new FileOutputStream(new File("facts2.ttl")) | ||
| 381 | // RDFoxUtil.export(data, rules, facts) | ||
| 382 | //} | ||
| 383 | |||
| 371 | val answers = { | 384 | val answers = { |
| 372 | val ans = RDFoxUtil.buildDescriptionQuery("Ans", query.answer.size) | 385 | val ans = RDFoxUtil.buildDescriptionQuery("Ans", query.answer.size) |
| 373 | RDFoxUtil | 386 | RDFoxUtil |
