3. Data Description
A container is a variable whose value is a data object of general character and arbitrary size (In Version 0/9, size is restricted. See section 3.4). Examples of containers which are implemented in other systems are files, records, fields, groups, and entries.
The container is distinct from the data in the container. For example, space allocation is an operation on a container, while changing the unit price field from 25 to 50 is an operation on data in a container.
A container may enclose other containers. When a container is not enclosed by another container, it is said to be outermost. If container A encloses container B, and no other container in A also encloses B, then A immediately encloses B.
A Datalanguage description is a statement of the properties of a container.
All containers have the attributes ident and type. Ident is a character string by which users refer to the container. Type determines the form of the container's value; the value can be elementary, or it can consist of other containers. There are 3 types: LIST, STRUCT, and STRING(***). A LIST contains a group of containers having the same description. A STRUCT contains a group of containers, each of which has its own description. A STRING is a sequence of ASCII characters. While a STRING is not really an elementary item, it is handled as one in Version 0/9.
Certain containers can have other attributes. An outermost container has a function. The function attribute specifies whether the container is to be used for storage or for transmission.
Size is some meaningful dimension of the container, which is type-dependent. It is used for space allocation and data stream parsing.
An aggregate container (i.e., one that contains other containers) has as an attribute the description or descriptions of its components. Thus if S is a STRUCT containing A, B, and C, then the descriptions of A, B, and C are attributes of S.
A STRING defined in certain contexts can have an inversion attribute. This is an access property that is not really local to the STRING, but is associated with it for convenience.
3.1 Ident
The ident of a container is composed of alphanumeric characters, the first of which is alphabetic. It may not consist of more than 100 characters.
The elements of a STRUCT must have idents unique in the STRUCT.
3.2 Function
The function of a container is either FILE, PORT, or TEMPORARY PORT. When the function is FILE, then the container is used for storage of data at the Datacomputer. When the function is PORT, then the container is used for transmission of data into or out of the Datacomputer. When the function is TEMPORARY PORT (which may be abbreviated TEMP PORT), the container behaves like a PORT; however, its description is not retained in the Datacomputer beyond the session in which it is created.
3.3 Type
Type is one of: LIST, STRUCT, or STRING. These are defined on the preceding page.
In an occurrence of a STRUCT, the elements appear in the order in which their descriptions appear in the STRUCT description. All elements are present in each occurrence of the STRUCT.
An element of a STRUCT or LIST can be a container of any datatype. However, the outermost container must be a LIST(***).
3.4 Size
The size of a STRING is the number of characters in it. The size of a STRUCT is not defined (***). The meaning of the size of a LIST depends upon other properties of the LIST (***).
Ordinarily, the size of a LIST is the number of LIST-members. An exception is the case of the outermost-LIST. In an outermost-LIST with a function of FILE, the size is the number of LIST-members for which space should be allocated. When no size is present in this case, the system computes a default. In an outermost-LIST with a function of PORT, the size is ignored (***).
Only outermost containers may be larger than a TENEX page (2560 ASCII characters)(***).
3.5 Inversion
An inversion is an auxiliary data structure used to facilitate retrieval by content.
Its basic application is the fast retrieval of sets of outermost-LIST-members (this can be extended to other container sets, and will be after release 1). Consider a list of weather observations, stored as a file on the Datacomputer. If quick retrieval of observations by COUNTRY is desired, then this is indicated in the description of the COUNTRY container. According to common usage in information retrieval, this makes COUNTRY a key in the retrieval of observations.
Note that the inversion option only affects the efficiency of retrieval by COUNTRY, not the ability to retrieve by COUNTRY.
There are restrictions on use of the inversion option. First, it can be applied only to STRINGs. Second a STRING having the inversion option must occur only once in each outermost-LIST-member. Third, it is ignored when applied to STRINGs in PORT descriptions.
Eventually there will be several types of inversion option; in Version 0/9 there is only the 'D' option (for distinct).
3.6 Syntax
The description is simply an enumeration of properties; these properties are specified in the order:
<ident> <function> <type> <size> <other>
Properties which do not apply are omitted. An example:
F FILE LIST (25) A STR (10)
Here 'F' is the <ident>, 'FILE' is the <function>, 'LIST' is the <type>, '(25)' is the size, and 'A STR (10)' is the <other> of one description. Of course, 'A STR (10)' is itself another description: the description for members of the LIST named F.
An example of a complete description for a file of weather observations keyed on location:
WEATHER FILE LIST
OBSERVATION STRUCT
LOCATION STRUCT
CITY STR (10), I=D
COUNTRY STR (10), I=D
END
TIME STRUCT
YEAR STR (2)
DAY STR (3)
HOUR STR (2)
END
DATE STRUCT
TEMPERATURE STR (3)
RAINFALL STR (3)
HUMIDITY STR (2)
END
END
The ENDs are needed to delimit the list of elements of a STRUCT. , I=D indicates that the string is to be an inversion key for the retrieval of outermost-LIST-members.