Upload
mariano-rodriguez
View
289
Download
0
Embed Size (px)
DESCRIPTION
Quick description of quest and ontop, a system for ontology based data access (OBDA) that allows SPARQL over RDBMS (through virtual RDF with mappings)
Citation preview
A reasoner for Ontology Based Data Access
Mariano Rodríguez-Muro and Diego CalvaneseKRDB Research Group
Free University of Bozen-BolzanoOWLED’12May, 2012
Quest
OBDA and -Quest-
OWL Ontologies
• Uses• Documentation• Knowledge Exchange• Discovering new knowledge• Ontologies + Data…
OBDA and -Quest-
Instance reasoning
• Instance reasoning• Infer new information about the data• Detect inconsistent data• Use inferred information for complex queries (e.g., SPARQL)
• Aim: Large ontologies + Large data• Traditional approach...
OBDA and -Quest-
The usual workflow (ETL)
Reasoner
Source
Application
Communication
Ontology
Inputs
Triples Application Code (e.g., D2RQ, R2RML processors, etc)
OBDA and -Quest-
Problem with approach • Software Complexity• Duplication• Data refreshing
• Performance (implementation, even light languages)• Data structure is lost (PKEYS,
FOREIGN KEYS, etc)
Reasoner
Source
Application
Communication
Ontology
Inputs
Triples Application Code
OBDA and -Quest-
OBDA Models: Sources and Mappings
“A formal specification of the relationship between data in a data source and the vocabulary of the ontology”
OBDA Model
Source Declaration
Source MA set of mappings
Mapping: “A tuple of an source query (e.g., SQL) and a template of the ABox assertions to defined by the answers to the query.”
OBDA and -Quest-
OBDA as an Architecture
Reasoner
Source
Application
Direct Communication
Ontology
OBDA Model
Inputs
OBDA and -Quest-
The Pay-off
OBDA and -Quest-
The Pay-off• At least• The source is documented• Data handling can be done automatically (by the reasoner)• Reduced cost of application development and maintenance• The reasoner can analyze source and mappings to minimize the cost of
inference
OBDA and -Quest-
The Pay-off• At least• The source is documented• Data handling can be done automatically (by the reasoner)• Reduced cost of application development and maintenance• The reasoner can analyze source and mappings to minimize the cost of
inference
• The sweet spot (with OWL 2 QL/RDFS)• On-the-fly ontology based data access• Exploitation of efficient sources (e.g., SQL engines) • Reasoning by pure query rewriting
OBDA and -Quest-
An OBDA reasoner focused on fast and efficient query answering over very large ontologies and very large volumes of data.Features:• Support for RDFS and OWL 2 QL semantics• SPARQL* (> UCQs)• Powerful mapping language (often compensates for OWL 2
QL)• OWLAPI 3 and Protégé 4.1 support• Reasoning by query rewriting.• Relies on SQL engines for query execution.• ABox modes...
Quest
OBDA and -Quest-
Quest in “classic ABox mode” (R/W)
Ontology
Quest
ABox/OBDA Model
Source
Application
JDBC
Storage is is based on the Semantic Index technique (ISWC11, KR12)
Internal DB
OBDA and -Quest-
Quest in “virtual ABox mode” (read-only)
Ontology
Quest
OBDA Model
Source
ApplicationInputs
PostgreSQL, MySQL, SQL Server, DB2 and Oracle
JDBC
OBDA and -Quest-
Data integration with virtual ABox mode
Ontology
Quest
OBDA Model
Database Federation
Application
JDBC
Inputs
E.g., Teiid, Oracle, DB2
OBDA and -Quest-
What’s special about Quest?• We realized that SQL determines performance, not TBox query
rewriting.• Query rewritings in Quest are “natural” SQL queries • Effective query rewriting:• Highly efficient rewriting algorithm• Highly efficient SQL generation:• Detection of redundant SQL (w.r.t. constraints and mappings)• Optimized individual SQL queries (w.r.t. constraints and mappings)• Generates optimal SQL for modern engines
• Beyond academic prototype, focused on features for SW application development.• Going beyond OWL 2 QL. Rules (SWRL, RIF), exploiting
recursivity of SQL and Datalog engines for OWL 2 EL, hybrid approaches for OWL 2 RL.
OBDA and -Quest-
OBDA and -Quest-
THANK YOUQuestions, Examples, Hands-on or Demos?
OBDA and -Quest-
Query Rewriting in a Nutshell
“Given a query Q, a TBox T, an OBDA model <D, M> to compute a query Q’ over D that returns the desired
answers”
OBDA and -Quest-
Example OBDA model
id [PKEY] name age ssn
12 John 37 xxx-999
Table: patient
patient_id [FKEY] c_id [FKEY]
12 33
Table: condition
OBDA and -Quest-
Example OBDA model
SELECT id,name,age,ssn FROM patient
:person/{$id} a Patient; name $name; age $age^^xsd:int; ssn $ssn
id [PKEY] name age ssn
12 John 37 xxx-999
Table: patient
patient_id [FKEY] c_id [FKEY]
12 33
Table: condition
OBDA and -Quest-
Example OBDA model
SELECT id,name,age,ssn FROM patient
:person/{$id} a Patient; name $name; age $age^^xsd:int; ssn $ssn
id [PKEY] name age ssn
12 John 37 xxx-999
Table: patient
patient_id [FKEY] c_id [FKEY]
12 33
Table: condition
SELECT id, c_id FROM condition:person/{$id} affectedBy :cond/{$id}/{$c_id}
OBDA and -Quest-
Example OBDA model
SELECT id,name,age,ssn FROM patient
:person/{$id} a Patient; name $name; age $age^^xsd:int; ssn $ssn
id [PKEY] name age ssn
12 John 37 xxx-999
Table: patient
patient_id [FKEY] c_id [FKEY]
12 33
Table: condition
SELECT id, c_id FROM condition:person/{$id} affectedBy :cond/{$id}/{$c_id}
SELECT id,c_id FROM condition WHERE c_id = 33:cond/{$id}/{$c_id} a CardiacArrest
SELECT id,c_id FROM condition WHERE c_id = 27:cond/{$id}/{$c_id} a Clog
OBDA and -Quest-
Query Rewriting: An example
Ontology (Tbox)
SubClassOf(:CardiacArrest :HearthCondition)SubClassOf(:Clog :HearthCondition)
Query (SPARQL)
SELECT ?p ?n ?ssn WHERE { ?p a :Patient; :name ?n; :ssn ?s; :age ?a; :affectedBy [ a :HeartCondition ]. FILTER (?a >= 21 && ?a <= 50)}
OBDA and -Quest-
Query Rewriting An Example
Rewriting w.r.t. the OBDA model (mappings)
Efficient n-ary to binary!!
OBDA and -Quest-
Query Rewriting An Example
Rewriting w.r.t. the OBDA model (mappings)
SELECT (‘http://quest.org/owled#’ || tp.id) as p, tp.name as n, tp.ssn as sFROM patient tp JOIN condition tc ON tp.id = tc.patient_idWHERE (c.c_id = 33 || c.c_id = 27) AND tp.age >= 21 AND tp.age <= 50
Efficient n-ary to binary!!
OBDA and -Quest-
Query Rewriting An Example
Rewriting w.r.t. the OBDA model (mappings)
SELECT (‘http://quest.org/owled#’ || tp.id) as p, tp.name as n, tp.ssn as sFROM patient tp JOIN condition tc ON tp.id = tc.patient_idWHERE (c.c_id = 33 || c.c_id = 27) AND tp.age >= 21 AND tp.age <= 50
p n s
:person/12 John xxx-999
Answer
Efficient n-ary to binary!!