I suspect many of our readers may already have a black belt in Linked Data, but for others it’s all new, so I thought it was worth explaining what Linked Data means to me. The definitive description is Tim Berners-Lee’s Design Issues document, but I’ll try to illustrate what this means in practice.

In a nutshell, Linked Data is:

“a method of publishing structured data [on the Web], so that it can be interlinked and become more useful.” -wikipedia

Linked Data can be used to describe any real-world things, such as people, objects, events, observations etc. Let’s say we want to describe a unicorn (called Yuri).

1. We choose an http URI to identify our unicorn. This URI looks like a normal web address, but in essence it’s just a long name for Yuri (and is unique to him alone). For example, if I owned the unicornherders.com domain (I don’t!), I might choose:

http://unicornherders.com/id/unicorns/yuri

2. As you’d expect from a web address, people can look it up. Dereferencable (look-up-able) identifiers are a key feature of Linked Data. Looking up this URI would yield useful information about Yuri the Unicorn, such as his height, weight, eye colour, and horn-length.

3. The info also contains links that connect Yuri to related things (such as Yuri’s family members, owner, breed etc.), and be available in different useful formats. This puts Yuri in context, and allows the person originally interested in Yuri to continue browsing and discover other useful stuff.

A Worked Example

My description above hopefully sounds simple enough, but to clarify here’s a (more sensible) worked example…

This is the URI that the folks at data.gov.uk have chosen to identify the City of Manchester local authority district:

http://statistics.data.gov.uk/id/local-authority-district/00BN

If you click on the link above, you will be redirected (via a 303 “see other” response) to an HTML page which contains information about the City of Manchester.

http://statistics.data.gov.uk/doc/local-authority-district/00BN

Aside: It’s worth noting that your browser ends up at a different address to the original URI you entered. This is because in Linked Data we make a distinction between the real world thing, the City of Manchester local authority (…/id/…) and a document about the City of Manchester (…/doc/…). It can seem like nit-picking, but I think it’s an important point to get your head around.

On that web page, there are links to other related things, such as the containing county, Greater Manchester.

You can request the information about the City of Manchester in different formats by including an HTTP accept header.

For example, to get it as JSON:


curl --get http://statistics.data.gov.uk/doc/local-authority-district/00BN --header "Accept: application/json" -v

Alternatively, you can just add a format extension to the description page’s URL, like so:

http://statistics.data.gov.uk/doc/local-authority-district/00BN.json

Both of these approaches will yield something like this:


{"http:\/\/statistics.data.gov.uk\/id\/local-authority-district\/00BN":{"http:\/\/www.w3.org\/2004\/02\/skos\/core#altLabel":[{"value":"Manchester","type":"literal","lang":"en"}],"http:\/\/statistics.data.gov.uk\/def\/administrative-geography\/region":[{"value":"http:\/\/statistics.data.gov.uk\/id\/government-office-region\/B","type":"uri"}],"http:\/\/statistics.data.gov.uk\/def\/electoral-geography\/ward":[{"value":"http:\/\/statistics.data.gov.uk\/id\/electoral-ward\/00BNGQ","type":"uri"},{"value":"http:\/\/statistics.data.gov.uk\/id\/electoral-ward\/00BNHH","type":"uri"},{"value":"http:\/\/statistics.data.gov.uk\/id\/electoral-ward\/00BNHB","type":"uri"}
...

I’ve used JSON in my example as many developers are already familiar with that, but you can get the same information in other formats including RDF/XML (.rdf) and Turtle (.ttl).

Keep up to date with our news by signing up to our newsletter.
Thanks for reading all the way to the end!
We'd love it if you shared this article.