Abstract
A two-level data transformation consists of a type-level transformation of a data format coupled with value-level transformations of data instances corresponding to that format. Examples of two-level data transformations include XML schema evolution coupled with document migration, and data mappings used for interoperability and persistence.
We provide a formal treatment of two-level data transformations that is type-safe in the sense that the well-formedness of the value-level transformations with respect to the type-level transformation is guarded by a strong type system. We rely on various techniques for generic functional programming to implement the formalization in Haskell.
The formalization addresses various two-level transformation scenarios, covering fully automated as well as user-driven transformations, and allowing transformations that are information-preserving or not. In each case, two-level transformations are disciplined by one-step transformation rules and type-level transformations induce value-level transformations. We demonstrate an example hierarchical-relational mapping and subsequent migration of relational data induced by hierarchical format evolution.
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Alves, T.L., Silva, P.F., Visser, J., Oliveira, J.N.: Strategic term rewriting and its application to a VDM-SL to SQL conversion. In: Fitzgerald, J.S., Hayes, I.J., Tarlecki, A. (eds.) FM 2005. LNCS, vol. 3582, pp. 399–414. Springer, Heidelberg (2005)
Atanassow, F., Jeuring, J.: Inferring type isomorphisms generically. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 32–53. Springer, Heidelberg (2004)
van den Brand, M., Klint, P., Vinju, J.: Term rewriting with type-safe traversal functions. ENTCS 70(6) (2002)
Cleve, A., Henrard, J., Hainaut, J.-L.: Co-transformations in information system reengineering. ENTCS 137(3), 5–15 (2005)
Cunha, A., Oliveira, J.N., Visser, J.: Type-safe two-level data transformation – with derecursivation and dynamic typing. Technical Report DI-PURe-06.03.01, Univ. Minho (2006)
Foster, J.N., et al.: Combinators for bi-directional tree transformations: a linguistic approach to the view update problem. In: Proc. 32nd ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 233–246. ACM Press, New York (2005)
Hinze, R.: Fun with phantom types. In: Gibbons, J., de Moor, O. (eds.) The Fun of Programming, pp. 245–262. Palgrave (2003)
Hinze, R., Löh, A., Oliveira, B.: Scrap your boilerplate reloaded. In: Hagiya, M., Wadler, P. (eds.) FLOPS 2006. LNCS, vol. 3945, pp. 13–29. Springer, Heidelberg (2006)
Hutton, G., Meijer, E.: Back to Basics: Deriving Representation Changers Functionally. Journal of Functional Programming 6(1), 181–188 (1996)
Lämmel, R.: Coupled Software Transformations (Extended Abstract). In: First International Workshop on Software Evolution Transformations (November 2004)
Lämmel, R.: Transformations everywhere. Sci. Comput. Program 52, 1–8 (2004); Guest editor’s introduction to special issue on program transformation
Lämmel, R., Lohmann, W.: Format Evolution. In: Proc. 7th Int. Conf. on Reverse Engineering for Information Systems, books@ocg.at, vol. 155, pp. 113–134. OCG (2001)
Lämmel, R., Meijer, E.: Mappings make data processing go ’round. In: Lämmel, R., Saraiva, J., Visser, J. (eds.) GTTSE 2005. LNCS, vol. 4143. Springer, Heidelberg (2006)
Lämmel, R., Peyton Jones, S.: Scrap your boilerplate: a practical design pattern for generic programming. In: Proc. ACM SIGPLAN Workshop on Types in Language Design and Implementation, pp. 26–37. ACM Press, New York (2003)
Lämmel, R., Visser, J.: Strategic polymorphism requires just two combinators! Technical Report cs.PL/0212048, arXiv; An early version was published in the informal preproceedings IFL 2002 (December 2002)
Lämmel, R., Visser, J.: Typed combinators for generic traversal. In: Krishnamurthi, S., Ramakrishnan, C.R. (eds.) PADL 2002. LNCS, vol. 2257, pp. 137–154. Springer, Heidelberg (2002)
Morgan, C., Gardiner, P.H.B.: Data refinement by calculation. Acta Informatica 27, 481–503 (1990)
Neves, F.L., Silva, J.C., Oliveira, J.N.: Converting Informal Meta-data to VDM-SL: A Reverse Calculation Approach. In: VDM in Practice! A Workshop co-located with FM 1999: The World Congress on Formal Methods, Toulouse, France (September 1999) http://www.csr.ncl.ac.uk/vdm/vdmworkshop/fm99.html.
Oliveira, J.N.: A reification calculus for model-oriented software specification. Formal Aspects of Computing 2(1), 1–23 (1990)
Oliveira, J.N.: Software reification using the SETS calculus. In: Denvir, T., Jones, C.B., Shaw, R.C. (eds.) Proc. of the BCS FACS 5th Refinement Workshop, Theory and Practice of Formal Software Development, pp. 140–171. Springer, Heidelberg (1992)
Oliveira, J.N.: Calculate databases with ‘simplicity’. Presentation at the IFIP WG 2.1 #59 Meeting, Nottingham, UK (September 2004)
Peyton Jones, S., Washburn, G., Weirich, S.: Wobbly types: type inference for generalised algebraic data types. Technical Report MS-CIS-05-26, Univ. of Pennsylvania (July 2004)
Wadler, P.: The essence of functional programming. In: Proc. 19th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pp. 1–14. ACM Press, New York (1992)
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2006 Springer-Verlag Berlin Heidelberg
About this paper
Cite this paper
Cunha, A., Oliveira, J.N., Visser, J. (2006). Type-Safe Two-Level Data Transformation. In: Misra, J., Nipkow, T., Sekerinski, E. (eds) FM 2006: Formal Methods. FM 2006. Lecture Notes in Computer Science, vol 4085. Springer, Berlin, Heidelberg. https://doi.org/10.1007/11813040_20
Download citation
DOI: https://doi.org/10.1007/11813040_20
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-37215-8
Online ISBN: 978-3-540-37216-5
eBook Packages: Computer ScienceComputer Science (R0)