W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2004

RE: draft XML query results format spec

From: Howard Katz <howardk@fatdog.com>
Date: Tue, 28 Sep 2004 14:01:07 -0700
To: "Steve Harris" <S.W.Harris@ecs.soton.ac.uk>, <public-rdf-dawg@w3.org>

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:


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 )

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?


> -----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
Received on Tuesday, 28 September 2004 20:59:36 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:00:45 UTC