Re: support XML Literals in RDF

From: Dave Beckett <dave.beckett@bristol.ac.uk>
Subject: Re: support XML Literals in RDF (was Re: Test cases: XML Literal value space and exclusive canonicalization)
Date: Thu, 7 Aug 2003 12:22:00 +0100

> On Thu, 07 Aug 2003 07:02:52 -0400
> "Peter F. Patel-Schneider" <pfps@research.bell-labs.com> wrote:
> 
> > > Date: Thu, 7 Aug 2003 11:08:44 +0100
> > > From: Dave Beckett <dave.beckett@bristol.ac.uk>
> > > To: Martin Duerst <duerst@w3.org>
> > > Cc: www-rdf-comments@w3.org, pat hayes <phayes@ihmc.us>, Benja Fallenstein <b.fallenstein@gmx.de>, Jeremy Carroll <jjc@hplb.hpl.hp.com>, w3c-rdfcore-wg@w3.org, w3c-i18n-ig@w3.org, msm@w3.org> 
> 
> > > On Mon, 04 Aug 2003 13:55:25 -0400
> > > Martin Duerst <duerst@w3.org> wrote:
> > > 
> > > <snip/>
> > >> So it seems to be true, for simple datatype literals, that
> > >> 
> > >> Abstract syntax == lexical value ~= representation in RDF/XML
> > >> 
> > >> (the ~= including generic issues such as character escaping,
> > >> but no datatype-specific issues).
> > > 
> > > Yeah, sort of.  And the Unicode characters in the lexical form that
> > > can't be written in XML.
> > > 
> > > <snip/>
> > >  
> > >> Is every RDF application required to support XML Literals?
> > >> Or only the syntactic parts, and the RDF/XML to Graph conversion
> > >> (including canonicalization) if appropriate?
> > > 
> > > Only those that deal with mapping between the abstract syntax and the
> > > XML syntax (either direction).  
> > > 
> > > The "pure" RDF applications work on graphs and need have no XML-specific
> > > code.  XML Literals just look like any other datatype to RDF graph
> > > applications and should need no extra support in the graph.
> > > 
> > > <snip/>
> > 
> > Although any RDF-only application, i.e., an application that *only* 
> > needs to determine the RDF implications of an RDF graph, does not need 
> > any special code to support XML Literals beyond the code needed to 
> > support sequences of octets, an RDF application that goes beyond these 
> > implications, for example to determine whether a literal is in LV, will 
> > need considerable code to support XML Literals.
> 
> Any RDF application that doesn't do (RDF, RDFS, any) entailment does not
> need this "considerable code".

This is needed for more than just entailment.  For example, as indicated
above, determining whether a^^rdf:XMLLiteral is indeed a valid XML Literal
requires considerable code.

> > Also, any application that needs to determine the RDFS implications of 
> > an RDF graph needs at least an oracle to determine whether a sequence of 
> > octets is in the value space of rdf:XMLLiteral.
> 
> The RDF/XML rdf:parseType="Literal" exc-C14N  checks that for you, in
> the parsing.

Sure, but not all RDF graphs are the result of parsing RDF/XML documents.
Further, there is no indication in an RDF graph of whether the graph is the
result of parsing an RDF/XML document.   So, determining the RDFS
entailments of an RDF graph requires access to an oracle for canonical XML.

> There are no octets in the graph.  The Unicode strings in the graph that
> make up the lexical forms of XML literals will be in exc-C14N form, if
> used via rdf:parseType="Ltieral" and require no XML code for your
> entailments.

Not according to the current editor's draft of RDF/XML Syntax Specification
(Revised) where the result of 7.2.17 is an octet sequence.  (Either that or
the initial string, which would mean that XML Literals are not normalized
at all during RDF/XML parsing.)

> If you had said datatype-entailment then that would be your oracle - an
> XSD implementation library for example.  Such a "considerable code"
> would likely have to include some XML support, since the X in XSD stands
> for XML.  There seem to be such libraries freely already available.

Why would an XSD library have XML canonicalization code in it?  Is there
any XSD datatype that needs this?  I can't see one.

> Dave

Peter F. Patel-Schneider
Bell Labs Research
Lucent Technologies

Received on Thursday, 7 August 2003 07:35:19 UTC