1 / 28

Temporal Queries in XML Document Archives and Web Warehouses

Temporal Queries in XML Document Archives and Web Warehouses. Author: Fusheng Wang and Carlo Zaniolo. Publication: TIME-ICTL’03, IEEE. 報告人:陳建宏. outline. Main Issue Previous Work A Logical Model for Versions Complex Queries Conclusions. outline. Main Issue Previous Work

kacia
Download Presentation

Temporal Queries in XML Document Archives and Web Warehouses

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Temporal Queries in XML Document Archives and Web Warehouses Author: Fusheng Wang and Carlo Zaniolo Publication: TIME-ICTL’03, IEEE 報告人:陳建宏

  2. outline • Main Issue • Previous Work • A Logical Model for Versions • Complex Queries • Conclusions

  3. outline • Main Issue • Previous Work • A Logical Model for Versions • Complex Queries • Conclusions

  4. Main issue • Concisely representing the successive versions of a document as an XML document that implements a temporally grouped data model • Using XML query languages, such as XQuery, to express complex queries on the content of a particular version, and on the temporal evolution of the document elements and their contents

  5. outline • Main Issue • Previous Work • A Logical Model for Versions • Complex Queries • Conclusions

  6. Temporal XML Representation • A valid tag for XML/XHTML documents is proposed to support valid time • A data model is proposed for temporal XML documents • XML query languages such as Xpath and XQuery <valid> <validity from=“1980-01-01” to=“1985-12-31”/> This is test </valid> <title time:valid="2000-01-01, 2000-01-09">XML</title> <title time:valid="2000-01-10, now">Introduction to XML</title> Xquery example: select all the title elements in the "books.xml" file doc("books.xml")/bookstore/book/title

  7. Change Detection How to know the difference between the latest version and the previous one? There are some of efficient change detection algorithms • Ladiff • XyDiff • X-Diff

  8. Managing the Deltas There are different schemes for storing these deltas on secondary storage and processing them for version reconstruction and query execution • Revision Control System (RCS) scheme • Reference-Based Version Model(RBVM) scheme • Source Code Control System(SCCS) scheme

  9. Temporal Databases • Many temporal data models are proposed already. They are classified into two main categories • Temporally ungrouped • Temporally grouped

  10. outline • Main Issue • Previous Work • A Logical Model for Versions • Complex Queries • Conclusions

  11. XML REPRESENTATION of versioned document • V-Document • Each element is assigned with two attributes vstart and vend, which represent the valid version interval of the element • In V-Document, we represent each attribute by a sub-element denoted by a special flag attribute isAttr.

  12. Sampled versioned xml documents version 2002-01-01 <document> <chapter no="1"> <title>Introduction</title> <section>Background</section> <section>Motiviation</section> </chapter> </document> version 2002-01-02 <document> <chapter no="1"> <title>Introduction and Overview</title> <section>Background</section> <section>History</section> </chapter> <chapter no="2"> <title>Related Work</title> <section>XML Storage</section> </chapter> </document> version 2002-01-03 <document> <chapter no="1"> <title>Introduction and Overview</title> <section>Background</section> <section>History</section> </chapter> <chapter no="2"> <title>Related Work</title> <section>XML Indexing</section> </chapter> </document>

  13. V-document Example Attribute of element ”chapter” <document vstart="2002-01-01" vend="now"> <chapter vstart="2002-01-01" vend="now"> <no isAttr="yes" vstart="2002-01-01" vend="now">1</no> <title vstart="2002-01-01" vend="2002-01-01">Introduction</title> <title vstart="2002-01-02" vend="now">Introduction and Overview</title> <section vstart="2002-01-01" vend="2002-01-01">Motivation</section> <section vstart="2002-01-01" vend="now">Background</section> <section vstart="2002-01-02" vend="now">History</section> </chapter> <chapter vstart="2002-01-02" vend="now"> <no isAttr="yes" vstart="2002-01-02" vend="now">2</no> <title vstart="2002-01-02" vend="now">Related Work</title> <section vstart="2002-01-02" vend="2002-01-02">XML Storage</section> <section vstart="2002-01-03" vend="now">XML Indexing</section> </chapter> </document> vstart and vend tag

  14. V-document advantage • No storage redundancy • The changes are naturally representated • Temporal queries are easily expressed on V-documents

  15. Change operations - update • UPDATE <document> <chapter no="1"> <title>Introduction</title> <section>Background</section> <section>Motiviation</section> </chapter> </document> <title vstart="2002-01-01" vend=“now"> Introduction </title> <title vstart="2002-01-01" vend="2002-01-01"> Introduction </title> <title vstart="2002-01-02" vend="now"> Introduction and Overview </title> <document> <chapter no="1"> <title>Introduction and Overview</title> <section>Background</section> <section>History</section> </chapter>

  16. Change operations - insert • INSERT <section vstart="2002-01-01" vend="now"> Background </section> <document> <chapter no="1"> <title>Introduction</title> <section>Background</section> </chapter> </document> <section vstart="2002-01-01“ vend="now"> Background </section> <section vstart="2002-01-02" vend="now"> History </section> <document> <chapter no="1"> <title>Introduction and Overview</title> <section>Background</section> <section>History</section> </chapter>

  17. Change operations - DELETE • DELETE <section vstart="2002-01-01" vend="now"> Motivation </section> <document> <chapter no="1"> <title>Introduction</title> <section>Background</section> <section>Motivation</section> </chapter> </document> <section vstart="2002-01-01" vend="2002-01-01"> Motivation </section> <document> <chapter no="1"> <title>Introduction and Overview</title> <section>Background</section> </chapter>

  18. outline • Main Issue • Previous Work • A Logical Model for Versions • Complex Queries • Conclusions

  19. Sampled versioned xml documents version 2002-01-01 <document> <chapter no="1"> <title>Introduction</title> <section>Background</section> <section>Motiviation</section> </chapter> </document> version 2002-01-02 <document> <chapter no="1"> <title>Introduction and Overview</title> <section>Background</section> <section>History</section> </chapter> <chapter no="2"> <title>Related Work</title> <section>XML Storage</section> </chapter> </document> version 2002-01-03 <document> <chapter no="1"> <title>Introduction and Overview</title> <section>Background</section> <section>History</section> </chapter> <chapter no="2"> <title>Related Work</title> <section>XML Indexing</section> </chapter> </document>

  20. Query 1 • Snapshot queries: retrieve the version of the document on 2002-01-03: for $e in document("V-Document.xml") /document return snapshot( $e,"2002-01-03“) <document vstart="2002-01-01" vend="now"> <chapter vstart="2002-01-01" vend="now"> <no isAttr="yes" vstart="2002-01-01" vend="now">1</no> <title vstart="2002-01-02" vend="now">Introduction and Overview</title> <section vstart="2002-01-01" vend="now">Background</section> <section vstart="2002-01-02" vend="now">History</section> </chapter> <chapter vstart="2002-01-02" vend="now"> <no isAttr="yes" vstart="2002-01-02" vend="now">2</no> <title vstart="2002-01-02" vend="now">Related Work</title> <section vstart="2002-01-03" vend="now">XML Indexing</section> </chapter> </document>

  21. Query 2 • Change queries: retrieve the unchanged elements between the version on 2002-01-01 and the version on 2002-01-03: for $e in document("V-Document.xml") /document return diff-identical($e,"2002-01-01","2002-01-03") <document vstart="2002-01-01" vend="now"> <chapter vstart="2002-01-01" vend="now"> <no isAttr="yes" vstart="2002-01-01" vend="now">1</no> <section vstart="2002-01-01" vend="now">Background</section> </document>

  22. Query 3 • Evolutionary queries: find the history of the title of chapter 1: for $title in document("V-Document.xml") /document/chapter[no="1"]/title return $title <title vstart="2002-01-01" vend="2002-01-01">Introduction</title> <title vstart="2002-01-02" vend="now">Introduction and Overview</title>

  23. Query 4 • Continuous queries: find titles that didn’t change for more than 2 consecutive years. for $title in document("V-Document.xml") /document/chapter/title let $duration := substract-dates( $title/@vend, $title/@vstart) where dayTimeDuration-greater-than( $duration, "P730D") return $title <title vstart="2002-01-02" vend="now"> Introduction and Overview </title>

  24. Query 5 • A Since B: find chapters in which section “History” remains unchanged since the version when the title was changed to “Introduction and Overview”. for $ch in document("V-Document.xml") /document/chapter let $title := $ch/title[ title="Introduction and Overview"] let $sec := $ch/section[section="History"] where not empty($title) and not empty($sec) and $sec/@vstart = $title/@vstart and $sec/@vend ="now" return $ch <chapter vstart="2002-01-02" vend="now"> <no isAttr="yes" vstart="2002-01-02" vend="now">1</no></chapter>

  25. Query 6 • A Until B: find chapters in which the title didn’t change until a new section “History” was added for $ch in document("V-Document.xml") /document/chapter let $title := $ch/title[1] let $sec := $ch/section[section="History"] where not empty($title) and not empty($sec) and $title/@vend = $sec/@vstart return $ch <chapter vstart="2002-01-01" vend=“2002-01-01"> <no isAttr="yes" vstart="2002-01-01" vend="now">1</no> </chapter>

  26. Join Query • Joins: find the chair of employee ’Bob’ on 1996-01-31: for $e in document("employees.xml") /employees/employee[name=’Bob’] for $d in document("depts.xml")/depts/dept let $et := snapshot($e,"1996-01-31") let $dt := snapshot($d,"1996-01-31") where not empty($et) and not empty($dt) and $et/dept = $dt/name return $dt/chair

  27. outline • Main Issue • Previous Work • A Logical Model for Versions • Complex Queries • Conclusions

  28. Conclusions • We can represent a multi-version document in V-Document • In this representation scheme, complex queries can be expressed easily

More Related