Types can be simple, complex or undefined:
Type expressions for simple types:
Syntax Description Examples typeSimple type floatProperty contains a floating point value
(type1|type2)Type union (float|int)Property contains a floating point or integer value
(type1,type2)Type sequence Note: Type sequences must not directly or indirectly contain a complex type.
(NMTOKEN|int)Property contains a name token followed by an integer value
{value1,value2,...}Type restriction by enumeration. Only the listed values are allowed for the property. Note: Enumeration values that contain syntactical characters are enclosed in single or double quotes.
int{1,2,3}Property contains one of the listed integers.
{I,II,III}Property contains one of the listed values of undefined type.
type(param1=value1, param2=value2, ..., @att1=attVal1, ...)type(param1,param2, ..., @att1=attVal1, ...)Type parameters and attributes. Type parameters depend on the type system used (e.g. restricting facets in XML Schema or length specification in SQL) Type attributes are identified by names starting with the 'at'-character(@). They must specify a single string value. Type attributes should be written at the very end of a type parameter expression. Type attribute names must be unique within the scope of a typed property.
Note: Parameter values that contain syntactical characters are enclosed in single or double quotes.
decimal(fractionDigits=2)Property contains decimal values with two fractional digits.
varchar(25)Property contains up to 25 characters.
float(@unit=inch) typetype@assetUnqualified type reference. Refers to a type declaration. Qualified type reference. Must be used when the unqualified type reference is not unique. Should be used when the type reference is not local (within the same asset).
numericnumeric@businessTypesTypes, type sequences, and type unions can be postfixed with a modifier.
Syntax Description Example ?Optional type (used in sequences) (NMTOKEN?,int)Property contains an integer which can optionally be prefixed with a name token.
+List extension of type with at least one occurrence (NMTOKEN,int+)Property contains a name token which is followed by at least one integer.
*Optional list extension of type (NMTOKEN,int*)Property contains a name token which may be followed by integers.
[n..m]List extension of type with at least n occurrence and at most m occurrences (NMTOKEN,int[2:4])Property contains a name token followed by 2-4 integers.
Modifiers must be used in such a way that the resulting type expressing disallows the empty string. For example,
float?or(NMTOKEN | float?)is invalid while(NMTOKEN, float?)is valid.
Type expressions for complex types:
Note: Complex types cannot be used in type sequences.
Syntax Description Examples typeComplex type personProperty contains a structure as defined in asset person
(type1|type2)Type union (person|company)Property contains either a structure as defined in asset person or a structure as defined in asset company
Syntax Examples !name expression !numeric (float|int) !dec2 decimal(fractionDigits=2)
Example for simple type usage
|
Example for complex type usage
|
The type syntax for complex types is only an abbreviation for inheritance relation. Please note that this equivalence holds only if the type asset and its superassets do not connect to other assets via arcs except inheritance arcs.
Type syntax
|
Equivalent syntax
|
Type syntax for union type
|
Equivalent syntax
|
| Home | Definition | Step-by-Step | Examples | Downloads |
Contact: info@aoModeling.org