Scripting > mrScriptMetadata User's Guide > mrScriptMetadata reference > Namespacing
 
Namespacing
The UNICOM Intelligence Data Model automatically creates full names for items that are contained within other items. The full names are used by the UNICOM Intelligence Data Model and the only time you might specify a full name when you are writing mrScriptMetadata code is when you define an expression for a derived variable.
To understand how full names work, think of the items in terms of parents and children. For example, categories can be considered children of the category list of which they are part, and questions nested inside a loop can be considered children of the parent loop.
The UNICOM Intelligence Data Model generally combines the names of the child item with its parent items (if any) to create the full name. A single period (.) is used to indicate a parent-child relationship. For example, by default a question called Plnview in a compound called Plans has the full name Plans.Plnview.
The full names of the questions in a loop include [] (brackets) to indicate that the question is asked each time the loop is iterated. For example, a question called Color in a loop called Vehicle has the full name Vehicle[..].Color.
However, note the following:
Compounds: You can optionally use the nonamespace keyword to specify that the name of the parent compound should be excluded from the full names of the questions nested inside. For example, if you used the nonamespace keyword on the compound described above, the full name of the Plnview question would be Plnview rather than Plans.Plnview.
Blocks: It is not possible to specify that the name of the parent block should be excluded from the full names of the questions nested inside. This might be a feature of a future version of UNICOM Intelligence.
Categories: By default, the name of the parent list is excluded from category full names. (This is the opposite of the behavior in compounds and blocks.) However, you can use the namespace keyword to specify that the name of the parent list is to be included in the full names of the child categories. This is useful when you are creating a question that combines category lists that contain categories that have the same name, because using the namespace option makes the full names of the categories unique and you would get an error if there were any duplicate category full names in the question. See Categorical for more information.
The nonamespace keyword is not available on loops because, unlike compounds, loops define a true hierarchical structure. Navigating the hierarchical structure would not be possible if the full names of the items nested within the loop did not include the parent names. (Compounds merely group questions, either for display in the questionnaire or for convenience.)
See
mrScriptMetadata reference