Linked Data for RESTafarians

2009-10-09

So, you took the red pill? You’re a full blown RESTafarian brother? Good news for you, then. You’ll understand linked data in less then 30sec. Ok. Step by step. REST, understood as a ’set of constraints that inform an architecture’:

  1. Resource Identification
  2. Uniform Interface
  3. Self-Describing Messages
  4. Hypermedia Driving Application State
  5. Stateless Interactions

… and now read the linked data principles with your ‘REST goggles’ on:

  1. Use URIs as names for things
  2. Use HTTP URIs so that people can look up those names.
  3. When someone looks up a URI, provide useful information, using the standards (RDF, SPARQL)
  4. Include links to other URIs. so that they can discover more things.

In the linked data, we use HTTP URIs for everything. For documents, but also for concepts or real-world entities such as people. Linked data provides a uniform (read-only) interface through HTTP GET. The messages are self-describing through RDF and RDF-based vocabularies and through the last of the linked data principles, what we have in the LOD cloud is a highly connected (or: interlinked) system.

As nicely described by Leonard Richardson and Sam Ruby in RESTful Web Services you design a RESTful (ROA) system in that you:

  • Identify and name your resources (using HTTP URIs),
  • design your representations (documents & data), and
  • link the resources to each other.

You’ll typically end up in a 3D design space such as the following (kudos to Cesare Pautasso and Erik Wilde):
REST-design-space

The same actually happens when you publish linked data, with some simplifications: due to the read-only characteristic of linked data you only have to worry about one HTTP verb (GET) and with RDF as the unified data model (based on your preferences and needs) you pick one of the RDF serializations (preferably RDFa, as it nicely integrates with HTML and hence allows you to serve humans and programs). When you have your data in RDF (or so ;) you’ll mainly find yourself worrying how to interlink it with other data on the Web. But this really is a huge benefit – finally enabling to use the Web as one huge database.

As an aside: I’m aware of the fact that we still need to sort out some issues along the way, both in the academia and in practice. However, I encourage people in both camps (RESTful yadayada and Linked Data rogues) to look beyond one’s own nose and eventually understand that there is only one Web and we all ‘live’ in it ;)


Technology MalBestPracticing

2009-05-24

Reading RESTful Web Services by Leonard Richardson and Sam Ruby, it suddenly stroke my like thunder: yes indeed, it’s very often the case with technologies that they are (often unknowingly) abused in obscure ways, which then is often perceived by the community as good or best practice. So much generic introduction for explaining the title – let’s flesh it out ;)

Couple of years a go I used to develop Web applications using JSP and relational databases (RDB). One pattern I often found (and have to admit, did myself pretty much the same way): treating the RDB only as a dump store without exploiting the features it offers. So, you load whatever you need via some SQL command in the beginning, process it in memory and when you’re done you dump it back again into the RDB. Is this the way RDB are supposed to be used? Certainly not.

Then, as motivated by the RESTful WS book, HTTP naturally provides a set of methods for CRUD operations, however, certain so-called ‘Web’ solutions merely use HTTP as a transport protocol and redefine most of the logic in rather complex ways (RPC-style being one example, but also hybrids exist that partially use HTTP for reading, but define their own mechanisms to update resources).

Anyway, there seems to be a pattern and now I was wondering if we know about such MalBestPracticing in the RDF world as well. What comes to mind are the following (ok, very roughly, but feel free to add yours):

  • Using RDF in a closed-world setup: often seen and often seen failing. Whenever you have a closed-world application, that is, something that’s supposed to do a job in an environment you entirely control (Intranet, desktop, etc.) and there is no need to share/incorporate other data, using RDF is probably not a smart choice. You’re better off with the RDB of your choice and some hand-coded rules, both in terms of complexity and performance.
  • Thinking of RDF on the serialisation level. Yes, there are a couple of RDF serialisations such as RDF/XML, RDFa, Turtle, etc. but that’s not the point. If I want to I can put my RDF-glasses on and view (quite) everything as RDF, but one should think of RDF on the data model level, rather. The important point is that RDF provides a away to express structured data in a graph manner which happens to be the same as the Web from a morphological point of view.
  • No interlinking between data. Hu, that’s a heavy one. Publishing RDF without interlinking to other data in RDF out there. But to be fair, this has been properly addressed by TimBL in his LinkedData note and the community has picked it up since. Imagine HTML documents on all of the computers in the world … without a single hyperlink between them. Would you call that the Web? Certainly not. Believe it or not, this was more or less what we’ve been doing for more than six years or so in the Semantic Web.

So, what’s your favorite MalBestPracticing in the Semantic Web world?