Re: isNumeric

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.

	Andy

Received on Monday, 27 September 2010 21:12:27 UTC