Developer Documentation Library > Data Model > Accessing the UNICOM Intelligence Data Model > Working with the Case Data Model > Connecting to the UNICOM Intelligence Data Model > Version expressions
 
Version expressions
When you open an MDM Document a metadata (.mdd) file, you can specify the version or versions you want to use. This topic describes the syntax that you use to specify the version or versions. This syntax applies to the second parameter of the MDM Document.Open method as well as to the MR Init MDM Version connection properties.
You can specify a single version using its name. Version names are made up of a combination of the major version and minor version numbers in the form Major#:Minor#, where Major# is the number of the major version and Minor# is the number of the minor version. Changes in the major version number indicate that the structure of the case data has changed (for example, variables or categories have been added or deleted) whereas changes in the minor version number indicate that the changes affect the metadata only (for example, a question text has been changed). Version names are created automatically when a version is locked. A version that has not been locked is always called LATEST.
You can open the latest minor version that belongs to a specified major version by entering the major version number followed by a colon. For example, if there are minor versions 2:1, 2:2, and 2:3, specifying 2: will open minor version 2:3.
You can use an expression to open a superset (sometimes called a superversion) of two or more versions. The order in which you specify the versions determines the order of precedence that is used when there is a conflict between versions. (The rightmost versions in the expression take precedence over the leftmost.) For example, if a category label differs in the versions you select, the text in the version with the highest precedence will be used. However the order of questions and categories is always taken from the most recent version and there is special handling of changes to loop definition ranges and the minimum and maximum values of variables between the versions, similar to that described for the Metadata Model Version Utility in the master version in a merge operation.
Syntax
The version expression syntax is:
{<version> (, <version>)*}
<version>::= VersionName | [^] [VersionName] .. [VersionName]
Parameter
VersionName
The name of a major or minor version and ^ indicates that the following range is to be excluded.
You can specify the name of versions that do not exist in a range. MDM will then automatically use the next highest or lowest name it encounters, depending on whether the name is specified at the start or end of the range and whether the range is in ascending or descending sequence.
Examples
{..}
Include all versions in the MDM Document. If there are no versions, this selects the unversioned Document.
{2, 3, 7}
Include versions 2, 3, and 7 and give highest precedence to version 7, the next highest precedence to version 3, and the lowest precedence to version 2.
{5..1}
Include versions 5 through 1, giving the highest precedence to version 1.
{2..7,9}
Include versions 2 through 7 and version 9.
{2..11,^3:1..5:4}
Include versions 2 through 11 but exclude versions 3:1 to 5:4 inclusive.
{}
Include the most recent version in the MDM Document.
{LATEST}
Select the most recent version in the versions collection, whether or not it is named LATEST. If there are no versions, this selects the unversioned document.
{LASTLOCKED}
Include the most recent locked version in the MDM Document.
EBNF definition
The syntax for specifying the version or versions to open can be specified using the following Extended Backus-Naur Form (EBNF), which is a notation for specifying the syntax of a language succinctly and precisely:
<versionname> ::= <version> | (<vername>:) | <range>
<range> ::= { <range_item>(, <range_item>)* }
<range_item>::= [^]((<version>[..])|([<version>]..[<version>]))
<version> ::= (<vername>[:<vername>]) | LATEST | LASTLOCKED
<vername> ::= Any positive integer value
See also
Connecting to case data with and without metadata