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

Re: isNumeric

From: Andy Seaborne <andy.seaborne@epimorphics.com>
Date: Mon, 27 Sep 2010 22:11:21 +0100
Message-ID: <4CA10879.60605@epimorphics.com>
To: public-rdf-dawg@w3.org
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.

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

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