Re: Details of string operations

On 05/12/10 15:47, Steve Harris wrote:
>>> CONCAT(plain, anything) ->  plain
>>> >>  CONCAT(string, string) ->  string
>> >
>> >  CONCAT(simple, anything) ->  anything
> But if CONCAT(plain, string) gives plain, you don't need that case, it falls out naturally as "simple" literals are a subset of plain.


For me, it's whether the result follows the data or the query form and 
I'd rather it followed the data.  Not following the form of the data 
seems to more inconsistent and inconvenient.

CONCAT(?var1, " ->  ", ?var2)

where ?var1 and ?var2 are
   xsd:string -> xsd:string,
   simple ->  simple
   plain+lang -> when same lang tag, plain+lang

This allows people working with data using xsd:string to write unadorned 
" ->  ", and mixed data, on different solutions, keeps the form of the 
solution where it can.  If the app wants to pick a form, it can add a 
cast/STR/STRLANG.

Forcing use of xsd:string means that the expression is forced by the 
form of the constant, not the type of ?var1/?var2.  That can be achieved 
in the query by casting the result or using " ->  "^^xsd:string

	Andy

Received on Sunday, 5 December 2010 18:04:46 UTC