Using Topic Views 2: Mapping Topic Branches

Mapping from branch to branch

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.

    • Open the Topic Views tab.
    • Click Add and create a new topic view named England/All.
    • Give it the specification map ?Demos/Sportsbook/Football/England// to Demos/Sportsbook/Football/England/All/<path(5)>.

      • Click Add and open the Topics tab.
      • Browse to the new topic branch Demos/Sportsbook/Football/England/All and 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.

    Mapping from branch to branch, selectively

    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:

    • Open the Topic Views tab.
    • Click Add and create a new topic view named England/Leagues.
    • Give it the specification: map ?Demos/Sportsbook/Football/England/League.*/ to Demos/Sportsbook/Football/England/Leagues/<path(5)>.

    • Click Add and open the Topics tab.
    • Browse to the new topic branch Demos/Sportsbook/Football/England/Leagues and 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.

    Next: Extracting source topic values.