<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss1full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns="http://purl.org/rss/1.0/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0"><channel rdf:about="http://blogs.talis.com/n2"><title>n²</title><link>http://blogs.talis.com/n2</link><description>All about developing with the Talis Platform</description><dc:language>en</dc:language><image rdf:resource="http://blogs.talis.com/n2/wp-content/plugins/podpress/images/powered_by_podpress.jpg" /><dc:rights>©</dc:rights><dc:creator>ian.davies@talis.com</dc:creator><sy:updatePeriod xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">hourly</sy:updatePeriod><sy:updateFrequency xmlns:sy="http://purl.org/rss/1.0/modules/syndication/">1</sy:updateFrequency><itunes:keywords xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" /><itunes:subtitle xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" /><itunes:summary xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">All about developing with the Talis Platform</itunes:summary><itunes:author xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" /><itunes:category xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" text="Society &amp; Culture" /><itunes:owner xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">
			<itunes:name />
			<itunes:email>ian.davies@talis.com</itunes:email>
		</itunes:owner><itunes:block xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">No</itunes:block><itunes:explicit xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd">no</itunes:explicit><itunes:image xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" href="http://blogs.talis.com/n2/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" /><items><rdf:Seq><rdf:li rdf:resource="http://blogs.talis.com/n2/?p=659" /><rdf:li rdf:resource="http://blogs.talis.com/n2/?p=602" /><rdf:li rdf:resource="http://blogs.talis.com/n2/?p=581" /><rdf:li rdf:resource="http://blogs.talis.com/n2/?p=617" /><rdf:li rdf:resource="http://blogs.talis.com/n2/?p=569" /><rdf:li rdf:resource="http://blogs.talis.com/n2/?p=554" /><rdf:li rdf:resource="http://blogs.talis.com/n2/?p=539" /><rdf:li rdf:resource="http://blogs.talis.com/n2/?p=533" /><rdf:li rdf:resource="http://blogs.talis.com/n2/?p=518" /><rdf:li rdf:resource="http://blogs.talis.com/n2/?p=485" /></rdf:Seq></items><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/talis/n2" type="application/rss+xml" /></channel><image rdf:about="http://blogs.talis.com/n2/wp-content/plugins/podpress/images/powered_by_podpress.jpg"><url>http://blogs.talis.com/n2/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url><title>n²</title><link>http://blogs.talis.com/n2</link></image><item rdf:about="http://blogs.talis.com/n2/?p=659"><title>Data Migration using SPARQL and Changesets</title><link>http://feedproxy.google.com/~r/talis/n2/~3/3GEVY_SztTg/659</link><dc:subject>Tips and Tricks</dc:subject><dc:subject>Tutorials</dc:subject><dc:creator>kwijibo</dc:creator><dc:date>2009-07-10T01:25:21-07:00</dc:date><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>A tagline sometimes used for RDF is “self-describing data”. Sometimes though, you make your data describe itself badly; perhaps you’ve used a vocabulary term that has since been deprecated, or perhaps you’ve found a term which is more widely supported, or more appropriate to the data; maybe there was a typo in the script you generated your triples with. At any rate, it’s pretty common to have to fix your data, and if you have a live application with fresh ‘bad’ triples being created all the time, and a lot of bad triples to fix anyway, this can get tricky.</p>
<p>We&#8217;re having to do this in a project at the moment, and this is the method <a href="http://www.virtualchaos.co.uk/">Nad</a> and I came up with. We separated out adding <em>good triples</em> and removing <em>bad triples</em> into separate stages because our application will continue to function the same with both good and bad triples, but, once we rollout the code that expects the good triples, we <em>need</em> the good triples, whereas the bad triples can be removed at our leisure.</p>
<h3>Adding New Good Triples</h3>
<p>So, say for example, one of the things we want to fix is using <code>dcterms:creator</code> instead of <code>dc:creator</code>. We can get the good triples by querying for:</p>
<pre>
    CONSTRUCT {
    # good
                ?s &lt;http://purl.org/dc/terms/creator&gt; ?o
    } WHERE {
    # bad
                ?s &lt;http://purl.org/dc/elements/1.1/creator&gt; ?o
    }
