Using Topic Views 2: Mapping Topic Branches

9 Jul 19

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.

Mapping and joining topic branches

    • 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)>.

    Adding the topic view ‘England/All’

      • 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.

    Browsing new reference topics

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)>.

Adding topic view “England/Leagues”

  • 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.

Browsing the new reference topics under “Leagues”

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.


The Diffusion Intelligent Data Platform manages, optimizes, and integrates data among devices, systems, and applications. Push Technology pioneered and is the sole provider of real-time delta-data streaming™ technology that powers mission-critical business applications worldwide. Leading brands use Push Technology to fuel revenue growth, customer engagement, and business operations. The products, Diffusion® and Diffusion Cloud™, are available on-premise, in-the-cloud, or in a hybrid configuration, to fit the specific business and infrastructure requirements of the applications operating in today’s mobile obsessed, everything connected world. Learn how Push Technology can reduce infrastructure costs, and increase speed, efficiency, and reliability, of your web, mobile, and IoT application.

LEARN MORE: Case Studies and Developer Resources