You are viewing the documentation for Blueriq 15. Documentation for other versions is available in our documentation directory.

Instance Mappings vs Mapping Rules

In Blueriq Studio a data mapping essentially consists of a collection of instance mappings. Structurally each instance mapping has a target entity, 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. 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 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. 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 Blueriq Encore it will be possible to view a data mapping as a collection of mapping rules, with each rule conforming to a specific rule type. For backwards compatibility, Blueriq encore will analyze existing instance mappings and transform them into mapping rules. Of which rule types these mapping rules will be, and how these rule types are detected is explained in the following section.

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.

For example a given source profile has 5 instances of type Person, which must be mapped to 5 instances of type Customer in a given empty target profile. There are in total 5 source instances, but they will each be mapped independently from each other to a Customer instance. In this case we consider the mapping rule to have 1 source instance and 1 target instance. 


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

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 Blueriq Studio it consists of a single instance mapping without additional contexts, and 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.

Key properties

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

Join

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 Blueriq Studio this is modeled as a single instance mapping with additional context expressions. These additional context expression essentially give us multiple sources to use in the mapping. The source expression/label in combination with the list of additional context expressions/labels is unique over all instance mappings.

Key properties

  • 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

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

In 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 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.

Key properties

  • 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

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

In 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.

Key properties

  • 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 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
  • No labels