Skip to content
skomlaebri edited this page May 21, 2015 · 19 revisions

Ontop offers many different preferences for users to configure it considering their needs. Ontop can be configured both from the Protege plugin and from the source code.

Configure Ontop from the Protege Plugin

Go to Launcher -> Preferences -> Quest to configure Ontop preferences.

####First Order Reformulation

Enable Query Rewriting: This mode indicates if the query should be rewritten w.r.t. the existential axioms in TBox. When enabled, Ontop applies the treewitness rewriting algorithm to handle the unnamed individuals introduced existential axioms.

####Data Configuration Ontop presents two kind of data configuration mode: Virtual ABox and Classic ABox. This configuration defines how data assertions are given to the system.

Virtual Abox Mode: In this mode Ontop functions as a mediator, located on-top of the data source linked to the ontology by means of mappings. Ontop gets as input an RDFS/OWL2QL ontology and an .obda file which includes a set of mappings. By using the mappings, Ontop translates SPARQL queries over the ontology into SQL queries over database.

Classic ABox Mode: In this mode Ontop gets as input an ontology and data triples/ABox assertions. In this respect, Ontop works similarly to a traditional OWL reasoner or triple store. The interesting aspect of this mode is that Quest uses the same mechanism for query answering as the one used in virtual mode. That is, Quest will also use an OBDA model and a RDBMS during query answering; however, in this case the database (schema and data) and the mappings of the OBDA model are defined and managed by Quest itself.

  1. Schema organization strategy of Classic ABox: This indicates how to construct the database repository to store the ABox/data of the system. The options for shema organization strategy are Direct and Semantic Index.
  • Direct: In this mode Ontop creates one table per each class/property.

  • Semantic Index: In this mode Ontop uses one table for each type of assertions, i.e., class, object, and data property assertions (in the last case one for each value domain). In these tables, the class or property is determined by a numeric id (idx). The assignment of ids to classes and properties is done taking into account the TBox. In this way the value of idx encodes the implied hierarchical structure of TBox.

  1. Database location: This configuration determines the location of the database that will serve as ABox repository in classic mode.
  • In-Memory (H2-DB): By enabling this configuration, user lets Ontop to create a H2 in-memory database to hold the ABox.
  1. Data Source(s): This mode indicates where the ABox should be read from. The options for this configuration are From active ontology's ABox and From the current mappings in the OBDA model.
  • From active ontology's ABox: This option indicates that the ABox data should be read from the loaded ontology.
  • From the current mappings in the OBDA model: This option indicates that the ABox data should be read from the OBDA model. Ontop materializes the data as triples into an H2 in-memory database which are mapped from database to ontology.

Configure Ontop from the Source Code

User should create a .properties file to configure Ontop preferences and should set DEFAULT_PROPERTIESFILE string inside the QuestPreferences.java class to the path of .properties file by calling setCurrentValueOf function of QuestPreferences class. Otherwise default Ontop configurations (i.e. QuestDefaults.properties file) will be in charge. User can also set each Ontop preference individually by calling setCurrentValueOf function.

EXAMPLE: The content of an example configuration file which is set to virtual ABox mode is as following:

rewrite=true
org.obda.owlreformulationplatform.sqlGenerateReplace=true
org.obda.owlreformulationplatform.aboxmode=virtual
max_pool_size=20
initial_pool_size=2
remove_abandoned=false
abandoned_timeout=60
keep_alive=true
JDBC_URL=jdbc:mysql://10.7.20.39:3306/uobm
DBUSER=fish
DBPASSWORD=fish
JDBC_DRIVER=com.mysql.jdbc.Driver

The content of an example configuration file which is set to classic ABox mode is as following:

rewrite=true
org.obda.owlreformulationplatform.sqlGenerateReplace=true
org.obda.owlreformulationplatform.aboxmode=classic
org.obda.owlreformulationplatform.dbtype=semantic
org.obda.owlreformulationplatform.obtainFromOntology=true
org.obda.owlreformulationplatform.obtainFromMappings=false
STORAGE_LOCATION=h2-inmemory

OPTIONS:

rewrite can be set as true or false. Setting it as true enables query rewriting. The algorithm which is used for rewriting is TreeWitness. TreeWitness is a new technique written by R. Kontchakov, which performs very well compared to other rewriting techniques.

org.obda.owlreformulationplatform.sqlGenerateReplace can be set as true or false. By setting it as true, the system can be enabled to generate the long nested REPLACE expressions that replace any non valid symbol in URIs, such as blank spaces, by its equivalent percent-encoding, e.g. %20.

org.obda.owlreformulationplatform.aboxmode can be set as virtual or classic. Please look at "Data Configuration" section.

org.obda.owlreformulationplatform.distinctResultSet can be set as true or false. The default value is false. By setting it as true, select distinct in a SPARQL query is executed removing duplicates from the result set instead of executing SQL queries with distinct. This choice can improve the performance, but can return incorrect results with query using limit or offset.

Virtual ABox Mode

  • max_pool_size sets maximum pool size according to database server's resources.

  • initial_pool_size sets initial pool size according to server's resources.

  • remove_abandoned can be set as true or false. Setting it to true lets the system to put abandoned(not properly closed) connections back to pool after timeout (in seconds).

  • abandoned_timeout allows borrowed connections to be put back into the connection pool after a connection has not been used for a specific amount of time.

  • keep_alive setting uses SELECT 1 test query to make sure connection is alive before passing it.

  • JDBC_URL should be set to an JDBC connection URL. For more details about connection URLs please look at here.

  • DBUSER should be set to database user name.

  • DBPASSWORD should be set to database password.

  • JDBC_DRIVER should be set to an JDBC driver class. For more details about JDBC drivers please look at here.

Classic ABox Mode

More information for the rest is in "Configure Ontop from the Protege Plugin" section.

  • org.obda.owlreformulationplatform.dbtype can be set as direct or semantic. Please look at "Schema organization strategy of Classic ABox" item.

  • org.obda.owlreformulationplatform.obtainFromOntology can be set as true or false. Please look at "Data Source(s)" item.

  • org.obda.owlreformulationplatform.obtainFromMappings can be set as true or false. Please look at "Data Source(s)" item.

  • STORAGE_LOCATION can be set as only h2-inmemory. Please look at "Database location" item.

Clone this wiki locally