Declarative Objectivity (DO) Language : Attribute Structures
Attribute Structures
Attribute structures describe the attributes of a class within a federated database’s schema, and are building blocks within schema clauses.
 
To Specify Attributes For
See
Boolean, character, integer, real, and GUID values
String values
Date, time, datetime (timestamp), and interval values
References to persistent objects of a schema class (to-one relationships)
Objects that represent complex values embedded in other objects
Lists, maps, or sets (including to-many relationships to persistent objects of a schema class)
Note:Do not confuse attribute structures with attribute expressions. Attribute structures are for describing and defining the attributes of a schema class, whereas attribute expressions are for accessing values from persistent data.
About Attribute Structures
Attribute structures define and display the attributes of a class in the federated database’s schema. You specify attribute structures when creating class descriptions in a CREATE CLASS Clause. You can see attribute structures as part of the schema class descriptions returned by a SHOW CLASS Statement.
Syntax 

attributeStructure : attributeName ':' attributeBody;
attributeBody : logicalType | (logicalType '{' setting (',' setting)* '}' );
setting : settingKeyword ':' (settingOption | attributeBody);
Discussion 
In general, an attribute structure includes:
The name of the attribute, which must be unique within the enclosing schema class. See Names for details about well-formed attribute names.
A keyword indicating the attribute’s logical type, such as Boolean or String. The logical type can be thought of as the simple meaning or interpretation of a set of values, abstracted away from how those values are encoded and stored.
One or more settings that specify the detailed characteristics about values of the logical type.
Example. The following attribute structure describes an attribute called lastName of logical type String, with two settings (Encoding and Storage) that determine the character encoding and length of the string values that the attribute can hold:
firstName: String {
  Encoding: Utf32,
  Storage: Variable
}
Syntax for Settings
Settings are enclosed within curly braces. Multiple settings are separated by commas. When defining an attribute, you can specify the settings in any order.
Most settings specify one of several predefined options. The available options vary depending on the setting and the logical type.
Example. In an attribute structure with the logical type String, the Encoding setting could be set to Byte, Utf8, Utf16, or Utf32. In an attribute structure with the logical type Integer, the Encoding setting could be set to Signed or Unsigned.
Settings with predefined options generally have a default option. When defining an attribute, you can omit the setting if you want the default option.
Example. The following two attribute structures are equivalent. The attribute structure for firstName explicitly describes a string attribute that specifies the default options for both the Encoding and Storage settings. The attribute structure for lastName omits the default settings:
firstName: String {
  Encoding: Utf8,
  Storage: Variable
}
 
lastName: String
Some settings do not have predefined options, but instead specify the name of a class or another attribute.
Example. The following attribute structure describes a reference attribute called atStall, which holds references to persistent objects of the FleetData.Stall schema class.
atStall: Reference {
  Referenced: FleetData.Stall
}
The Element and Key settings for collection attributes specify entire data types. These settings use the same logical type and settings that are defined for attributes.
Example. The following attribute structure describes a reference attribute called servRecs, which will hold lists of UTF-32 variable-length strings. Notice that the Element setting uses the same logical type and settings that are available for string attributes:
servRecs: List {
  Element: String {
    Encoding: Utf32,
    Storage: Variable
  }
}