[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

  • To: "Jonathan Borden" <jborden@a...>,"Jonathan Robie" <jonathan.robie@d...>,"James Clark" <jjc@j...>,"David G. Durand" <david.durand@p...>
  • Subject: RE: XQuery types was Re: Yet another plea for XUpdate...
  • From: "Dare Obasanjo" <dareo@m...>
  • Date: Mon, 6 May 2002 21:02:15 -0700
  • Cc: <xml-dev@l...>
  • Thread-index: AcH1d2aIoCGqKKnRTRmosvNnHJfuvgAAP+5w
  • Thread-topic: XQuery types was Re: Yet another plea for XUpdate...

xquery insert
> -----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!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.