This exercise teaches you how to find and map relationships between
source and target elements by running the discover function.
To find relationships between source and target elements:
- In the Data Project Explorer view, expand the mytestproject project
and expand the Mappings folder.
- Double-click the myfirstmapping.msl mapping
model that you created in the last exercise to open the three-paned mapping
editor. To model the integration between two schemas (these schemas
could represent two separate data sources), create a mapping between columns
in the two tables that you think are similar. In this example, you assume
that you know of a project number relationship between the columns MGRNO in
the DEPARTMENT table, and the MAJPROJ column in the PROJECT table.
- Select the MGRNO column in the DEPARTMENT table in the Source
pane, and select the MAJPROJ column in the PROJECT table in the Target pane.
- Right-click anywhere in the mapping editor, and select Create
Mapping.
The editor displays a mapping line
between the two columns with a hub that appears as a square.
You can
also use the discover function to find relationships between the source and
the target.
- Select the DEPARTMENT table in the Source pane, and select the
PROJECT table in the Target pane.
First, configure the discover
function to use the Lexical similarity and Semantic name algorithms, because
this matches the source and target elements by using name or text values.
- Right-click in the center pane of the mapping editor.
- Select
- In the table of algorithms, select Lexical similarity and Semantic
name. These algorithms search text and names to find
matches.
- Specify the Composition by sequence radio
button, which ensures that the Lexical similarity algorithm is used before
the Semantic name algorithm. Because that is the current sequence,
you do not need to change the order of the algorithms.
- Click Finish. Then, run the discover
function to find the most satisfactory match among all of the elements in
the model.
- Right-click in the center pane of the mapping editor, and select .
- On the Specify Scope to Discover Relationships page, select the
scope of the discover function. All of the elements from both
the source and the target tables are selected, because you launched the discover
function from the center pane of the mapping editor. The scope changes depending
on how you start the discover function. You can clear a check box to exclude
that element from finding the relationships. For this example, leave all of
the elements selected.
- Optional: If you did not want to see this window again,
you could select the Do not show this window again while
looking for relationships check box. For this example, do not select the check
box.
- Click Finish. The mapping
editor view displays the mapping lines between the successful matches. These
are proposed or discovered mappings. Notice that the hubs of the discovered
mappings appear as brackets.
- Select the mapping line between the DEPTNO column in the DEPARMENT
table, and the DEPTNO column in the PROJECT table. Right-click the line and
select Accept Mapping. Notice that
the color of the line and the hub of the line changed when you accepted the
proposed mapping.
- Right-click in the center pane of the mapping editor and select Reject
All Mappings. The accepted mapping and the manually
created mapping both remain in the editor.
The mapping editor displays a visual representation of the mapped
relationships.