Re: example of options 3 & 4 simplifying code (ACTION-86)

Sandro,

I could now point out how that code is more complicated than the equivalent option 2 code and consider your simplicity argument refuted.

But it just strikes me as remarkable that you seriously put forward the potential saving of two lines of code in the *implementation* (not even interface) of *one class* as an argument for changing a W3C Recommendation.

Also, your proposal seems to be motivated by a desire to reduce the total number of distinct parts in a literal from three to two. Why not go further and reduce them to one? Surely that would be superior to your proposal by your own metric?

Also, "foo"@en and "foo"@EN and "foo"@eN are all the same literal in Turtle, SPARQL and N-Triples. Would "foo"^^rdfl:en, "foo"^^rdfl:EN and "foo"^^rdfl:eN be the same or different in your proposal?

Also, this:
http://lists.w3.org/Archives/Public/public-rdf-wg/2011May/0425.html

Best,
Richard


On 8 Sep 2011, at 14:13, Sandro Hawke wrote:

> On Thu, 2011-09-08 at 10:12 +0200, Richard Cyganiak wrote:
>> On 7 Sep 2011, at 19:34, Sandro Hawke wrote:
>>> I argued in todays meeting, off the cuff, that option 2 (in Pat's
>>> email [1]) offers only aesthetic improvements, while options 3 and 4
>>> will result in simpler code.  
>> 
>> Please provide some example code for:
>> 
>> Option 3:
>> 
>> - checking whether a literal is a string
> 
> LANG = "http://www.w3.org/ns/lang/"
> XS = "http://www.w3.org/2001/XMLSchema" 
> 
> def is_string(node):
>   return is_literal(node) and (
>      node.datatype == XS+"string" or
>      node.datatype.startswith(LANG) )
> 
>> - returning the language tag of a language-tagged string
> 
> def lang_tag(node):
>   assert node.datatype.startswith(LANG) 
>   return node[len(LANG):]
> 
>> Option 4:
>> 
>> - returning the lexical form of a literal
> 
> node.lexrep
> 
> I agree this is a significant compatibility problem, since it will
> return chat@fr.
> 
>     -- Sandro
> 
>> Thanks,
>> Richard
>> 
> 
> 
> 

Received on Thursday, 8 September 2011 16:43:54 UTC