Prev Up Next Index
Go backward to Simple Constraint Expression Examples
Go up to 4.1 Selecting Data: Using Constraint Expressions
Go forward to 4.1.3 Using Functions in a Constraint Expression

4.1.2 Operators, Special Functions, and Data Types

The data types accessible through the OPeNDAP software are listed and described in Section 6.3. It is advisable to be familiar with these types before trying to construct complex constraint expressions.

The constraint expression syntax defines a number of operators for each data type. These operators are listed in table 4.1.2

Except for the * operation defined on the URL data type, all the operators defined for the scalar base types are boolean operators whose result depends on the specified comparison between its arguments. Refer to Section 4.1.4 for a description of the URL data type and its operator.

The ~= operator returns true when the character string on the left of the operator matches the regular expression on the right. See Section 4.1.5 for a discussion of regular expressions.

The Structure, Sequence, and Grid data types are each composed of a collection of simpler data types. The . and operators allow a user to refer to the subsidiary variables within these compound types. For example, station.year indicates the value of the year member of the station sequence.

The array operator [] is used to subsample the given array. See here for an explanation and example of its use.

Constraint Expression Operators.
 

Class Operators
Simple Types
Byte, Int32, UInt32, Float64 < > = != <= >=
String = != ~=
URL *
Compound Types
Array [start:stop] [start:stride:stop]
List length(list), nth(list,n), member(list,elem)
Structure .
Sequence .
Grid [start:stop] [start:stride:stop] .

There are three special functions defined to operate on the List data type. The length() function returns the number of elements in the given list, the nth()  function returns the list element indicated by the input index, and the member()  function, which returns true if the given value equals any member of the list. Note that the behavior of the nth() function is undefined for indices beyond the range of the list.
Tom Sgouros, August 25, 2004

Prev Up Next