Presentation is loading. Please wait.

Presentation is loading. Please wait.

Translating Relational Schemas to XML Schemas Dongwon Lee, Murali Mani, Frank Chiu, Wesley. W. Chu UCLA.

Similar presentations


Presentation on theme: "Translating Relational Schemas to XML Schemas Dongwon Lee, Murali Mani, Frank Chiu, Wesley. W. Chu UCLA."— Presentation transcript:

1 Translating Relational Schemas to XML Schemas Dongwon Lee, Murali Mani, Frank Chiu, Wesley. W. Chu UCLA

2 Our goals. Map from relational to XML model automatically. Maintain semantic constraints during the mapping. Existing work such as XML Extender (from IBM), db2XML, XML-DBMS, SilkRoute, EXPERANTO rely on user-specified mapping, and do not maintain semantic constraints.

3 NeT: Nesting-based Translation Nesting on a single attribute, X  C, where C is column set of a table t “groups” the tuples of t with the same value for (C – X). NeT is especially useful to: –Remove redundancies due to MVDs. –Group on attributes to get a more intuitive schema. Semantic constraints are maintained.

4 ABC #11a10 #21a20 #32a10 #43a10 #54b10 #64b20 #75b20 t ABC+1a{10, 20} 2a10 3a 4b{10, 20} 5b20 nest C (t) A+BC+ 1a{10, 20} {2,3}a10 4b{10,20} 5b20 nest A (nest C (t))

5 NeT optimization Perform minimum number of nesting. Properties used for optimization: –Idempotency of nesting: we need not perform nesting more than once on any single attribute. –Nesting need not be done on an attribute that does not participate in any one candidate key. Experimental results: NeT almost always decreases the data size tremendously – for one particular data set, size of the nested table is 6% of the size of the original table.

6 CoT: Constraint-based Translation: Step 1 Consider IND s[  ]  t[  ], where   X,   Y,  is primary key, and  is non-nullable. –If  is unique, M(t) = (Y, s?), else M(t) = (Y, s*) –M(s) = (X -  ) –Key for s is (K s -  ) SnameAdvisorCourse JohnMuntzDB JohnMuntzN/W PnameAge Muntz60 Chu55 student professor M(professor) = (Pname, Age, student*) M(student) = (Sname, Course) Muntz 60 John DB John N/W Chu 55

7 CoT: Step 2 Consider tables, s, t1, t2 with column set X, Y1, Y2, and INDs s[  ]  t1[  1], and s[  ]  t2 [  2], where  1,  2 are primary keys and ,  are non-nullable Translate one IND as in Step1, and translate the other to IDREF as: M(t1) = (Y1, s*), M(t2) = (Y2), M(s) = (X -  -  ), A(t2) = {ID_t2::ID}, A(s) = {Ref_t2::IDREF} CnameRoom DB4760 N/W4549 course <course ID_course=“DB”/> <course ID_course=“N/W”/> Chu 55 Muntz 60 John John

8 CoT: Step 3 Consider a relational schema with tables {t1, t2,…,tn} and INDs ti[  i]  tj[  j] Construct an IND-graph Identify top-nodes as: –Nodes that do not have any IND are top-nodes –In a strongly connected component formed from table- set, S, if there is no IND from a node in S to a node outside S, then one of the nodes in S must be a top- node. Perform BFS and translate the IND as in Step 1 or Step 2.

9 student (Sid, Name, Advisor) emp [Eid, Name, ProjName] prof [Eid, Name, Teach] course [Cid, Title, Room] dept (Dno, Mgr] proj [Pname, Pmgr] student [Advisor]  prof [Eid] emp [projName]  proj [Pname] prof [Teach]  course [Cid] prof [Eid, Name]  emp [Eid, Name] dept [Mgr]  emp [Eid] proj [Pmgr]  emp [Eid] IND-Graph M (course) = (Cid, Title, Room, course*) M(prof) = (student*) M(student) = (Sid, Name) M(emp) = (Eid, Name, dept*, proj*) M(dept) = (Dno) M(proj) = (Pname) A(emp) = {ID_emp::ID, Ref_proj::IDREF} A(prof) = {Ref_emp::IDREF} A(proj) = {ID_proj::ID}

10 Conclusions Automatically map from relational to a good XML model. Maintain semantic constraints. Remove some of the redundancies that could have been present in the relational model.


Download ppt "Translating Relational Schemas to XML Schemas Dongwon Lee, Murali Mani, Frank Chiu, Wesley. W. Chu UCLA."

Similar presentations


Ads by Google