Reference Mapping in BizTrans X

Reference Mapping in BizTrans X

Moonyoung Chung
Electronics and Telecommunications Research Institute
Gajeong-Dong, Yuseong-Gu, Daejeon, 305-350, Republic of Korea
+82-42-860-6599
mchung@etri.re.kr
Sooyoung Oh
Electronics and Telecommunications Research Institute
Gajeong-Dong, Yuseong-Gu, Daejeon, 305-350, Republic of Korea
+82-42-860-6775
runtou@etri.re.kr
Hyeonsung Cho
Electronics and Telecommunications Research Institute
Gajeong-Dong, Yuseong-Gu, Daejeon, 305-350, Republic of Korea
+82-42-860-6734
hsc@etri.re.kr
Hyun-Kyu Cho
Electronics and Telecommunications Research Institute
Gajeong-Dong, Yuseong-Gu, Daejeon, 305-350, Republic of Korea
+82-42-860-5651
hkcho@etri.re.kr

ABSTRACT

Key and foreign key constraints are useful for XML data in semantic specification, query optimization, and data transformation and integration [6]. They provide a robust mechanism of identifying and referring to portions of an XML document. Several XML proposals, e.g., XML Schema [2] and XML Data [3], support key and foreign key specifications. These constraints, however, have not been used for data transformation in existing mapping tools. Therefore, we describe how key and foreign key constraints are utilized for semantically transforming one XML document into the other, and with this result we define reference mapping that improves mapping power. In addition, we introduce BizTrans X, a XSLT-based mapping tool that supports reference mapping.

Keywords

XML, XSLT, Mapping, Integrity Constraints

1. INTRODUCTION

XML is the standard format for data exchange between inter-enterprise applications on the Internet. To facilitate data exchange, industry groups define schemas or use electronic commerce solutions (e.g., ebXML, OBI, xCBL, RosettaNet, UDDI, and OAGIS) that specify the format of the XML data to be exchanged between their applications. Enterprises use these schemas to transform their business document into partner's one for the purpose of business-to-business e-commerce.

To efficiently transform between XML documents, many commercial tools with a graphic UI enable users to create mapping between elements and attributes in two different specifications, and execute transformations with mapping information. Nevertheless, existing tools have a fundamental limit in mapping; they use only syntactic structure of schemas to make a map between different documents. On the other hand, we noticed that semantic information such as key and foreign key constraints can be used to improve mapping power.

In this paper, we show how key and foreign key constraints are utilized for semantically transforming between XML documents, and with this result, we define reference mapping that improves mapping power. Finally, we introduce BizTrans X that is an XSLT-based XML-to-XML mapping tool implementing reference mapping.

2. Reference Mapping

2.1 BizTrans X

BizTrans X is a graphical mapping tool that enables users to create a correspondence between elements and attributes in two different specification formats. This tool presents users with both source specification and target specification and enables users to graphically define transformation by drawing lines between elements and attributes in the tree view. A map represents structural transformation relationship between two specifications. BizTrans X uses the data in a map to generate XSLT [4]. Then the XSLT output transforms a source document into a target one. As a result, users can efficiently transform between two documents without coding. Example snapshot is depicted in Figure 1.

BizTrans X: an XML-to-XML Mapping Tool
Figure 1. BizTrans X: an XML-to-XML Mapping Tool

2.2 Key and Foreign Key Constraints

Keys and foreign keys have been proposed for XML in, e.g., XML Schema [2] and XML Data [3]. They express a fundamental part of the semantic of XML data, and they provide a robust mechanism of identifying and referring to portions of an XML document.

The current mechanism of the XML standard relies on ID and IDREF attributes. It is rather weak since, as opposed to keys and foreign keys, ID and IDREF attributes are neither typed nor scoped [5]. In other words, one has little control over what a reference points to. In Figure 2, what transactionId refers to is not described in the schema, but semantically we can perceive the transactionId of the BusinessProcess to refer to the id of the BusinessTransaction.

