W3C home > Mailing lists > Public > public-rdf-in-xhtml-tf@w3.org > October 2004

RDF/A and xml:lang on XMLLiterals

From: Jeremy Carroll <jjc@hplb.hpl.hp.com>
Date: Tue, 26 Oct 2004 15:58:08 +0100
Message-ID: <417E6600.3040305@hplb.hpl.hp.com>
To: public-rdf-in-xhtml-tf <public-rdf-in-xhtml-tf@w3.org>

One of the concerns I raised last week was to do with the forgetting of 
lang.

I think this issue is one where it is worth trying to get a TF agreement 
on, and hence make a formal comment.
It is worth remembering that the I18N and RDF Core WGs fell out over this.

I'll start with a possible formal comment, consisting of test cases, and 
then some discussion.
I suspect that e-mail follow up should first address discussion points, 
and when/if we reach consensus on that, we can then see what should 
happen to the comment.

proposed comment
[[
The RDF-in-XHTML TF suggests that the RDF triple corresponding to:

a)

<head xml:lang="it" xml:base="http://example.org/doc">
   <meta property="dc:creator">Luigi <em>Rossi</em></meta>
</head>

should be

<http://example.org/doc> dc:creator
"<span xml:lang='it'>Luigi <em>Rossi</em></span>"^^rdf:XMLLiteral .


b)

<head xml:lang="it" xml:base="http://example.org/doc">
   <meta property="dc:creator">Luigi Rossi</meta>
</head>

should be

<http://example.org/doc> dc:creator
"<span xml:lang='it'>Luigi Rossi</span>"^^rdf:XMLLiteral .


c)

<head xml:lang="" xml:base="http://example.org/doc">
   <meta property="dc:creator">Luigi Rossi</meta>
</head>

should be

<http://example.org/doc> dc:creator
"<span xml:lang=''>Luigi Rossi</span>"^^rdf:XMLLiteral .

d)

<head xml:base="http://example.org/doc">
   <meta property="dc:creator">Luigi Rossi</meta>
</head>

should be

<http://example.org/doc> dc:creator
"<span xml:lang=''>Luigi Rossi</span>"^^rdf:XMLLiteral .


e)

<head xml:lang="it" xml:base="http://example.org/doc">
   <meta property="dc:creator"><em>Luigi Rossi</em></meta>
</head>

should be

<http://example.org/doc> dc:creator
"<span xml:lang='it'><em>Luigi Rossi</em></span>"^^rdf:XMLLiteral

f)

<head xml:lang="it" xml:base="http://example.org/doc">
   <meta property="dc:creator"
   ><span class="red">Luigi Rossi</span></meta>
</head>

should be

<http://example.org/doc> dc:creator
"<span xml:lang='it'><span class='red'>Luigi Rossi</span></span>" 
^^rdf:XMLLiteral

(In all cases the XML Literal is understood as being in exclusive 
canonical XML, and having the XHTML2 default namespace)
]]


Discussion:

a)

<head xml:lang="it" xml:base="http://example.org/doc">
   <meta property="dc:creator">Luigi <em>Rossi</em></meta>
</head>

The object has to be an rdf:XMLLiteral because it includes markup.
The object of the triple should include the lang information, which gets 
deleted in the current document. Since there is no where to put it, we 
have to add a span element to get

"<span xml:lang='it'>Luigi <em>Rossi</em></span>"^^rdf:XMLLiteral .


b)

<head xml:lang="it" xml:base="http://example.org/doc">
   <meta property="dc:creator">Luigi Rossi</meta>
</head>

for consistency with a) we get the datatype of rdf:XMLLiteral, and then 
by the same argument as in a) we introduce a <span> element to carry the 
xml:lang attribute.


"<span xml:lang='it'>Luigi Rossi</span>"^^rdf:XMLLiteral .




c)

Even if the lang is explicitly empty, we could follow the same approach 
as in a)

<head xml:lang="" xml:base="http://example.org/doc">
   <meta property="dc:creator">Luigi Rossi</meta>
</head>

should be

"<span xml:lang=''>Luigi Rossi</span>"^^rdf:XMLLiteral .


d)

No lang and an empty lang are treated the same.

<head xml:base="http://example.org/doc">
   <meta property="dc:creator">Luigi Rossi</meta>
</head>

should be

"<span xml:lang=''>Luigi Rossi</span>"^^rdf:XMLLiteral .

e)
I think for simplicity it is better to always introduce the new span 
element, even if there is a convenient element on which an xml:lang 
could hang.

<head xml:lang="it" xml:base="http://example.org/doc">
   <meta property="dc:creator"><em>Luigi Rossi</em></meta>
</head>

should be

<http://example.org/doc> dc:creator
"<span xml:lang='it'><em>Luigi Rossi</em></span>"^^rdf:XMLLiteral

f)
even if the convenient element is itself a span.

<head xml:lang="it" xml:base="http://example.org/doc">
   <meta property="dc:creator"
   ><span class="red">Luigi Rossi</span></meta>
</head>

should be

<http://example.org/doc> dc:creator
"<span xml:lang='it'><span class='red'>Luigi Rossi</span></span>" 
^^rdf:XMLLiteral


=====


Further discussion

In my examples I assumed that various html 4 features are still in 
xhtml2, please correct me where I am wrong.
I assume that the lang attribute has been replaced by the xml:lang 
attribute in xhtml2.

Jeremy
Received on Tuesday, 26 October 2004 14:58:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 8 January 2008 14:14:59 GMT