query answering with description logic ontologies Meghyn Bienvenu (CNRS & Université de Montpellier) Magdalena Ortiz (Vienna University of Technology)
navigational queries
limitations of (u)cqs Some very natural queries are not expressible as CQs: - find dishes that contain something spicy - is a a relative of b? - is there a bus connection from x to y? We need navigational queries that can flexibly explore our data 3/23
limitations of (u)cqs Some very natural queries are not expressible as CQs: - find dishes that contain something spicy - is a a relative of b? - is there a bus connection from x to y? 3/23 We need navigational queries that can flexibly explore our data
We are dealing with graph-structured data aboxes and gsd (node- & edge-) labeled graphs = ABoxes = ∙ important in the database community ∙ can capture highly connected data with no fixed schema ∙ social, biological, chemical networks, pointer structures … 4/23 relational databases with unary and binary predicates only
aboxes and gsd (node- & edge-) labeled graphs = ABoxes = ∙ important in the database community ∙ can capture highly connected data with no fixed schema ∙ social, biological, chemical networks, pointer structures … 4/23 relational databases with unary and binary predicates only We are dealing with graph-structured data
Both languages have 1-way and 2-way variants navigational queries serves Menu y z Spicy ingredOf hasIngred x y courseOf hasCourse hasStarter x y Regular Path Queries (RPQs) : find pairs of objects that are connected hasMain serves Menu y z q x x ∙ extend CQs with the navigational power of RPQs ∙ similar to CQs, but each atom is an RPQ Conjunctive RPQs: allow to join RPQs conjunctively by a chain of roles that comply with a given regular language 5/23 ( hasCourse ∪ courseOf − ) · ( hasIngred ∪ ingredOf − ) ∗ · Spicy ?( x , y )
navigational queries Regular Path Queries (RPQs) : find pairs of objects that are connected by a chain of roles that comply with a given regular language Conjunctive RPQs: allow to join RPQs conjunctively ∙ similar to CQs, but each atom is an RPQ ∙ extend CQs with the navigational power of RPQs 5/23 ( hasCourse ∪ courseOf − ) · ( hasIngred ∪ ingredOf − ) ∗ · Spicy ?( x , y ) q ( x , x ′ ) = ∃ y , z . serves · Menu ? · ( hasMain ∪ hasStarter )( x , y ) ∧ serves · Menu ? · ( hasCourse ∪ courseOf − )( x ′ , y ) ∧ ( hasIngred ∪ ingredOf − ) ∗ · Spicy ?( y , z ) Both languages have 1-way and 2-way variants
our most expressive navigational queries: c2rpqs Regular languages can be given as: Note: RegExps and NFAs are equivalent, but NFAs are more succinct ∙ non-deterministic finite automata NFA A N R r ∙ regular expressions y) where A is a concept name 6/23 Recall: N ± R contains all role names and their inverses. A conjunctive two-way regular path query (C2RPQ) has the form y . � L ( t , t ′ ) ∧ � A ( t ) q ( � x ) = ∃ � t , t ′ are variables or individuals (in N I ∪ � x ∪ � L is regular language over N ± R ∪ { A ? | A ∈ N C }
our most expressive navigational queries: c2rpqs A is a concept name Note: RegExps and NFAs are equivalent, but NFAs are more succinct ∙ non-deterministic finite automata NFA R ∙ regular expressions Regular languages can be given as: y) where 6/23 Recall: N ± R contains all role names and their inverses. A conjunctive two-way regular path query (C2RPQ) has the form y . � L ( t , t ′ ) ∧ � A ( t ) q ( � x ) = ∃ � t , t ′ are variables or individuals (in N I ∪ � x ∪ � L is regular language over N ± R ∪ { A ? | A ∈ N C } E → r ∈ N ± | A ? | E · E | E ∪ E | E ∗
other navigational query languages hasIngred x y Spicy hasCourse hasIngred q x y x y Spicy hasIngred q x y all of the restrictions above (One-way) Regular path queries (RPQs) are 2RPQs with no inverses x y Spicy ingredOf q x y Conjunctive (one-way) regular path queries (CRPQs) disallow inverses x y Spicy ingredOf hasIngred q x y both variables are answer variables existential variables Two-way regular path queries (2RPQs) have only one atom and no 7/23 � regular expressions use only (direct) role names q ( x , x ′ ) = ∃ y , z . serves · Menu ? hasCourse ( x , y ) ∧ serves · Menu ? · hasCourse ( x ′ , y ) ∧ hasIngred ∗ · Spicy ?( y , z ) ∃ y . hasIngred ∗ · Spicy ?( x , y ) q ( x ) =
other navigational query languages (One-way) Regular path queries (RPQs) are 2RPQs with no inverses x y Spicy hasCourse hasIngred q x y x y Spicy hasIngred q x y all of the restrictions above 7/23 Conjunctive (one-way) regular path queries (CRPQs) disallow inverses Two-way regular path queries (2RPQs) have only one atom and no � regular expressions use only (direct) role names q ( x , x ′ ) = ∃ y , z . serves · Menu ? hasCourse ( x , y ) ∧ serves · Menu ? · hasCourse ( x ′ , y ) ∧ hasIngred ∗ · Spicy ?( y , z ) ∃ y . hasIngred ∗ · Spicy ?( x , y ) q ( x ) = existential variables � both variables are answer variables = ( hasIngred ∪ ingredOf − ) ∗ · Spicy ?( x , y ) q ( x , y ) = ( hasIngred ∪ ingredOf − ) ∗ · Spicy ? · Σ ∗ ( x , y ) q ( x , y )
other navigational query languages Two-way regular path queries (2RPQs) have only one atom and no (One-way) Regular path queries (RPQs) are 2RPQs with no inverses Conjunctive (one-way) regular path queries (CRPQs) disallow inverses 7/23 � regular expressions use only (direct) role names q ( x , x ′ ) = ∃ y , z . serves · Menu ? hasCourse ( x , y ) ∧ serves · Menu ? · hasCourse ( x ′ , y ) ∧ hasIngred ∗ · Spicy ?( y , z ) ∃ y . hasIngred ∗ · Spicy ?( x , y ) q ( x ) = existential variables � both variables are answer variables = ( hasIngred ∪ ingredOf − ) ∗ · Spicy ?( x , y ) q ( x , y ) = ( hasIngred ∪ ingredOf − ) ∗ · Spicy ? · Σ ∗ ( x , y ) q ( x , y ) � all of the restrictions above = hasIngred ∗ · Spicy ?( x , y ) q ( x , y ) = hasCourse · hasIngred ∗ · Spicy ?( x , y ) q ( x , y )
Again suffices to find match in universal model semantics of c2rpqs Match : mapping Certain answers defined as for CQs maps answer variables to a q a if match As before: from terms to elements that satisfies all atoms 8/23 Satisfaction of atoms L ( t , t ′ ) : ( d , d ′ ) ∈ L I if there is an L -path from d to d ′ , i.e., ∙ a sequence e 0 e 1 . . . e n objects from ∆ I with e 0 = d and e n = d ′ ∙ a word u 1 u 2 . . . u n ∈ L over N ± R ∪ { A ? | A ∈ N C } such that, for every 1 ≤ i ≤ n: ∙ if u i = A ? , then e i − 1 = e i ∈ A I ∙ if u i = R ∈ N ± R , then ( e i − 1 , e i ) ∈ R I
Again suffices to find match in universal model semantics of c2rpqs a Certain answers defined as for CQs 8/23 Satisfaction of atoms L ( t , t ′ ) : ( d , d ′ ) ∈ L I if there is an L -path from d to d ′ , i.e., ∙ a sequence e 0 e 1 . . . e n objects from ∆ I with e 0 = d and e n = d ′ ∙ a word u 1 u 2 . . . u n ∈ L over N ± R ∪ { A ? | A ∈ N C } such that, for every 1 ≤ i ≤ n: ∙ if u i = A ? , then e i − 1 = e i ∈ A I ∙ if u i = R ∈ N ± R , then ( e i − 1 , e i ) ∈ R I Match : mapping π from terms to elements that satisfies all atoms = π q ( � a ) if match π maps answer variables to � As before: I |
semantics of c2rpqs a Certain answers defined as for CQs 8/23 Satisfaction of atoms L ( t , t ′ ) : ( d , d ′ ) ∈ L I if there is an L -path from d to d ′ , i.e., ∙ a sequence e 0 e 1 . . . e n objects from ∆ I with e 0 = d and e n = d ′ ∙ a word u 1 u 2 . . . u n ∈ L over N ± R ∪ { A ? | A ∈ N C } such that, for every 1 ≤ i ≤ n: ∙ if u i = A ? , then e i − 1 = e i ∈ A I ∙ if u i = R ∈ N ± R , then ( e i − 1 , e i ) ∈ R I Match : mapping π from terms to elements that satisfies all atoms = π q ( � a ) if match π maps answer variables to � As before: I | Again suffices to find match in universal model
Bound on matches ranging over individuals only e 3 ArrabSauce answering 2rpqs e 1 hasIngred hasIngred hasIngred hasIngred serves serves Peperonc Spicy e 4 Penne Pasta e 2 Nduja Spicy PenneArrab y We focus on answering 2RPQs : one atom, no existential variables b PizzaCalab p x r x y Spicy ingredOf hasIngred serves q x y Challenge: paths may need to go deep into the universal model 9/23
e 3 ArrabSauce answering 2rpqs y hasIngred hasIngred hasIngred hasIngred serves serves Peperonc Spicy e 4 Penne Pasta e 2 Nduja Spicy e 1 PenneArrab We focus on answering 2RPQs : one atom, no existential variables b PizzaCalab p x r x y Spicy ingredOf hasIngred serves q x y Challenge: paths may need to go deep into the universal model 9/23 Bound on matches ranging over individuals only
answering 2rpqs e 1 hasIngred hasIngred hasIngred hasIngred serves serves e 4 e 2 We focus on answering 2RPQs : one atom, no existential variables 9/23 PenneArrab b PizzaCalab p r Challenge: paths may need to go deep into the universal model Bound on matches ranging over individuals only q ( x , y ) = serves · ( hasIngred ∪ ingredOf − ) ∗ · Spicy ? · Σ ∗ ( x , y ) π ( y ) π ( x ) e 3 ArrabSauce Nduja , Spicy Penne , Pasta Peperonc , Spicy
Recommend
More recommend