Databases Reference
In-Depth Information
Figure 4: DTD for the XML document in Figure 1.
the XML documents in Figure 1 is conformant to the DTD in Figure 4. In their
method, DTDs simplification is performed as a initial step. For each child element
e of elements, information on the number of occurrences (i.e. once or more than
once) of e and information whether e is mandatory or not is retained. However,
information regarding the occurrence order of distinct elements is discarded. A
graph representing DTDs after simplification is called a DTD graph. For example,
the DTD graph of the DTD in Figure 4 is shown in Figure 5.
Two major methods, called Shared and Hybrid, are proposed for translation of
DTD graphs into relatinal database schemas. In the Shared method, for each element
with indegree greater than or equal to 2 in DTD graphs (i.e. element shared by more
than one elements), a relation schema is created. Elements with indegree 1 are
translated into an attribute of the relation corresponding to an ancestor element.
Also, a relational schema is created for each elements with indegree 0. Here, for
each element represented by a destination node of an edge labeled with “*”, a separate
relational schema is created. This is because set values by themselves cannot be
stored in relational databases. Furthermore, elements which are reachable along
directed paths in DTD graphs from an element having its own relational schema,
say R, are “inlined” into R (i.e. they are defined as attriutes of R .), provided that the
directed paths do not include an edge labeled with “*”. For example, the Shared
translates the DTD graph in Figure 4 into the relational database schema in Figure
6(a). In the Hybrid method, elements with indegree greater than or equal to 2 are
also inlined, if they are reachable from other elements without passing an edge with
“*”. The Hybrid method yields the relational database schema in Figure 6(b).
The information on the occurrence order of elements, which was discarded at
ititial step, is recovered by adding the occurrence position of elements in relational
database schemas.
Search WWH ::




Custom Search