| |
(2/7/00) My Proposal of representation of XML Updates
|
Well-Formed XML Document:
| Data Model (inspired from [XPath]
Data Model):
| Three types of Nodes: Element, Attribute and Text. |
| Text and Element Nodes are ordered. |
|
Type of Node
|
Properties of Node
|
Comments
|
Attribute |
Name, Value |
no Order |
Element |
Type, Children List, Attribute List, Order |
with OID |
Text |
Value, Order |
|
|
| Link has no names with: From, To. |
| An XML data model is a graph of {N, L}. N
is the set of nodes, and L is the set of links between the
nodes in set N. |
|
| Operations:
| Node
| Update Node |
| Add Node |
| Delete Node |
|
| Link
| Add Link |
| Remove Link |
| Update Link (From, To) |
|
|
| Misc: |
Valide XML document with DTD:
|
DTD Updates:
|
|
XML Updates:
|
Operations that will not violate the DTD.
|
|
|
(2/8/00) Relationship between XML and DTD Updates:
|
For well-formed XML documents, we don't need to figure out that
relationship because there is no DTD exists.
For valid XML documents, understanding the relationship between XML and
DTD updates is very useful when we want to figure out how to update DTD
when the underlying XML is changed, and vice versa. When we want to map
the XML changes into RDB, clearance of this relationship is essential. |
(2/8/00) Mapping the XML updates and DTD updates into RDB:
|
We update the XML documents after we load XML documents into RDB.
How can we update the RDB accordingly?
Our mapping approach takes the advantage of DTD. In this case, we are
going to discuss the valid XML documents with a DTD. For the case of
well-formed XML documents we assume there is a DTD generate from it.
If a valid XML documents with a DTD is updated, there could be two
types of changes: 1st: XML documents changed, but still valid under
original DTD. 2nd: XML documents changed, and its DTD changed accordingly
in order to still make it valid. It usually happened during the generation
of DTD. Let's discuss the cases one by one.
1. XML documents changed but still under same DTD.
Because the mapping algorithm generates the relational schema from DTD,
so the relational schema is not changed. Only the data of the tables will
be changed accordingly.
Here is a list of possible updates in XML documents:
| Add Node |
| Delete Node |
| Update Node |
| Add Link |
| Remove Link |
| Update Link |
When we talk about updating, we have to have a way to locate the place
we want to update in the existing tables. Here we use the "oid"
of each element in the documents. The "oid" of each element is
mapped to "iid" in the tables. Also, because we have the
operations like distill attribute, some elements is eliminated and
stored as attribute of other tables. This requires using the metadata
table to locate the position of a specific element.
(to be continued.)
2. XML documents changed also the DTD.
|
Mapping the RDB updates back to XML updates and DTD updates:
|
|
|