rdf:dataType="&rdf;XMLLiteral" (was: Re: first pass parseType="Literal" text for primer)

For whatever reason, I found out this morning that this mail only went
to the I18N mailing list, rather than to RDF. So I'm resending it.


At 10:06 03/07/24 -0400, Jeremy Carroll wrote:

>Frank Manola wrote:
>
>
>>By the way, you never answered the "What happens..." question?
>
>
><rdf:Description>
>   <eg:prop rdf:parseType="Literal"><em>foo</em></eg:prop>
>   <eg:prop rdf:dataType="&rdf;XMLLiteral">&lt;em>foo&lt;/em></eg:prop>
></rdf:Description>
>
>creates the same triple twice

Hello Jeremy, others,

The above example was bugging me for quite a while,
but I couldn't figure out exactly why.

The first thing I came up was that the rdf:dataType="&rdf;XMLLiteral"
line wasn't exactly what I would consider good practice, and would
only confuse people having difficulties handling different escaping
levels. So I was going to propose that any mention of this be left
out of the primer.

However, thinking about it a bit more, the above raises more
issues. What about
     <eg:prop rdf:dataType="&rdf;XMLLiteral">&lt;br/></eg:prop> ?

Is that valid RDF/XML? Its abstract syntax is supposed to be
"<br></br>"^^rdf:XML. Are RDF/XML parsers required to do one level
of unescaping on the content of such a property element, and
then feed it back to an XML parser in order to get this checked and
cannonicalized? Do any implementations currently do this? Is it
worth requiring them to do so? (Please note that one of the
motivations of introducing what's now called XML Literals
was to avoid such double parsing.)

It seems much simpler to have the spec simply forbid using
&rdf;XMLLiteral in a datatype attribute in RDF/XML. This could
create a slight burden on generators of RDF/XML, in that they
would be required to write out XML Literals with
rdf:parseType="Literal", but I think that burden would not
really be anything serious, in particular because writing
out XML Literals this way is actually very easy (you don't
have to check the content of the string you have stored
if you can assume that it's actual well-formed and balanced XML).


Regards,    Martin.

Received on Wednesday, 30 July 2003 10:02:30 UTC