javaowlontologyowl-apiswrl

Combining reasoners in OWL API for OWL DL + SQWRL support


I need to calculate some SQWRL rules on a OWL 2 DL ontology.

The problem is:

I consider two possible solutions:

  1. Use OWLAPI directly in Java to execute SQWRL on top of OWL 2 DL reasoner (like Pellet)
  2. Somehow use both reasoners (Pellet and Drools-SWRLAPI) and avoid static java code

so my question is: is it possible to combine two reasoners so that they will not conflict?

Like

  1. pre-compute inferences with DL reasoner
  2. run the resulting ontology on Drools-SWRLAPI to execute SQWRL
  3. put that back to DL reasoner and validate/compute more inferences
  4. loop

thanks!


Solution

  • This should be doable if the OWLReasoner is created as non-buffering and Drools-SWRLAPI materializes all inferred triples in the input ontology. This might not be the case, so it might be necessary to take steps to materialize these inferences.

    I'm not familiar with the SWRL API and the Drools rule engine, so I cannot say whether this is doable or easy; I'd probably start by taking one of the Open Source reasoners that support SWRL and try to replace their SWRL support with the Drools code - this has the advantage of ensuring that the algorithm the reasoners use to ensure correctness and completeness is applied (looping between the two reasoning approaches should be a good approximation, but there might be corner cases missed, as well as lost optimizations.

    The reverse approach, i.e., materializing OWL2DL inferences and applying SWRL rules afterwards, has the weakness of having to choose which inferences to materialize; class expressions in the taxonomy won't travel easily across the OWLReasoner interface, and the process might be very computationally expensive.