Re: rq25 updates (STRBEFORE, STRAFTER, REPLACE and more)

On 2011-10-31, at 14:59, Andy Seaborne wrote:

>>> Proposal 1:
>>> REGEX and REPLACE work on strings (simple literal or xsd:string) only.
>>> 
>>> Proposal 2:
>>> REGEX and REPLACE work on all string-like forms as first argument (includes literals with language tag).  This adds first argument literal with language tag to REGEX.
>> 
>> I prefer 2.
>> 
>> There's even an option:
>> 
>> Proposal 3:
>> REGEX and REPLACE work on all literal forms as first argument (includes literals with language tags and typed literals). This adds first argument literal with language tag or datatype to REGEX.
> >
> > Not sure if I prefer that to 2, but it is an option.
> 
> To check I understand : you mean a sort of "automatic STR of literals" applied to the main (first) arg of REGEX and REPLACE?
> 
> I need to think about 3 + REPLACE a bit more, but you can produce illegal lexical forms by simple string bashing -- it's quite hard to do that with strings themselves.  Some systems do not handle illegal lexical forms at all.
> 
> REPLACE(123, "2", "A") -> "1A3"^^xsd:integer ???

Sure, note I wasn't actually advocating it, but I can imagine users asking for it, and it being useful in some cases.

Systems have to (somehow) deal with "1A3"^^xsd:integer anyway, there's a number of ways it can occur.

Even without REPLACE on arbitrary literals you can do STRDT(REPLACE(STR(?x), "2", "A"), DATATYPE(?x)) if you're so inclined.

That could either be an argument for or against allowing it.

- Steve

-- 
Steve Harris, CTO, Garlik Limited
1-3 Halford Road, Richmond, TW10 6AW, UK
+44 20 8439 8203  http://www.garlik.com/
Registered in England and Wales 535 7233 VAT # 849 0517 11
Registered office: Thames House, Portsmouth Road, Esher, Surrey, KT10 9AD

Received on Monday, 31 October 2011 15:39:53 UTC