Alternative representation of typed literal nodes in NTriples (and N3)

Hi folks,

I've been chewing on the representation of typed literal nodes in 
NTriples in a manner that is both consistent for non-XML and XML
literals and which is more compatable with use of qnames rather
than URIrefs, both by N3 as well as in our own examples, since
it is common practice by the editors to use qnames in the NTriples
in the specs.

What I propose is that we keep the current representation of 
literals in NTriples, and that the datatype be separated from 
the literal by a comma.

Thus:


   non-XML literal                                                    "25"
   non-XML literal with lang                                          "25"-en
   URIref typed non-XML literal                  <http://...#integer>,"25"
   URIref typed non-XML literal with lang        <http://...#integer>,"25"-en
   qname typed non-XML literal                            xsd:integer,"25"
   qname typed non-XML literal with lang                  xsd:integer,"25"-en

   XML literal                                           xml"<h1>Foo</h1>"
   XML literal with lang                                 xml"<h1>Foo</h1>"-en
   URIref typed XML literal              <http://...#h1>,xml"<h1>Foo</h1>"
   URIref typed XML literal with lang    <http://...#h1>,xml"<h1>Foo</h1>"-en
   qname typed XML literal                      xhtml:h1,xml"<h1>Foo</h1>"
   qname typed XML literal with lang            xhtml:h1,xml"<h1>Foo</h1>"-en

Since a comma is not a legal XML NAME character, when joining a qname
with an XML literal, there is no ambiguity regarding the partitioning
between the qname and the XML flag 'xml'.

This keeps both non-XML and XML literals delimited by double quotes, and
no changes to the current NTriples syntax (other than the prefixing of
the datatype).

It also reinforces, IMO, the fact that the typed literal node is a pairing
of a datatype and a literal, the latter having its own three-part structure
of XML bit, string, and language code.

So, we can use qnames in examples and N3 can adopt typed literal nodes
without any syntactic ambiguity.

Eh?

Patrick

--
               
Patrick Stickler              Phone: +358 50 483 9453
Senior Research Scientist     Fax:   +358 7180 35409
Nokia Research Center         Email: patrick.stickler@nokia.com
 

Received on Thursday, 22 August 2002 14:28:28 UTC