RE: [Fwd: Turtle - Terse RDF Triple Language doc 2007-11-20 update]

-------- Original Message --------
> From: Tim Berners-Lee <>
> Date: 26 November 2007 01:05
>
> > One thing I was thinking about, comparing with SPARQL is the
> > difference in quoting for literals.  SPARQL allows 'foo' and '''foo'''
> > as well as "foo" and """foo"" but Turtle only uses double quotes.  I
> > need more information on whether to add this, does this causes N3/cwm
> > problems?
> >
>
> Cwm has always had triple-double-quote, which are like python and, I
> think, invaluable for multi-line strings.
>
> The single quotes and back quotes were reserved.
> I wish they had been reserved in SPARQL too.
> It is the sort of thing that, once you've allowed them, you can't
> reclaim them -- and then you find you want to extend the language and
> you are hosed as you have no characters left.

Single quotes in SPARQL enable easier embedding of SPARQL queries in language strings.  Language strings are often delimited by " only (pace Python) and putting in \" obfusticates.  It's quite common to want to put a literal in a query so this is not an uncommon case.  It's the double-quotes that are questionable.

> Single quotes could for example be used as:
>
> - a different sort for string, one in which variable substitution occurs
>    as in { ?x name ?y; phone ?z }  =>  { 'You can call $y on the phone
> at $z for more information' }.

There are lots of designs that would enable this - I find choosing one which is the other way round from sh quite confusing.  What about the other style with unlikely-as-plain substitution markers, like using ${y}?

>
> - Nested quotes of some form with backquote, such as   `foaf:Person'
> meaning the string of the URI of that symbol, as in       myStatemet
> rdf:predicateURI  `foaf:knows'.

As the backquote is leading, this is not precluded by single quotes for strings although using `` is more obvious to me.

>
> - Embedding XML  as a shorter syntax for XML literals
>         foo s:comment   '<em>Don't try this at home</em>'

Didn't N-Triples have a form that was removed for x"<em>Don't try this at home</em>".  Using "xml" for XML literal (c.f. a for rdf:type):

"<em>Don't try this at home</em>"^^xml

>
> etc
>
> What do people think?  The SPARQL design seems to have been to just use
> up the language space with no  thought for the future expansion.
> Also using up the $sign as a synonym for ?.
>
> Tim
>
> > The other SPARQL issue to consider is the allowed characters in
> > prefixed names.  SPARQL has slightly different rules that allow
> > numbers and '.'s in different places.
> >
> > See
> >  Turtle - Terse RDF Triple Language 20 November 2007
> > http://www.dajobe.org/2004/01/turtle/
> >
> > All changes:
> >  http://www.dajobe.org/2004/01/turtle/#sec-changelog
> >
> > Dave

Received on Monday, 26 November 2007 10:15:12 UTC