You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by John Ibbotson <jo...@uk.ibm.com> on 2011/07/04 11:43:35 UTC

Extending the DescribeClass sample to show DatatypeProperty

I want to extend the Jena DescribeClass sample to show any 
DatatypeProperties associated with a class. How do I do this ?
Regards,
John







Unless stated otherwise above:
IBM United Kingdom Limited - Registered in England and Wales with number 
741598. 
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire PO6 3AU






Re: Extending the DescribeClass sample to show DatatypeProperty

Posted by Ian Dickinson <ia...@epimorphics.com>.
Hi John,
On 04/07/11 10:43, John Ibbotson wrote:
> I want to extend the Jena DescribeClass sample to show any
> DatatypeProperties associated with a class. How do I do this ?

I'm not 100% sure what you mean by "associated with", but taking a guess 
that you mean a frame-like view [1], you'll need to call 
listDeclaredProperties() on the OntClass object, then iterate over the 
returned results and filter out the ones that return true to 
isDataTypeProperty().

How you incorporate that into the output is rather harder to advise, 
unless you can supply more details (such as an example of the display 
you're trying to create).

Hth,
Ian

[1] http://openjena.org/how-to/rdf-frames.html



-- 
____________________________________________________________
Ian Dickinson                   Epimorphics Ltd, Bristol, UK
mailto:ian@epimorphics.com        http://www.epimorphics.com
cell: +44-7786-850536              landline: +44-1275-399069
------------------------------------------------------------
Epimorphics Ltd.  is a limited company registered in England
(no. 7016688). Registered address: Court Lodge, 105 High St,
               Portishead, Bristol BS20 6PT, UK