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] Property listener is not listening

Timothy Redmond tredmond at stanford.edu
Thu Oct 2 09:43:47 PDT 2008


Sorry - I was  silly not to see this immediately.

If you look at the declaration of addPropertyValueListener you will  
see it is a member of the RDFResource interface.  It is not a member  
of the RDFProperty interface.  This is a  big hint.

The line

> TestProperty.addPropertyValueListener (new PropertyValueAdapter() {
> public void propertyValueChanged (RDFResource resource, RDFProperty
> property, Collection oldValues) {
>   System.out.println("Value of property " + property.getName() + " has
> changed.");
>   }
> });

can be used to detect when an annotation on the TestProperty changes.   
It does not add a listener that detects when the TestProperty of some  
individual changes.  In order to do what you want, you need to add a  
property value listener to the owl model and filter out the cases that  
you don't want.

The point is - and this is not well defined - when a property value  
changes on an individual, people usually think of the individual as  
having changed but not the property.  So the interfaces have been  
designed so that the listener gets added to the individual.

-Timothy


On Sep 30, 2008, at 6:24 AM, Georg Hebinger wrote:

> Hi everybody
>
> I still have a problem concerning property listeners. I added a  
> listener to a
> property:
>
> TestProperty.addPropertyValueListener (new PropertyValueAdapter() {
> public void propertyValueChanged (RDFResource resource, RDFProperty
> property, Collection oldValues) {
>   System.out.println("Value of property " + property.getName() + " has
> changed.");
>   }
> });
>
> and then changed the value of a datatype property
> within my java code:
>
> int a = 10;
> RDFIndividual Individual = owlModel.getRDFIndividual ("TESTOBJECT");
> edu.stanford.smi.protegex.owl.model.OWLDatatypeProperty Property =
> owlModel.getOWLDatatypeProperty ("hasIntValue");
> Individual.setPropertyValue (Property, a);
>
> I know that the value has been changed successfully, but my listener  
> does not
> seem to have noticed that.
>
> Any help or suggestion is very much appreciated.
>
>
> George
> _______________________________________________
> 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