cess methods, the role of the wrapper is to translate
the wrapper specificity to a common access method.
The Integration Layer is the heart of the media-
tion system as it process XQuery requests according
to sources and send by the result in XML form. The
Wrapper Information Manager is for integrating in-
formation about wrapped sources. It provides to the
mediator sources metadata, capabilities, and costs sta-
tistics on source data. The XQuery Evaluator parses
the XQuery query, make logical plans then physical
plans by using optimization rules, choose the best ex-
ecution plan, and then evaluates the execution plan
by querying relevant sources and merging results The
XLive system is provide a public API that process an
XQuery query and evaluates it on sources, and then
return the result as an XML document.
Some clients using the XLive API have been im-
plemented on the Presentation Layer: The Console
is a graphical interface for managing and querying
XLive. The Web service provides services for man-
aging/querying XLive from the Web. And finally, the
Benchmark is designed to test the XLive mediator and
other sources in order to make comparisons.
More details on the XLive architecture can be
found on (Dang-Ngoc and Gardarin, 2003; Dang-
Ngoc et al., 2005). The TGV model used for XQuery
evaluation has been described in (Travers and Dang-
Ngoc, 2006a; Travers et al., 2007). And a paper de-
scribing the TGV annotation method and extensible
optimization rules has been submitted to this confer-
ence in the paper session.
2 XQUERY EVALUATION
XQuery is a rich and complex language. Its power-
ful expression capabilities provide a large range of
queries over XML documents. However the richness
of the language makes the evaluation of XQueries in-
efficient in several cases.
Figure 2 describes the evaluation process: (1)
XQuery is canonizedinto a canonicalform of XQuery
(2) then the canonized XQuery is modeled in the in-
ternal structure TGV which can (3) be restructured
into equivalent structures using equivalence rules. (4)
Then the TGV is annotated with information for eval-
uation such as the data sources location, cost models
information, sources functional capabilities, etc. The
optimal annotated TGV is then selected and (5) the
logical TGV is transformed into an execution plan us-
ing a physical algebra. We have chosen the XAlgebra
(Dang-Ngoc and Gardarin, 2003), an extension of the
relational algebra to XML. (6) Finally, the execution
plan is evaluated and produces an XML result.
logical plan
physical plan
XML
XQuery
XAlgebra
Annotated
TGV
Canonized
XQuery
TGV
transformation
into a physical
algebra
optimization
(physical rules)
(logical rules)
optimization
Preparing the execution plan
annotation
modelizationcanonization
evaluation
Figure 2: XQuery evaluation process.
Table 1: An XQuery query example.
<bib>{
for $b in doc("http://bstore1.example.com/bib.xml")//book
where count ($b/author) > 0
return
<book>
{$b/title}
{$b/author[position() <= 2]}
{if (count ($b/author) > 2) then <et-al/> else ()}
</book>
}</bib>
The whole process is implemented in the XLive
(Dang-Ngoc et al., 2005) system and validates all use-
cases defined by the W3C that do not imply strong
typing consideration (our system recognize 8 of the 9
categories of XQuery).
Table 1 givesan XQuery query example supported
by our XQuery processor. It is the query XMP-6 de-
fined in the W3C use-cases document. This query ex-
presses the following request: ”For each book that
has at least one author, list the title and first two au-
thors, and an empty ”et-al” element if the book has
additional authors.”
2.1 XQuery Canonization
XQuery defines complex operations such as ag-
gregation, ordering, nesting/unnesting, document
construction, conditional cases (if-then-else),
and XPath filter. To handle such functionali-
ties, a canonical form using simple sequences of
FOR...LET...WHERE...ORDER-BY...RETURN
(FLWOR) expressions can be used (the demonstra-
tion begin in (Chen et al., 2003) and achieved in
(Travers and Dang-Ngoc, 2006b)).
In order to optimize the evaluation of such queries,
we propose to structure the language declaration by
canonizing it using some transformation rules. These
transformation rules keep the semantic of queries and
make them more convenient to manipulate.
XLIVE: INTEGRATING SOURCES WITH XQUERY - An Efficient XQuery Evaluation Prototype with TGV
379