MySparql is a server and javascript client library being developed for fishDelish to aid in creating learning resources. While users will mostly interact through a layer of indirection via iDoc, I feel that MySparql is interesting enough to talk about on its own.
So what is it? Essentially, it is a query repository. It provides an API that you can throw a SPARQL query (and the SPARQL endpoint to query) at and it will return you an ID for the query. This then forms a URI that will run the query when the URI is requested. Simple enough. There’s some caching behaviour in there as well, so once you have run a query MySparql will store the results and serve that up instead of re-running the query in the future. This caching behaviour is based off the usage foreseen in FishDelish where the data is static – for other uses some thought would be needed to determine what constitutes a good caching behaviour (perhaps with a user specified Time To Live value for how long the results remain ‘valid’)
It also includes a JavaScript client library that does the good stuff. Currently, this client library is fairly simple – it will get the results from a MySparql stored query and display them in the page as a table. It can do this in two modes, currently called ‘Table’ and ‘Tutorial’. Table mode will get the results for the query and convert them into a table embedded in the page. Tutorial mode provides a query box tied to the data source and initially populated with the original query. This provides a learning resource where a user can see the results from a query, edit the query and re-run the query easily.
For creating queries, we currently have a TinyMCE plugin that provides a query editor (with preview) for content editors. This is added to the iDoc instance that will be used for creating fish-based learning resources for FishDelish.
This is a fairly simple solution that works well at the moment, providing a nice simple way to embed data tables into pages using SPARQL. There are also a couple of areas that will be added over the next week or two to add to the user experience. The first will be an XSLT mode for queries, which will allow the results from a query to be processed as specified by an XSLT file hosted online, with the results being displayed in-page. This will allow much richer pages to be built from MySparql queries, which we hope to exemplify by creating Species pages from the FishDelish data using just MySparql queries.
The second will hopefully be the inclusion of a query editor of some description into the TinyMCE editor plugin. Currently, the only vaguely suitable example seems to be Sparqler. Sparqler provides helper buttons to aid in query creation. This isn’t a perfect solution, and a better solution would be a Query By Example style editor if anything suitable can be found for integration. Creation of our own query editor isn’t completely off the table, but existing options will be evaluated before committing to such a large implementation task.