简体   繁体   中英

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.

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.

http://www.slideshare.net/rajighawi/java-and-sparql#我认为该链接对您有帮助,我使用耶拿代码在Eclipse中访问了我的本体,并且它起作用了

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM