Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Instance Mappings vs Mapping Rules

In the Blueriq Studio a data mapping essentially consists of a collection of instance mappings. Structurally each instance mapping has a target entity and , a single source expression and optionally one or more additional context expressions. The source expression is used to determine which source instances must be mapped to instances of the target entity. When starting with an empty target profile, each source instance will result in the creation of one new instance of the target entity. Additionally it is also possible to define additional context expressions, which can be Additional context expressions are used to activate an additional source instance, for each source instance, when determining attribute and relation values for each target instance.

With these 3 concepts (target entity, source expression, additional context), and even combining them across multiple instance mappings, it is possible to solve a wide range of mapping scenarios. Which combination of instance mappings to use and how to combine them exactly can be a difficult task however. The Model Mapper introduces To help with this, Blueriq Encore introduces mapping rules and mapping rule types, with each rule type solving one of 4 basic mapping scenarios: Direct, Join, Split, Full.

In the Model Mapper Blueriq Encore it will be possible to see view a data mapping as a collection of mapping rules, with each rule conforming to a specific rule type. For backwards compatibility, the Model Mapper will Blueriq encore will analyze existing instance mappings to determine their rule types and transform them into the corresponding mapping rules. What these Of which rule types arethese mapping rules will be, and how they these rule types are detected is explained for each rule type in the following sectionssection.

A notable difference between an instance mapping and a mapping rule, other than the specific type, is that a mapping rule may have multiple target entities. For each target entity there also is a separate value mapping and a separate matching strategy.

Rule Type Definitions

The basic mapping scenarios (Direct, Join, Split, Full) are defined by the number of source instances and target instances that are mapped together when executing a mapping rule.

...


Single sourceMultiple sources
Single targetDirectJoin
Multiple targetsSplitFull

Examples

The following package contains example projects with data mappings for the Join, Split and Full rule types.

MappingRuleExamples.package.zip

Direct Image Added

The Direct rule type is most simple rule type. It is used in scenarios where a single instance in the source profile must be mapped to a single instance in the target profile.

In the Blueriq Studio it consists of a single instance mapping without additional contexts, and it's its source expression/label combination is unique over all instance mappings. Alternatively, any instance mapping that is not recognized as (being part of) a Join, Split or Full mapping rule is considered a Direct mapping rule.

...

  • consists of a single instance mapping
  • has no additional contexts defined
  • source expression/label is unique over across all instance mappings

Join Image Added

The Join rule type is used in scenarios where data from multiple instances in the source profile must be mapped to a single instance in the target profile.

In the Blueriq Studio this is modeled as a single instance mapping with additional context expressions. These additional context expressions allow us to combine data from multiple sources in a single mapping rule. 

Note that only the source expression is used to determine which instances will be mapped to the target profile, and that the additional expressions are only used when performing property mappings. For the property mappings, additional context expressions must evaluate to a known value or else the property mappings can not be performed and this step will be skipped.

The source expression/label in combination with additional contexts. Like the Direct mapping, the source expression/label is unique over all instance mappings, but additionally, the list of additional context expressions/labels is also unique over all instance mappings.

...

  • consists of a single instance mapping
  • has with additional contexts defined
  • source expression/label and list of additional contexts/labels are unique over all instance mappings

Split Image Added

The Split rule is used when a single source instance must be mapped to multiple target instances.

In the Blueriq Studio this can only be achieved by using multiple instance mappings, each with the same source expression/label, and one instance mapping for each target instance which must be created.

In the Model Mapper all Blueriq Encore all instance mappings with the same source expression/label will be combined in a single mapping rule, with each target entity of each instance mapping becoming a target of the new mapping rule.

...

  • consists of multiple instance mappings
  • no additional contexts defined for all instance mappings in the Split mapping rule
  • source expression and label is identical for all instance mappings in the Split mapping rule

Full Image Added

The Full rule is used when multiple source instances must be mapped to multiple target instances.

In the Blueriq Studio this can only be achieved by using multiple instance mappings, each with the same source expression/label and the same additional context expressions/labels, and one instance mapping for each target instance which must be created.

...

  • consists of multiple instance mappings
  • additional contexts defined for all instance mappings in the Full mapping rule
  • source expression/label and list of additional contexts/labels are identical for all instance mappings in the Full mapping rule

Transformation

...

The following table defines how we determine to which rule type an instance mapping will be transformed from the Studio to the Model Mapper.

...

from instance mappings (Blueriq Studio) to mapping rules (Blueriq Encore)

How the transformation from instance mappings to mapping rules is performed is described in the following steps:

  1. Group instance mappings with identical sources together
    1. Instance mappings have identical sources if the source expression, source label and all additional context expressions and labels are exactly the same
  2. For each group of instance mappings
    1. If there is a single source and a single instance mapping in the group, transform to Direct mapping
    2. If there are multiple sources and a single instance mapping in the group, transform to Join mapping
    3. If there is a single source and a multiple instance mappings in the group, transform to Split mapping
    4. If there are multiple sources and multiple instance mappings in the group, transform to Full mapping

...