Galax: Static Typing
Description: galax, xquery, query language, ocaml
Keywords: galax, xquery, query language, ocaml

Tech. Center
XQuery Optimization Static Typing Testing Research Papers Galax Projects
| # About Static Typing The purpose of this page is to help you get acquainted with XQuery's type system, and static typing. Static typing in XQuery is one of the most innovative feature of XQuery. Static typing can be used to check at compile time that your query will never raise any type errors. This allows to detect a large number of errors during early phases of the development of your application. Static typing has proved itself an invaluable tool in other programming languages in the past, for instance in Java or ML. This benefit has a cost though, since the developer must first understand the type system, and how to work effectively with it. In the context of XQuery, the type system is based on XML Schema. Galax and Static Typing. Galax supports XQuery's static typing option. One way to learn about static typing is to give it a try. # XML Schema and the XQuery Type System The first step in understanding static typing is to understand XML Schema which is XQuery's type system. An introduction to the semantics of XML Schema and the corresponding type system can be found in the following paper: The Essence of XML, Philip Wadler, and Jérôme Siméon. ACM Conference on Principles of Programming Languages (POPL'2003). January 2003. The complete specification for XQuery's type system and many more examples can be found in the Formal Semantics. # Static Typing in XQuery The way static typing functions can be somewhat complex. Understanding how static typing works is not necessary for a user of the language, but is necessary for an XQuery implementor. The following papers and presentations explain the basics of static typing in XQuery. About Galax Implementation (Microsoft, Seattle, December 2001) A semistructured monad for semistructured data. Mary Fernandez, Jerome Simeon, Philip Wadler. ICDT, London, January 2001. An Algebra for XML Query. Mary Fernandez, Jerome Simeon, Philip Wadler. FST TCS, Delhi, December 2000. An Algebra for XML Query. Mary Fernandez, Jérôme Siméon, and Philip Wadler, draft manuscript. June 2000. (This one was the actual submission to the W3C!) A Data Model and Algebra for XML Query Mary Fernandez, Jérôme Siméon, Dan Suciu and Philip Wadler. Draft manuscript. November 1999. The complete specification for XQuery's static typing feature can be found in the Formal Semantics. # Subtyping Dealing subtyping on XML Schema types is one of the main technical difficulty when implementing XQuery's type system. The following paper presents a way to deal with subtyping in XQuery. Galax subtyping algorithm is based on this paper. Subsumption for XML Types. Gabriel M. Kuper and Jérôme Siméon, in International Conference on Database Theory (ICDT'2001), January 2001, London, UK.