Information Technology Reference
In-Depth Information
Fig. 6.6 Three steps for database reengineering query translation
Fig. 6.7 XML and relational
gateways
schema. As a result, we need to segregate a relational schema into an augmented
view of XML tree structure in order to make them compatible. A methodology is de-
veloped to allow users to interoperate RDB and XMLDB through query translation.
The database gateways receive the input queries before they are sent to the underly-
ing databases. Query translation will be done through the gateways. The translated
query will be sent to the appropriate database. Users can rely on one data model and
his or her familiar query language to access data in both the RDB and the XMLDB.
The query translation process consists of two main steps of schema translation
and query translation. The system allows users to input SQL query which is trans-
lated into XPath for selecting the data on XMLDB. The architecture composes of
two gateways, the XML gateway and the relational gateway, as shown in Fig. 6.7 .
There is a common interface between these gateways, which connect to a XMLDB
and RDB server.
6.5.1
Methodology of Query Translation Between SQL and XQL
As shown in Fig. 6.7 , we need to abstract an augmented view of the target XML
tree structure into a relational schema in phases I and II. We have a compatible tree
structure in a partitioned relational schema and a mapped target XML schema. Then
in phase III, we translate an SQL to XQL according to the mapped XML schema.
Similarly, we can translate an XQL to SQL according to the partitioned relational
schema. These three phases are further detailed in the subsequent subsections.
Phase I: Schema Translation Between Relational and XML Data
We add a sequence number into a relational table for data position in XML docu-
ment. For any table that is used for query translation, an extra column— seqno is
required. This column is used by the XML gateway described as follows:
For each table, the last column is seqno . This seqno column is used to ensure
Search WWH ::




Custom Search