Skip to content

A basic source-to-target mapping

What this example shows

The smallest complete mapping in CrossModel: one source entity, one target entity, and attribute-level lineage between them.

It is the end state of Mapping Fundamentals.

Branch: examplesmappingfundamentals

What's in the workspace

A MyDWH data model containing a Customer entity and a Customer mapping that fills it from JuiceERP.Customer:

mapping:
    id: Customer
    sources:
      - id: CustomerSource
        entity: JuiceERP.Customer
        join: from
    target:
        entity: Customer
        mappings:
          - attribute: ID
            sources:
              - CustomerSource.CustomerID
          - attribute: DateOfBirth
            sources:
              - CustomerSource.DateOfBirth

That is the whole thing, and it is worth reading closely because every more complex mapping is this shape with more in it.

How to read a mapping

  • sources lists the source objects. Each gets an id you refer to elsewhere - here CustomerSource - and a join role. The first source is the from; later ones join onto it.
  • target names the entity being filled.
  • mappings is the attribute-level lineage: for each target attribute, which source attribute or attributes feed it.

Note that ID is fed from CustomerID. The names differ, which is the normal case - the mapping is what records that they are the same thing. This is the lineage that makes it possible to answer "where does this column come from?" later.

Also note what is not here: only two attributes are mapped. A mapping does not have to be complete to be useful.

What to look at

  • The mapping diagram. Open the mapping and use the diagram perspective. Source on the left, target on the right, a line per mapped attribute.
  • The dependency on JuiceERP. MyDWH declares a dependency on JuiceERP so it can reference its entities. Open the data model to see it.

Where to go next