You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@jena.apache.org by David Jordan <Da...@sas.com> on 2013/04/23 20:45:22 UTC

OntClass.listDeclaredProperties

When I call listDeclaredProperties with a direct parameter value of false, I get a list of properties associated with a class. But when I pass a value of true, I don’t get any values, yet there are properties directly associated with the class. I do run this with a reasoner, using OWL_MEM_MICRO_RULE_INF. I am using the latest TDB release. Any idea why they are not being returned?


David Jordan
Senior Software Developer
SAS Institute Inc.
Health & Life Sciences, Research & Development
Bldg R ▪ Office 4467
600 Research Drive ▪ Cary, NC 27513
Tel: 919 531 1233 ▪ david.jordan@sas.com<ma...@sas.com>
www.sas.com<http://www.sas.com/>
SAS® … THE POWER TO KNOW®


Re: OntClass.listDeclaredProperties

Posted by Ian Dickinson <ia...@epimorphics.com>.
Hi David,
On 23/04/2013 19:45, David Jordan wrote:
> When I call listDeclaredProperties with a direct parameter value of
> false, I get a list of properties associated with a class. But when I
> pass a value of true, I don’t get any values, yet there are
> properties directly associated with the class. I do run this with a
> reasoner, using OWL_MEM_MICRO_RULE_INF. I am using the latest TDB
> release. Any idea why they are not being returned?
As always, a complete minimal example would be very helpful. Note that 
it won't have anything to do with TDB - the OntModel does not care where 
the triples it is processing are stored.

Ian

Re: OntClass.listDeclaredProperties

Posted by Ian Dickinson <ia...@epimorphics.com>.
On 24/04/13 13:51, David Jordan wrote:
> Someone should fix the link in the javadoc that is meant to refer to
> http://jena.apache.org/documentation/notes/rdf-frames.html
>
> It has the value
> http://jena.apache.org/documentation/javadoc/jena/index.html
> which is not valid.
Thanks. Fixed in svn, and it will go live on the web site when we do the 
next release.

Ian


RE: OntClass.listDeclaredProperties

Posted by David Jordan <Da...@sas.com>.
Someone should fix the link in the javadoc that is meant to refer to
http://jena.apache.org/documentation/notes/rdf-frames.html

It has the value
http://jena.apache.org/documentation/javadoc/jena/index.html
which is not valid.

-----Original Message-----
From: Ian Dickinson [mailto:ian@epimorphics.com] 
Sent: Tuesday, April 23, 2013 6:49 PM
To: users@jena.apache.org
Subject: Re: OntClass.listDeclaredProperties

On 23/04/2013 20:10, Joshua TAYLOR wrote:
> On Tue, Apr 23, 2013 at 2:45 PM, David Jordan <Da...@sas.com> wrote:
>> When I call listDeclaredProperties with a direct parameter value of false, I get a list of properties associated with a class. But when I pass a value of true, I don’t get any values, yet there are properties directly associated with the class. I do run this with a reasoner, using OWL_MEM_MICRO_RULE_INF. I am using the latest TDB release. Any idea why they are not being returned?
>
> Until now, I hadn't looked closely enough at the doc to know what 
> listDeclaredProperties was supposed to return.It returns an iterator 
> over "properties associated with a frame-like view of this class", but 
> I wasn't sure what "associated with" meant there.
What it means is documented here:

http://jena.apache.org/documentation/notes/rdf-frames.html

Looking
> at the implementation in OntClassImpl, a property is associated with a 
> class if class is one of the property's domains.  Is that the same 
> meaning of "associated with a class" that you're operating under?  (I 
> ask this not because your question suggested any misunderstanding, but 
> because I, not having used listDeclaredProperties, assumed it might 
> return properties in restrictions on classes and the like, and that 
> doesn't appear to the be the case.)

Ian




Re: OntClass.listDeclaredProperties

Posted by Ian Dickinson <ia...@epimorphics.com>.
On 23/04/2013 20:10, Joshua TAYLOR wrote:
> On Tue, Apr 23, 2013 at 2:45 PM, David Jordan <Da...@sas.com> wrote:
>> When I call listDeclaredProperties with a direct parameter value of false, I get a list of properties associated with a class. But when I pass a value of true, I don’t get any values, yet there are properties directly associated with the class. I do run this with a reasoner, using OWL_MEM_MICRO_RULE_INF. I am using the latest TDB release. Any idea why they are not being returned?
>
> Until now, I hadn't looked closely enough at the doc to know what
> listDeclaredProperties was supposed to return.It returns an
> iterator over "properties associated with a frame-like view of this
> class", but I wasn't sure what "associated with" meant there.
What it means is documented here:

http://jena.apache.org/documentation/notes/rdf-frames.html

Looking
> at the implementation in OntClassImpl, a property is associated with a
> class if class is one of the property's domains.  Is that the same
> meaning of "associated with a class" that you're operating under?  (I
> ask this not because your question suggested any misunderstanding, but
> because I, not having used listDeclaredProperties, assumed it might
> return properties in restrictions on classes and the like, and that
> doesn't appear to the be the case.)

Ian



Re: OntClass.listDeclaredProperties

