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] how can I retrieve instance of ontology by Protege-OWL API?

hong hong at
Mon Apr 30 10:04:22 PDT 2007

Hi, Martin,

Thank you very much for your reply. SWRL query is a very good way to resolve
my problem. However, I am still curious to know how Protégé-OWL API can get
instance of the class with specified values of the properties. I did refer
to Protégé-OWL API java doc, but I didn't find the API which has such
functions. I notice that OWLNamedClass has method 
getInstances (Boolean includingSubclasses), but it seems not to be the
appropriate one. Could you please specify, if possible, which API I should
use to get instance of the class with specified values of the properties?
Moreover, I am wondering if I can implement this function by using DIG
interface or Jena API.

Thanks a lot.
Kind regards,

-----Original Message-----
From: protege-owl-bounces at
[mailto:protege-owl-bounces at] On Behalf Of Martin
Sent: 30 April 2007 17:04
To: User support for the Protege-OWL editor
Subject: Re: [protege-owl] how can I retrieve instance of ontology by
Protege-OWL API?

You can use the Protege-OWL API [1] to get instances of the class Person
that have the specified values for the properties you list.

Alternatively, for this type of retrieval you could write a SWRL query
of the form:

Person(?x) ^ hasChild(?x, Tom) ^ hasFriend(?x, Jim) ^ hasNationality(?x,
English) ^ liveIn(?x, China) -> query:select(?x)

and use the SWRLQueryAPI [2] to retrieve the results.



hong wrote:

> Dear All,
> I¡¯m trying to write a java application which can perform some function
> like instance retrieval from an ontology. For example, in family
> ontology, I would like to retrieve the instance of person, who has a
> child called Tom, has a friend called Jim, has nationality English and
> lives in China. The DL assertion should be like:
> but I am not familiar with Prot¨¦g¨¦-OWL API, so I don¡¯t know how to
> translate this assertion into program code by Prot¨¦g¨¦-OWL API. Could
> anyone help me?
> Thanks a lot.
> Hong
>protege-owl mailing list
>protege-owl at
>Instructions for unsubscribing: 

More information about the protege-owl mailing list