Prev Up Next Index
Go backward to 6.3 Data representation
Go up to 6.3 Data representation
Go forward to 6.3.2 Constructor Types

6.3.1 Base Types

The OPeNDAP data model uses the concepts of variables and operators. Each data set is defined by a set of one or more variables, and each variable is defined by a set of attributes. A variable's attributes--such as units, name and type--must not be confused with the data value (or values) that may be represented by that variable. A variable called time may contain an integer number of minutes, but it does not contain a particular number of minutes until a context, such as a specific event recorded in a data set, is provided. Each variable may further be the object of an operator that defines a subset of the available data set. This is detailed in Section 6.3.3.

Variables in the OPeNDAP DAP have two forms. They are either base types or type constructors. Base type variables are similar to predefined variables in procedural programming languages like C or Fortran (such as int or integer*4). While these certainly have an internal structure, it is not possible to access parts of that structure using the DAP. Base type variables in the DAP have two predefined attributes (or characteristics): name, and type. They are defined as follows:

Name
A unique identifier that can be used to reference the part of the dataset associated with this variable.
Type
The data type contained by the variable. This can be one of Byte, Int32, UInt32, Float64, String, and URL. Where:
Byte
is a single byte of data. This is the same as unsigned char in ANSI C.
Int32
is a 32 bit two's complement integer--it is synonymous with long in ANSI C when that type is implemented as 32 bits.
UInt32
is a 32 bit unsigned integer.
Float64
is the IEEE 64 bit floating point data type.
String
is a sequence of bytes terminated by a null character.
Url
is a string containing an OPeNDAP URL. Please refer to Section 2.1 for more information about these strings. A special * operator is defined for a URL. If the variable my-url is defined as a URL data type, then my-url indicates the string spelling out the URL, and *my-url indicates the data specified by the URL.

The declaration in a DDS of a variable of any of the base types is simply the type of the variable, followed by its name, and a semicolon. For example, to declare a month variable to be a 32-bit integer, one would type:

Int32 month;

Tom Sgouros, August 25, 2004

Prev Up Next