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-owl] Detecting change in restriction values for datatype property

reymonet at irit.fr reymonet at irit.fr
Mon Apr 23 00:54:10 PDT 2007


Hello,

Thank you very much ! I tried your solution and it works perfectly. I was
so focused on the ModelAdapter Listener which detected the value change
(but without allowing the access to the restricted property name) that I
did not think of adding a listener of another type. Thank you again,

Axel Reymonet

>
> I am not sure what you mean here.  At first it sounded like you were
> trying to detect when the value of a datatype property changes.
>
> Here is my best interpretation.  You have an instance myDogRover of
> the class Dog and there is a datatype property maximumSize with
> domain Dog and whose range will include strings like "BigDog",
> "SmallDog".  You want to detect when the maximumSize datatype
> property is changed for the instance myDogRover.
>
> If this is the question you can do this with a
> PropertyValueListener.  Here is some code
>
>          OWLModel om = ...
>          om.addPropertyValueListener(new PropertyValueAdapter() {
>              public void propertyValueChanged(RDFResource resource,
>                                               RDFProperty property,
>                                               Collection oldValues) {
>
>                  System.out.println("Property value changed:");
>                  System.out.println("Resource = " +
> resource.getBrowserText());
>                  System.out.println("Property = " +
> property.getBrowserText());
>                  System.out.println("Old Values = " + oldValues);
>                  System.out.println("New values = " +
> resource.getPropertyValues(property));
>              }
>          });
>          OWLNamedClass a = om.getOWLNamedClass("A");
>          RDFProperty r = om.getRDFProperty("r");
>          a.setPropertyValue(r, "foo");
>          a.setPropertyValue(r, "bar");
>
> If this is not the right type of listener, the different listeners
> can be found in the source tree in the package
> edu.stanford.smi.protegex.owl.model.event.  You can use these
> listeners to listen for many things.  Two others that might be what
> you are looking for are:
>
>    - when the super class of a class changes (using class listeners)
>    - when a class definition is changed (using class listeners to
> listen for changes to the super classes that are definitions)
>
> Does this help at all?
>
> -Timothy
>
>
>
>
> On Apr 20, 2007, at 5:43 AM, reymonet at irit.fr wrote:
>
>> Hello,
>>
>> I am having some problems figuring out how to detect any change in the
>> String value restricting a given Datatype property on a concept. Let's
>> imagine a concept "Dog" with a datatype property "maximumSize"
>> which is
>> restricted to different values according to the subclass ("BigDog",
>> "SmallDog"...). I'm trying to spot every time when one of the
>> values is
>> modified by the user.
>>
>> For that purpose, I use a ModelAdapter as a listener for my
>> OWLModel and I
>> have seen that modifying such a datatype property restriction value
>> triggers the calling of the "void individualCreated
>> (RDFResource)" (then
>> individualDeleted) method. However, the RDFResource returned in
>> this case
>> can be casted to edu.stanford.smi.protege.model.SimpleInstance, ie an
>> instance which is not a class, a slot, or a facet. As a
>> consequence, how
>> can I check whether the modification has really been made on the
>> restriction value of "maximumSize"? Is it even possible? Thanks in
>> advance,
>>
>> Axel Reymonet
>>
>> PS : please do not focus on the example given, I made it
>> artificially for
>> confidentiality issues.
>> _______________________________________________
>> protege-owl mailing list
>> protege-owl at lists.stanford.edu
>> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>>
>> Instructions for unsubscribing: http://protege.stanford.edu/doc/
>> faq.html#01a.03
>
> _______________________________________________
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-owl
>
> Instructions for unsubscribing:
> http://protege.stanford.edu/doc/faq.html#01a.03
>




More information about the protege-owl mailing list