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 16:06:24 +0000
Cc: SPARQL Working Group <public-rdf-dawg@w3.org>
Message-Id: <C4BF844F-3A12-499C-B342-29AB84363AB6@garlik.com>
To: Andy Seaborne <andy.seaborne@epimorphics.com>
On 2011-10-31, at 15:39, Steve Harris wrote:
> Even without REPLACE on arbitrary literals you can do STRDT(REPLACE(STR(?x), "2", "A"), DATATYPE(?x)) if you're so inclined.

Actually, that would mangle language tagged literals in a very unfortunate way in RDF 1.1, so it would have to be something like:

IF(LANG(?x),
   STRLANG(REPLACE(STR(?x), "2", "A"), LANG(?x)),
   IF(DATATYPE(?x) == xsd:string,
      REPLACE(STR(?x), "2", "A"),
      STRDT(REPLACE(STR(?x), "2", "A"), DATATYPE(?x))))

That will be hard for optimisers to spot reliably, so Option 3 is looking a bit more tempting.

I imagine most systems could process REPLACE(123, "2", "A") -> "1A3"^^xsd:integer more efficiently the the thing above.
 
- 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 16:07:05 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 16:15:47 GMT