220 likes | 320 Views
EReX: A Conceptual Model for XML. Murali Mani XSym, 2004 Aug 30, 2004. Motivations behind this work. Goal 1: Many different schema languages for XML: DTD, RELAX NG, W3C XML Schema Different structural specification characteristics (subclasses of regular tree grammars).
E N D
EReX: A Conceptual Model for XML Murali Mani XSym, 2004 Aug 30, 2004
Motivations behind this work • Goal 1: • Many different schema languages for XML: DTD, RELAX NG, W3C XML Schema • Different structural specification characteristics (subclasses of regular tree grammars). • Also different constraint specification characteristics. • Which XML schema language is good for database applications? • Goal 2: • An application wants to design an XML logical schema. What is the process? DSRG, WPI
Deliverables • EReX (ER extended for XML) • A conceptual model for modeling any database application. • XML schema language characteristics needed for database applications. DSRG, WPI
Binary 1:n relationships Binary m:n relationships ER Model DSRG, WPI
N-ary relationships Recursive relationships ER Model DSRG, WPI
Extensions to ER: Categories PersonCity, PersonZip are categories of Person Book, Paper are categories of Article • Note: • Article does not have a key attribute. • A is category of B any instance of A is also instance of B DSRG, WPI
PersonCity PersonZip = PersonCity PersonZip = Person personBook personPaper = personBook personPaper = Person confPaper journalPaper = confPaper journalPaper = Paper Extensions to ER: Coverage Constraints DSRG, WPI
Extensions to ER: Order constraints DSRG, WPI
EReX: Summary • EReX = ER extended with categories, coverage constraints and order constraints. • Any database applications can be modeled in EReX. • Implications • Global Document order is not significant for our applications. • Rather, what is significant is order specified in the relationship. DSRG, WPI
XGrammar • Structural specification using regular tree grammar. • Constraint specification on types (rather than path expressions). DSRG, WPI
XGrammar Example Library library (Person*) Person person (@name, ((@city, @state) + @zip), (Book* + Paper*), Review*) Book book (@btitle, @ISBN, @BID) Paper paper (@ptitle, @year?, @PID) Review review (@article, @rating) Constraints: key (Person) = <@name>; key (Book) = <@ISBN>; key (Paper) = <@ptitle>; key (Review) = <parent::person/@name, @article> article::IDREF REFERENCES (Book + Paper) DSRG, WPI
EReX schema XML schema – binary 1:n relationship types • Parent-child: • Professor professor (@pname, @age, Student*) • Student student (@sname, @year) • ID/IDREF • Professor professor (@pname, @age, @PID) • Student student (@sname, @year, @advisor) • advisor::IDREF REFERENCES (Professor) • Key/Foreign Key • Professor professor (@pname, @age) • Student student (@sname, @year, @advisor) • Student (advisor) REFERENCES Professor (@pname) DSRG, WPI
EReX schema XML Schema – binary m:n relationship types • Person person (@name, @zip, Review*) • Review review (@rating, @BookRef) • Book book (@ISBN, @title, @year, @BID) • BookRef::IDREF REFERENCES (Book) DSRG, WPI
EReX schema XML Schema – ternary relationship types • Company company (@name, Supply+) • Supply supply (@ProductRef, @CityRef, @quantity) • Product product (@name, @ProductID) • City city (@name, @CityID) • ProductRef::IDREF REFERENCES (Product) • CityRef::IDREF REFERENCES (City) DSRG, WPI
EReX schema XML Schema – recursive relationship types • Part part (@name, Part*, @qty?) DSRG, WPI
PersonCity PersonZip = PersonCity PersonZip = Person EReX schema XML Schema – coverage constraints • Person person (@name, (@city, @state) + @zip)) DSRG, WPI
confPaper journalPaper = confPaper journalPaper = Paper EReX schema XML Schema – coverage constraints • Conference conference (@name, @venue, Paper*) • Journal journal (@name, @publisher, Paper*) • Paper paper (@title) DSRG, WPI
personBook personPaper = personBook personPaper = Person EReX schema XML Schema – coverage constraints • Person person (@name, (Book+ + Paper+)) • Book book (@isbn, @title) • Paper paper (@title, @journal) DSRG, WPI
EReX schema XML Schema – order constraints • Order in the XML model • Person person (@name, @address, Book*) • Using order attributes • Person person (@name, @address, @PersonID) • Book book (@isbn, @title, @PersonRef, @order) • PersonRef::IDREF REFERENCES (Person) DSRG, WPI
EReX schema XML Schema – Summary • Translation algorithm captures all entity types, relationship types. • It captures most cardinality constraints (some minimum cardinality constraints may be lost). • It captures all categories • It captures all order constraints. • It captures most coverage constraints (some coverage constraints may be lost). • Resulting XML Schema • Single type tree grammar. • Constraints specified on types. DSRG, WPI
Acknowledgements: Antonio Badia, University of Louisville, Kentucky Dongwon Lee, PennState University Members of DSRG and colleagues at WPI DSRG, WPI
Thank You URL: http://www.cs.wpi.edu/~mmani Email: mmani@cs.wpi.edu Questions? DSRG, WPI