logo
Use Cases < TMSS, Topic Map based Inter-Syndication < < Home 

PrevUpNext

Use Cases

What are now practical applications and typical use cases on the syndicator and on the subscriber side? For this purpose we have prototyped a TMSS package for Perl, Syndicate::Channel. These modules implement the abstract channel concept outlined so far but also provide drivers for the various RSS formats on the one hand and for TMSS on the other, using either XTM or AsTMa= serialization syntax. This design guarantees that the package can deal with channels independent from their representations while allowing conversion in any of the supported formats. For an RSS-only syndicator this means some degree of abstraction from RSS itself. For a TM aware syndicator this opens the option to integrate channel streams with a Topic Map backbone which the following scenarios shall demonstrate:

Standalone Syndication Abstraction: In this scenario a content provider, Andrew Grant, is a bike fan offering news information on his web site. He has read about RSS and TMSS and in order to reach as many people as possible wants to offer his information in both forms.

Andrew will write a server-side script which allows a download of the news information aboute the articles he keeps in a small database. Whenever someone requests a channel object he will extract the headlines from the backend, will build the channel and will output it depending on the user's request:

use Syndicate::Channel;
my $c = new Syndicate::Channel();
$c->title("Andrew Grants DirtBike Digest");
$c->description("Andrew gives you his weekly view of dirt bikes.");
$c->link("http://www.andrewgrant.org/dirt/syndicate.cgi");

# @webarticles contain article information, maybe from a database
foreach my $article (@webarticles) {
   my $item = new Syndicate::Channel::item();
   $item->title      ($article->{Title});
   $item->link       ($article->{Link});
   $item->description($article->{Description});
   $c->addItem($item);
}

if ($format eq 'tmss') { # user requested TMSS
   use Syndicate::Channel::TMSS;
   return (new Syndicate::Channel::TMSS ($c))
                         .toString(type =>"atm") );
} elsif ($format eq 'rss') {
   use Syndicate::Channel::RSS;
   return (new Syndicate::Channel::RSS ($c))
                         .toString(type =>"1.0") );
} else {
...
}
First the channel is filled with content without any reference to the format. This is delayed until all article headlines with link and description have been added as items.

Only then a new object with the required format imprinted will be cloned from the existing channel object. That will be serialized to text and output. In case of TMSS this will be AsTMa=, in the case of RSS it is version 1.0.

Relayed Syndication Abstraction: The content aggregator yourStreams.com collects news streams from hundreds of sites. From a Topic Map based syndicator they receive an TMSS stream which they want to gateway for their RSS subscribers.

For this purpose we import first the modules and fill the channel with information from the TMSS based content stream:

use Syndicate::Channel;
my $c_tmss = new Syndicate::Channel (
                 url => 'http://example.com/news.tmss');
my $c_rss  = new Syndicate::Channel::RSS ($c_tmss);
print $c_rss->toString (type => "1.0");
The Syndicate::Channel constructor will do some heuristics to determine in which format the downloaded channel definition is provided. In our case the TMSS imprinted channel is used to create an RSS imprinted variant. That one we convert then into text for output.

XML application service: NoWhereMan.com is a portal service which receives a news feed from a TM syndicator. In order to integrate the news stream in an XML application server, the chief architect decides to convert the TMSS stream into a RSS stream and postprocess the XML RSS code via an XSLT stylesheet. The local Perl hacker will write an XML taglib using a similar code like above.

Accumulating Syndication: The site Analyst.com is collecting syndication feeds from a number of technology oriented content providers. They are using Topic Map technology to keep track of advances in research projects and industrial cooperations in various areas. Analyst.com receives a few TMSS feeds which they can directly load into their Topic Map database. For RSS streams they will convert either the messages manually into topic maps or may use the following Perl snippet:

use Syndicate::Channel;
my $c_rss  = new Syndicate::Channel (
                 url => 'http://hitech.com/news.rss');
my $c_tmss = new Syndicate::Channel::TMSS ($c_rss);


PrevUpNext