Search Mailing List Archives
[protege-owl] how can I retrieve instance of ontology by Protege-OWL API?
hong at dmu.ac.uk
Mon Apr 30 10:04:22 PDT 2007
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.
From: protege-owl-bounces at mailman.stanford.edu
[mailto:protege-owl-bounces at mailman.stanford.edu] 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
You can use the Protege-OWL API  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  to retrieve the results.
> 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.
>protege-owl mailing list
>protege-owl at lists.stanford.edu
>Instructions for unsubscribing:
More information about the protege-owl