Yesterday I quickly wrote up a simple (but awesome) MediaWiki extension that allows you to make use of the Spark library in your wiki.
Spark as described on the Spark website:
The web is not only growing in sheer size, but it also grows in how much it is interconnected. Where once the Web was a set of more or less separated sites, today sites are more and more being connected. More and more data is being offered on the Web in a way that can be further processed, and more and more sites and applications are using external data. More and more mashups are created, where data from different sources is integrated and displayed with novel visualisations.
Spark is a library that enables HTML authors to create mashups more easily than ever before. Using standard Web technologies like SPARQL, RDF, HTML5, and JavaScript, Spark can query external knowledge sources (so called triple stores or SPARQL endpoints), and then visualise the results.
With Spark, website developers can create visually appealing mashups without having to write a single line of JavaScript, but merely using some markup elements describing the source of the data that is to be shown, a query to select the appropriate data, and selecting one from an expandable set of visualisations and their parameters.
Spark is developed by Denny Vrandečić and Andreas Harth.
This MediaWiki extension, unsurprisingly titled Spark, adds a <spark> tag to MediaWiki which is equivalent to <div class=”spark”> as described in the spark library documentation. All parameters (except the class=”spark” one) can just be copied over between spark divs in web pages, and the <spark> tag in MediaWiki. It is currently at version 0.1, which is a beta release. It includes a still experimental version of the Spark library, so you should probably not use this extension on production websites just yet. The Spark people are looking for developers to help out, so if you want to play around with SPARQL a bit, like I basically did with this extension, be sure to poke them 🙂
The extension required MediaWiki 1.17 or above (as it makes use of the new Resource Loader) and PHP 5.2 or later.
Download
- The current Spark (MediaWiki extension) release (zip)
- svn co http://svn.wikimedia.org/svnroot/mediawiki/tags/extensions/Spark/REL_0_1 (tag for 0.1, including Spark lib trunk)
- svn co http://svn.wikimedia.org/svnroot/mediawiki/trunk/extensions/Spark (trunk, including Spark lib trunk)
- svn co http://rdf-spark.googlecode.com/svn/trunk/src/ (Spark lib trunk)
Further possibilities
Right now you can embed mashups with SPARQL queries that get their data from some SPARQL endpoint. This opens up a whole bunch of possibilities, but is a bit silly when you are running your own Semantic MediaWiki instance and want to visualize structured data stored by it using Spark. A possible addition to the Spark MediaWiki extension therefore is having support for Spark as a so called SMW result format. For this translation from the SMW ask query language to SPARQL is needed, which is some work. I might implement this at some future point, but have several other things I want to poke at, so it won’t be soonish 🙂