Open daniel86 opened 9 months ago
Hi Daniel!
Thank you for your question.
Unfortunately, incremental reasoning is not supported (yet). The second call to realise()
won't produce any new inferences as FaCT++ remembers that the KB is already realized and doesn't do anything in this case.
However, you can query asserted or inferred triples separately if you specify scope
parameter in the call to Coras.query method. The scope can be asserted
, inferred
or both
(default).
Ivan.
Hi Ivan,
oh really? I was not assuming a second call would do nothing when additional facts were added until the last call. I was thinking it might be possible due to the par in the README about persistent and incremental reasoning. Is this functionality of the C++ implementation which is not yet exposed to Python?
oh yes, I found this line: https://github.com/tilde-lab/pyfactxx/blob/814bfe94d4ada40c153569c6606ab78d4bcdaec4/Kernel/Kernel.h#L882
So your response suggests you are planning to support incremental mode at some time?
FYI: I am considering a use case where a robot manages a knowledge base over time, during the course of its action it grounds new knowledge in its action and perception which I would like to incrementally add/remove to/from reasoning systems in the knowledge base.
Best, Daniel
Hello again,
I would like to use
pyfactxx
in an incremental fashion where initially I load some files, and during runtime mainly object and data roles are asserted and retracted. I am now wondering about whether there is a smart way to obtain a list of all new inferences after calling classify/realize, and also which previous inferences were removed. This information could be obtained be keeping the list of previous inferences in my code, but that seems not optimal.Is there some way I am not aware of? Maybe to hook an event handler into the reasoner that gets a call for every change?
Best, Daniel