Feed and generalize (python)
Do the birds fly ?
Make our agent proactive
In the previous part, our program has realized its generalizations without telling us, and the only way for us to realize this was to ask the right questions at the right time.
So we will use the topic 'ontologenius/reasoner_notifications' which is a topic Ontologenius publishes when it realizes some reasoning including the generalization.
The messages published on this topic are in our case in the form: "[NEW]concept>property:type#value ". So we will use again a regex to extract the information easily.
Here is the callback function:
And finally, in the main function, we subscribe to the notification topic using the OntologyManipulator:
You can now delete the internal file and learn again to your program that birds can fly (or something else).
This tutorial is already finished. I let you imagine everything you could do with it. Do not hesitate to look at all the classes made available by the API to discover all the features offered by Ontologenius.