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: examples → mapping → fundamentals
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
sourceslists the source objects. Each gets anidyou refer to elsewhere - hereCustomerSource- and ajoinrole. The first source is thefrom; later ones join onto it.targetnames the entity being filled.mappingsis 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.
MyDWHdeclares a dependency onJuiceERPso it can reference its entities. Open the data model to see it.
Where to go next
- Do it yourself, starting from
BrightGreen- Mapping Fundamentals - Add logic - A mapping with a transformation expression
- Combine systems - A mapping that joins two sources
- Turn a mapping into runnable SQL - Generating data warehouse views