Posted by Joshua TAYLOR <jo...@gmail.com>.
> -----Original Message-----
> From: Joshua TAYLOR [mailto:joshuaaaron@gmail.com]
> Sent: Tuesday, April 23, 2013 3:11 PM
> To: users@jena.apache.org
> Subject: Re: OntClass.listDeclaredProperties
>
> On Tue, Apr 23, 2013 at 2:45 PM, David Jordan <Da...@sas.com> wrote:
>> When I call listDeclaredProperties with a direct parameter value of false, I get a list of properties associated with a class. But when I pass a value of true, I don’t get any values, yet there are properties directly associated with the class. I do run this with a reasoner, using OWL_MEM_MICRO_RULE_INF. I am using the latest TDB release. Any idea why they are not being returned?
>
> Until now, I hadn't looked closely enough at the doc to know what
> listDeclaredProperties was supposed to return.   It returns an
> iterator over "properties associated with a frame-like view of this class", but I wasn't sure what "associated with" meant there.  Looking at the implementation in OntClassImpl, a property is associated with a class if class is one of the property's domains.  Is that the same meaning of "associated with a class" that you're operating under?  (I ask this not because your question suggested any misunderstanding, but because I, not having used listDeclaredProperties, assumed it might return properties in restrictions on classes and the like, and that doesn't appear to the be the case.)

On Tue, Apr 23, 2013 at 3:18 PM, David Jordan <Da...@sas.com> wrote:
> Actually, no it is not. What I really want is those properties included in the definition of the class. I guess the better way to do this is to call model.listStatements for the class and get the set of properties.
>
> Thanks for looking in the code.

It's always a handy idea to keep a copy of the source around and to
keep your grep ready.  :)  Do be aware that you'll have to do a bit
more digging even with model.listStatements because restrictions used
in class "definitions" are typically declared as superclasses (or,
less commonly, equivalent classes) of the class being "defined".  I
put "definition" and "defined" in quotes, because typically the class
"definition" is a set of necessary conditions, but not always
sufficient.  At any rate, you'll have to examine those superclasses
and equivalent classes, and you might want to recurse up the other
superclasses of the class too, if, in a case like

Vehicle subClassOf (hasWheel min 2)
MotorVehicle subClassOf Vehicle
MotorVehicle subClassOf (hasMotor min 1)

you want to say that hasWheel is used in the definition of MotorVehicle.

//JT
-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/

RE: OntClass.listDeclaredProperties

Posted by David Jordan <Da...@sas.com>.
Actually, no it is not. What I really want is those properties included in the definition of the class. I guess the better way to do this is to call model.listStatements for the class and get the set of properties.

Thanks for looking in the code.


-----Original Message-----
From: Joshua TAYLOR [mailto:joshuaaaron@gmail.com] 
Sent: Tuesday, April 23, 2013 3:11 PM
To: users@jena.apache.org
Subject: Re: OntClass.listDeclaredProperties

On Tue, Apr 23, 2013 at 2:45 PM, David Jordan <Da...@sas.com> wrote:
> When I call listDeclaredProperties with a direct parameter value of false, I get a list of properties associated with a class. But when I pass a value of true, I don’t get any values, yet there are properties directly associated with the class. I do run this with a reasoner, using OWL_MEM_MICRO_RULE_INF. I am using the latest TDB release. Any idea why they are not being returned?

Until now, I hadn't looked closely enough at the doc to know what
listDeclaredProperties was supposed to return.   It returns an
iterator over "properties associated with a frame-like view of this class", but I wasn't sure what "associated with" meant there.  Looking at the implementation in OntClassImpl, a property is associated with a class if class is one of the property's domains.  Is that the same meaning of "associated with a class" that you're operating under?  (I ask this not because your question suggested any misunderstanding, but because I, not having used listDeclaredProperties, assumed it might return properties in restrictions on classes and the like, and that doesn't appear to the be the case.)

//JT

--
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/


Re: OntClass.listDeclaredProperties

Posted by Joshua TAYLOR <jo...@gmail.com>.
On Tue, Apr 23, 2013 at 2:45 PM, David Jordan <Da...@sas.com> wrote:
> When I call listDeclaredProperties with a direct parameter value of false, I get a list of properties associated with a class. But when I pass a value of true, I don’t get any values, yet there are properties directly associated with the class. I do run this with a reasoner, using OWL_MEM_MICRO_RULE_INF. I am using the latest TDB release. Any idea why they are not being returned?

Until now, I hadn't looked closely enough at the doc to know what
listDeclaredProperties was supposed to return.   It returns an
iterator over "properties associated with a frame-like view of this
class", but I wasn't sure what "associated with" meant there.  Looking
at the implementation in OntClassImpl, a property is associated with a
class if class is one of the property's domains.  Is that the same
meaning of "associated with a class" that you're operating under?  (I
ask this not because your question suggested any misunderstanding, but
because I, not having used listDeclaredProperties, assumed it might
return properties in restrictions on classes and the like, and that
doesn't appear to the be the case.)

//JT

-- 
Joshua Taylor, http://www.cs.rpi.edu/~tayloj/