[tmql-wg] Proposed requirements: Operations on primitive types

Dmitry dmitryv@cogeco.ca
Mon, 21 Jul 2003 19:41:39 -0400

From: "Lars Marius Garshol"
To: <tmql-wg@isotopicmaps.org>
Sent: Monday, July 21, 2003 10:33 AM
Subject: [tmql-wg] Proposed requirements: Operations on primitive types

> One issue we have not discussed so far is to what extent we should
> support primitive types and operations on them. That is, should a
> query be allowed to interpret internal occurrences as containing
> numbers? Dates?

I personally think that it is very important for real scenarios. I really
like the way it is done in XPath 2.0.

1) for literals it is possible to use constructors: xs:date('1993-08-01')
2) dynamic type converters such as:  number(price), date(birthdate)
3) 'instance of' operator which allows to verify that operand is of specific

> And, if we support this, should we also support operations on these
> values? That is, basic arithmetic functions on numbers like plus,
> minus, multiplication, etc? String operations like those of XPath?
> Date functions? Regular expressions?

I think that, again, XPath 2.0 provides a good example of demarcation line
in terms of number of implemented operators and functions.