Information Technology Reference
In-Depth Information
translation, navigational syntax will be modified. For example, the join operation
in RDB can be replaced by class navigation (association) in OODB. Queries of
source language are built in our model. We navigate the query graph (QG) of SQL
and then map it to the QG of OSQL (object-oriented SQL or OQL; Cattell et al.
1997 ) with reference to the intermediate result of schema translation. Semantic
rules (transformation definition) for query transformation from source language
to target language will be applied. Then, query of target language will be pro-
duced. The output query OSQL should be the syntactic and semantic equivalent
to the source SQL.
The OSQL, the object-oriented extension to SQL, allows data retrieval using
path expressions, and data manipulation using methods. In query transformation, a
syntax-directed parser converts the input OSQL into multi-way trees. The transfor-
mation process is then performed, based on the subtree matching and replacement
technique. The process of SQL to OSQL transformation is in Fig. 5.11 .
After schema mapping from RDB to OODB, we can transform an RDB trans-
action (SQL) to an OODB transaction (OSQL). The following sections detail the
major SQL statements for the Join, Update, Insert, and Delete operations and their
translation into the equivalent OSQL statements.
Relational Operation Join
In the relational model, a join operation is allowed between two relations if the
joined attributes are compatible. Users may transform a join operation in RDB to
class navigation in OODB. The technique is to convert the database access path
from SQL's QG of joining relations: R 1 ,R 2 , … R n to the OSQL's QG of navigating
classes: C anchor , C 2 , … C n . The join operation can be transformed to class navigation
for class C anchor (first class in class navigation path; Fong 1997 ) as:
Step 1. Decompose SQL query transaction.
During this step, the SQL query transaction is decomposed into groups by pars-
ing its syntax as:
SQL
RDB
schema
OODB
schema
1. Explicit syntax
transformation
2. Create SQL
query graph(QG)
3. Map SQL QG to
OSQL QG
4. Transform OSQL
QG to OSQL query
SQL QG
OSQL QG
OSQL
Search WWH ::




Custom Search