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

On 10/31/2011 10:26 AM, Steve Harris wrote:
> On 2011-10-31, at 13:41, Andy Seaborne wrote:
>
>> I've put in text for STRBEFORE, STRAFTER and REPLACE, removed SHA224, and done some tidying up in the area.
>>
>> See
>> http://www.w3.org/2009/sparql/docs/query-1.1/rq25.xml#func-strings
>> and onwards.
>>
>>
>>
>> One issue arises:
>>
>> REGEX currently takes a simple literal only for the first argument.
>>
>> For RDF 1.1 preparation, this should change to xsd:string or simple literal.
>>
>>
>> REPLACE is like REGEX except it makes replacements.
>>
>> What should the first argument to REPLACE be?
>>
>> I'm assuming the pattern replacement and flags are still simple literals (or + xsd:strings for RDF 1.1).
>>
>> Like REGEX only working on plain strings.
>> Or also process language tagged literals?
>>   (c.f. STRBEFORE and STRAFTER)
>>
>> I'd like REGEX and REPLACE to align.
>>
>> 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.

I prefer option 2 or option 1. I understand the motivation for option 3, 
but in general we've shied away from that sort of automatic casting in 
SPARQL, and I believe we ought to continue that way.

Lee

>
> - Steve
>

Received on Tuesday, 1 November 2011 14:31:13 UTC