Re: XQuery and URIs

On Tue, Jan 27, 2004 at 12:26:14AM -0500, Liam Quin wrote:
> Speaking for myself here, and not the WG...
> 
> Note that it's not generally enough to escape a query in a URI;
> you'll need to decide whether to use CGI-style encoding, and if
> so, what the variables should be called, and how to name a script
> that interfaces to a query...

I don't think that part needs to be standardized upon, at least not as
part of XQuery.  See below ...

In response to Michael, and as I earlier pointed out, the TAG has
"recommended" (or whatever weight you put behind their findings) that,
in general, queries be performed via GET.  See;

http://lists.w3.org/Archives/Public/public-qt-comments/2003Oct/0096.html

> Or are you expecting a standardised WHEREIS query for a Web page?

Not at all.  

> Do I do,
> http://www.example.org/collections/36/search.pl?query=XXXX
> or do I do
> http://www.example.org/~user/cgi-bin/q.cgi?srch=XXXX

That depends on the form language.  What depends on the query language
is the "XXXX" and how that's encoded, I believe.  See below ...

> The best I can suggest here is that you investigate WSDL and Web
> Services for a more general mechanism than I believe XML Query
> can or should provide.

Eeek! 8-O

> > We have closed this issue for now; please let us know if this
> > disposition is not satisfactory.
> 
> > Sorry, it's not. 8-(
> Are you asking for the XML Query Specification to have a note saying
> that queries can be put in a "GET" URL and escaped as per the URL
> RFC?  Or that when embedded in a URL, queries must be escaped
> according to the rules of said spec?  Doesn't that follow
> automatically from HTTP and the URI/IRI spec?  I'm sorry if I'm
> being slow -- I'm missing how interoperability is helped by a
> more specific note.  How do you think we should proceed?

Perhaps I should break down how I see it, as there's a few specs
simultaneously in play here;

1.  URI spec
2.  Forms language spec
3.  An instance of a form
4.  XQuery spec

#1, obviously, defines the URI syntax and generic semantics

#2 defines how form "questions" are presented, and "answers" encoded.
For GET forms, the encoding describes how the answer structure (e.g.
name value pairs) is encoded into a URI per the URI spec (e.g.
"?param=value&..." ala HTML).

#3 defines a specific parameter and type for a value (e.g. "xq" will
hold an "XQuery document") per the forms spec

So the role of #4, XQuery, needs to be to define a canonical
encoding for its documents to fit into the parameter value.  If URI
escaping is to be used, that's fine, but nothing in #s 1, 2, or 3,
says that this is the case.

I should add that the interplay I described there is current practice
per HTML and largely XForms, but need not be the only way this is
handled.  For example, #2 could have been done in #1.  Nonetheless, I
believe it to be a sound design.

Mark.
-- 
Mark Baker.   Ottawa, Ontario, CANADA.        http://www.markbaker.ca

Received on Tuesday, 27 January 2004 18:50:07 UTC