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] reading owl in java application

Cedric Peeters cedric.peeters at
Mon Feb 16 04:37:33 PST 2009


To read an ontology in a Java application with Jena, you can do this:

OntModel ontologyModel =  
ModelFactory.createOntologyModel(OntModelSpec.OWL_MEM, null);, "RDF/XML-ABBREV"); //where owlBaseFile  
is a string containing the path to your pizza.owl file

The you can interact with your ontology. For instance you can get a  
class like this:

OntClass pizzaClass =  
ontologyModel.getOntClass(nameSpace+className);//where namespace is  
the namespace of your ontology (for instance (do not forget the #  
after the soruce)" and the className is a string containing the name  
of the class you want (for instance "Pizza").

When you have finish with your ontology, you can close it:

You can learn more here:
and here is a small tutorial :

Hope it helps;


Quratulain Rajput <quratulain.rajput at> a écrit :

>  I have to read owl file in my java application. I am trying to read
>   pizza.owl a popular example comes along with protege. I do'nt know how
>   to do it.
>   please tell me any tutorial, if available. I am working with eclipse
>   and created RDF using Jena.
>   Now I have to read OWL file. Please give me any sample code.
>   waiting of your response.
>   Quratulain
> _______________________________________________
> protege-owl mailing list
> protege-owl at
> Instructions for unsubscribing:  

More information about the protege-owl mailing list