The template model in heureka ModGen |
1. Generating meta columns:
Data vault tables often contain so-called „meta columns“, that are being generated for the data vault object type and that – for example - serve the documentation of your ETL processes. There are some other fields like the „loaded at“ or the „record source“ field, that every data vault table should contain.
For defining such columns, we have deployed the template model.
data vault object types as tables in the template model |
Within this model you will find three tables that are labelled with „hub“, „link“ and „sat“. When generating the target model, each column we have defined within those tables will be adopted into the corresponding data vault type.
Looking at our example above, this would mean that every hub of the target model would have the columns „LOAD_DTS“, „REC_SRC“ as well as all the data warehouse columns. The same applies to the links and sats of the target model.
2. Colour scheme for data vault objects in the target model
If you already have looked into one of our demo models, you probably have noticed the colour codings of our target models.
Colour scheme of a data vault model |
As you can see in the above graphic, our data vault object types have their own color code: sat tables are pigmented in yellow, links in a light blue and hubs in green.
The template model helps you defining such colour codes for your heureka ModGen output in a simple way:
Themes innerhalb des Template-Modells |
For implementing the colour scheme, you just need three themes inside of your template model with the names of the corresponding object types „link“, „hub“, or „sat“. All you have to do then is assigning the colour code you would like to use to those themes. If you want to change the colours, just follow the same procedure.
3. The surrogate key
The surrogate key probably represents the most important function of the template model. Unfortunately it is also the most challenging function to decribe on paper, so be lenient with me and my wording, I will do my best.
For understanding the function of a surrogate key in combination with the template model, we need to take a step back to my last post, which addressed the „Advanced Options“ of heureka Modgen.
You – as a data vault expert – might already know that for „hub“ tables it is necessary to have an artificial key (i.e. surrogate key). This key – in most cases – is being generated regardless of what information has been deposited in the source model (except the case when using an HKEY, but that will be enough content for another post).
When developping heureka ModGen we thought about determining the way such a surrogate key has to look like. The consequence of this deployment would have been, that the user would have to manually touch up the key for it to being individually applicable. So we decided that it would be much more comfortable if the user would be able to determine a template, a domain, right before the generation. So this is what we deployed:
Choice of domains for surrogate keys - Advanced Options |
What we are looking at here is the possibility to specify a domain within the advanced options. Following the example of this domain, all surrogate keys in the target model will be created. Technically speaking, the domain is being created in the target model and the artificially created hub keys are then being assigned to that domain.
The selection of the domains we are looking at here comes from the template model. It does not necessarily need to be a basis domain that erwin is automatically maintaining for each model. Your own created domains would also be listed here. This enables fast and cross-model changes to all surrogate keys in the target model.
But please pay attention: With no domain being selected for the surrogate key, the generation process will fail in most cases.
That was all as for this post. If you have any questions or would like to get a free trial, feel free to contact support@heureka.com. We’ll be glad to help you.