
key that refers to Employee.EID. The relationship is
of type Employee (1;1) : (0,M) Dependant, thus
Employee participates partially and Dependant
totally in the relationship. A complex type definition
is created for each table similar to the record
definition and is assigned to a complex element. An
additional element with the table name concatenated
with an “s” takes the role of the relation, thus
keeping the “records” grouped. Figure 3 defines two
complex types, empType and depType corresponding
to record definitions of the tables Employee and
Dependant. The complex elements emp and dep are
of the complex types previously created and act as
records within the relation- elements emps and deps.
After the elements are created, additional
constraints (i.e. primary and unique keys) are
included in the XML Schema. For inner elements of
a nested structure the structural constraints of the
former relationships are represented with minOccurs
and maxOccurs restrictions as in Figure 3. The tree
root elements have maxOccurs equal to ”unbound”
regardless of the relation’s cardinality in the
database. This ensures that the tree roots are not
inner elements of any other element, except for the
XML Schema root element. If the eliminated foreign
key column is also part of the primary key of the
child table as in the example from Figure 3, then the
primary key in the XML Schema contains the
balance of the primary attributes and the constraint
is still preserved.
In conclusion, ConvRel and Conv2XML are two
algorithms for conversion of relationships into XML
nested structures focused on preserving their
structural constraints. ConvRel translates each
relationship individually into a nested XML
structure. Conv2XML considers the implications of
relationship interconnections in a relational
database.
6 CONCLUSION AND FUTURE
WORK
This paper introduced a detailed method for
representing relational information in a tree-like
structure in XML. The algorithms use the
advantages of the relational model, such as database
normalization, relationships, cardinality and
participation ratios, exactness of relational data
types, and of the XML Schema, such as a more
natural representation in nested structures. The
method proposed is based on the depth-first
algorithm that efficiently identifies tree structures in
an oriented graph. Thus, the Entity-Relationship
Diagram associated with the relational database is
transformed so that it can model nested structures
and is analysed from the perspective of a directed
graph.
The conversion algorithms presented in this
paper have been implemented in Java version 1.3.1.
It extracts the metadata of a DB2 database and based
on additional user input for certain semantic
cardinality ratios produces a nested XML Schema.
Additional future work includes incorporating
the query metric and the XML structure evolution.
The research community has not yet agreed upon a
standard query method so it has not been included in
our method. XML’s ability to evolve and alter its
structures by adding or subtracting elements,
subelements, and attributes is an interesting feature
that has not been adequately exploited yet.
REFERENCES
Cormen, T. H., 2001. Introduction to Algorithms,
Reading, The MIT Press, 2
nd
edition.
Duta, A., Barker, K., and Alhajj R., 2004. ConvRel:
Relationship conversion to XML nested structures (to
appear). In ACM Symposium on Applied Computing
(SAC’04), Cyprus, March, 2004.
Elmasri, R., and Navathe, S. B., 2003. Fundamentals of
Database Systems, Addison-Wesley, 4
th
edition.
Fernandez, M., Tan, W.-C., and Suciu, D., 2000.
SilkRoute: Trading between Relations and XML. In
International World Wide Web Conference (WWW),
Amsterdam, Netherlands, May 2000.
Lee, D., Mani, M., Chiu, F. and Chu, W. W., 2002. NeT &
CoT: Translating Relational Schemas to XML
Schemas using Semantic Constraints. In 11th ACM
Int'l Conf. on Information and Knowledge
Management (CIKM), McLean, VA, USA, November
2002.
Lee, D., Mani, M., Chiu, F. and Chu, W. W., 2001.
Nesting-based Relational-to-XML Schema Translation.
In International Workshop on the Web and Databases
(WebDB), Santa Barbara, CA, USA, May 2001.
Lee, D., Mani, M. and Chu, W. W., 2002. Effective
Schema Conversions between XML and Relational
Models. In European Conference on Artificial
Intelligence (ECAI), Knowledge Transformation
Workshop(ECAI-OT), Lyon, France, July 2002.
Turau V., 1999. Making Legacy Data Accessible for XML
Applications. [Internet] Available from
<http://citeseer.nj.nec.com/turau99making.html>
[Accessed January 15th, 2004]
World Wide Web Consortium, 2001. XML Schema Part 0,
1, and 2. [Internet] Available from
<http://www.w3.org/TR
> [Accessed January 19th,
2004]
CONV2XML: RELATIONAL SCHEMA CONVERSION TO XML NESTED-BASED SCHEMA
215