Tag-less literals and literals with empty tags

[After 3 weeks being blocked by the W3C mail system, I'm re-trying. If you get this mail and answer, please cc public-esw-thes@w3.org, from which this discussion comes]

Dear RDF group,

A question which may be related to stuff you're being discussing now on literals.

On the SKOS community list, a question has been sent to know whether one of the SKOS axioms (S14: "A resource has no more than one value of skos:prefLabel per language tag", http://www.w3.org/TR/skos-reference/#labels) applies to literals without language tags [1].

The intention behind this axiom is of course that yes: the graph
S skos:prefLabel "A" ; skos:prefLabel "B" .
is inconsistent.

When we wrote the spec, the assumption was that literals without tags could be considered as literal with empty tags, and thus the wording for S14 was catching all situations.

However it is not so clear from the RDF specs. In particular, some of us made the following points:


> Alan Ruttenberg wrote:
> without a language tag it is a string, with a language tag it is a pair of
> strings. The set of plain literals without language tags is *not* the
> set of pairs (string , "").

(which I think matches what is written in the RDF Concepts and Abstract Syntax)


And:


> Antoine Isaac  wrote:
> http://www.w3.org/TR/rdf-plain-literal/#plfn:compare
> 
> [plfn:compare] returns the empty sequence if one of the arguments is empty,
> if one of $comparand1 and $comparand2 has a language tag and the other one does not,
> or if the language parts of $comparand1 and $comparand2 are unequal.
> 


But the rdf:PlainLiteral spec also has for plfn:lang-from-literal, which is used in the spec of plfn:compare:


> Simon Spero wrote:
> http://www.w3.org/TR/rdf-plain-literal/#plfn:lang-from-PlainLiteral
> 5.1.3 plfn:lang-from-PlainLiteral
>    Summary: returns the language tag l if $arg is an rdf:PlainLiteral data value
> of the form < s, l >, and returns the empty string if $arg is an rdf:PlainLiteral
> data value of the form s.


Note that the XML spec should solve directly the issue, for any RDF/XML data:


> Johan De Smedt wrote:
> From http://www.w3.org/TR/xml/#sec-lang-tag <http://www.w3.org/TR/xml/%23sec-lang-tag>,
> 
> “For example:
> [...]
> <p xml:lang="en-US">What color is it?</p>
> <sp who="Faust"  desc='leise' xml:lang="de">
>    <l>Habe nun, ach! Philosophie,</l>
>    <l>Juristerei, und Medizin</l>
> [...]
> The language specified by |xml:lang| applies to the element where it is specified (including the values of its attributes), and to all elements in its content unless overridden with another instance of |xml:lang|. In particular, the empty value of |xml:lang| is used on an element B to override a specification of |xml:lang| on an enclosing element A, without specifying another language. Within B, it is considered that there is no language information available, just as if |xml:lang| had not been specified on B or any of its ancestors.
> So I conclude that, without any outer context that pre-establishes a language, the following should be equivalent.
> <skos:prefLabel>Dog</skos:prefLabel>
> <skos:prefLabel xml:lang=””>Dog</skos:prefLabel>


But for other RDF syntaxes, it's maybe not so clear. And I'm not sure it's "so clear" even for the RDF/XML situation: digging this was painful. Whichever of the alternatives is right (a tag-less literal is equivalent to a literal with empty language tag, or not) an extra line in one of the RDF specs would be handy!

Best,

Antoine

[1] http://lists.w3.org/Archives/Public/public-esw-thes/2011Jun/0021.html

Received on Friday, 22 July 2011 07:28:12 UTC