W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > October to December 2011

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

From: Steve Harris <steve.harris@garlik.com>
Date: Mon, 31 Oct 2011 15:39:22 +0000
Cc: SPARQL Working Group <public-rdf-dawg@w3.org>
Message-Id: <45C4A718-9860-44A8-B43A-D5C5C14FDBCF@garlik.com>
To: Andy Seaborne <andy.seaborne@epimorphics.com>
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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 15:01:05 UTC