Project Cenote code released as Open Source

As announced during last week's Talis Platform webinar, the code behind Talis' Project Cenote is being released here on the TDN, licensed under the GNU General Public Licence.

Project Cenote demonstrates the power of the Talis Platform, leveraging rich and flexible apis onto Internet-strength stores of community-contributed bibliographic data to rapidly build compelling new applications.

The code powering Project Cenote demonstrates the ease with which the Talis Platform can be put to work in powering existing and future applications. Simple web service calls, clearly visible in the code we are making available, allow web developers to easily integrate Talis Platform capabilities within their own applications.

Take a look at the code driving Project Cenote, and see how straightforward it would be to modify this to meet your own requirements.

Nadeem Shabir, one of the creators of Project Cenote, offers further information on the code and what it does, here.

Please note: Project Cenote obtains book jacket images from data contributed to us for experimental purposes by Talis Platform partner, Nielsen Bookdata. The version of the code made available for download here replaces this store of images with imagery from Amazon, in line with Amazon's terms of use.

Cenote XSLT question

Have a question about one of the XSLT stylesheets used in Cenote. Due fully to my limited knowledge in this area and should probably be better addressed to a xslt-newbie forum.

Anyway...

For item details, you have the following code for Author(s)

<td class="value author">
<xsl:variable name="author" select="/rdf:RDF/rss:item/dc:creator[1]" />
<xsl:value-of select="$author" />
<xsl:for-each select="/rdf:RDF/rss:item/dc:creator[position() > 1]"> &
<xsl:value-of select="text()" />
</xsl:for-each>
</td>

This is fine, produce a table cell, print out the first author name, and for any additional names produce an & and then their name. Good.

But here is the code for listing the ISBNs:

<td class="value isbn">
<xsl:apply-templates select="/rdf:RDF/rss:item/dc:identifier[starts-with(text(), 'urn:isbn:')]" />
</td>

This produces output such as "9781858983608, 1858983606". But I don't see how it is doing this. I thought there might be some sort of template or specification elsewhere in the file, or in another referenced file, but couldn't see one. I can see it selects 'dc:identifier' and only those that start 'urn:isbn' but can't see how it actually *removes* the preceding urn:isbn, and adds commas between each one. How does this code produce a nice list?

Cheers!

Chris Keene - University of Sussex.

Cenote XSLT question

I'm no expert, but I think the magic is done a bit lower down in the xslt (RenderItemDetails) specifically;


xsl:template match="dc:identifier"
xsl:variable name="isbn" select="substring-after(.,'urn:isbn:')" /
xsl:if test="position() > 1"
xsl:text, /xsl:text
/xsl:if
xsl:value-of select="$isbn" /
/xsl:template

I hope this helps.

Richard Francis
Support, Talis

Hi Richard Well spotted, I

Hi Richard

Well spotted, I think you are right.

We can see this selecting what comes after 'urn:isbn' for each dc:identifier element, and *if* it is not the first isbn, stick a comma in front of it first.

XSLT seems like a very cool way of presenting data.

Chris Keene - University of Sussex.
PS the lack of a pre tag in the commenting system on TDN makes it very difficult to copy code info to this message box!