-
Notifications
You must be signed in to change notification settings - Fork 0
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 existential axioms in TBox. When enabled, Ontop applies the treewitness rewriting algorithm to handle the unnamed individuals introduced existential axioms.
Enable Query Ontology Annotations: This mode can be enabled when the user requires to query the annotation property defined in the ontology. Since it can be expensive it is disabled by default.
Enable owl:sameAs in mappings: Allow a special use of owl:sameAs in mappings that needs linked table map to work, see iswc-crosslinked .
####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 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.
org.obda.owlreformulationplatform.queryingAnnotationsInOntology can be set as true
or false
. The default value is false. By setting it as true, it is possible to query annotation properties defined in the ontology. This choice can slow down the offline performance, but it allows to retrieve in the results also information about annotation properties defined in the ontology and not only in the mappings.
org.obda.owlreformulationplatform.sameAs can be set as true
or false
. The default value is false. By setting it as true, it is possible to enable owl:sameAs in mapping. See iswc-crosslinked .
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.
To configure Ontop preferences user can modify QuestDefault.properties
file inside the jar file ontop-reformulation-core-vvv.jar
(where vvv is the current version of ontop). This jar file is contained in the lib
folder of ontop-distribution
. QuestDefault.properties
can be found inside the jar in the folder /it/unibz/krdb/obda/owlrefplatform/core/
.
The user can modify the jar directly from command line, this is a way to avoid the null pointer exception:
move the QuestDefaults.properties inside your file with
jar -uf YOURJAR.jar dir/filetoadd
For example:
jar -uf it.unibz.inf.ontop.protege-1.17.1.jar ./it/unibz/krdb/obda/owlrefplatform/core/QuestDefaults.properties
For more information about how to change the preferences see the explanation in Configure Ontop from the Source Code
- Quick Start Guide
- Easy-Tutorials
- More Tutorials
- Examples
- FAQ
- Using Ontop
- Learning more
- Troubleshooting
- Developer Guides
- Links