Skip to main content

Type-Safe Two-Level Data Transformation

  • Conference paper
FM 2006: Formal Methods (FM 2006)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 4085))

Included in the following conference series:

  • 1196 Accesses

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.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

Similar content being viewed by others

References

  1. 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)

    Chapter  Google Scholar 

  2. Atanassow, F., Jeuring, J.: Inferring type isomorphisms generically. In: Kozen, D. (ed.) MPC 2004. LNCS, vol. 3125, pp. 32–53. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  3. van den Brand, M., Klint, P., Vinju, J.: Term rewriting with type-safe traversal functions. ENTCS 70(6) (2002)

    Google Scholar 

  4. Cleve, A., Henrard, J., Hainaut, J.-L.: Co-transformations in information system reengineering. ENTCS 137(3), 5–15 (2005)

    Google Scholar 

  5. 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)

    Google Scholar 

  6. 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)

    Google Scholar 

  7. Hinze, R.: Fun with phantom types. In: Gibbons, J., de Moor, O. (eds.) The Fun of Programming, pp. 245–262. Palgrave (2003)

    Google Scholar 

  8. 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)

    Chapter  Google Scholar 

  9. Hutton, G., Meijer, E.: Back to Basics: Deriving Representation Changers Functionally. Journal of Functional Programming 6(1), 181–188 (1996)

    Article  Google Scholar 

  10. Lämmel, R.: Coupled Software Transformations (Extended Abstract). In: First International Workshop on Software Evolution Transformations (November 2004)

    Google Scholar 

  11. Lämmel, R.: Transformations everywhere. Sci. Comput. Program 52, 1–8 (2004); Guest editor’s introduction to special issue on program transformation

    Article  Google Scholar 

  12. 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)

    Google Scholar 

  13. 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)

    Chapter  Google Scholar 

  14. 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)

    Chapter  Google Scholar 

  15. 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)

    Google Scholar 

  16. 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)

    Chapter  Google Scholar 

  17. Morgan, C., Gardiner, P.H.B.: Data refinement by calculation. Acta Informatica 27, 481–503 (1990)

    Article  MATH  MathSciNet  Google Scholar 

  18. 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.

    Google Scholar 

  19. Oliveira, J.N.: A reification calculus for model-oriented software specification. Formal Aspects of Computing 2(1), 1–23 (1990)

    Article  MathSciNet  Google Scholar 

  20. 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)

    Google Scholar 

  21. Oliveira, J.N.: Calculate databases with ‘simplicity’. Presentation at the IFIP WG 2.1 #59 Meeting, Nottingham, UK (September 2004)

    Google Scholar 

  22. 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)

    Google Scholar 

  23. 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)

    Chapter  Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints 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)

Publish with us

Policies and ethics