Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-discussion] Questions concernign the Changes Plug-in

Tania Tudorache tudorache at stanford.edu
Fri Apr 24 10:49:30 PDT 2009


Simon Paradies wrote:
> Hi Tania,
>
>   
>>> My problem with your suggestions is that my code is not aware of user/gui 
>>> triggered instance cloning events. Possibly, some kind of listener would be 
>>> useful here but I haven't found any. Any hints to solve this issue?
>>>   
>>>       
>> You can add listener on the KB and when an instance is removed, you 
>> check using the ChAO API if it has annotations. If it does, you get the 
>> wrapped protege instance and delete it.
>>     
>
> Yes, that works quite fine for deleting instances, thanks for the hint.
> I could also define a listener that is triggered when instances are added. In 
> case of cloning however, I do not get to know the original instance as there is 
> no reference to it in the event parameter of the listener's individualCreated() 
> method. Would it be possible to change the code such that in case of cloning, 
> the original element is also referenced by the event object? Argument2 and 
> Argument3 are null at the moment and could be used for that purpose. Or, would 
> it break something? 
>   

There is no clone event. The clone is only a convenience method that 
doesn't trigger any special event. So, the event generator of Protege 
will not distinguish between a clone and a simple create.

You could add a transaction listener, and parse the transaction string 
for "clone". This would be hacky, and it would work in OWL for now. I 
will also wrap the cloning in protege-frames in a transaction, because 
it does seem to make sense.

Tania

> Thanks
> Simon
>
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-discussion
>
> Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 
>
>   




More information about the protege-discussion mailing list