Prev Up Next Index
Go backward to 6.3.3 Operators
Go up to 6.3 Data representation
Go forward to 6.4 Ancillary data

6.3.4 External Data Representation

Each of the base-type and type constructor variables has an external representation defined by the OPeNDAP data access protocol. This representation is used when an object of the given type is transferred from one computer to another. Defining a single external representation simplifies the translation of variables from one computer to another when those computers use different internal representations for those variable types.

The XDR data types corresponding to OPeNDAP base-type variables
 

Base Type XDR Type
Byte xdr byte
Int32 xdr long
UInt32 xdr unsigned long
Float64 xdr double
String xdr string
URL xdr string

Constraint expressions do not affect how a base-type variable is transmitted from a client to a server; they determine if a variable is to be transmitted. For constructor type variables, however, constraint expressions may be used to exclude portions of the variable. For example, if a constraint expression is used to select the first three of six fields in a structure, the last three fields of that structure are not transmitted by the server.

The data access protocol uses Sun Microsystems' XDR protocol[6] for the external representation of all of the base type variables. table 6.3.4 shows the XDR types used to represent the various base type variables.

In order to transmit constructor type variables, the data access protocol defines how the various base type variables, which comprise the constructor type variables, are transmitted. Any constructor type variable may be subject to a constraint expression which changes the amount of data transmitted for the variable (see Section 4.1 for more information about constraint expressions.). For each of the six constructor types these definitions are:

Array
An Array is sent using the xdr_array function. This means that an Array of 100 Int32s is sent as a single block of 100 xdr longs, not 100 separate xdr longs.
List
A List is sent as if it were an Array.
Structure
A Structure is sent by encoding each field in the order those fields are declared in the DDS and transmitting the resulting block of bytes.
Sequence
A Sequence is transmitted by encoding each item in the sequence as if it were a Structure, and sending each such structure after the other, in the order of their occurrence in the sequence. The entire sequence is sent, subject to the constraint expression. In other words, if no constraint expression is supplied then the entire sequence is sent. However, if a constraint expression is given all the records in the sequence that satisfy the expression are sent19.
Grid
A Grid is encoded as if it were a Structure (one component after the other, in the order of their declaration).

The external data representation used by an OPeNDAP server and client may be compressed, depending on the configuration of the respective machines. The compression is done using the gzip  program. Only the data transmission itself will be affected by this; the transmission of the ancillary data is not compressed.  


Tom Sgouros, August 25, 2004

Prev Up Next