W3C home > Mailing lists > Public > public-rdf-wg@w3.org > May 2011

Re: Action-48 text: a New Plan for plain literals

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Tue, 24 May 2011 10:01:17 +0100
Message-ID: <4DDB73DD.8070308@epimorphics.com>
To: Pat Hayes <phayes@ihmc.us>
CC: public-rdf-wg@w3.org


On 24/05/11 02:29, Pat Hayes wrote:
>
> On May 23, 2011, at 3:48 PM, Andy Seaborne wrote:
>
>>
>>
>> On 23/05/11 04:01, Pat Hayes wrote:
>>> The proposal outlined in the wiki here
>>>
>>> http://www.w3.org/2011/rdf-wg/wiki/StringLiterals/LanguageTaggedLiteralDatatypeProposal
>>>
>>>
>>>
completes Richard and my action item 48 from the last telecon.
>>>
>>> Pat
>>
>> -0
>>
>> I'm not sure this provides sufficient benefit - tagged literals
>> exist and applications have to (and want to) deal with them.
>
> True, but I don't quite see your point.
>
>>
>> It does mean you can write "rdfs:range rdf:LanguageTaggedString" ;
>> it's hard to say "rdfs:range<a string, which might be tagged>" (I
>> suppose rdf:PlainLiteral would capture that
>
> Yes, exactly, that is the intention. rdf:PlainLIteral is any plain
> literal, which means now xsd:string literals and lang tagged
> literals; and rdf:LTL is just the lang tagged literals. And just the
> untagged ones is xsd:string, of course. rdf:PlainLIteral is the
> (disjoint) union of xsd:string and rdf:LTL.
>
>> ).
>>
>> So taking Ivan's FOAF file:
>>
>> <foaf:name xml:lang="hu">Herman Iván</foaf:name> <foaf:name>Ivan
>> Herman</foaf:name>
>>
>> It does have a cost which is the deployed code that assumes
>> literals have a language tag or a datatype.
>
> Well, that has to now be understood as either a lang tag or a
> datatype **other than rdf:LanguageTaggedLiteral**. As nobody has
> previously written code that mentioned  this datatype, I don't think
> this is likely to cause any serious problems. And notice, the
> proposal keeps the present written form of all RDF string literals in
> all RDF surface syntaxes.

Existing code might well assume that if literal has a datatype, then it 
does not have a language tag.  Code works on the stored form - the 
abstract syntax.

To quote Steve's example (13/May)

> More concerning is code like:
>
> Literal(String lexicalValue, Resource lang_or_dt)
> {
> 	if (typeof(lang_or_dt) == Literal) {
> 		/* it has a language tag */
> 	} else if (typeof(lang_or_dt) == URI) {
> 		/* it has a datatype */
> 	} else {
> 		/* it has neither */
> 	}
> }
>
> We have a lot of such code.
>
> It /might/ all come out in the wash, but it's going to need some care.

now swap the test and the situation is the same (RDF 1.0) and misses the 
language (RDF 1.1):

	if (typeof(lang_or_dt) == URI) {
  		/* it has a datatype */
	} else if (typeof(lang_or_dt) == Literal) {
		/* it has a language tag */



Of course, we might now end up with a new abstraction - the post-parse 
abstract graph.

	Andy
Received on Tuesday, 24 May 2011 09:01:51 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:25:43 GMT