Getting Started With Linked Data – OpenUp Laboratories Example SPARQL Queries

On and off over the last few months, I’ve had the occasional rant and Twitter heckle about how hard it seems to be getting going with Linked Data, not least because the there appear to be so few rungs at the bottom of the getting started ladder.

The typical response of a Linked Data geek to a request for “how do I start” is often along the lines of:

do the following query to your LD datastore SPARQL endpoint:
SELECT ?a ?b ?c WHERE { ?a ?b ?C } LIMIT 50
and it’ll dump out 50 triples, so you can easily see what’s in there…

Right…

I personally find an easier way in to look at example queries that might, in and of themselves, be useful, or interesting; at the very least, they should provide an example of the sort of query you might make to the datastore in a real world context. As David Flanders pointed out in a tweet last night, just being able to get hold of lists is often a useful start. (Paul Miller retorted with a “lists are only a tiny part of the usefulness” quip, and then quietly failed to pull out even the most simple list of schools by council area from the education datastore. I think he was going to phone the council this morning, instead..?!;-)

Anyway, I was pleased to see that today(?) the TSO have launched the TSO OpenUP Laboratories, a showcase for work in progress that includes their Linked Data work. As well as linking to data sets they have a hand in:

OPen Up Laboratories - http://openuplabs.tso.co.uk/

there are also links to example queries on their Linked Data stores. So for example, here are some example queries on the statistics datastore

TSO openup labs linked data/sparql examples - http://openuplabs.tso.co.uk/

Meaningful example queries are given separately for all the datasets, and in many cases appear to have been chosen so that you can recombine fragments from two or more queries in order to produce more complex queries. So for example, in the research datastore, I could readily combine elements of the query [t[o find all the projects, which started in 2010 with the query to [f]ind the details for all the projects, whose project status is live and are funded by Technology Strategy Board to come up with a mashed together query to find the projects that started in 2010 funded by the Technology Strategy board.

I also made a couple of guesses at queries that don’t appear to be supported yet, but I hope will be. For example, the Technology Strategy Board was identified using it’s DBpedia identifier: <http://dbpedia.org/resource/Technology_Strategy_Board&gt;
So I went to DBPedia and searched for JISC (<Joint_Information_Systems_Committee>), and the EPSRC (<Engineering_and_Physical_Sciences_Research_Council>), and tried those queries, although they failed to return anything. But at least there was enough of a crib in the example queries to help me start thinking about possible queries I might be able to make on a research projects database.

As well as the sample queries, the TSO have been working on a RESTful/ URL based API that sits on top of a SPARQL query into a particular datastore and masks some of the complexity of the query from the user: Open Up Labs – APIs. (See also A Developers’ Guide to the Linked Data APIs.)

Work is still in progress on this API, but as well as abstracting up from queries via nicely patterned URLs, it also looks set to offer a variety of preview output displays, as you can see on the project wiki – for example: Linked Data API: BasicHTMLViewer

For some time, I’ve been of the mind that sharing queries is going to be a Good Thing to do, and that a small economy or query-based market may even evolve around them. Good examples are an important part of that, particularly from an educational point of view, and the OpenUP Labs provide a great example of this. With a bit of luck, I’ll have even more to post on this topic in the next few days…

PS by the by, it’s maybe also worth mentioning that the OpenUP competition deadline has been extended to the end of the year:

We are looking for ideas of how you, the public, want to have that information made available to you. What different pieces of information do you need to make that informed decision? How would you want that information presented to you – on a map, combined with other statistics, delivered as a regular email? What other information does government data need to be combined with to make it more useful?

We are looking for ideas from everyone; parents, students, businesspeople, GPs, local government officers, pensioners and everyone else who has ever needed to use a piece of government information.

This is your opportunity to share your ideas, win £1,000 and have your idea developed.

If you’re a developer, or just want to get involved we would love to hear from you as well.

Competition details
The closing date for the OpenUp challenge is now 31 December 2010. The best five ideas will then be selected and if yours is one of them you’ll be invited to pitch your idea for 10 minutes to a panel of experts. They will have the difficult job of choosing the winning idea which will be brought to life with a £50,000 development fund as well as £1,000 cash for the creator of the idea.

Hmmm.. I maybe need to have a think about that…?!;-)

PS see also: Hackable SPARQL Queries: Parameter Spotting Tutorial

Author: Tony Hirst

I'm a Senior Lecturer at The Open University, with an interest in #opendata policy and practice, as well as general web tinkering...

2 thoughts on “Getting Started With Linked Data – OpenUp Laboratories Example SPARQL Queries”

  1. It would be really great of you guys could also publish the schemas for these datasets! without the schema it is almost impossible to write a meaningful and complex queries!

Comments are closed.

%d bloggers like this: