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

RE: variables prefix - ?variable vs. $variable

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Tue, 31 Aug 2004 15:09:14 +0100
Message-ID: <E864E95CB35C1C46B72FEA0626A2E80803E3C144@0-mail-br1.hpl.hp.com>
To: Dirk-Willem van Gulik <dirkx@webweaving.org>
Cc: Alberto Reggiori <alberto@asemantics.com>, RDF Data Access Working Group <public-rdf-dawg@w3.org>




-------- Original Message --------
> From: Dirk-Willem van Gulik <>
> Date: 31 August 2004 13:57
> 
> On Tue, 31 Aug 2004, Seaborne, Andy wrote:
> 
> > So are you saying ALL '?' get processed, even if in a literal?
> 
> We've found several JDBC interfaces where this is downright buggy; and
> where an escape of a ? which is followed by something which happened to
> be 
> a ?validvarname is handled incorrectly.

This is a worrying argument - we can not hope to steer round bugs because
one system does it wrong and another does it right.  At this point we are
not reusing other systems - we are designing the syntax for them.  They may
get fixed (hopefully).

> 
> I.e. {escape 'escape-character'} does not work for some inside a
> literal. 

So - there is an escape mechanism.  (Aside: it was stated a while back there
wasn't).  We will have to use it somewhere for those characters in query
literals.  It is then independent of the query language and is specific to
the lcoal environment.

> 
> > How does a client ask query that involves a ? in a string?
> 
> Use an escape sequence; such as \.
> 
> BUT these are often trapped by, say, the java compiler. So you end up
> having to use, say, a more harmless / and end up with:
> 
> statement.executeQuery(
>   "SELECT * FROM FACT WHERE
> 	DESC='Dirkx/'s opinion is that escaping sucks too ' {escape '/'}");

It's a common idiom that programmers are used to:

	DESC='Dirkx\\'s opinion is that escaping sucks too ' {escape
'\\'}");

It's a "feature" :-) of the coding language.

> 
> statement.executeQuery(
>   "SELECT ?x FROM FACT WHERE
> 	DESC='Where are the pigeons/?' { escape '/'}");
> 
> Which gets downright horrible if you need a ", { or ' also in
> your query string in a langauge where they also have a special
> meaning. (And pray that % and  _ which are special in LIKE
> are not part of it - but luckily most DB's allow for the { escape } to
> be used multiple times in the same string).
> 
> Hence; lets avoid the ? and use a '^', '@', '+' or something harmelss.

We can't proceed with this arbitrary way of deciding what's in and what's
out.  The same argument could be made for $.  That is a client-side
substituion marker (Perl and bash).

I'm happy for minor changes to avoid unnecessary inconvenience (so, for
example, $ for ? is OK by me at the moment but if $ gets used, its not).  It
is far, far too early to argue from inconsistent usage and some buggy
systems.  Do it when we are near the end-game as ways to increase useableity
but don't warp the whole design on it.

Thanks for clearing things up.

	Andy

> 
> Dw.
Received on Tuesday, 31 August 2004 14:10:11 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:20 GMT