Each controlled value class defined in an OPM schema has a distinct class name, and is either of string type or numeric type. A controlled value class can be associated with an optional default value, an optional class description, and an optional list of domain-specific properties. Domain-specific properties are specified as tag-value pairs and are interpreted by application (e.g., front-end) software.
A string type controlled value class consists of a set of enumerated atomic values, which are strings. If a default value is specified, then the default value must be one of the enumerated atomic values. For example, a string type controlled value class PROJECT_TYPE is defined as
CONTROLLED VALUE CLASS PROJECT_TYPE
{ "overlap", "homologs", "single", "nonoverlap", "unknown" }
DEFAULT: "unknown"
Each string type controlled value can be associated with
a code associated with a data type for this code.
Data type for code can be numeric type like:
INTEGER, SMALLINT, TINYINT,
REAL, FLOAT, DECIMAL and NUMERIC,
or character string type like: CHAR and VARCHAR.
(The default type is: INTEGER.)
A code can consist of alphanumeric characters and special symbols
(. : + - * /
! =).
Each controlled value can also have a value description. For example, controlled value class PROJECT_TYPE mentioned above can be also defined as:
CONTROLLED VALUE CLASS PROJECT_TYPE
{ ("overlap", 1, "overlap project"),
("homologs", 2, "homologs project"),
("single", 3, "single project"),
("nonoverlap", 4, "non-overlap project") }
("unknown", 0, "unknown project type"),
DEFAULT: "unknown"
CODE_TYPE: SMALLINT
DESCRIPTION: "project type"
A numeric type controlled value class consists of a set of ranges, where each range is either a number or an interval defined by a lower and an upper bound. For example, a numeric type controlled value class INTERVALS can be defined as as { 5-20, 30, 40-60 }. If a default value is specified, then the default value must be within ranges defined for this controlled value class. Numeric type controlled values or ranges can have value descriptions, but cannot be associated with codes.
<controlled value class> ::= <controlled value class name> { <enum-constant> }
<class default> <code type>
<class description>
<class example>
<domain-specific properties>
| <controlled value class name> { <ranges> }
<class default> <code type>
<class description>
<class example>
<domain-specific properties>
;
<controlled value class name> ::= <class name>
;
<enum-constant> ::= <constant_code_desc>
| <enum-constant> , <constant_code_desc>
;
<constant_code_desc> ::= <constant>
| ( <constant>, <code> )
| ( <constant> , <value description> )
| ( <constant> , <code> , <value description> )
;
<value description> ::= " <text> "
;
<code> ::= /* alphanumeric characters or special symbols : + - * / \ ! = . */
;
<ranges> ::= <range_desc>
| <ranges> , <range_desc>
;
<range_desc> ::= <range>
| ( <range> , <value description> )
;
<range> ::= <number>
| ( - <number> )
| <number> - <number>
| ( - <number> ) - <number>
| ( - <number> ) - ( - <number> )
;
<code type> ::= <null>
| CODE_TYPE ':' <code data type>
;
<code data type> ::= CHAR '(' <integer> ')'
| VARCHAR '(' <integer> ')'
| INTEGER
| SMALLINT
| TINYINT
| REAL
| FLOAT | FLOAT ( <integer> )
| DECIMAL | DECIMAL '(' <integer> ')'
| DECIMAL '(' ( <integer> ',' <integer> ')'
| NUMERIC | NUMERIC '(' <integer> ')'
| NUMERIC '(' ( <integer> ',' <integer> ')'
;