W3C home > Mailing lists > Public > w3c-rdfcore-wg@w3.org > May 2003

Fwd: Typed literals in RDF

From: Jeremy Carroll <jjc@hplb.hpl.hp.com>
Date: Tue, 13 May 2003 14:10:01 +0200
To: <w3c-rdfcore-wg@w3.org>
Message-ID: <BHEGLCKMOHGLGNOKPGHDOEKLCBAA.jjc@hpl.hp.com>

This is the rationale I have sent to the jena-devel list.
.....

> ACTION: jjc send rationale for typed literals decision to jena-devel list

On Friday RDF Core changed the definition of a literal, so that a literal
can be one of the following:

A lexical form
A lexical form paired with a language tag
A lexical form paired with a datatype URI


This eliminates the possibility, visible in the Last Call drafts, of

A lexical form, a langauge tag and a datatype URI



The changes to the syntax and N-triples spec will eliminate the langauge tag
from typed literals in N-triples, and an in-scope xml:lang declaration will
be ignored in the generation of typed-literals (including rdf:XMLLiteral) in
the syntax document.

===

Part 1:
-------
Types other than rdf:XMLLiteral:

In the last call documents the langauge tag is irrelevant, explicitly
meaningless, and a potential source of confusion:

From
http://www.w3.org/TR/rdf-mt/#dtype_interp
[[
For any typed literal "sss"^^ddd or "sss"@ttt^^ddd in G, if I(ddd) is in D
and 'sss' is a valid lexical form for I(ddd) then IL("sss"^^ddd) =
L2V(I(ddd))(sss)
]]

http://www.w3.org/TR/rdf-concepts/#section-Literal-Value
[[
The value associated with a typed literal is found by applying the datatype
mapping associated with the datatype URI to the lexical form.
]]

http://www.w3.org/TR/rdf-concepts/#section-Graph-Literal
[[
Note: When using the language identifier, care must be taken not to confuse
language with locale. The language identifier only relates to human language
text. Presentational issues, how to best represent typed data to the
end-user, should be addressed in end-user applications.
]]

In RDF Test Cases we see:

http://www.w3.org/2000/10/rdf-tests/rdfcore/datatypes/test004a.nt
eg:foo eg:bar "10"^^xsd:integer .
entails
http://www.w3.org/2000/10/rdf-tests/rdfcore/datatypes/test004b.nt
eg:foo eg:bar "10"@fr^^xsd:integer .


User defined types with a Lexical2Value mapping depending on the language
tag were not permitted.

For all these datatypes, syntactically excluding the language tag from typed
literals merely better articulates the WG's earlier decision (approx Nov
2002) that such language tags had no meaning. That decision is clearly
articulated in three of the last call documents.

Part 2
------
rdf:XMLLiteral

The Last Call documents are clear that:
- language tags are relevant to XML Literal
- language tags impact the meaning of XML Literal

The WG decided to change this.
Moreover, the current <rdf-wrapper> stuff in the lexical2value mapping is
now unnecessary and will be deleted.

There appeared to be three justifications for this:
- the <rdf-wrapper> seems an ongoing source of confusion
(c.f.
"Confusion about wrapping of XMLLiteral"
http://lists.w3.org/Archives/Public/www-rdf-comments/2003JanMar/0434.html
)
- the benefits of a uniform clarification of literals exceeded the costs of
requiring users of rdf:parseType="Literal" to explicitly include an xml:lang
in their data.
- having the xml:lang in scope can be positively harmful. From
http://lists.w3.org/Archives/Public/w3c-rdfcore-wg/2003May/0089.html
[[
Option 4 [the agreed resolution] simplifies matters the most,
I think, and also has the
added benefit that XML literals can be used for modular content
management without concern of infection from the particulars of
a given RDF/XML serialization (i.e. xml:lang attributes).
]]
From http://www.w3.org/TR/xml-exc-c14n/
In Abstract:
[[
some applications require a method which, to the extent practical, excludes
ancestor context from a canonicalized subdocument
]]
later:
[[
attributes in the XML namespace, such as xml:lang and xml:space are not
imported into orphan nodes of the document subset,
]]

I believe that the WG will provide, in either the primer or the syntax
document, or both, examples of use with xhtml showing the need for a <span>
element to carry an xml:lang attribute.
e.g.

<rdf:Description xmlns="...xhtml...">
  <eg:prop rdf:parseType="Literal"
  ><span xml:lang="en">Hello World</span><eg:prop>
</rdf:Description>

===

In summary
The decision on typed literals is:
+ merely editorial for types other than rdf:XMLLiteral, and any opposition
to it is based on a misreading of the last call, which this change
eliminates.
+ substantive for rdf:XMLLiteral, but better aligns with the WG's earlier
decision to base the treatment of rdf:parseType="Literal" on xml-exc-c14n,
by excluding more of the surrounding context from the meaning of the
literal, and better enabling rdf:parseType="Literal" to be an enveloping
mechanism for XML content.


Joke, sort-of ...

Ha, got you there with a catch-22 if you don't like the change that adds to
the evidence that it is needed!
Received on Tuesday, 13 May 2003 08:10:09 EDT

This archive was generated by hypermail pre-2.1.9 : Wednesday, 3 September 2003 09:57:30 EDT