Hi,

On 29/07/12 20:06, Alejandro Rodríguez González wrote:
Hi Dave,

Thanks. I've created a small ontology and set of rules which are fired (I
print the results and I saw that is making the inference correctly). I
checked if derivation is switched on (I've executed setDerivationLogging to
true)) and the files continue empty..!!

This is the full code that I'm using:

OWLInferenceManager: http://pastebin.com/trQVtv1s
Consult: http://pastebin.com/nCnT0nBa
Main: http://pastebin.com/UduJ2nXY

The ontology: http://pastebin.com/1QkrknMr

The rules: http://pastebin.com/JPT3UZSi

And the output (that confirms that rules are fired, but no derivation is
logged): http://pastebin.com/HA06pYmX

That's not a *minimal* example!

It's quite hard to see what you are trying to do with model and inferenceModel. The inferenceModel is created over the top of model and yet you also add inferenceModel back into model at various stages. Very circular and probably not what you mean.

You seem to set derivation logging on model, rather than inferenceModel during createConsult and then set derivation logging on inferenceModel only at the start of executeInference. At least for the first cycle this will be after inference is complete and so there's no derivations left to make and nothing will be logged for that iteration.

Can I suggest that you start with a simpler test case.

Just create a single InfModel over your rules.
No fiddling with the base model.
Set derivation logging on at creation time.
Then add a data sample and check that derivations are logged.

If you try that and it works then you know the Jena machinery works the way you are using it and you can incrementally extend your code to do what you want it to do. If if doesn't work then you have a test case we can take a look at without having work out the rest of your code :)

Cheers,
Dave

Reply via email to