|Re: [higgins-dev] IProperty getType()|
I'm working on rewording it now. Here's what I currently have: IProperty.getType(). It's a lot like what I had, but plays with words (swapped should for may, added "or range of types"). I'm still not happy with it -- I don't think the use of the word "may" carries the meaning that it's not always possible.
Regarding the possible solution: What would IPropertyValue.getType() return? A more specific URI?
>>> "Paul Trevithick" <paul@xxxxxxxxxxxxxxxxx> 9/22/06 5:31 PM >>>
I have been looking at your latest Javadoc http://forgeftp.novell.com/bandit/HigginsIDASJavadoc/
In your IProperty interface you have a getType() method. In your doc you say:
It is used to convey both the name of this property and the runtime class type of the value (returned by getValue()).
I agree with this for OWL DatatypeProperties, but for OWL ObjectProperties this isnt strictly true. Although it is true that sometimes an OWL ObjectProperty is defined such that its range is only one class, it is also true that sometimes an ObjectProperty whose range is defined as being a set of possible classes. Even if only one class is mentioned, the actual instance might be a subclass of this class (and there might even be several kinds of subclasses). My point is that a Propertys URI doesnt always tell you the type of what, in graph representation, it is pointing at.
You said in your Javadoc:
A consumer should also be able to determine from this URI, the Type of object(s) returned from getValue() and getValues().
And more to the point that:
These determinations may be made either by examining parts of the URI itself, or dereferencing it (or parts) to other sources of information.
But it seems to me that you really have to use reflection on the Java object returned from getValue to know exactly the type (class) of what youve got. You cant determine this a priori. (Note: Ive been careful to talk here only about ObjectProperties, OWL DatatypeProperties are not a problem on this point).
A possible solution: In addition making some edits to the above javadoc text.Since getType() returns an IPropertyValue, could we add a getType() to IPropertyValue? [In higgins.owl all ranges of the attribute property are subclasses of the Attribute class, so this new getType() would in effect tell you which subclass of Attribute youve got].