Presentation is loading. Please wait.

Presentation is loading. Please wait.

Topics covered (class assignment)

Similar presentations


Presentation on theme: "Topics covered (class assignment)"— Presentation transcript:

1 Topics covered (class assignment)
SHIQ (from [Horrocks, Sattler and Tobies]) CS848: Topics in Databases: Foundations of Query Optimization

2 QL dependencies to DLA dependencies
(class assignment) ( select name, age from EMP where loc = ‘Waterloo’ ) ´ ( select name, age from WATEMP ) ( select name where loc = ‘Toronto’ ) ´ ( select name from TOREMP ) ( select name from EMP ) ´ ( select name from WATEMP ) union all ( select name from TOREMP ) CS848: Topics in Databases: Foundations of Query Optimization

3 Dependency translation (cont’d)
WEMP ´ EMP u (8loc.WATERLOO) WEMP v (> 1 eref) (8eref.WEMP) v C1 C1 v (8eref.WEMP) u (8wref.WATEMP) C1 v (C1:eref ! id) u (C1:wref ! id) C1 v (eref.name = wref.name) u (eref.age = wref.age) WATEMP v (> 1 wref) (8wref.WATEMP) v C1 TEMP ´ EMP u (8loc.TORONTO) TEMP v (> 1 eref) (8eref.TEMP) v C2 C2 v (8eref.TEMP) u (8tref.TOREMP) C2 v (C2:eref ! id) u (C2:tref ! id) C2 v (eref.name = tref.name) TOREMP v (> 1 tref) (8tref.TOREMP) v C2 CS848: Topics in Databases: Foundations of Query Optimization

4 Dependency translation (cont’d)
EMP v (WEMP t TEMP) WATERLOO v STR u (:TORONTO) u (WATERLOO:! id) TORONTO v STR u (:WATERLOO) u (TORONTO:! id) ¤ v 8waterloo.WATERLOO ¤ v 8toronto.TORONTO CS848: Topics in Databases: Foundations of Query Optimization

5 Another approach WEMP ´ EMP u (8loc.WATERLOO)
WEMP v (8wref.WATEMP) u (WEMP:wref ! id) WATEMP v (8eref.WEMP) u (WATEMP:eref ! id) WATEMP v (name = eref.name) u (age = eref.age) TEMP ´ EMP u (8loc.TORONTO) TEMP v (8tref.TOREMP) u (TEMP:tref ! id) TOREMP v (8eref.TEMP) u (TOREMP:eref ! id) TOREMP v (name = eref.name) EMP v (WEMP t TEMP) WATERLOO v STR u (:TORONTO) u (WATERLOO:! id) TORONTO v STR u (:WATERLOO) u (TORONTO:! id) ¤ v 8waterloo.WATERLOO ¤ v 8toronto.TORONTO CS848: Topics in Databases: Foundations of Query Optimization

