Developer Documentation Library > Data Model > Extending the UNICOM Intelligence Data Model > Working with the Alias Map component
 
Working with the Alias Map component
The Alias Map component is used to convert text to unique names that meet certain criteria, such as a maximum length of eight characters or a restricted character set. When necessary, the component can also create multiple unique names from each input text. The input text is assumed to be double-byte encoded Unicode and the output names are called aliases, or subaliases when multiple unique names are created from an input text.
The Metadata Model (MDM) supports the storage of alias and subalias names so that they can be permanently linked to their related MDM object. For more information, see Creating the Aliases Visual Basic sample. However, the Alias Map component can be used independently of this feature.
When you export UNICOM Intelligence data to IBM SPSS Statistics, the Alias Map component is used to create the names for the IBM SPSS Statistics variables from the FullNames of the Data Model VariableInstance objects. This is because VariableInstance FullNames might not be valid in IBM SPSS Statistics. For example, IBM SPSS Statistics variable names must start with a letter or one of the characters @, #, or $, and be no more than 64 bytes long. In addition, more than one IBM SPSS Statistics variable is created for a single VariableInstance object that is a multiple-response categorical, and so multiple aliases need to be created from the VariableInstance FullName. The alias and subalias names are stored in the MDM Document, so that it can reconnect to the .sav file using the same mappings.
The Alias Map component applies replacement rules based on regular expression matches, such as "replace all characters not in [A-Za-z] with underscores (_), and then add a serial number to prevent duplicates." You can configure the rules in different ways. However, this requires some knowledge of regular expressions, which are a concise and flexible notation for finding and replacing patterns of text.
The key features of the Alias Map component are:
It creates unique valid names.
It includes a dictionary that keeps track of the names created.
It enables names to be generated in various ways.
It enables one to many name mappings.
The default implementation:
Defines word boundaries (or sections) within the input text where truncation can be applied. This means that truncation can be applied on individual sections within the input text.
Prioritizes where truncation should take place.
Filters valid characters.
Replaces invalid characters.
Appends a serial number (called a counter) to avoid duplicates.
You can create your own generator and plug it into the Alias Map object model to create aliases to meet other requirements.
Requirements
UNICOM Intelligence Data Model
See also
Regular expressions
Structure of the Alias Map component
Examples of using the Alias Map component
Replacing the Generator and Dictionary
Creating multiple aliases
IGeneratorConfiguration
Examples of configuring the Generator
Extending the UNICOM Intelligence Data Model