Database Reference
In-Depth Information
query is posed over a model that was generated using the model management
operator Merge on two models, the query is expanded into a SMql query over
constructs from potentially multiple source models using query unfolding [11]
and associations between the source models and the merged model. The ex-
panded SMql query is compiled into the algebra and optimised, and subqueries
of the logically optimised plan that are associated with specific sources are then
translated to the source specific query languages as described in Sections 4.1
and 4.2, whereby the left hand side input and the right hand side input of the
UNION operator are treated as separate subqueries that are processed sepa-
rately even if they are to be evaluated over the same source. The translated
subqueries are passed to the operators EvaluateSQL and EvaluateXQuery, re-
spectively, which can be parameterised with tuples and a Predicate, e.g., in the
case of joins between different sources. Assume, for simplicity, that query Q 2 is
posed over the merged schema of S 1 and S 2 (not shown) and that constructs
with the same names in the three schemas are associated. The expanded algebra
with the translated subqueries of Q 2 resulting from the use of these associations,
query unfolding and the translation algorithms introduced in Sections 4.1 and
4.2 is shown in Figure 3.
Query rewriting is a two step process applied both for translating (portions of)
a query into SQL and into XQuery. The first step is a recursive algorithm that
traverses all operators in the query posed over the supermodel, and gathers all
the information required for query rewriting in the corresponding data structures
appropriate for the type of target query. In the second step, this information is
utilised to generate a string representation of the target query. The process is
described in more detail in the following.
The approach presented here only deals with syntax; dealing with semantics
is beyond the scope of this paper. Once access has been provided to a source,
the other model management operators provide techniques for manipulating the
resulting integration model in ways that reflect semantic issues.
4.1 SMql Query over Supermodel into XQuery over XML
BasedonthepartsofanXQuery,namelythe Let , For , Where and Return
clauses, the following data structure is introduced to gather the information
that is needed for each of the clauses.
An XQuery is a quadruple < let, for, where, return > ,where let is a map of
variable names and references to source documents, for is a list of abstract/root
element or structOfAttributes/complex elements, where is a list of conjunctive
predicates and return is a list of fully qualified lexical/simple element names,
either qualified with the name of the abstract
complex
element the lexical belongs to or with the corresponding variable name. Both
lists and maps support the operators add and contains . We assume here that
the data source, or the source document of each instance i of a construct in the
supermodel can be obtained by i.source .
We follow the two step process described briefly above, which consists of
gathering the information for the various clauses of the XQuery by recursively
|
structOfAttributes / root
|
 
Search WWH ::




Custom Search