Re: NTriples proposed changes summary

At 11:27 AM 3/15/02 +0000, Dave Beckett wrote:
>So although Tim has raised a problem with using '-' in the proposed
>changes, I feel we should make this change for now.  We can revisit
>this later and tweak the format again if and when we get a better way
>to resolve this encoding of lang-strings (or we make some other change).

I don't feel strongly about this, but in view of Tim's comment would offer 
this suggestion (for use now, later or never):

   literal  ::=  plainstring | langString | xmlString

   plainstring   ::= '"' string '"'

   langString   ::= 'lit(' '"' string '"' ',' language ')'

   xmlString    ::= 'xml(' '"' string '"' (',' language)? ')'

   language     ::= character+  excluding ',', '(', ')' and ws

I think this avoids confusion with N3 (...) because N3 syntax has that only 
at the start of a statement.  For greater safety, maybe reserve 'xml' and 
'lit' as keywords?


The test cases then become:

# XML literals
<http://example.org/resource21> <http://example.org/property> xml("") .
<http://example.org/resource22> <http://example.org/property> xml(" ") .
<http://example.org/resource23> <http://example.org/property> xml("x") .
<http://example.org/resource23> <http://example.org/property> xml("\"") .
<http://example.org/resource24> <http://example.org/property> xml("<a/>") .
<http://example.org/resource25> <http://example.org/property> xml("a <b/>") .
<http://example.org/resource26> <http://example.org/property> xml("a 
<b></b> c") .
<http://example.org/resource26> <http://example.org/property> 
xml("a\n<b></b>\nc") .
<http://example.org/resource27> <http://example.org/property> xml("chat") .
<http://example.org/resource28> <http://example.org/property> xml("chat",fr) .
<http://example.org/resource29> <http://example.org/property> xml("chat",en) .

# literals with languages
<http://example.org/resource30> <http://example.org/property> lit("chat",fr) .
<http://example.org/resource31> <http://example.org/property> lit("chat",en) .


(Non-language, non-XML literals are unchanged.)

#g


-------------------
Graham Klyne
<GK@NineByNine.org>

Received on Friday, 15 March 2002 07:54:27 UTC