Re: Mixing Python, OWL, SWRL and Reasoning
Posted by cknoll on
URL: http://owlready.306.s1.nabble.com/Mixing-Python-OWL-SWRL-and-Reasoning-tp2653p2655.html
Hi Felix,
thank you for your quick reply. I already suspected that the reasoner is not able to directly execute Python code. On the other hand it would not surprise me if there is a possibility to somehow sneak in a "callback-mechanism".
Your solution works for the presented example. However, I want to perform some more sophisticated calculations than mere arithmetic (say, calculating roots of polynomials etc.). I think that this will not be possible with pure SWRL but would be quite simple in Python code. At the end from the reasoners point of view it should not make too much difference, between calling a builtin function like "divide" or calling an external function. I might however be a technical challenge and break decidability (if one does not restrict the content of those external functions).
Anyway, your solution gave me the idea to run Python code and the reasoner alternately.
Best,
Carsten