XQuery 1.0 and XPath 2.0 Formal Semantics - Last Call

(via Michael Rys)

This is a Last Call Working Draft. Comments on this document are due no later than 15 July 2005...

I guess that those interested in this area know about this, and for others it is a bit too late to get involved, but at least it's good to know the status of the formal specification.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

XQuery and monads

Looks like this spec does a great job at interpreting and clarifying the other specs. However, it's a bit strange that the semantics of these languages is (officially) developed after the syntax, or that there are two languages, or that these languages are so big and complex. I didn't analyze deeply what makes the bulk of these specs, probably I will when I have more time. It might be instructional to compare the semantics of XQuery and XPath with that of nested relational query languages (like CPL, or calculi/algebras like NRC/NRA).

Perhaps Ehud can invite Philip Wadler to comment on this, as he represents both camps (e.g., see An Algebra for XML Query and its bibliography).

Another interesting link is XQuery 1.0 Formal Semantics (yes, another one, this one is from 2001). Look for "monad" :-)

The 2005 version mentions monads no more...

Let gazillions FLW[O]Rs bloom

So the year 2005 version not only does not mention monads or comprehensions, but also drops the "Equivalences" section that discussed essentially monadic laws of FLWRs (for-let-where-return, a generalization of SQL's select-from-where).

As a side note - I found it difficult to sell comprehension-like syntax to my colleagues, while forEach in XSLT appealed to them as more natural. I guess that's the reason XQuery went for FLWRs. Also, not sure how to handle O (order by) using comprehensions (or monads for that matter).