In the prior chapter we mapped single topics to another location, emulating the behaviour of the slave topic. In this chapter we will tackle something that slave topics struggle with: mapping a topic branch to another location.
map ?Demos/Sportsbook/Football/England// to Demos/Sportsbook/Football/England/All/<path(5)>.
Demos/Sportsbook/Football/England/Alland see how this condenses all the topics from its neighbors into one place.
We have joined four branches of source topics into one branch of reference topics. Notice the
// suffix to the topic selector in the source mapping clause. This is a descendant qualifier and can be read “this topic and all descendants”. Notice also the source path directive
<path(5)> in the path mapping clause, this can be read as “Everything from the 5th part of the source topic” (NB: paths are zero indexed).
Summary: Combining a descendant qualifier in the topic selector, and a source path directive in the path mapping clause upgrades the topic view from mapping a discrete topic to mapping and joining whole topic branches.
As their name implies, topic selectors can be selective. The prior example demonstrated mapping a whole topic branch. In this example, we will map specific parts of the source topic branch.
The English Football Association divides its professional teams into the Premier League, the Championship, League One and finally League Two. The following topic view will aggregate the bottom half of the professional teams:
map ?Demos/Sportsbook/Football/England/League.*/ to Demos/Sportsbook/Football/England/Leagues/<path(5)>.
Demos/Sportsbook/Football/England/Leaguesand see how this condenses Leagues One and Two into one place.
Summary: We can use the selectivity of the topic selectors to map specific parts of a topic branch, instead of all of it.