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

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 UTC