6 Dialect SHIQ The S part stands for ALC plus transitive roles R+ µ R.
Also introduces inverse roles. SI roles consist of (R [ {R- : R 2 R}) Inv(R) = R-; Inv(R-) = R. Trans(R) = true iff R 2 R+ or Inv(R) 2 R+ The H part means that we allows role inclusion axioms R1 v R2. Given a set R of role inclusion axioms, define the role hierarchy R+ ´ (R [ {Inv(R1) v Inv(R2) : R1 v R2 2 R}, v*) where v* is the reflexive transitive closure of v over R [ {Inv(R1) v Inv(R2) : R1 v R2 2 R}. CS848: Topics in Databases: Foundations of Query Optimization

7 Dialect SHIQ (cont’d) (union) D1 t D2 (D1)I [ (D2)I
(universal concept) > D (primitive concept) C (C)I (transitive role) R 2 R (R)I = ((R)I )+ (negation) :D D – (D)I (intersection) D1 u D (D1)I Å (D2)I S (union) D1 t D (D1)I [ (D2)I (role value restriction) 8R.D {e1 : 8e2: (e1, e2) 2 (R)I ! e2 2 (D)I} (role existence) 9R.D {e1 : 9e2: (e1, e2) 2 (R)I Æ e2 2 (D)I} (role hierarchy) R1 v R (R1)I µ (R2)I H (inverse role) R {(e2, e1) : (e1, e2) 2 (R)I} I (number restriction) (> n R) {e1 : |{e2 : (e1, e2) 2 (R)I}| ¸ n} N (number restriction) (6 n R) {e1 : n ¸ |{e2 : (e1, e2) 2 (R)I}|} (qualified number restriction) (> n R D) {e1 : |{e2 : (e1, e2) 2 (R)I Æ e2 2 (D)I}| ¸ n} Q (qualified number restriction) (6 n R D) {e1 : n ¸ |{e2 : (e1, e2) 2 (R)I Æ e2 2 (D)I}|} CS848: Topics in Databases: Foundations of Query Optimization

8 Dialect SHIQ (cont’d) An interpretation I satisfies a role hierarchy R+ iff (R1)I µ (R2)I for each R1 v* R2 2 R+. Concept D is satisfiable with respect to role hierarchy R+ iff there exists I that satisfies R+ and for which (D)I ¹ ;. CS848: Topics in Databases: Foundations of Query Optimization

9 Internalization in SHIQ
Given terminology T, role inclusion axioms R, SHIQ concept D and transitive role U not occurring in T, D or R, define DT ´ u {:D1 t D2 : D1 v D2 2 T } and RU ´ R [ {R v U, Inv(R) v U : R occurs in T, D or R}. Then D is satisfiable with respect to T and R+ iff D u DT u 8U.DT is satisfiable with respect to (RU)+. CS848: Topics in Databases: Foundations of Query Optimization

10 Reasoning in SHIQ Based on an extension of the union generalized chase for ALC. To accommodate role inclusion hierarchies, allow arcs in a partial database to be labeled with sets of role names and role inverses. Write L(x, y) to denote the set of (possibly inverse) roles that label an arc from x to y. Write »D to denote the negation normal form of a SHIQ concept :D, and clos(D) to denote the smallest set of concepts in negation normal form that contains »D and is closed under subconcepts and ». Node y is an R2-successor of node x if an arc from x to y exists such that R1 2 L(x, y) and R1 v* R2. Node y is an R-neighbour of x iff y is an R-successor of x, or if x is an Inv(R)-successor of y. CS848: Topics in Databases: Foundations of Query Optimization

11 :C u 9(R1)-.(C u (6 1 R1)) u 8(R2)-.(9(R1)-.(C u (6 1 R1)))
Blocking in SHIQ As with ALC with arbitrary terminologies, SHIN does not have the finite model property; e.g., when R2 is a transitive super-role of R1, :C u 9(R1)-.(C u (6 1 R1)) u 8(R2)-.(9(R1)-.(C u (6 1 R1))) requires the existence of an infinite (R1)- path. Therefore need blocking in chases to ensure termination. CS848: Topics in Databases: Foundations of Query Optimization

12 Blocking in SHIQ (cont’d)
Node y2 is directly blocked in a partial database if it has ancestors y1, x2 and x1 such that 1. arcs exists from y1 to y2 and from x1 to x2, 2. L(x1, x2) = L(y1, y2), 3. L(x1) = L(y1) and 4. L(x2) = L(y2). In such cases, x2 is said to block y2. A node is indirectly blocked iff one of its ancestors is blocked or it has an incoming arc with an empty label. A node is blocked iff it is directly or indirectly blocked. CS848: Topics in Databases: Foundations of Query Optimization

13 The SHIQ chase u–rule: if 1. D1 u D2 2 L(x),
2. x is not indirectly blocked, and 3. {D1, D2} * L(x) then L(x) Ã L(x) [ {D1, D2} t–rule: if D1 t D2 2 L(x), 2. x is not indirectly blocked and 3. {D1, D2} Å L(x) = ; then L(x) Ã L(x) [ {D1} or L(x) Ã L(x) [ {D2}. CS848: Topics in Databases: Foundations of Query Optimization

14 The SHIQ chase (cont’d)
9–rule: if R.D 2 L(x), 2. x is not blocked and 3. x has no R-neighbour y with D 2 L(y) then create a new node y and arc (x, y) with L(x, y) Ã {R} and L(y) Ã {D}. 8–rule: if R.D 2 L(x), 2. x is nor indirectly blocked and 3. there is an R-neighbour y of x with D Ï L(y) then L(y) Ã L(y) [ {D}. CS848: Topics in Databases: Foundations of Query Optimization

15 The SHIQ chase (cont’d)
8+ rule: if R2.D 2 L(x), 2. x is not indirectly blocked, 3. there is some R1 such that Trans(R1) and R1 v* R2, 4. there is an R1–neighbour y of x such that 8R1.D Ï L(y) then L(y) Ã L(y) [ {8R1.D}. choose-rule: if (6 n R D) 2 L(x) or (> n R D) 2 L(x), 3. there is an R-neighbour y of x such that {D, »D} Å L(y) = ; then L(y) Ã L(y) [ {D} or L(y) Ã L(y) [ {»D}. CS848: Topics in Databases: Foundations of Query Optimization

16 The SHIQ chase (cont’d)
>–rule: if (> n R D) 2 L(x), 2. x is not blocked, 3. there are not n R-neighbours y1, … , yn of x with D 2 L(yi) and yi ¹ yj for 1  i < j  n then create n new nodes y1, … , yn and arcs (x, yi) with L(x, yi) Ã {R}, L(yi) Ã {D} and yi ¹ yj for 1  i < j  n. CS848: Topics in Databases: Foundations of Query Optimization

17 The SHIQ chase (cont’d)
6–rule: if (6 n R D) 2 L(x), 2. x is not indirectly blocked, 3. there are n+1 R-neighbours y1, … , yn+1 of x such that D 2 L(yi), y2 is not an ancestor of x and not y1 ¹ y2 then do the following: 1. L(y1) Ã L(y1) [ L(y2); 2. L(y1, x) Ã L(y1, x) [ Inv(L(x, y2)) if y1 is an ancestor of x; 3. L(x, y1) Ã L(x, y1) [ L(x, y2) if y1 is not an ancestor of x; 4. L(x, y2) Ã ; and 5. set z ¹ y1 for all z such that z ¹ y2. CS848: Topics in Databases: Foundations of Query Optimization

18 Complexity of reasoning
A role is simple if it is neither transitive nor has transitive subroles. Theorem: The concept membership problem for SHIQ in which only simple roles occur within the scope of number restrictions is DEXPTIME-complete. Theorem: The concept membership problem for SI is PSPACE-complete. Theorem: The concept inclusion problem for SHIN in which arbitrary roles can occur within the scope of number restrictions is undecidable. CS848: Topics in Databases: Foundations of Query Optimization


Download ppt "Topics covered (class assignment)"

Similar presentations


Ads by Google