I am using the Jena GenericRuleReasoner. It is invoked in an Eclipse environment. After creating an InfModel by calling ModelFactory.createInfModel(reasoner, ontModel), I call QueryExecutionFactory.create(QueryFactory.create(query, Syntax.syntaxARQ, infModel). I then set the timeout by calling queryExecution.setTimeout(timeoutTime). I then start to iterate over the ResultSet returned by queryExecution.execSelect() by calling the ResultSet's hasNext() method.
I would like to be able to cancel or abort if inference takes an excessive amount of time. However, the call to the ResultSet hasNext() method results in a call to FBRuleInfGraph find(s, p, o), which ultimately ends up at LPBRuleEngine pump(gen), where gen is an LPInterpreterContext. Neither the QueryExecution timeout nor a call to QueryExecution abort() has any effect because control never gets out of the pump method. Is there a way to terminate reasoner execution gracefully? If not, could one be implemented by putting a check for cancellation, perhaps in the "while(!gen.isReady())" or like the periodic check if (count % CYCLES_BETWEEN_COMPLETION_CHECK == 0) { .... } and return cancelled? There does not seem to be any way to terminate inference currently, even though it is running as a separate Eclipse Job, so a separate thread. All documentation that I find says that the process needs to check to see if it has been cancelled; it can't be killed from outside. Andy Crapo