ID and IDREF in a Map
Figure 2. ID and IDREF in a Map

This ID/IDREF relationship, however, can be used for transforming a source document into a target document. Therefore, we use this reference relationship between ID and IDREF to improve mapping power in BizTrans X, and we call this kind of mapping "reference mapping".

2.3 Transformation with Reference Mapping

Many XML documents are structured differently while they have same logical structures. For example, in Figure 2 (A doted arrow is an annotation for illustration.), both source document and target document have a same logical structure, that is, a business process consists of several business transactions. However, one is represented by IDs and IDREFs and the other is represented by the parent-child tree relationship.

(a) a source document
(a) a Source Document
(b) a result using existing tool
(b) a Result using Existing Tool
(c) a result using BizTrans X
(c) a Result using BizTrans X
Figure 3. Example of Reference Mapping using ID and IDREF

Consider that a user makes a map as in the Figure 2. S/he intends that each BusinessProcess element has BusinessTransaction elements whose id is same as transactionId of BusinessProcess. Nevertheless, XSL code generated by existing tools produces all combination of BusinessProcess elements and BusinessTransaction elements of the source document since existing mapping tools don't use ID/IDREF relationships for data transformation. In the Figure 3 (a), BusinessProcess with id=ID1 refers to the BusinessTransaction with id=ID3, and BusinessProcess with id=ID2 refers to the BusinessTransaction with id=ID4 in the source document. However, XSL code generated by existing tools produces an XML document in (b) whereas the result that users want to get is in (c).

3. Implementation

To solve the problem above, BizTrans X provides a special mapping interface with a new function, and generates an XSL code for transforming source XML documents into target XML documents conforming to this mapping interface.

3.1 Mapping Interface

To provide intuitive mapping interface, we propose a special function called reference mapping and a link connecting two fields in a source specification with one field in a target specification. This mapping interface is shown in Figure 4 (Doted lines are annotations for illustration).

Reference Mapping Function and Link
Figure 4. Reference Mapping Function and Link

3.2 XSLT Stylesheet Generation

BizTrans X generates an XSLT code for the reference mapping. The output XSL code is presented in the Figure 5. A XML document conforming to a source specification is transformed to a XML document conforming to a target specification using this XSLT output without coding.

Generated XSLT Code
Figure 5. Generated XSLT Code

4. Conclusion

We have investigated how IDs and IDREFs work in transforming between different XML documents, and using ID/IDREF relationships, we proposed the idea of reference mapping. In order to support this idea, we implemented a mapping interface and XSLT algorithm in BizTrans X.

5. REFERENCES

  1. Tim Bary, Jean Paoli and C. M. Sperberg-McQueen. Extensible Markup Language (XML). Technical Report WD-xml, World Wide Web Consortium, 1998. http://www.w3.org/pub/WWW/TR/WD-xml.
  2. Henry S. Thomson, David Beech, Murray Maloney, and Noah Mendelsohn. XML Schema Part 1: Structures. W3C Working Draft, World Wide Web Consortium, 2000. http://www.w3.org/TR/xmlschema-1/.
  3. Andrew Layman, Edward Jung, Eve Maler, Henry S. Thompson, Jean Paoli, John Tigue, Norbert H. Mikula, and Steve De Rose. XML-Data. W3C Note, World Wide Web Consortium, 1998. http://www.w3c.org/TR/1998/NOTE-XML-data.
  4. Michael Kay. XSL Transformations (XSLT) Version 2.0. W3c Recommendation, World Wide Web Consortium, 2002. http://www.w3.org/TR/xslt20/.
  5. Peter Buneman, Susan Davidson, Wenfei Fan, Carmen Hara, and Wang-Chiew Tan. Keys for XML In Proceeding of 10th WWW Conference, pp 201-210, 2001.
  6. Wenfei Fan and Jéróme Siméon. Integrity Constraints for XML In ACM PODS, 2000.