W3C home > Mailing lists > Public > public-rdf-dawg@w3.org > July to September 2010

Re: isNumeric

From: Steve Harris <steve.harris@garlik.com>
Date: Tue, 28 Sep 2010 10:06:33 +0100
Cc: public-rdf-dawg@w3.org
Message-Id: <9CB8E6CF-92C8-47E0-9052-5B19DC92C9D5@garlik.com>
To: Andy Seaborne <andy.seaborne@epimorphics.com>
On 2010-09-27, at 22:11, Andy Seaborne wrote:

> Trying to write isNumeric() in terms of existing operations:
> 
> 1/ Only equivalent for XSD numerics.
> 
> datatype(?x) IN (xsd:decimal, xsd:integer, xsd;double,
>                 xsd;float, xsd:int, xsd:short ...,
>                 xsd:nonNegativeInteger ... xsd:unsignedByte ...)
> 
> The list is quite long.
> 
> 2/ Using COALESCE to catch an error: The IF is a way of changing the return from the addition (we don't care about) to boolean
> 
> COALESCE(IF(?x+0, true, "doesnotmatter"), false)
> 
> 3/ Using || to catch an error
> 
> !( sameterm(?x+0,<uri>) || true )
> 
> 
> It seems reasonable to me to add isNumeric.

Agreed.

- 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 Tuesday, 28 September 2010 09:07:07 GMT

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