Re: isNumeric

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 UTC