Download presentation
Presentation is loading. Please wait.
Published byEzra Bates Modified over 6 years ago
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=“ ” to=“ ”/> This is test </valid> <title time:valid=" , ">XML</title> <title time:valid=" , 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 XyDiff X-Diff Ladiff
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
<chapter no="1"> <title>Introduction</title> <section>Background</section> <section>Motiviation</section> </chapter> </document> version <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> </document> version <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> </document>
13
Attribute of element ”chapter”
V-document Example Attribute of element ”chapter” <document vstart=" " vend="now"> <chapter vstart=" " vend="now"> <no isAttr="yes" vstart=" " vend="now">1</no> <title vstart=" " vend=" ">Introduction</title> <title vstart=" " vend="now">Introduction and Overview</title> <section vstart=" " vend=" ">Motivation</section> <section vstart=" " vend="now">Background</section> <section vstart=" " vend="now">History</section> </chapter> <chapter vstart=" " vend="now"> <no isAttr="yes" vstart=" " vend="now">2</no> <title vstart=" " vend="now">Related Work</title> <section vstart=" " vend=" ">XML Storage</section> <section vstart=" " vend="now">XML Indexing</section> </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
<document> <chapter no="1"> <title>Introduction</title> <section>Background</section> <section>Motiviation</section> </chapter> </document> <title vstart=" " vend=“now"> Introduction </title> <title vstart=" " vend=" "> Introduction </title> <title vstart=" " vend="now"> Introduction and Overview <document> <chapter no="1"> <title>Introduction and Overview</title> <section>Background</section> <section>History</section> </chapter>
16
Change operations - insert
<section vstart=" " vend="now"> Background </section> <document> <chapter no="1"> <title>Introduction</title> <section>Background</section> </chapter> </document> <section vstart=" “ vend="now"> Background </section> <section vstart=" " vend="now"> History <document> <chapter no="1"> <title>Introduction and Overview</title> <section>Background</section> <section>History</section> </chapter>
17
Change operations - DELETE
<section vstart=" " vend="now"> Motivation </section> <document> <chapter no="1"> <title>Introduction</title> <section>Background</section> <section>Motivation</section> </chapter> </document> <section vstart=" " vend=" "> 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
<chapter no="1"> <title>Introduction</title> <section>Background</section> <section>Motiviation</section> </chapter> </document> version <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> </document> version <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> </document>
20
Query 1 Snapshot queries: retrieve the version of the
document on : for $e in document("V-Document.xml") /document return snapshot( $e," “) <document vstart=" " vend="now"> <chapter vstart=" " vend="now"> <no isAttr="yes" vstart=" " vend="now">1</no> <title vstart=" " vend="now">Introduction and Overview</title> <section vstart=" " vend="now">Background</section> <section vstart=" " vend="now">History</section> </chapter> <chapter vstart=" " vend="now"> <no isAttr="yes" vstart=" " vend="now">2</no> <title vstart=" " vend="now">Related Work</title> <section vstart=" " vend="now">XML Indexing</section> </document>
21
Query 2 Change queries: retrieve the unchanged elements between the version on and the version on : for $e in document("V-Document.xml") /document return diff-identical($e," "," ") <document vstart=" " vend="now"> <chapter vstart=" " vend="now"> <no isAttr="yes" vstart=" " vend="now">1</no> <section vstart=" " 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=" " vend=" ">Introduction</title> <title vstart=" " 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( where dayTimeDuration-greater-than( $duration, "P730D") return $title <title vstart=" " 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 = and ="now" return $ch <chapter vstart=" " vend="now"> <no isAttr="yes" vstart=" " 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 = return $ch <chapter vstart=" " vend=“ "> <no isAttr="yes" vstart=" " 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," ") let $dt := snapshot($d," ") 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
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.