Galigator / openllet

Openllet is an OWL 2 reasoner in Java, build on top of Pellet.
https://www.w3.org/TR/owl2-primer/
Other
100 stars 26 forks source link

Jena API Performance Problems #73

Closed thoebert closed 1 year ago

thoebert commented 2 years ago

I am using a the Openllet Jena API with an ontology of around n=500 classes. Currently, a usage of the Openllet reasoner is not possible for me since even for specific small queries or API usages the Openllet reasoner first computes a full closure and afterwards filters down to the returned subset. For example, the reasoner internally computes 190 000 disjoint statements (~n^2), between almost every class and EVERY other class, and filters down afterwards. This process takes multiple minutes and is completely unnecessary in my use-case. By changing the Selector of the ModelExtractor in module-jena/src/main/java/openllet/jena/graph/query/GraphQueryHandler.java:136 from StatementType.ALL_STATEMENTS to StatementType.DEFAULT_STATEMENTS, I was able to stop this behaviour and reduced the computation time to a second.

Therefore I was wondering how useful the default value is, or if this property should be a configurable parameter? Maybe a configurable new OpenlletOption could be sufficient to tackle this problem?

Galigator commented 1 year ago

Thank for this analysis. What you describe is the original behavior of ModelExtractor. Indeed all tests are still green after the change. Do you have a test case for this because there is currently no test in the project that could enlighten this behaviour.

Galigator commented 1 year ago

Pushed now in test branch.