</pre>
<p>And posting that back into the store. (First make sure that your application won&#8217;t do anything too weird if you add in these triples without changing any code).</p>
<p>If there are a lot of triples in the store, you may not be able to retrieve and post them all at once. To scale to large numbers of triples, just page through the results at, say, 1000 triples at a time by adding <code>LIMIT 1000 OFFSET 0 </code> and incrementing the OFFSET by the LIMIT (1000) until you don&#8217;t get  triples back anymore.</p>
<p>Wrap this little procedure up in a script because you&#8217;ll need to run it again.</p>
<h3>Deploy Code</h3>
<p>As soon as you have finished adding the new /good/ triples, deploy your new code that uses <code>dcterms:creator</code> instead of <code>dc:creator</code>. </p>
<p>Now run the <em>add good triples</em> script again. This is because, while you were deploying the code, users may have been plugging away at your app, happily creating more bad old triples. Running the script again will add good triples for any of these bad triples that have been created meantime. And because you&#8217;ve now deployed your code changes, the application won&#8217;t create any more bad triples.</p>
<p>All we have left to do is get rid of the bad old triples. With any luck (and a bit of foresight, and testing), your application will function perfectly well with both bad and good triples in the store, so we can take our time a bit getting rid of the bad triples.</p>
<h3>Removing Bad Old Triples</h3>
<p>We&#8217;ll write a SPARQL query to give us back the triples we want to remove, and then we&#8217;ll create a Changeset to remove them:</p>
<pre>
    CONSTRUCT {
    # bad
             ?s &lt;http://purl.org/dc/elements/1.1/creator&gt; ?o
    } WHERE {

    # bad
            ?s &lt;http://purl.org/dc/elements/1.1/creator&gt; ?o
    # good
            ?s &lt;http://purl.org/dc/terms/creator&gt; ?o

    }
</pre>
<p>(<ins>you should apply a LIMIT, but, so long as you are waiting for each changeset batch to succeed before sending the next one, you don&#8217;t need to page - just get back the first 1000 until you don&#8217;t get anything back.</ins> It&#8217;s worth remembering that the number of triples in a changeset document will be about ten-fold the number of triples you are removing, so you may need to make the limit a bit smaller than before).</p>
<p>An important point on the platform&#8217;s Changesets API: if you send more than <strong>14 changesets in a batch</strong> (ie, in the same document), they will be performed <em>asynchronously</em> and you should get back an <strong>HTTP 202 Accepted</strong> status code. A potential problem is that, if you are trying to <strong>remove a statement that doesn&#8217;t exist</strong> then all the changes in that batch will fail, but you will still get back a 202 Accepted (because the platform hasn&#8217;t tried processing them yet). You need a way of knowing if the batch has failed or not. One way to do this is to include in your batch of changes, the addition of a triple you can then poll the store for to see if it exists or not. </p>
<p>If you&#8217;re using PHP, you can use Moriarty to create your changesets:</p>
<pre>
    <code>
#php
define('STORE_URI', 'http://api.talis.com/stores/sandbox1');
$markerURI =  STORE_URI.'/items/'.time();
$time = time();

$rdfToAdd = " &lt;{$markerURI}&gt; &lt;http://purl.org/dc/terms/created&gt; \&quot;{$time}\&quot; . ";

$args = array(
    'before' =&gt; $rdfToRemove, // got this from the CONSTRUCT described above
    'after' =&gt; $rdfToAdd, // this is the marker triple
);
$cs = new Changeset($args);
$store = new Store(STORE_URI); // you will probably need to add your login credentials - see the moriarty docs
$response = $store-&gt;get_metabox()-&gt;apply_changeset($cs);

if(!$response-&gt;is_success()){
    //log error, and stop
    log_error("Changeset failed: ".$response-&gt;status_code ."\n " . $response-&gt;body ." \n  Changeset: \n" . $cs-&gt;to_rdfxml());
    break;
}

    </code>
</pre>
<p>At this point, you may also want to poll the store for the existence of your marker triple to see if the  batch has been processed. Since we minted  the marker URI in the store&#8217;s URI space, we can just try to dereference it; as soon as we get back a 200 or 303 response, we can move on, but if we still get back a 404 after say 10 seconds, the changeset has probably failed and we need to log that and investigate.</p>
<p>If everything goes OK, you can then make double sure you&#8217;ve got rid of all the bad triples by running a quick ASK query against your store&#8217;s SPARQL service.</p>
<pre>
    <code>
        ASK {
            # bad
            ?s &lt;http://purl.org/dc/elements/1.1/creator&gt; ?o
        }
    </code>
</pre>
<p>And if you get back FALSE, you&#8217;re finished. </p>
<p>Well done!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Share This</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.connotea.org/addpopup?continue=confirm&amp;uri=http://blogs.talis.com/n2/archives/659&amp;title=Data+Migration+using+SPARQL+and+Changesets" rel="nofollow" title="Add to&nbsp;Connotea"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/connotea.png" title="Add to&nbsp;Connotea" alt="Add to&nbsp;Connotea" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blogs.talis.com/n2/archives/659&amp;title=Data+Migration+using+SPARQL+and+Changesets" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blogs.talis.com/n2/archives/659&amp;title=Data+Migration+using+SPARQL+and+Changesets" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blogs.talis.com/n2/archives/659&amp;title=Data+Migration+using+SPARQL+and+Changesets" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
<img src="http://feeds.feedburner.com/~r/talis/n2/~4/3GEVY_SztTg" height="1" width="1"/>]]></content:encoded><description>A tagline sometimes used for RDF is “self-describing data”. Sometimes though, you make your data describe itself badly; perhaps you’ve used a vocabulary term that has since been deprecated, or perhaps you’ve found a term which is more widely supported, or more appropriate to the data; maybe there was a typo in the script you [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.talis.com/n2/archives/659/feed</wfw:commentRss><feedburner:origLink>http://blogs.talis.com/n2/archives/659</feedburner:origLink></item><item rdf:about="http://blogs.talis.com/n2/?p=602"><title>Searching the BBC Data in the Talis Platform</title><link>http://feedproxy.google.com/~r/talis/n2/~3/cJqoAad3BXY/602</link><dc:subject>Tips and Tricks</dc:subject><dc:subject>Tutorials</dc:subject><dc:subject>bbc</dc:subject><dc:subject>search</dc:subject><dc:creator>Leigh Dodds</dc:creator><dc:date>2009-06-15T05:31:06-07:00</dc:date><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I&#8217;ve previously blogged about how easy it is to <a href="http://blogs.talis.com/n2/archives/374">create a custom search index using the Platform</a>. So obviously during the process of loading the BBC programmes and music data into the Platform we&#8217;ve used this feature to build a search engine across their data.</p>
<p>In this post I wanted to show a few example queries and then review how we&#8217;ve configured the search indexes so you can not only get the most from the feature, but also see how it can be used against real-world data.</p>
<h2>Sample Queries</h2>
<p>Here are some sample queries. The Platform is more of a search engine tool-kit than a search engine <em>per se</em>: the results aren&#8217;t a human-readable web page, they&#8217;re an RSS 1.0 document that contains enough structured metadata about each item in order to build a presentation of the results. And where additional metadata is required, this can be extracted using <a href="http://n2.talis.com/wiki/Metabox">the describe service</a>, additional searches, <a href="http://n2.talis.com/wiki/Augment_Service">augmentation</a> or <a href="http://n2.talis.com/wiki/Store_Sparql_Service">a SPARQL query</a>.</p>
<p>However for the purposes of this article its enough to view the example in your browser. Application developers will want to dig into the underlying markup to see what extra data is included.</p>
<ul>
<li>A search for &#8220;<a href="http://api.talis.com/stores/bbc-backstage/items?query=Banksy">Banksy</a>&#8220;</li>
<li>A search for &#8220;<a href="http://api.talis.com/stores/bbc-backstage/items?query=The+Prodigy">The Prodigy</a>&#8221; &#8212; returning the artist, the dbpedia entry, and episode titles and descriptions in which they are mentioned</li>
<li>A search for &#8220;<a href="http://api.talis.com/stores/bbc-backstage/items?query=Pratchett">Terry Pratchett</a>&#8221; &#8212; again produces a mixture of different types.</li>
<li>A search for &#8220;Prodigy&#8221; limiting to things that are of type &#8220;&#8221;http://purl.org/stuff/rev#Review&#8221; &#8212; <a href="http://api.talis.com/stores/bbc-backstage/items?query=prodigy+type%3A%22http%3A%2F%2Fpurl.org%2Fstuff%2Frev%23Review%22">Results</a>.</li>
<li>A facetted search for &#8220;Prodigy&#8221; grouping the results based on their RDF type &#8212; <a href="http://api.talis.com/stores/bbc-backstage/services/facet?query=prodigy&amp;fields=type&amp;top=10&amp;output=html">Results</a>. This shows us that we have results in not only episodes but in a variety of other types too. We can drill down these into form the following search:</li>
<li>A search for &#8220;Prodigy&#8221; limits to Music Segments. <a href="http://api.talis.com/stores/bbc-backstage/items?query=Prodigy+AND+type%3A%22http\%3A%2F%2Fpurl.org%2Fontology%2Fpo%2FMusicSegment%22">Results</a>.</li>
</ul>
<p>If you want to try out your own queries, then <a href="http://api.talis.com/stores/bbc-backstage/items">use this simple form</a>.</p>
<h2>The Configuration</h2>
<p>To show how we&#8217;ve configured the <a href="http://n2.talis.com/wiki/Field_Predicate_Map">Field Predicate Map</a> and <a href="http://n2.talis.com/wiki/Query_Profile">Query Profile</a> for the BBC Backstage store, I&#8217;ve uploaded them to our public SVN: <a href="http://n2.talis.com/svn/playground/ldodds/n2-examples/trunk/bbc/fpmap.rdf">fmap.rdf</a> and <a href="http://n2.talis.com/svn/playground/ldodds/n2-examples/trunk/bbc/queryprofile.rdf">queryprofile.rdf</a></p>
<p>Looking at the Field Predicate Map, you can see we&#8217;ve configured the Platform store to index the key predicates in the BBC data, including titles, labels, descriptions and synopses. You can use any of the named fields in the configuration to refine searches to specific predicates in the data, allowing construction of an &#8220;advanced search form&#8221;. E.g. we can search for name:&#8221;Stephen Fry&#8221; to search for a person called Stephen Fry (<a href="http://api.talis.com/stores/bbc-backstage/items?query=name%3A&quot;Stephen+Fry&quot;&amp;max=10">results</a>).</p>
<p>The RDF type property is also included in the Field Predicate Map to allow us to limit searches to particular types of resource, it also enables us to do <a href="http://n2.talis.com/wiki/Facet_Service">facetted searches</a> based on type, giving us an alternate view of the data. Its easy to see how that functionality could be used to help build some useful additional options to restrict the search results presented in a user interface.</p>
<p>To configure the relevance ranking we chosen to boost hits in &#8220;labels&#8221; (names, labels, titles) over &#8220;descriptions&#8221; (description, synopses, review). We could easily change the boosting to favour one or other type of predicate to further tweak the results. But this configuration provides a reasonable set of search results for the tests we&#8217;ve done. Let us know how you get on and whether you think any of this should be changed. We&#8217;re happy to alter the configuration to make sure that people can get the most from the BBC data.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Share This</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.connotea.org/addpopup?continue=confirm&amp;uri=http://blogs.talis.com/n2/archives/602&amp;title=Searching+the+BBC+Data+in+the+Talis+Platform" rel="nofollow" title="Add to&nbsp;Connotea"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/connotea.png" title="Add to&nbsp;Connotea" alt="Add to&nbsp;Connotea" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blogs.talis.com/n2/archives/602&amp;title=Searching+the+BBC+Data+in+the+Talis+Platform" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blogs.talis.com/n2/archives/602&amp;title=Searching+the+BBC+Data+in+the+Talis+Platform" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blogs.talis.com/n2/archives/602&amp;title=Searching+the+BBC+Data+in+the+Talis+Platform" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
<img src="http://feeds.feedburner.com/~r/talis/n2/~4/cJqoAad3BXY" height="1" width="1"/>]]></content:encoded><description>I&amp;#8217;ve previously blogged about how easy it is to create a custom search index using the Platform. So obviously during the process of loading the BBC programmes and music data into the Platform we&amp;#8217;ve used this feature to build a search engine across their data.
In this post I wanted to show a few example queries [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.talis.com/n2/archives/602/feed</wfw:commentRss><feedburner:origLink>http://blogs.talis.com/n2/archives/602</feedburner:origLink></item><item rdf:about="http://blogs.talis.com/n2/?p=581"><title>Fishing for BBC Data using Augmentation</title><link>http://feedproxy.google.com/~r/talis/n2/~3/zu_yK5P0ibk/581</link><dc:subject>Tips and Tricks</dc:subject><dc:subject>Tutorials</dc:subject><dc:subject>augmentation</dc:subject><dc:subject>bbc</dc:subject><dc:subject>rss</dc:subject><dc:creator>Leigh Dodds</dc:creator><dc:date>2009-06-12T01:50:04-07:00</dc:date><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>In some of my recent talks I&#8217;ve used the metaphor of <a href="http://www.slideshare.net/ldodds/awash-with-data">streams, pool and reservoirs</a> for describing the flow and collection of data across the web. I usually refer to some of the different forms of data extraction that we support on the Platform, which covers <a href="http://n2.talis.com/wiki/Contentbox">keyword searching</a> as well as more <a href="http://n2.talis.com/wiki/Store_Sparql_Service">structured queries</a>.</p>
<p>Another form of data extraction is the <a href="http://n2.talis.com/wiki/Augment_Service">Augmentation Service</a> is what might be described as &#8220;fishing for data, using URIs as bait&#8221;. I thought I&#8217;d put together a little illustration that shows the potential for this kind of data extraction, as its both powerful and simple to use &#8212; so simple that you don&#8217;t need to write any queries at all.</p>
<p>Lets look at <a href="http://api.talis.com/stores/bbc-demo/items/demos/augmentation-example.rss">a sample RSS 1.0 feed</a> that contains a review of an episode of Dr Who. For brevity, I&#8217;ll only include the metadata for the single item in the feed:</p>
<pre>&lt;item rdf:about="http://www.example.org/reviews/1"&gt;
  &lt;title&gt;Review of "Blink"&lt;/title&gt;
  &lt;link&gt;http://www.example.org/reviews/1&lt;/link&gt;
  &lt;rev:title&gt;Review of Dr Who Series 3, Episode 10 "Blink"&lt;/rev:title&gt;
  &lt;rev:text&gt;A classic episode of Dr Who...&lt;/rev:text&gt;
  &lt;foaf:primaryTopic rdf:resource="http://www.bbc.co.uk/programmes/b0074gpl#programme"/&gt;
&lt;/item&gt;</pre>
<p>The item has the standard RSS 1.0 elements for title and link, but as the item is also a review, it also includes some additional metadata using the review vocabulary. The relationship between the review item and <a href="http://www.bbc.co.uk/programmes/b0074gpl">the Episode that is being reviewed</a> is made using the foaf:primaryTopic property. The precise vocabularies don&#8217;t really matter, the important thing is that there is a reference to an BBC /programmes URI: this is our bait.</p>
<p>The <a href="http://n2.talis.com/wiki/Augment_Service">Augmentation Service</a> allows the URL of an RSS 1.0 feed to be passed in as a parameter. You can use the form provided from <a href="http://api.talis.com/stores/bbc-backstage/services/augment">the augment service on the BBC Backstage store</a> and paste in the URL of the sample RSS 1.0 feed, or <a href="http://api.talis.com/stores/bbc-backstage/services/augment?data-uri=http%3A%2F%2Fapi.talis.com%2Fstores%2Fbbc-demo%2Fitems%2Fdemos%2Faugmentation-example.rss&amp;xsl=&amp;content-type=">click here to review the results</a>. Within the browser you won&#8217;t see that a great deal as changed, although you should see that that the results are themselves an RSS 1.0 feed. What the Augmentation service does is process an RSS feed to augment the metadata in the feed items against data present in the Platform Store.</p>
<p>Here&#8217;s the same RSS item after its been augmented, with the additional metadata shown in red:</p>
<pre>&lt;item rdf:about="http://www.example.org/reviews/1"&gt;
  &lt;title&gt;Review of "Blink"&lt;/title&gt;
  &lt;link&gt;http://www.example.org/reviews/1&lt;/link&gt;
  &lt;foaf:primaryTopic&gt;
<span style="color: #ff0000"> &lt;ns.0:Episode rdf:about="http://www.bbc.co.uk/programmes/b0074gpl#programme"&gt;
  &lt;ns.0:medium_synopsis&gt;In an old, abandoned house, the Weeping Angels wait.
  Only the Doctor can stop them, but he's lost in time.&lt;/ns.0:medium_synopsis&gt;
  &lt;rdf:type&gt;
    &lt;rdf:Description rdf:about="http://purl.org/ontology/po/Episode"/&gt;
  &lt;/rdf:type&gt;
  &lt;ns.0:position&gt;10&lt;/ns.0:position&gt;
  &lt;ns.0:short_synopsis&gt;Only the Doctor can stop the Weeping Angels, but he's lost in time.&lt;/ns.0:short_synopsis&gt;
  &lt;ns.0:genre&gt;
    &lt;rdf:Description rdf:about="http://www.bbc.co.uk/programmes/genres/drama/scifiandfantasy#genre"/&gt;
  &lt;/ns.0:genre&gt;
  &lt;ns.0:microsite&gt;
    &lt;rdf:Description rdf:about="http://www.bbc.co.uk/doctorwho/"/&gt;
  &lt;/ns.0:microsite&gt;
  &lt;ns.0:version&gt;
    &lt;rdf:Description rdf:about="http://www.bbc.co.uk/programmes/b0073km9#programme"/&gt;
  &lt;/ns.0:version&gt;
  &lt;foaf:depiction&gt;
    &lt;rdf:Description rdf:about="http://www.bbc.co.uk/iplayer/images/episode/b0074gpl_512_288.jpg"/&gt;
  &lt;/foaf:depiction&gt;
  &lt;ns.1:label&gt;Blink&lt;/ns.1:label&gt;
  &lt;ns.0:masterbrand&gt;
    &lt;rdf:Description rdf:about="http://www.bbc.co.uk/bbcone#service"/&gt;
  &lt;/ns.0:masterbrand&gt;
  &lt;dc:title&gt;Blink&lt;/dc:title&gt;
 &lt;/ns.0:Episode&gt;</span>
&lt;/foaf:primaryTopic&gt;
&lt;rev:text&gt;A classic episode of Dr Who...&lt;/rev:text&gt;
&lt;rev:title&gt;Review of Dr Who Series 3, Episode 10 "Blink"&lt;/rev:title&gt;
&lt;/item&gt;</pre>
<p>As you can see the feed now includes all of the key metadata about the episode, including its title, a synopsis, a link to a depiction of the episode, and to the Dr Who microsite on the BBC. All without writing any queries.</p>
<p>The trigger for the augmentation to looking up the data is simply the presence of a URI in the feed, that is also present in the RDF in the Platform Store. If the URI is not found then it is ignored. But if the URL is present then a description of that resource is automatically added to the RSS feed. In formal RDF terms that description is the <a href="http://n2.talis.com/wiki/Bounded_Descriptions_in_RDF#Concise_Bounded_Description">Concise Bounded Description</a> of the resource. More simplistically it will be all simple literal properties associated with the resource (e.g. the title and the synopsis) plus links to any related resources (e.g. the microsite, the genre). The end result is a feed that has been either completely or partially enriched against the data.</p>
<p>This kind of data augmentation is uniquely possible with RDF because of its reliance on URIs for global identifiers. Its makes dipping into a pool of data very easy to do. It&#8217;s also possible to augment a service against multiple stores, pipelining the augmentation across multiple datasets to gather up all of the relevant data. As the output of a search against a Platform store is also RSS 1.0, you can enrich search results against multiple stores starting from an initial keyword search.</p>
<p>You can also see how this kind of enrichment can be used as part of, e.g. <a href="http://pipes.yahoo.com">a Yahoo Pipeline</a>. This is the primary reason why the service has been initially designed to work on RSS 1.0 feeds &#8212; its well supported; easy to generate; and of all the varieties of RSS, RSS 1.0 is processable as both an RDF and an XML vocabulary, making it easy to process in this context. We are intending to expand the support to cover generic RDF input and output, and other flavours of RSS.</p>
<p>In the meantime, happy data fishing!</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Share This</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.connotea.org/addpopup?continue=confirm&amp;uri=http://blogs.talis.com/n2/archives/581&amp;title=Fishing+for+BBC+Data+using+Augmentation" rel="nofollow" title="Add to&nbsp;Connotea"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/connotea.png" title="Add to&nbsp;Connotea" alt="Add to&nbsp;Connotea" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blogs.talis.com/n2/archives/581&amp;title=Fishing+for+BBC+Data+using+Augmentation" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blogs.talis.com/n2/archives/581&amp;title=Fishing+for+BBC+Data+using+Augmentation" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blogs.talis.com/n2/archives/581&amp;title=Fishing+for+BBC+Data+using+Augmentation" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
<img src="http://feeds.feedburner.com/~r/talis/n2/~4/zu_yK5P0ibk" height="1" width="1"/>]]></content:encoded><description>In some of my recent talks I&amp;#8217;ve used the metaphor of streams, pool and reservoirs for describing the flow and collection of data across the web. I usually refer to some of the different forms of data extraction that we support on the Platform, which covers keyword searching as well as more structured queries.
Another form [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.talis.com/n2/archives/581/feed</wfw:commentRss><feedburner:origLink>http://blogs.talis.com/n2/archives/581</feedburner:origLink></item><item rdf:about="http://blogs.talis.com/n2/?p=617"><title>Augmenting Last.fm Data with BBC data on the Talis Platform</title><link>http://feedproxy.google.com/~r/talis/n2/~3/B-ISSYgzM1U/617</link><dc:subject>Tips and Tricks</dc:subject><dc:subject>Tutorials</dc:subject><dc:subject>augmentation</dc:subject><dc:subject>bbc</dc:subject><dc:subject>bbc-backstage</dc:subject><dc:subject>last.fm</dc:subject><dc:subject>Linked Data</dc:subject><dc:subject>platform</dc:subject><dc:subject>tutorial</dc:subject><dc:creator>kwijibo</dc:creator><dc:date>2009-06-11T05:10:03-07:00</dc:date><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>A short while back, I created a <a href="http://lastfm.rdfize.com/">Linked Data wrapper on the Last.FM API</a> for Events and Artists. The artist data links to the BBC&#8217;s data about each artist using owl:sameAs.</p>
<p>Now that the <a href="http://welcomebackstage.com/2009/06/bbc-backstage-sparql-endpoint/">BBC RDF is available in a Talis Platform store</a>,  I can put some of my Last.FM data into a store (it&#8217;s currently generated on the fly from the Last.FM API), search on it, and then <a href="http://n2.talis.com/wiki/Augment_Service">augment</a> it with data from the BBC.</p>
<p>So I put some Last.FM data into the <a href="http://api.talis.com/stores/sandbox1">Sandbox1 store</a>.</p>
<p>Now I can search on it with the <a href="http://n2.talis.com/wiki/Contentbox">items query endpoint</a> like:</p>
<p>http://api.talis.com/stores/sandbox1/items?query=Black</p>
<p>This gives us the results as RSS 1.0, which is also RDF/XML, and contains a graph with 12 resources in it.</p>
<p>We can now pass the URI of this (or any RSS 1.0) document to the <a href="http://api.talis.com/stores/bbc-backstage/services/augment">BBC-Backstage store&#8217;s Augment Service </a> like this:</p>
<p>http://api.talis.com/stores/bbc-backstage/services/augment?data-uri=http%3A%2F%2Fapi.talis.com%2Fstores%2Fsandbox1%2Fitems%3Fquery%3DBlack</p>
<p>The Augment service will look at the URIs in the RSS results, and add DESCRIBEs for any of those URIs that it finds in its own store, giving you back the RSS augmented with BBC data.</p>
<p>So the graph we get back now contains 15 resources, where the BBC-Backstage store has found descriptions for  3 of the URIs in the original RSS.</p>
<p>For further information, see Leigh Dodd&#8217;s slides on <a href="http://www.slideshare.net/ldodds/getting-started-with-the-talis-platform-presentation">Getting Started with the Talis Platform</a>.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Share This</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.connotea.org/addpopup?continue=confirm&amp;uri=http://blogs.talis.com/n2/archives/617&amp;title=Augmenting+Last.fm+Data+with+BBC+data+on+the+Talis+Platform" rel="nofollow" title="Add to&nbsp;Connotea"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/connotea.png" title="Add to&nbsp;Connotea" alt="Add to&nbsp;Connotea" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blogs.talis.com/n2/archives/617&amp;title=Augmenting+Last.fm+Data+with+BBC+data+on+the+Talis+Platform" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blogs.talis.com/n2/archives/617&amp;title=Augmenting+Last.fm+Data+with+BBC+data+on+the+Talis+Platform" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blogs.talis.com/n2/archives/617&amp;title=Augmenting+Last.fm+Data+with+BBC+data+on+the+Talis+Platform" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
<img src="http://feeds.feedburner.com/~r/talis/n2/~4/B-ISSYgzM1U" height="1" width="1"/>]]></content:encoded><description>A short while back, I created a Linked Data wrapper on the Last.FM API for Events and Artists. The artist data links to the BBC&amp;#8217;s data about each artist using owl:sameAs.
Now that the BBC RDF is available in a Talis Platform store,  I can put some of my Last.FM data into a store (it&amp;#8217;s [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.talis.com/n2/archives/617/feed</wfw:commentRss><feedburner:origLink>http://blogs.talis.com/n2/archives/617</feedburner:origLink></item><item rdf:about="http://blogs.talis.com/n2/?p=569"><title>Understanding the Big BBC Graph</title><link>http://feedproxy.google.com/~r/talis/n2/~3/PDnyBq3DVL0/569</link><dc:subject>Uncategorized</dc:subject><dc:subject>bbc</dc:subject><dc:subject>SPARQL</dc:subject><dc:creator>Leigh Dodds</dc:creator><dc:date>2009-06-11T02:00:08-07:00</dc:date><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>In the lead up to the announcement of the BBC SPARQL endpoint trials I&#8217;ve spent quite a bit of time working with and exploring the BBC /programmes and /music dataset. I thought it would be useful to write-up some of this to help out those of you looking to explore the data using <a href="http://api.talis.com/stores/bbc-backstage/services/sparql">the Talis Platform SPARQL endpoint</a>. (Tip: use <a href="http://api.talis.com/stores/bbc-demo/items/sparql/spared.html">the newer SPARQL form</a> for a better user experience when exploring the data.</p>
<h2>What&#8217;s in the Store?</h2>
<p>Currently the Platform store includes metadata for over 360,000 Radio and TV programme <a href="http://www.bbc.co.uk/ontologies/programmes/2009-04-17.shtml#Episode">Episodes</a> along with information on which <a href="http://www.bbc.co.uk/ontologies/programmes/2009-04-17.shtml#Version">Versions</a> of those programmes have been broadcast, including the time and channel on which they were shown. Information is also available for 6,500 <a href="http://www.bbc.co.uk/ontologies/programmes/2009-04-17.shtml#Series">Series</a>, and 5,500 <a href="http://www.bbc.co.uk/ontologies/programmes/2009-04-17.shtml#Brand">Brands</a> and their relationships, for more on that see below.</p>
<p>For the music data, the endpoint includes all of the artist and albums metadata currently available from the BBC Music website, which compromises over 23,000 <a href="http://musicontology.com/#term_SoloMusicArtist">solo artists</a>, 11,000 <a href="http://musicontology.com/#term_MusicGroup">groups</a>, and 25,000 <a href="http://musicontology.com/#term_Record">albums</a>. There are also nearly 4,500 album <a href="http://vocab.org/review/terms.html#Review">reviews</a>.</p>
<p>This core dataset is approximately 20 million triples, and this is obviously growing as new episodes and broadcasts are made, and as we crawl that additional data. But thats not all&#8230;</p>
<p>The artist metadata refers to <a href="http://dbpedia.org">dbpedia</a> entries via owl:sameAs links, and this immediate context has also been included, providing a single location to query and find all the additional metadata about a recording artist. As the metadata on the BBC programmes website gets updated to include dbpedia links, then this will also get included. We&#8217;re working with the BBC to get some of these links in place as soon as possible.</p>
<p>The /programmes team recently updated the website to begin exporting &#8220;<a href="http://www.mail-archive.com/public-lod@w3.org/msg02067.html">segment</a>&#8221; data. This describes what artist was being played in a specific segment of a broadcast (currently limited to Radio 2 &amp; 6), providing links between the programmes and music datasets. Increasingly it really is just one large graph that the BBC are producing.</p>
<h2>What Ontologies are Used?</h2>
<p>The core of the dataset is modelled using the <a href="http://purl.org/ontology/po/">Programmes</a> and <a href="http://purl.org/ontology/mo/">Music</a> ontologies. There is also the usual sprinkling of Dublin Core and <a href="http://xmlns.com/foaf/0.1/">FOAF</a> terms to capture titles, describe people, provide images for episodes, etc. The <a href="http://vocab.org/review/terms.html">RDF Review vocabulary</a> has been used to model the album reviews.</p>
<p>The programmes website includes some content categories for genres and formats. These are modelled in the dataset as <a href="http://www.w3.org/2004/02/skos/">SKOS</a> concepts. There seems to be some nascent support in the data for capturing metadata about people and places appearing in programmes. At the moment these are also modelled using SKOS.</p>
<p>That comprises the core data, beyond that there a number of different terms used in the dbpedia portions of the dataset. Check <a href="http://wiki.dbpedia.org/Ontology">the dbpedia documentation</a> for more information.</p>
<h2>Understanding Brands, Series, Episodes</h2>
<p>To get the most from the BBC programmes data you&#8217;ll need some understanding of some of the variations in the graph to ensure that you don&#8217;t accidentally exclude data in your queries. And if you&#8217;re a modelling geek like me its interesting in its own right! Any mistakes in the following are all my own, apologies to the BBC folk.</p>
<p>A Brand is a top-level concept that defines a collection of works. Its the resource that ties together Series and Episodes. Dr Who is a brand, as is the BBC News, and The Catherine Tate show. A Series, as you&#8217;d expect, is a run of Episodes, e.g. &#8220;Series 1 of The Wire&#8221;. And an Episode is similarly intuitively named.</p>
<p>We&#8217;re all already familiar with the basic relationships between these concepts. A Brand (&#8221;Red Dwarf&#8221;) may be related to a number of Series (&#8221;Red Dwarf Series 1&#8243;) and a Series is compromised of Episodes (&#8221;Red Dwarf, Series 1, Episode 1&#8243;). But there are a few wrinkles that are worth pointing out, as they can impact the way you write your SPARQL queries Thanks to Michael Smethurst for giving me a run-down of some of these!</p>
<p>Firstly a Brand may not be broken down into Series at all. The BBC News, for example, is simply a continuous stream of Episodes. Radio shows are similar.</p>
<p>Similarly a Series of Episodes may not necessarily be associated with a Brand. It may be a one-off run of Episodes, e.g. a short documentary series like <a href="http://www.bbc.co.uk/programmes/b006m8b2">Incredible Animal Journeys</a>.</p>
<p>Some Episodes are not associated with either a Series or a Brand. E.g. films, like <a href="http://www.bbc.co.uk/programmes/b00l5wdn">Lady In the Water</a>, for example.</p>
<p>And there&#8217;s also the more interesting relationship that sees consists of two Series being associated with one another. For example &#8220;<a href="http://www.bbc.co.uk/programmes/b006r9ys">Waking the Dead</a>&#8221; is divided up into Series (e.g. <a href="http://www.bbc.co.uk/programmes/b007tlwb">Series 5</a>), which themselves contain other Series (covering a specific story line, e.g. <a href="http://www.bbc.co.uk/programmes/b007tw3k">Towers of Silence</a>) and then individual Episodes (<a href="http://www.bbc.co.uk/programmes/b007ccx8">Part 1</a>).</p>
<p>(As an aside, this is the kind of flexibility that makes RDF such a great tool for modelling real-world data. I&#8217;ve used similar approaches in the past to model bibliographic metadata throwing out hierarchies and simply connecting together chunks of content in whatever structure is best suitable)</p>
<p>Finally an Episode may have more than one Version. It is at the Version level that information such as the sound format or duration of the show is captured, after all there may be many different manifestations of the same episode. Versions are also associated with Broadcasts which capture the date, time and channel (&#8221;masterbrand&#8221; in the Programmes ontology) on which the programme is aired. A Version of an Episode may be broadcast several times.</p>
<p>Finally at the most fine-grained level, there are Timelines that describe the start and end time of a specific broadcast.</p>
<h2>Application Ideas</h2>
<p>During my expeditions through the Big BBC Graph (&#8221;<em>you&#8217;re in a maze of twisty little predicates, all alike&#8230;</em>&#8220;) I&#8217;ve come up with a few application ideas that it would be interesting to put together. I thought I&#8217;d throw these out and see if anyone wants to pick them up.</p>
<p><strong>Programme Reviews</strong>. It&#8217;d be easy to build a mashup of the BBC programmes data and something like <a href="http://revyu.com">Revyu</a> (which also has a SPARQL endpoint) to allow someone to review a programme that they watched last night. Note, that as our crawling will be lagging behind the live site until we&#8217;ve implemented real-time updates, there will be a lead time between something being aired and in the Platform for reviewing.</p>
<p><strong>PVR Integration</strong>. There are a number of open source PVR solutions out there, could some of these be updated to automatically pull in additional data from the endpoint to improve electronic programme guides?</p>
<p><strong>Geographic Overlays</strong>. The interconnections between radio programmes, artists and their locations, offers an opportunity to build some mapping mashups, using either Google Maps or Earth. For example it ought to be possible to lay out the geographic spread of artists played by different BBC radio programmes and stations. Interested in music from a particular country or region? (Maybe you&#8217;re planning a trip there and what to pick up on the local vibe) Then use a map to home in on radio programmes that are most likely to play those artists.</p>
<p><strong>Fan Widgets</strong>. The ability to extract data from the endpoint using SPARQL and JSON means that its really easy to create little widgets to include programme data on external web pages. What could something like the <a href="http://tardis.wikia.com/">Doctor Who Tardis Index File</a> be enriched by widgets that came straight from the BBC database? Throw in additional annotations from the community and you could make some really interesting embeddable gadgets. Of course there&#8217;s also the other direction: if fan communities start using BBC identifiers then the BBC may be able to feed this crowd-sourced data back into their site, just as they&#8217;re doing with Wikipedia (via dbpedia)</p>
<p>Under the <a href="http://www.talis.com/cc">Talis Connected Commons</a> scheme anyone can have free hosting on the Platform for public domain data, so if a fan community wanted to organize itself around creating additional annotations for BBC programmes (how about character lists? mood assessment? scene breakdowns?) then these can be stored in the Platform for free, and then mashed up with the BBC data on the server-side using features like the <a href="http://n2.talis.com/wiki/Augment_Service">Augmentation</a> service, or <a href="http://blogs.talis.com/n2/archives/554">on the client-side using SPARQL and JSON</a>. Lots of potential there.</p>
<h2>Summary</h2>
<p>Hopefully that provides a good overview of the BBC linked data graph that we&#8217;re now hosting in the Talis Platform. There should be sufficient pointers here, and in some of <a href="http://api.talis.com/stores/bbc-demo/items/index.html">the example queries and demos</a> we&#8217;ve put together to get you started. If not, then feel free to ask questions on <a href="http://ideas.welcomebackstage.com/mailinglists">the BBC Backstage mailing list</a>, or <a href="http://groups.google.com/group/n2-dev">the n2-dev mailing list</a> or on IRC in #talis on irc.freenode.net.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Share This</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.connotea.org/addpopup?continue=confirm&amp;uri=http://blogs.talis.com/n2/archives/569&amp;title=Understanding+the+Big+BBC+Graph" rel="nofollow" title="Add to&nbsp;Connotea"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/connotea.png" title="Add to&nbsp;Connotea" alt="Add to&nbsp;Connotea" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blogs.talis.com/n2/archives/569&amp;title=Understanding+the+Big+BBC+Graph" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blogs.talis.com/n2/archives/569&amp;title=Understanding+the+Big+BBC+Graph" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blogs.talis.com/n2/archives/569&amp;title=Understanding+the+Big+BBC+Graph" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
<img src="http://feeds.feedburner.com/~r/talis/n2/~4/PDnyBq3DVL0" height="1" width="1"/>]]></content:encoded><description>In the lead up to the announcement of the BBC SPARQL endpoint trials I&amp;#8217;ve spent quite a bit of time working with and exploring the BBC /programmes and /music dataset. I thought it would be useful to write-up some of this to help out those of you looking to explore the data using the Talis [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.talis.com/n2/archives/569/feed</wfw:commentRss><feedburner:origLink>http://blogs.talis.com/n2/archives/569</feedburner:origLink></item><item rdf:about="http://blogs.talis.com/n2/?p=554"><title>SPARQL AJAX Client Library and Example</title><link>http://feedproxy.google.com/~r/talis/n2/~3/NWqE1Bam4-8/554</link><dc:subject>Tips and Tricks</dc:subject><dc:subject>Tutorials</dc:subject><dc:subject>ajax</dc:subject><dc:subject>javascript</dc:subject><dc:subject>jquery</dc:subject><dc:subject>SPARQL</dc:subject><dc:creator>Leigh Dodds</dc:creator><dc:date>2009-06-08T04:32:22-07:00</dc:date><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>Over the past few years I&#8217;ve tinkered with a number of different implementations of an AJAX client library for SPARQL. Before <a href="http://www.w3.org/TR/rdf-sparql-json-res/">a standard format for SPARQL JSON results</a>  was created, this involved having to jump through the extra hoops of parsing the XML format. But things are much easier now, especially when the JSON support is <a href="http://groups.google.com/group/n2-dev/browse_thread/thread/d3974505a30fa5ab">extended to include the results of CONSTRUCT and DESCRIBE queries</a>.</p>
<p>My personal favourite SPARQL client library though is the one produced by Lee Feigenbaum, Elias Torres, and Wing Yung as part of <a href="http://www.thefigtrees.net/lee/blog/2006/04/sparql_calendar_demo_a_sparql.html">their work on the SPARQL Calendar Demo</a>.</p>
<p>While the <a href="http://www.thefigtrees.net/lee/sw/sparql.js">sparql.js</a> library only supports JSON it does have a few convenience features which I like, including global PREFIX bindings and some functions for automatically processing the JSON results to produce some simpler javascript objects (e.g. arrays and hashes) that simplify some scripting tasks and make code more readable.</p>
<p>Using this on the Platform is quite straight-forward, as you can upload this library, and any other related Javascript files directly into <a href="http://n2.talis.com/wiki/Contentbox">the Contentbox</a> of your store. This not only avoids any cross-domain issues, but also means that you can deploy simple AJAX applications directly from a store.</p>
<p>I&#8217;ve put together a super simple demo that uses <a href="http://nasa.dataincubator.org">the NASA spaceflight data</a>. The <a href="http://n2.talis.com/svn/playground/ldodds/n2-examples/trunk/ajax/simple/">source code is here</a>, and I&#8217;ve uploaded the two files into the n2-examples store contentbox, so you can <a href="http://api.talis.com/stores/n2-examples/items/ajax/simple/index.html">play with the running application</a>.</p>
<p>The demo simply fetches the name, homepage, description and launch date for every spacecraft launched in a particular year, also retrieving a link to a photo if there&#8217;s one available. The results are dropped into an HTML table for viewing.</p>
<p>The code is well commented so rather than repeat that here, you can <a href="http://n2.talis.com/svn/playground/ldodds/n2-examples/trunk/ajax/simple/simple.js">look through the Javascript file that does the actual interaction</a>. I&#8217;ve used <a href="http://jquery.com/">JQuery</a> to help with the DOM manipulation, etc. This is delivered through the <a href="http://softwareas.com/google-jquery-cdn">Google JQuery CDN</a> rather than the Platform. But the rest of the application is served directly from the Platform.</p>
<p>A rather easy and trivial example, but sometimes its useful to reiterate the basics. And if you want to incorporate the NASA spaceflight data in your own mashups, then you can do so easily by simple using <a href="http://api.talis.com/stores/space/items/js/sparql.js">the version of sparql.js in the space data store</a>.</p>
<p>In my view, SPARQL + JSON + scripting languages like JS and Ruby hit a nice sweet spot for working with RDF, especially with the ability to bring together data from multiple sources using a single standard API.</p>
<p>Note: Keith Alexander has written up some of his own experiments with playing with JQuery against the platform <a href="http://blogs.talis.com/n2/archives/47">here</a> and <a href="http://blogs.talis.com/n2/archives/33">here</a>. His <a href="http://n2.talis.com/svn/playground/kwijibo/js/Talis.jQuery.plugin/trunk/Talis.jQuery.js">JQuery plugin</a> provides some additional Platform specific functionality.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Share This</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.connotea.org/addpopup?continue=confirm&amp;uri=http://blogs.talis.com/n2/archives/554&amp;title=SPARQL+AJAX+Client+Library+and+Example" rel="nofollow" title="Add to&nbsp;Connotea"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/connotea.png" title="Add to&nbsp;Connotea" alt="Add to&nbsp;Connotea" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blogs.talis.com/n2/archives/554&amp;title=SPARQL+AJAX+Client+Library+and+Example" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blogs.talis.com/n2/archives/554&amp;title=SPARQL+AJAX+Client+Library+and+Example" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blogs.talis.com/n2/archives/554&amp;title=SPARQL+AJAX+Client+Library+and+Example" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
<img src="http://feeds.feedburner.com/~r/talis/n2/~4/NWqE1Bam4-8" height="1" width="1"/>]]></content:encoded><description>Over the past few years I&amp;#8217;ve tinkered with a number of different implementations of an AJAX client library for SPARQL. Before a standard format for SPARQL JSON results  was created, this involved having to jump through the extra hoops of parsing the XML format. But things are much easier now, especially when the JSON [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.talis.com/n2/archives/554/feed</wfw:commentRss><feedburner:origLink>http://blogs.talis.com/n2/archives/554</feedburner:origLink></item><item rdf:about="http://blogs.talis.com/n2/?p=539"><title>Quick OpenCalais Hack</title><link>http://feedproxy.google.com/~r/talis/n2/~3/cDD-oclRYcM/539</link><dc:subject>Tips and Tricks</dc:subject><dc:subject>opencalais</dc:subject><dc:subject>pho</dc:subject><dc:subject>ruby</dc:subject><dc:creator>Leigh Dodds</dc:creator><dc:date>2009-06-08T01:47:32-07:00</dc:date><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I&#8217;ve been doing some more work on the <a href="http://pho.rubyforge.net">Ruby client for the Platform</a> recently, and one of my main goals is to provide functionality that makes it easier to copy, merge, interlink and relate together datasets. So far I&#8217;ve been concentrating on providing some framework code to make it easier to mash-up data across SPARQL endpoints, but there are many more services that one might want to use when enriching a dataset.</p>
<p>One of those services is <a href="http://www.opencalais.com/">OpenCalais</a>. I&#8217;ve played with the service on and off, and have previously built a Java client to the service to explore similar functionality using Java and Jena. But as I&#8217;m primarily working with Ruby at the moment, I thought I&#8217;d look for a Ruby client for Calais. Happily <a href="http://github.com/abhay/calais/tree/master">there is one on Github</a> and its <a href="http://rubyforge.org/projects/calais/">available as a Ruby gem</a>. </p>
<p>Documentation is a bit light, and I had to jump through a few hoops to get it working, needing to manually install the curb gem and some native libraries, the following worked for me:</p>
<p><code>sudo apt-get install libcurl3-dev<br />
sudo gem install curb<br />
sudo gem install calais<br />
</code></p>
<p>With that installed it was a breeze to run a document through the OpenCalais service, and then store the resulting RDF in the Platform:</p>
<pre>
<code>
# Use OpenCalais to find entities in a document specified on the command-line, then store the results
# in a Platform store
#
# Set the following environment variables:
#
# TALIS_USER:: username on Platform
# TALIS_PASS:: password
# TALIS_STORE:: store in which data will be stored
# CALAIS_KEY:: Calais license key
require 'rubygems'
require 'pho'
require 'calais'

store = Pho::Store.new(ENV["TALIS_STORE"], ENV["TALIS_USER"], ENV["TALIS_PASS"])
content = File.new(ARGV[0]).read()
resp = Calais.enlighten( :content =&gt; content, :content_type =&gt; :text, :license_id =&gt; ENV["CALAIS_KEY"])
resp = store.store_data(resp)
puts resp.status
</code>
</pre>
<p>The <a href="http://n2.talis.com/svn/playground/ldodds/n2-examples/trunk/calais/enlighten.rb">code is here</a>, and here&#8217;s some <a href="http://http://n2.talis.com/svn/playground/ldodds/n2-examples/trunk/calais/bio.txt">sample input</a> and <a href="http://n2.talis.com/svn/playground/ldodds/n2-examples/trunk/calais/output.rdf">sample output</a>.</p>
<p>The code is pretty trivial and error handling is non-existent, but I was pleased with how easy it was to get some data out of OpenCalais and pushed into the Platform. A bit of SPARQL can then be used to do some analysis or further processing of the results</p>
<p>So how do I plan to use this? </p>
<p>As a personal project I&#8217;m building out a dataset of NASA space-flight data, this will also include some metadata about astronauts and their roles on each mission. What I want to do is take some documents from the web and then store additional data to state relationships like &#8220;Buzz Aldrin is the <code>foaf:primaryTopic</code> of this document&#8221;.</p>
<p>The workflow I&#8217;m considering is using a Google custom search to give me a high-level index of content, e.g. selecting only the NASA websites. I can then run some representative searches to find documents use OpenCalais to do entity extraction on each result. I can then store the OpenCalais RDF data in the store in a <a href="http://n2.talis.com/wiki/Private_Graphs_Collection">private graph</a> &#8212; as I don&#8217;t want the raw data in the main dataset &#8212; I want to assert triples using my ids and preferred vocabularies. </p>
<p>If the data is in a private graph then I can use the stores&#8217; <a href="http://n2.talis.com/wiki/Store_Multisparql_Service">multisparql service</a> to do some SPARQL queries to match up the resources and CONSTRUCT new triples to store in the public graph.</p>
<p>I&#8217;ll post again with some more details on this as I progress, but I thought I&#8217;d start out by showing just how simple it is to mashup <a href="http://www.opencalais.com/">OpenCalais</a> and the <a href="http://www.talis.com/platform">Talis Platform</a>.</p>
<p>Don&#8217;t forget, if you want a Platform store to play with for development purposes then <a href="http://www.talis.com/platform/developers/contact">drop us a line</a>.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Share This</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.connotea.org/addpopup?continue=confirm&amp;uri=http://blogs.talis.com/n2/archives/539&amp;title=Quick+OpenCalais+Hack" rel="nofollow" title="Add to&nbsp;Connotea"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/connotea.png" title="Add to&nbsp;Connotea" alt="Add to&nbsp;Connotea" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blogs.talis.com/n2/archives/539&amp;title=Quick+OpenCalais+Hack" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blogs.talis.com/n2/archives/539&amp;title=Quick+OpenCalais+Hack" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blogs.talis.com/n2/archives/539&amp;title=Quick+OpenCalais+Hack" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
<img src="http://feeds.feedburner.com/~r/talis/n2/~4/cDD-oclRYcM" height="1" width="1"/>]]></content:encoded><description>I&amp;#8217;ve been doing some more work on the Ruby client for the Platform recently, and one of my main goals is to provide functionality that makes it easier to copy, merge, interlink and relate together datasets. So far I&amp;#8217;ve been concentrating on providing some framework code to make it easier to mash-up data across SPARQL [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.talis.com/n2/archives/539/feed</wfw:commentRss><feedburner:origLink>http://blogs.talis.com/n2/archives/539</feedburner:origLink></item><item rdf:about="http://blogs.talis.com/n2/?p=533"><title>Pho 0.5</title><link>http://feedproxy.google.com/~r/talis/n2/~3/Sb3NzKiKLVY/533</link><dc:subject>Uncategorized</dc:subject><dc:subject>pho</dc:subject><dc:subject>ruby</dc:subject><dc:creator>Leigh Dodds</dc:creator><dc:date>2009-06-04T07:50:27-07:00</dc:date><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>I&#8217;ve just sent a quick announcement to the n2-dev mailing list to <a href="http://groups.google.com/group/n2-dev/t/18192fd8277592a8">announce a new release of Pho</a> the Ruby client for the Talis Platform.</p>
<p>The <a href="http://pho.rubyforge.org/rdoc/files/CHANGES.html">CHANGES document</a> includes a complete summary of the changes made since the 0.4.1 release. There have been quite a few of these as I&#8217;ve added more code for handling submission of directories of files to the Content Box; initial support for Changesets to support updates of RDF graphs, including support for &#8220;diffing&#8221; two graphs to generate the appropriate changesets for submission to the Platform; as well as a SPARQL protocol client and a number utility classes to make working with SPARQL queries slightly easier.</p>
<p>The <a href="http://groups.google.com/group/n2-dev/t/d3974505a30fa5ab">addition of RDF/JSON</a> for serializing results of CONSTRUCT and DESCRIBE queries makes it much easier to work with query results as they&#8217;re much easier to parse.</p>
<p>The latest release does add a dependency on <a href="http://librdf.org/docs/ruby.html">the Redland Ruby language bindings</a> to provide support for parsing of RDF/XML, Turtle and N-Triples. So you&#8217;ll need to install the relevant Redland packages to make use of the latest release.</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Share This</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.connotea.org/addpopup?continue=confirm&amp;uri=http://blogs.talis.com/n2/archives/533&amp;title=Pho+0.5" rel="nofollow" title="Add to&nbsp;Connotea"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/connotea.png" title="Add to&nbsp;Connotea" alt="Add to&nbsp;Connotea" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blogs.talis.com/n2/archives/533&amp;title=Pho+0.5" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blogs.talis.com/n2/archives/533&amp;title=Pho+0.5" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blogs.talis.com/n2/archives/533&amp;title=Pho+0.5" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
<img src="http://feeds.feedburner.com/~r/talis/n2/~4/Sb3NzKiKLVY" height="1" width="1"/>]]></content:encoded><description>I&amp;#8217;ve just sent a quick announcement to the n2-dev mailing list to announce a new release of Pho the Ruby client for the Talis Platform.
The CHANGES document includes a complete summary of the changes made since the 0.4.1 release. There have been quite a few of these as I&amp;#8217;ve added more code for handling submission [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.talis.com/n2/archives/533/feed</wfw:commentRss><feedburner:origLink>http://blogs.talis.com/n2/archives/533</feedburner:origLink></item><item rdf:about="http://blogs.talis.com/n2/?p=518"><title>Moriarty Progess Report</title><link>http://feedproxy.google.com/~r/talis/n2/~3/OHRem7_riJU/518</link><dc:subject>Projects</dc:subject><dc:subject>moriary</dc:subject><dc:subject>php</dc:subject><dc:creator>Ian Davis</dc:creator><dc:date>2009-06-03T01:35:08-07:00</dc:date><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>It&#8217;s been a while since I wrote about <a href="http://code.google.com/p/moriarty/">Moriarty</a>, the PHP library I created for working with the <a href="http://www.talis.com/platform">Talis Platform</a>. That&#8217;s not to say that there have been no changes: on the contrary, there have been lots of improvements and some major new areas of functionality. I&#8217;m going to summarise them in this post and then, time permitting, follow up with more detailed posts on particular areas.</p>
<ul>
<li><strong>Fresnel Selector Language</strong> &mdash; This is a major new addition to Moriarty. A new class called GraphPath has been added which implements almost all of the <a href="http://www.w3.org/2005/04/fresnel-info/fsl/">Fresnel Selector Language</a> specification. I&#8217;ve been interested in RDF path languages for a long time and  FSL now appears to be the strongest contender. Currently this is a stand-alone class, but after a few more cycles of testing it would be nice to add a convenience method to SimpleGraph to allow selection of resources using paths.</li>
<li><strong>Zend-compatible caching</strong> &mdash; I did a substantial refactoring a while back to convert Moriarty&#8217;s HTTP caching implementation to be compatible with Zend&#8217;s cache interfaces. Whereas before you were limited to caching HTTP responses to disk, you can now supply any of Zend&#8217;s built-in cache classes to enable caching in databases, memcached and many other systems. You do this by creating an instance of HttpRequestFactory with your cache class and then pass the factory to the Store class.</li>
<li><strong>JSON usage</strong> &mdash; <a href="http://n2.talis.com/wiki/Platform_Release_24_Notes">Release 24</a> of the Talis Platform introduced <a href="http://n2.talis.com/wiki/RDF_JSON_Specification">RDF/JSON</a> serialisation for describe and constuct SPARQL queries. Moriarty now requests this format where it and because the SimpleGraph class uses an RDF/JSON structure as its index often there is no result parsing involved at all.</li>
<li><strong>OAI Service Support</strong> &mdash; OAIService is a new class that represents a store&#8217;s <a href="http://n2.talis.com/wiki/Store_OAI_Service">OAI-PMH Service</a>. It provides simple access to the OAI service allowing all resources in a store to be listed.</li>
<li><strong>Automated Builds</strong> &mdash; We have added Moriarty to an Hudson server which monitors the subversion repository and runs the unit test suite after every checkin. It&#8217;s not ideal because the server is not accessible to users outside of Talis (come on Google Code - we need Hudson support!). However it adds an extra level of confidence to checkins because test failures are emailed out to moriarty-dev@googlegroups.com which is open for anyone to join. A few times in the past we have run the unit tests locally and then forgotten to check in some critical dependency so the subversion trunk contains a broken build. Hudson will alert us to these kinds of errors much more quickly.</li>
<li><strong>Extended Describes</strong> &mdash; The Sparql classes now accept an extra parameter to their describe methods that allows you to specify the type of description you want. By default you get the Platform&#8217;s default graph which is a list of triples that have the subject you specify (no bnodes remember!). Moriarty allows you to easily request other types such as symmetric bounded description (triples where the URI being described is subject or object), labelled bounded description (like the default description plus the addition of label properties for URIs in the description set) and symmetric labelled bounded description (a combination of the previous two). See the <a href="http://n2.talis.com/wiki/Bounded_Descriptions_in_RDF">Bounded Description</a> page on the n2 wiki for more information.</li>
<li><strong>Richer Store Interface</strong> &mdash; Up until now Moriarty has used a object model that closely follows the Platform&#8217;s separation of services. That tended to make code using Moriarty quite verbose. We&#8217;re now gradually introucing convenience methods onto the Store class so common operations can be accessed with less code.</li>
</ul>
<p>The moriarty Google Code project now has several committers although Keith and myself are still the most prolific. However, having multiple committers is one more step away from this being a personal project and towards it being community owned. Moriarty is being used in lots of small projects in and around Talis, but significantly it is also in the core of two of our most important products: <a href="http://www.talis.com/prism">Talis Prism</a> and <a href="http://www.talis.com/aspire">Talis Aspire</a>. That&#8217;s great validation for Moriarty, although it brings a lot more responsibility in terms of quality of testing. I now consider Moriarty to be out of continual alpha and into continual beta!</p>
<p><strong>About Moriarty&#8230;</strong> Moriarty is a simple PHP library for accessing the <a href="http://n2.talis.com/">Talis Platform</a>. It follows the Platform API very closely and wraps up many common tasks into convenient classes while remaining very lightweight. It also provides some simple RDF classes that are based on the excellent <a href="http://arc.semsol.org/">ARC2</a> class library. Moriarty is being developed by small community of developers and is in continual beta, subject to a slow stream of updates. You can read <a href="http://n2.talis.com/wiki/Moriarty">more about Moriarty on the n&#178; wiki</a> or visit its <a href="http://code.google.com/p/moriarty/">Google Code project</a></p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Share This</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.connotea.org/addpopup?continue=confirm&amp;uri=http://blogs.talis.com/n2/archives/518&amp;title=Moriarty+Progess+Report" rel="nofollow" title="Add to&nbsp;Connotea"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/connotea.png" title="Add to&nbsp;Connotea" alt="Add to&nbsp;Connotea" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blogs.talis.com/n2/archives/518&amp;title=Moriarty+Progess+Report" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blogs.talis.com/n2/archives/518&amp;title=Moriarty+Progess+Report" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blogs.talis.com/n2/archives/518&amp;title=Moriarty+Progess+Report" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
<img src="http://feeds.feedburner.com/~r/talis/n2/~4/OHRem7_riJU" height="1" width="1"/>]]></content:encoded><description>It&amp;#8217;s been a while since I wrote about Moriarty, the PHP library I created for working with the Talis Platform. That&amp;#8217;s not to say that there have been no changes: on the contrary, there have been lots of improvements and some major new areas of functionality. I&amp;#8217;m going to summarise them in this post and [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.talis.com/n2/archives/518/feed</wfw:commentRss><feedburner:origLink>http://blogs.talis.com/n2/archives/518</feedburner:origLink></item><item rdf:about="http://blogs.talis.com/n2/?p=485"><title>voiD, datasets, graphs, documents, and dcterms:isPartOf backlinks</title><link>http://feedproxy.google.com/~r/talis/n2/~3/wvSpkKCcAQk/485</link><dc:subject>Community News</dc:subject><dc:subject>Ideas and Experiments</dc:subject><dc:subject>Tutorials</dc:subject><dc:subject>datasets</dc:subject><dc:subject>Linked Data</dc:subject><dc:subject>LOD</dc:subject><dc:subject>rdf</dc:subject><dc:subject>voiD</dc:subject><dc:creator>kwijibo</dc:creator><dc:date>2009-05-28T12:46:48-07:00</dc:date><content:encoded xmlns:content="http://purl.org/rss/1.0/modules/content/"><![CDATA[<p>One thing that I have heard people asking several times now regarding voiD is to do with how to say that data is part of a dataset.</p>
<p><a href="http://fgiasson.com/blog/">Frédérick Giasson</a> asked about this recently in <a href="http://chatlogs.planetrdf.com/swig/2009-05-27.html#T16-08-26">#swig</a>, and wondered why the <a href="http://rdfs.org/ns/void-guide">voiD guide</a> recommended using dcterms:isPartOf. I thought, since this is something that has been asked about a few times, I would blog about it and explain the reasoning behind this.</p>
<p>So, it wouldn&#8217;t be right to say something like:</p>
<p>	<code> &lt;http://lastfm.rdfize.com/artists/Black+Sabbath&gt; dcterms:isPartOf &lt;http://lastfm.rdfize.com/meta.n3#Dataset&gt; .</code></p>
<p>&#8230; because we don&#8217;t want to say that &#8220;Black Sabbath is part of the lastfm.rdfize.com dataset&#8221;.<br />
We want to say  &#8220;a description of Black Sabbath (composed of triples) is part of the <a href="http://lastfm.rdfize.com/">lastfm.rdfize.com dataset</a>&#8220;.</p>
<p>One approach to encapsulating this meaning would be to reify each individual triple and state that the triple is part of the dataset &#8230; but we felt that this would be neither practical nor popular.</p>
<p>So, in the voiD guide, we advocate that when you publish Linked Data, and you want to say that the data you are publishing is part of a voiD Dataset, you add a triple linking the <em>document</em> in which the data is published, to the dataset. eg:</p>
<p><code>&lt;http://lastfm.rdfize.com/?artistName=Black+Sabbath&gt; terms:partOf &lt;http://lastfm.rdfize.com/meta.n3#Dataset&gt; .</code></p>
<p>(where <code>&lt;http://lastfm.rdfize.com/?artistName=Black+Sabbath&gt; </code> is a document containing a description of <code>&lt;http://lastfm.rdfize.com/artists/Black+Sabbath&gt;</code>)</p>
<p>This way, when a Linked Data client dereferences <code>&lt;http://lastfm.rdfize.com/artists/Black+Sabbath&gt; </code>they get redirected to a document, and can follow the dcterms:isPartOf link from the document URI to the voiD Dataset.</p>
<p>What some people don&#8217;t like so much, is the implication that their dataset consists of documents, when what they really want to say is that their dataset consists of descriptions of resources.</p>
<p>The conceptual problem, if there is one, is that here the document URI is identifying an RDF/XML <em>document</em>, not the <em>graph</em> of  RDF data <em>encoded</em> in that document. So, if you wanted to explicitly state that the graph, rather than the document, is part of the dataset, it could perhaps be done like this:<br />
<code><br />
   [  a  &lt;http://www.w3.org/2004/03/trix/rdfg-1/Graph&gt; ;<br />
      &lt;http://purl.org/vocab/frbr/core#embodiment&gt; &lt;http://lastfm.rdfize.com/?artistName=Black+Sabbath&amp;output=rdf&gt; ;<br />
    dcterms:isPartOf &lt;http://lastfm.rdfize.com/meta.n3#Dataset&gt; .<br />
   ]<br />
</code></p>
<p>But I&#8217;m really not too sure if that is either semantically correct, or in any way a more practically useful description than simply saying the document is part of the dataset.</p>
<p>We (the voiD guide authors) think that the <code>&lt;document&gt; dcterms:isPartOf &lt;dataset&gt; </code>pattern is the most pragmatic approach to making a dataset discoverable from a LOD document.<br />
But we are also open to suggestions for improvement as we evolve the vocabulary and guide in line with popular usage and the requirements of LOD publishers.</p>
<p>What do you think?</p>
<!-- Social Bookmarks BEGIN -->
<div class="social_bookmark">
<a><strong><em>Share This</em></strong></a>
<br />
<div class="d">
<br />
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://www.connotea.org/addpopup?continue=confirm&amp;uri=http://blogs.talis.com/n2/archives/485&amp;title=voiD%2C+datasets%2C+graphs%2C+documents%2C+and+dcterms%3AisPartOf+backlinks" rel="nofollow" title="Add to&nbsp;Connotea"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/connotea.png" title="Add to&nbsp;Connotea" alt="Add to&nbsp;Connotea" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://del.icio.us/post?url=http://blogs.talis.com/n2/archives/485&amp;title=voiD%2C+datasets%2C+graphs%2C+documents%2C+and+dcterms%3AisPartOf+backlinks" rel="nofollow" title="Add to&nbsp;Del.icio.us"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/delicious.png" title="Add to&nbsp;Del.icio.us" alt="Add to&nbsp;Del.icio.us" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://digg.com/submit?phase=2&amp;url=http://blogs.talis.com/n2/archives/485&amp;title=voiD%2C+datasets%2C+graphs%2C+documents%2C+and+dcterms%3AisPartOf+backlinks" rel="nofollow" title="Add to&nbsp;digg"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/digg.png" title="Add to&nbsp;digg" alt="Add to&nbsp;digg" /></a>
<a onclick="window.open(this.href, '_blank', 'scrollbars=yes,menubar=no,height=600,width=750,resizable=yes,toolbar=no,location=no,status=no'); return false;" href="http://reddit.com/submit?url=http://blogs.talis.com/n2/archives/485&amp;title=voiD%2C+datasets%2C+graphs%2C+documents%2C+and+dcterms%3AisPartOf+backlinks" rel="nofollow" title="Add to&nbsp;reddit"><img class="social_img" src="http://blogs.talis.com/n2/wp-content/plugins/social-bookmarks/images/reddit.png" title="Add to&nbsp;reddit" alt="Add to&nbsp;reddit" /></a>
<br />
</div>
</div>
<!-- Social Bookmarks END -->
<img src="http://feeds.feedburner.com/~r/talis/n2/~4/wvSpkKCcAQk" height="1" width="1"/>]]></content:encoded><description>One thing that I have heard people asking several times now regarding voiD is to do with how to say that data is part of a dataset.
Frédérick Giasson asked about this recently in #swig, and wondered why the voiD guide recommended using dcterms:isPartOf. I thought, since this is something that has been asked about a [...]</description><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://blogs.talis.com/n2/archives/485/feed</wfw:commentRss><feedburner:origLink>http://blogs.talis.com/n2/archives/485</feedburner:origLink></item></rdf:RDF>
