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

Re: [Fwd: SPARQL: Backslashes in string literals]

From: Seaborne, Andy <andy.seaborne@hp.com>
Date: Thu, 04 Aug 2005 14:36:42 +0100
Message-ID: <42F219EA.8050101@hp.com>
To: Dave Beckett <dave.beckett@bristol.ac.uk>
CC: RDF Data Access Working Group <public-rdf-dawg@w3.org>



Dave Beckett wrote:
> On Thu, 2005-08-04 at 13:52 +0100, Seaborne, Andy wrote:
> 
>>ACTION AndyS: take the "Backslashes in string literals" comment
>>
>>I have added text for string escapes in
>>http://www.w3.org/2001/sw/DataAccess/rq23/#grammar
>>The escapes are:
>>\t \b \n \r \f \' \" \uXXXX \UXXXXXXXX
>>The choice of escapes was based on what programming languages seem to typically 
>>accept.
>>
>>(which has the strange effect that writing the string in your fav language means 
>>the processing is done there, not in SPARQL, if you use one backslash which 
>>works for everything except \n and \r because the are not allows as raw 
>>charcater in single line strings).
>>
>>At Dave's suggestion,  I also put in text to allow \u and \U in IRIs and qnames 
>>in support of writing queries where the input system isn't capable of the full 
>>range of UTF characters
>>
>>When reviewed and approved, I'll reply on the comments list.
> 
> 
> Have had a read through:
> 
> It doesn't say if \anything-else has a meaning or is banned.  I'd prefer
> the latter (not in the syntax) in case it needs something added later.

Added:
"No other escape sequences are defined for strings."
> 
> Oops:
>   [[where HEX  is a hexadecimal character
>      HEX ::= [0-9] | [A-Z] | [a-z]
>   ]]

Fixed :-)

> 
> Turtle follows N-Triples and picks just uppercase for hex \u & \U
> escapes (I think there was something in the older charmod drafts about
> having just one way to encode it).  I'd prefer to follow that [0-9]
> [A-F].

Can't find anything in current charmod.

Unless there is a single convention that will not catch people out, I prefer to 
leave both in - it's not clear to me that there is a convention (I write mine in 
upper case.)

> 
> Apart from that, looks ok.  I'll likely match it in Turtle.
> 
> Dave
> 
> 
Received on Thursday, 4 August 2005 13:40:08 GMT

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