Search Mailing List Archives
[protege-owl] reading owl in java application
cedric.peeters at fundp.ac.be
Mon Feb 16 04:37:33 PST 2009
To read an ontology in a Java application with Jena, you can do this:
OntModel ontologyModel =
ontologyModel.read(owlBaseFile, "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
http://www.semanticweb.org/2009/1/pizza.owl# (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 : http://kill.devc.at/node/84
Hope it helps;
Quratulain Rajput <quratulain.rajput at gmail.com> 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.
> protege-owl mailing list
> protege-owl at lists.stanford.edu
> Instructions for unsubscribing:
More information about the protege-owl