-
Notifications
You must be signed in to change notification settings - Fork 10
Ontop Preferences
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.
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 TBox during query answering. Query rewriting is necessary in such cases that the concepts and roles for atoms in query have many sub-concepts and sub-roles according to TBox.
####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.
-
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
andSemantic 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 ofidx
encodes the implied hierarchical structure of TBox.
- 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.
-
Data Source(s): This mode indicates where the ABox should be read from. The options for this configuration are
From active ontology's ABox
andFrom 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.
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. Otherwise default Ontop configurations (i.e. QuestDefaults.properties
file) will be in charge. User can also set each Ontop preference individually by calling setProperty
function of QuestPreferences
class.
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
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 is much faster than any 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.
org.obda.owlreformulationplatform.aboxmode can be set as virtual
or classic
. Please look at "Data Configuration" section.
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
orfalse
. 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
orsemantic
. Please look at "Schema organization strategy of Classic ABox" item. -
org.obda.owlreformulationplatform.obtainFromOntology can be set as
true
orfalse
. Please look at "Data Source(s)" item. -
org.obda.owlreformulationplatform.obtainFromMappings can be set as
true
orfalse
. Please look at "Data Source(s)" item. -
STORAGE_LOCATION can be set as only
h2-inmemory
. Please look at "Database location" item.