user3176901
user3176901

Reputation: 11

Accessing my Protege OWL Ontology using Java in Eclipse

I've just built a new OWL ontology in protege (classes, properties and individuals). My problem is: How can I access (query) the individuals to use it in a program written in Java under Eclipse.

I've tried the following:

  1. Generate the ontology java code and try to load it using Jena in Eclipse but that requires programming using jena and Im not sure if I need this.
  2. Add protege plugin in Eclipse and try to access the OWL file to read from the file but that also didn't work.

Thus what is the proper method for accessing (Querying) the OWL individuals from protege in a Java program written under Eclipse.

Upvotes: 1

Views: 5389

Answers (1)

Michael
Michael

Reputation: 4886

You should use a Java library for RDF. You mention Jena, but there's also Sesame. Or if you want something OWL specific, you could try the OWLAPI.

There's nothing fancy you need to do to use your ontology in an application. Any of the aforementioned libraries can read it in, it's just RDF after all, and provide programmatic access directly such as iterating over the triples, or via queries or other lookup mechanisms.

All three libraries have good documentation to get you started on how you'd read in and use your ontology. You might stick with the OWLAPI if you want to use a reasoner, or want to do OWL-specific manipulations of the data.

Upvotes: 3

Related Questions