You can create a semantic type based on a dictionary in Talend Dictionary Service and add it to the list of recognized data types in Talend Data Stewardship. However, duplicate values are not allowed in a dictionary-based semantic type as they are useless and can slow down the process.
In Talend Data Stewardship, not every type of data can currently be matched with one of the predefined semantic types. The counties of United Kingdom for example, are currently not recognized as such.
Let's say that you work for a British company, with customers only residing in the
United Kingdom. In this example, you need to intervene and manage some customer
data, such as their names, email address, or the county they live in. You will
wonder what semantic type to use for the column containing the counties when you
define the data model in Talend Data Stewardship. You want here to add a
semantic type specific to your data:
UK_counties semantic type in
You will create this new semantic type in Talend Dictionary Service, and it will be automatically available in Talend Data Stewardship so that your data can be matched with and validated against a proper type.
Create a .txt file containing the exhaustive list of the
British counties and save it as DICT_UK_COUNTIES.txt.
Make sure to enter one item per line.
Unlike an open dictionary which purpose is to identify data, this exhaustive list acts as a closed dictionary of values to validate data in Talend Data Stewardship. Data that exactly matches one of the listed values is categorized as a British county.
Add this file to the
This folder is used for the sake of this example, but you can save it to your preferred location.
Open a command prompt window and use the
cdcommand to go to the <Dictionary_Service_Path>/command-line folder.
To create the new
UK_countiessemantic type in Talend Dictionary Service and configure its different parameters, put the following command in one single line and execute it according to your operating system:
You are prompted for your Talend Administration Center credentials. The command is executed after you enter a valid login and password.
category_manager.bat -c -name UK_counties -type DICT -cmpl true -desc "Counties of the United Kingdom" -src samples\source\DICT_UK_COUNTIES.txtfor Windows.
./category_manager.sh -c -name UK_counties -type DICT -cmpl true -desc "Counties of the United Kingdom" -src samples/source/DICT_UK_COUNTIES.txtfor Linux.
-cmplattribute stands for completeness, and is used to determine if the dictionary you are adding is a closed dictionary. It is set to
falseby default but in this case, it must be set to
true. Open dictionaries are not supported with Talend Data Stewardship.
The UK_counties semantic type is now added to the list of categories in Talend Dictionary Service.
Go back to Talend Data Stewardship and create a data model for the United Kingdom customers data.
UK_counties is now available in the list of the semantic types and you can set it for the County column.
When you load data containing the United Kingdom
counties to Talend Data Stewardship,
they are matched with and validated against the proper semantic type,
UK_counties that you manually created in Talend Dictionary Service.
category_manager.bat -hcommand for Windows.
./category_manager.sh -hfor Linux.