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-discussion] a simple questions about owl programming

Timothy Redmond tredmond at
Wed Nov 17 10:01:01 PST 2010

> by the way, I use protege 4.0 to develop a owl file

It depends on how much work you have done at this point, but my usual 
recommendation with apis is that you only use the Protege 3 owl api if 
you plan on using some of the Protege 3 capabilities (e.g. there is some 
tab or widget that you want/need).  Usually I would recommend the 
Manchester owl api (, used by Protege 4) as it has 
less warts, handles OWL 2.0 and corresponds very well to the OWL 
specifications.  If you have more of an RDF orientation rather than an 
OWL orientation, there are many other apis that work very well for RDF 
and I am not sure which is best.

For the Protege 3 OWL api Thomas's answer is right on but I would also add


to get a list of all the RDFProperties that could have a value.

> he code on website is like this:

A glance at this code from the web site shows it as a bit brittle.  I 
think that it will only find classes that are declared to be subclasses 
of owl:Thing.

> but I still very confused by these methods...

I started trying to make an example but realized that I am not sure what 
the question is.  Maybe some more details about what you are trying to 
do and what you expect.

> if I click Jim as the picture, I can get the result as the rigt part 
> of the picture displayed, Usage

Usage of a resource is one of the things that is particularly difficult 
to do in a complete way with the Protege 3 OWL api.  It is very easy 
with the Manchester OWL api.


On 11/17/2010 07:20 AM, tingyu li wrote:
> hi Thomas, thanks for your response. but I still very confused by 
> these methods...and I have read all the samples posted on the website, 
> but I don't find any solutions for my problems, a very similar 
> question is about query all resources that have a certain property 
> value. the code on website is like this:
>     RDFProperty subClassOfProperty = owlModel.getRDFProperty(RDFSNames.Slot.SUB_CLASS_OF);
>     OWLNamedClass owlThingClass = owlModel.getOWLThingClass();
>     Collection results = owlModel.getRDFResourcesWithPropertyValue(subClassOfProperty, owlThingClass);
>     System.out.println("Subclasses of owl:Thing:");
>     for (Iterator it = results.iterator(); it.hasNext();) {
>          RDFResource resource = (RDFResource);
>          System.out.println(" - " + resource.getBrowserText());
>     }
> but, actually, there are no slot on the new version owl files. and I 
> think RDFProperty is not very fit for my file. by the way, I use 
> protege 4.0 to develop a owl file and save it as format: RDF/XML. the 
> file  is like this:
> <owl:ObjectProperty 
> rdf:about="">
> <rdfs:range 
> rdf:resource=""/>
> <rdfs:domain 
> rdf:resource=""/>
> </owl:ObjectProperty>
> I want get the similar result as the probem I described above. in 
> other words, if I click Jim as the picture, I can get the result as 
> the rigt part of the picture displayed, Usage and Property assertions:Jim
> thanks.
> 2010/11/17 Thomas Russ <tar at <mailto:tar at>>
>     On Nov 16, 2010, at 7:07 AM, tingyu li wrote:
>         Hello everyone,
>         I have a simple question about owl programming, and if a
>         instance was specified in my code, and how I get its data
>         properity assertions? and even I can get its class name and
>         superclass or subclass? I can't find a relevant function to do
>         that.
>         right now, I just can use: owlModel.getOWLNamedClass("class
>         name") to specify a class, and use: getInstances to get
>         class's instance. but I don't know how to do a reverse process.
>         I will very appreciate if everyone can give me any suggestions
>         or samples.
>     I assume you have looked at
>     For your specific question, you need to look at the java docs
>     for OWLIndividual and find the appropriate methods like
>       getPropertyValue
>       getPropertyValues
>       getRDFType
>       getRDFTypes
>     _______________________________________________
>     protege-discussion mailing list
>     protege-discussion at
>     <mailto:protege-discussion at>
>     Instructions for unsubscribing:
> -- 
> Li
> _______________________________________________
> protege-discussion mailing list
> protege-discussion at
> Instructions for unsubscribing:

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the protege-discussion mailing list