Developer Documentation Library > Scripting > mrScriptMetadata User’s Guide > mrScriptMetadata reference
 
mrScriptMetadata reference
mrScriptMetadata provides a fast and easy way of creating metadata using a script. You define metadata in mrScriptMetadata by adding new field entries to the Metadata section of either an Interview Script (.mdd) file or a Data Management Script (.dms) file. Each field entry corresponds to a question, defined list, information item, loop, grid, compound, block, or page.
This reference section also contains general information about mrScriptMetadata, such as how to define question texts for multiple languages, how to change the appearance of a field, how to add comments to a mrScriptMetadata script, and so on. For more information, see Sections.
See also Syntax conventions.
Metadata section: Syntax
The metadata section is defined in the script using the Metadata keyword as follows:
Metadata ( [Language] [, [Context] [, [LabelType] [, [DataSource] ]]]
[ (, <parameter-name> = <value> )* ] )
<field> (; <field> )* [;]
End Metadata
Metadata must be the first word on the line (leading spaces are ignored).
Positional parameters
Positional parameters must be specified in this order:
Language
Defines the current language for the metadata. Must be a recognized language code. For details of recognized language codes, see Language codes.
Context
Defines the current user context for the metadata. User contexts define different usages for the metadata, so that different texts and custom properties can be used depending on how the metadata is being used. For example, the Question user context is typically used to define the default texts to be used when interviewing and the Analysis user context is typically used to define shorter texts for use when analyzing the response data. For details of recognized user contexts, see Contexts and label types.
LabelType
Defines the current label type. Label types enable different types of labels to be created for different types of information. For example, the default label type of Label is used for question and category texts and variable descriptions, and the Instruction label type is used for interviewer instructions. For details of recognized label types, see Contexts and label types.
DataSource
This parameter, used only when the Metadata section is part of a Data Management Script (.dms) file, identifies the data source to which the Metadata section relates. You specify the data source using the name defined for the InputDataSource section in the Data Management Script.
Named parameters
Named parameters can be included in the Metadata definition after any positional parameters. The format of a named parameter is parameter-name = value. Multiple named parameters must be separated by commas.
The following named parameters are supported:
SystemVariables
Valid values: True or False.
Whether the UNICOM Intelligence System variables should be included in the metadata document. The default value is True. You might want to set this parameter to False if you are creating a metadata document (.mdd) file that will be used to read a Quantum-format ASCII file. For more information, see Creating a questionnaire definition file for a Quantum file.
<field>
Defines a question. For more information, see Field definitions.
Examples
The following metadata section from an Interview Script (.mdd) file has a default language of English (United States), a default user context of Question, and a default label type of Label.
Metadata (en-us, Question, label)
...
End Metadata
All texts and custom properties will be created in the default language, user context, and label type, unless you specify otherwise when you define them.
The following metadata section from an Interview Script (.mdd) file has a default language of German (Germany) and includes the SystemVariables named parameter.
Metadata (de-de, SystemVariables = False)
...
End Metadata
Sections
Topics
Description
mrScriptMetadata field types.
Rules and advice for defining names and labels in mrScriptMetadata.
How to define alternative question and category labels for different languages, user contexts, and label types.
How to define a question or category label so that additional text or information will appear in the label when the interview is run. For example, a label can include the answer to a previous question.
How to define custom properties for fields and for the metadata document. Custom properties store information that is not directly supported by the Metadata Model (MDM).
How to define the appearance of a field. For example, you can define the color, style, font, and size of the text in a question label.
How to add an axis expression to a question. Axis expressions are used by UNICOM Intelligence Reporter and the tables option in UNICOM Intelligence Professional.
How to define a question that has a special use. For example, a question might be used to store a weight or a filter that will be used in the analysis stage of a survey.
How to define a question that can be used to store the name of an image file or a sound file.
A description of the HTML5 input type as it relates to IStyle.Control.Type.
How to define image attributes, including alternate text, width, and height.
A description of how questions within loops, grids, compounds, blocks, and pages are named and how to change the default naming convention.
A description of how questions within loops, grids, compounds, blocks, and pages can refer to other questions in the document.
How to add comments to an mrScriptMetadata script.
How to change the informational messages, error messages, navigation button labels, and special response labels that are displayed when an interview is run.
How to add keycodes to an mrScriptMetadata script.
A list of the languages that can be specified when defining a metadata section or an alternative label.
A list of the user contexts and label types that can be specified when defining a metadata section or an alternative label.
A list of all the keywords used in the mrScriptMetadata language.
A list of the Metadata Model (MDM) objects that are created for each type of mrScriptMetadata field.
A definition of the syntax of mrScriptMetadata in Extended Backus-Naur Form (EBNF), which is a notation for specifying the syntax of a language succinctly and precisely.
Frequently Asked Questions about mrScriptMetadata.
See
mrScriptMetadata reference