Ontology and Database Systems Labs 2016/2017
Lab 8. Learning to use the Ontop API.
-
Start the h2 database distributed in lab-7.
- Install a Java IDE. The following procedures are for IntelliJ. Other IDEs like Eclipse also work.
- Create a new Maven Project via
File -> New -> Project
, for instance
- 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:
- 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
- Ontop wiki
- Ontop API example
- Mapping
Design Tips
- Using ontop as
Maven dependency
- Using R2RML
with ontop
- Ontop:
Answering SPARQL Queries over Relational Databases (Semantic Web Journal 2016 best paper award)