Ontology and Database Systems Labs 2016/2017

Lab 8. Learning to use the Ontop API.

  1. Start the h2 database distributed in lab-7.

  2. Install a Java IDE. The following procedures are for IntelliJ. Other IDEs like Eclipse also work.

  3. Create a new Maven Project via File -> New -> Project, for instance

  4. Open the example_files. Replace the created default pom.xml file with the downloaded file. Copy exampleBooks.obda, exampleBooks.owl, and exampleBooks.properties to src/main/resources/example. Copy QuestOWLExample.java to src/main/java. To hide Ontop debugging information, you might also want to copy logback.xml to src/main/resources. The structure of your project should be as follows:

  5. You can now run QuestOWLExample.java as a Java application. You will get the answers to sparqlQuery defined in the code. Also, you will get the SQL unfolding of that SPARQL query.
This simple example shows you how to use the ontop API. If you are going to develop a Java application for your project, you should probably start from this example.

Useful Links

  1. Ontop wiki
  2. Ontop API example
  3. Mapping Design Tips
  4. Using ontop as Maven dependency
  5. Using R2RML with ontop
  6. Ontop: Answering SPARQL Queries over Relational Databases (Semantic Web Journal 2016 best paper award)