On Thursday, November 07, 2013 09:03:56 AM Parastoo Delgoshaei wrote: > This listener does not work if the result of change to the model is due to > rule checking. i.e. assume I have this rule: > @ prefix af: <http://personont.org/person#>. > .... > [GetAge (?a rdf:type af:Person) (?a af:hasBirthDate ?b) getAge(?b,?d)->(?a > af:hasAge ?d)] > > getAge() is a built-in that is attached to the model. When I query the > individuals they have "hasAge" property with the correct value associated > with their birthdates. However, the listener is not triggered when this > change happens at the rule level.
You still haven't show your code. By "code" I mean a minimal complete example. I suspect you're listening to the wrong model, but since I can't see how you make the models and attach the listeners and run the inference I can't see where any problem might be. If you do rule-based inference on a model M, then no changes are made /to M/, so if that's what you're listening to you'll hear nothing. Give us a minimal, complete example and we can run it, tinker with it, and use it as a test case if there's actually a problem to fix. > On Wednesday, November 6, 2013 6:55 AM, Chris Dollin > <[email protected]> wrote: > On Wednesday, November 06, 2013 05:21:23 PM Dibyanshu Jaiswal wrote: > > I feel if you register the model with a change listener as disscussed > > earlier, like: model.register(changeListener); which has proper > > implementation of the abstrat methods defined in ModelChangedListener > > (atleast for Statementadded()), you will be able to detect every changes > > made to your model. > > "rule checking" suggests inference, which suggests a base model and > a deductions model, which suggests there are two models, only one > of which is updated -- if that's the listened-to model, everything will > be quiet. Too quiet. > > Hence my request to show code ... > > Chris > > > On Tue, Nov 5, 2013 at 8:28 PM, Chris Dollin > > > > <[email protected]>wrote: > > > On Tuesday, November 05, 2013 06:53:17 AM Parastoo Delgoshaei wrote: > > > > Claude, > > > > Thanks for your response. This solution works only if you have hard > > > > > > coded add/removal statements (i.e. model.add( S, P, O2 ); or > > > model.remove(s);) However, I do not see any add and removal > > > notifications > > > as a result of rule checking. The model certainly has changed I see it > > > in > > > the print out after the rule checking. However, the listener does not > > > recognize this add/remove. > > > > > > > Your help is appreciated, > > > > > > Show code. > > > > > > (Are you listening to the model that's being changed?) > > > > > > Chris > > > > > > -- > > > "The wizard seemed quite willing when I talked to him." /Howl's Moving > > > Castle/ > > > > > > Epimorphics Ltd, http://www.epimorphics.com > > > Registered address: Court Lodge, 105 High Street, Portishead, Bristol > > > BS20 > > > 6PT > > > Epimorphics Ltd. is a limited company registered in England (number > > > 7016688)
