W3C home > Mailing lists > Public > www-international@w3.org > January to March 2005

Re: XMLLiterals and language

From: Jeremy Carroll <jjc@hplb.hpl.hp.com>
Date: Tue, 18 Jan 2005 11:51:19 +0000
Message-ID: <41ECF837.8090401@hplb.hpl.hp.com>
To: Reto Bachmann-Gmuer <reto@gmuer.ch>
CC: www-rdf-interest@w3.org, www-international@w3.org

Reto Bachmann-Gmuer wrote:
> 
> Jeremy Carroll wrote:
> 
>>
>> Reto Bachmann-Gmuer wrote:
>>
>>> Jeremy Carroll wrote:
>>>
>>>> According to the recs the language in this one is ignored. If you 
>>>> want the language tag (which you should) you have to put it 
>>>> explicitly inside the XMLLiteral e.g.
>>>>
>>>>
>>>> <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
>>>>   xmlns="....xhtml"
>>>>   xmlns:dc="http://purl.org/dc/elements/1.1/">
>>>>   <rdf:Description rdf:about="http://www.w3.org/">
>>>>     <dc:title  rdf:parseType="Literal" xml:lang="en"><span
>>>> xml:lang="en">World Wide Web
>>>>  Consortium</span></dc:title>
>>>>   </rdf:Description>
>>>>  </rdf:RDF>
>>>
>>>
>>>
>>>
>>> After finding the current recs, I think I understood but don't like it.
>>>
>>> My usecase is an application (KnoBot [1]) delivering rdf on http 
>>> requests, it honours the accept-language header on a per literal 
>>> basis, literals in a language that is not in the accept-language 
>>> header are not ignored, the others are sorted according to the user 
>>> preferences. Now I don't like the idea to xml-parse every literal.
>>>
>>> Then I would have assumed a semantic difference between the language 
>>> of the literal, and the language of the elements in the xhtml.
>>>
>>> <ex:Book>
>>>    <dc:title xml:lang="de">Carpe diem</dc:title>
>>> </ex:Book>
>>>
>>> I would have thought that this means that the title of the German 
>>> (translation of a) book is "Carpe diem". Similarly to quotes in 
>>> foreign language within a document, if xml:lang would be legal with 
>>> XMLLiterals I would have understood the following to express that 
>>> "Carpe diem" are Latin words expressing the German title of the book.
>>>
>>> <ex:Book>
>>>    <dc:title xml:lang="de" rdf:parseType="Literal"><span
>>> xml:lang="la">Carpe diem</span></dc:title>
>>> </ex:Book>
>>>
>>>
>>
>> I suggest the following markup for that example:
>> <ex:Book>
>>     <dc:title rdf:parseType="Literal"><span xml:lang="de"><span
>>  xml:lang="la">Carpe diem</span></span></dc:title>
>> </ex:Book>
>>
>>
>> but I'm not wholly up on the conventions for using lang tags to 
>> indicate one language quote inside another ... (cc-ing to 
>> www-international for a further opinion).
>> I think if you want to know about the language of a piece of XHTML you 
>> have to process it as XHTML, hmmmm, I suppose for an XHTML page there 
>> is often metadata about the page such as the accept-language headers 
>> which give some sort of overview.
> 
> 
> With this convention it becomes effectively impossible to have a 
> language independent default version. With the following illegal rdf/xml 
> I'd like to express that the default abnormal-termination message if 
> "Requiem in pax" which are Latin words, but the English version is a 
> blinking "Rest in peace".
> 
> <ex:MessageBundle>
>    <ex:abnormalTermination rdf:parseType="Literal"><span
>         xml:lang="la">Requiem in pax</span></ex:abnormalTermination>
>    <ex:abnormalTermination xml:lang="en" 
> rdf:parseType="Literal"><blink>Rest in 
> peace</blink></ex:abnormalTermination>
> </ex:MessageBundle>
> 
> reto
> 
> 

If your wanting to make such semantically heavy use of language I think 
it should be a more explicit part of your knowledge base, rather than 
part of the values of the knowledge base ... moving to triples (I'll 
recode in RDF/XML at end of message)

_:a rdf:type ex:MessageBundle .
_:a ex:defaultAbnormalTermination _:b .
_:b rdf:type ex:Message .
_:b rdfs:label
"<span xmlns=\"...xhtml" xml:lang=\"la\">Requiem in pax</span>"
    ^^rdf:XMLLiteral.
_:a ex:abnormalTermination _:c .
_:c rdf:type ex:Message .
_:c dc:language "en" .
_:c rdfs:label
"<blink xmlns=\"...xhtml" xml:lang=\"en\">Rest in peace</blink>"
    ^^rdf:XMLLiteral.


Notes:
+ <blink> isn't an HTML element, so is a further issue here.
+ I've added a type ex:Message because I think it makes it clearer, a 
Message has a label, and may have a language
+ I've added a property defaultAbnormalTermination rather than relying 
on some procedure to identify the default over all possible 
abnormalTerminations

In RDF/XML

<ex:MessageBundle>
    <ex:defaultAbnormalTermination>
       <ex:Message>
          <rdfs:label rdf:parseType="Literal"><span
xml:lang="la">Requiem in pax</span></rdfs:label>
       </ex:Message>
    </ex:defaultAbnormalTermination>
    <ex:abnormalTermination>
       <ex:Message>
          <dc:language>en</dc:language>
          <rdfs:label rdf:parseType="Literal"
 ><blink xmllang="en">Rest in peace</blink></rdfs:label>
        </ex:Message>
     </ex:abnormalTermination>
</ex:MessageBundle>

Jeremy
Received on Tuesday, 18 January 2005 11:51:53 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 2 June 2009 19:17:04 GMT