[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XQuery types was Re: Yet another plea for XUpd
> -----Original Message----- > From: Jonathan Borden [mailto:jborden@a...] > Sent: Tuesday, May 07, 2002 8:41 AM > To: Jonathan Robie; James Clark; Dare Obasanjo; David G. Durand > Cc: xml-dev@l... > Subject: Re: XQuery types was Re: Yet > another plea for XUpdate... > > > David G. Durand wrote: > > well said. > > > At the beginning of this thread Dare asserted that a weakness of > > XML-Query is that it's semantics is too weak to allow > static analysis > > of the correctness of updates. > > > > What's interesting is that this assertion is in fact untrue, but > > people seem to be accepting it and instead arguing whether that's a > > fatal flaw or not (and what the relevant definition of "type" is). Please prove this assertion untrue. XML type systems (especially with W3C XML Schema) are based on constraints. Constraints are runtime issues. Queries like UPDATE INSERT /person[@age] - 10 INTO /person/@age where the age attribute is a simpleType restriction of xs:positiveInteger with minInclusive = 18 and maxInclusive = 44 cannot be verified at compile time no matter how fancy your heuristics are. Content model issues are just the same, queries like UPDATE INSERT FOR $b in /bookstore/book RETURN ($b, $b, $b) INTO /bookstore where there is a set number of <book>'s that can occur as children of the bookstore element (e.g. a sequence of 10 books) cannot be determined to be valid until runtime. Basically, the kind of updates that benefit from static typing are far fewer and less commonplace than those that benefit from mechanisms similar to post-update validation. > > One of the interesting things about regular tree grammars is that > > many of their properties are decideable. They have the same closure > > properties as regular langauges over strings. This has some nice > > consequences. For instance, Pierce and Hosoya's work on XDuce is > > admittedly an initial step into a research area, but some > results are > > already crystal clear. You can use a regular tree grammar > (and hence > > any of several popular schema languages) as a static type in the > > programming language sense, and use it to type check and validate > > programs operate on documents. In particular you can > validate that a > > program is guaranteed to produce results conforming to another > > schema. I don't think anyone would argue that the best formalism, > > syntax, or algorithms have yet been determined for this kind of > > system yet; it's still bleeding edge. But one can already write > > programs and feed them to an automatic system that will predict and > > validate the relationship between input and output schemas. > > There are a variety of other schema checks that database systems > > perform (like referential integrity). Frequently these are dynamic, > > in fact, not static, though they are given declaratively. At least > > some of the complaints I hear relate to these issues. I'm not > > informed about these issues, but defects in aspects like > this are not > > due to some inherent "lack of a type system" but rather to type > > systems that solve different problems. I've read Dan Suciu's work and it directly contradicts these statements specifically in the case of query languages. Secondly, even if one could absolutely determine what the results of an XQuery expression would always conform to a certain schema (which in many cases is an undecidable problem) there are still a wide number of scenarios where updates still need runtime validation. > > I'm not trying to argue the details of the XQuery semantics, as I'm > > not an expert there (I'm barely informed), but I think that it is > > very significant that we are seeing that one can get real > mileage out > > of current scheme languages when they are considered as > type systems. > > > > I'm interested in this because this has potential to make document > > processing a lot cleaner, more reliable, and pleasant -- > but I'm one > > of the document-oriented old guard in the markup game. > > > > I should note that I mentioned Pierce and Hosoya's XDuce, but there > > are a number of other researchers exploring different > aspects of this > > terrain. For the interested, starting from on of their XDuce papers > > in Citeseer will lead you to a lot of this other work. I've looked at one of their papers and sat in one of their presentations held at MS Research for Xtatic (what they did after XDuce). I remember questioning them about some of their methodolgies and knowledge of XML and not being particularly satisfied that they had done enough research or investigation. I remember Michael Rys was there as well, perhaps he will chime in with his opinions of their work (doubtful). -- PITHY WORDS OF WISDOM No matter how long or how hard you shop for an item, after you've bought it, it will be on sale somewhere cheaper. This posting is provided "AS IS" with no warranties, and confers no rights. You assume all risk for your use. (c) 2002 Microsoft Corporation. All rights reserved.
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|