Re: draft XML query results format spec

On Tue, Sep 28, 2004 at 02:01:07PM -0700, Howard Katz wrote:
> 
> In terms of XQuery, I don't think there's a great difference between the two
> result formats. As in most things, it largely comes down to personal
> preference (in which case I lean slightly toward result format #1, mostly
> just because I like its concision of expression for ad hoc querying).
> Ultimately it's just that age-old question: what's better, attributes or
> elements? The angels-on-pinheads committee is still out on that one I think.
> 
> >From another perspective, variation #1 is probably somewhat more efficient
> for most (all?) XQuery implementations. If you want to do a query for the
> presence or absence of a result variable named 'mbox' in format #1, you'd do
> an XPath-style kindtest:
> 
>        //mbox
> 
> To do the same query in format #2, you'd need to check the string value of
> an attribute:
> 
>       //@name = "mbox"
> 
> In either case, you'd get the element(s)/attribute(s) if it/they existed,
> otherwise null. You could also ask:
> 
>      exists( //mbox )

My preference is to be able to pass a template a discovered result and
have that tempate look for an attribute like
@bindingType='NULL'. Otherwise, you have to push the is-it-a-null
logic into the outer template. Not critical, but seems like the more
consitent and predicable design will contribute to peace on earth, at
least for the hackers, which is the only community we really intereact
with.

> in which case you'd get a boolean true or false.
> 
> Finally, Steve asks what the XML community thinks. Good idea: Why don't we
> ask them? I'd be quite happy to draft a note to the XML query languages
> mailing list asking exactly that. I can't speak authoritatively for XSLT
> people or even for XQuery folk; maybe there's something in one format or the
> other that members of the larger XML query community might have problems
> with? Why don't we ask?
> 
> Howard
> 
> 
> > -----Original Message-----
> > From: public-rdf-dawg-request@w3.org
> > [mailto:public-rdf-dawg-request@w3.org]On Behalf Of Steve Harris
> > Sent: Tuesday, September 28, 2004 1:13 PM
> > To: public-rdf-dawg@w3.org
> > Subject: Re: draft XML query results format spec
> >
> >
> >
> > On Tue, Sep 28, 2004 at 06:04:46 +0100, Andy Seaborne wrote:
> > > I don't mind which style of design - I would go for whatever the XML
> > > community see as most appropriate for processing with XSLT and XQuery.
> >
> > +1
> >
> > > 2/ Do XML literals go in as XML subtrees?
> > >    I assume so - so using the same tags as the wrapper may arise and a
> > >    poorly written XPath may (mis)match.  Not sure we can remove all
> > >    situations of this.  Sometimes may actually want it.
> > >    Worse case: a query result as XML literal within an XML result set.
> > >    Example: querying a detailed server log file of queries and their
> > > results.
> >
> > I would expect XML Literals to be escaped, so they can be handled the same
> > way as other literal types, and to make processing easier in non-XSLT
> > applications.
> >
> > - Steve
> >
> >
> 
> 

-- 
-eric

office: +81.466.49.1170 W3C, Keio Research Institute at SFC,
                        Shonan Fujisawa Campus, Keio University,
                        5322 Endo, Fujisawa, Kanagawa 252-8520
                        JAPAN
        +1.617.258.5741 NE43-344, MIT, Cambridge, MA 02144 USA
cell:   +1.857.222.5741 (does not work in Asia)

(eric@w3.org)
Feel free to forward this message to any list for any purpose other than
email address distribution.

Received on Wednesday, 29 September 2004 09:51:21 UTC