From W3C Wiki
Jump to: navigation, search

Web of Data Objects (WoDo)

An object-oriented view on the Web of Data


What is a WoDo?

A Web of Data Object (WoDo) is a RESTful resource consisting of (i) an RDF graph, which is the DATA part of the WoDo, and (ii) a set of SPARQL Update statements forming the CODE part of the WoDo.

Why is this important?

There is a chasm between RESTful Web Services (see also REST and RDF Granularity) and the RDF-based Web of Data world. Understanding RDF-based data in an object-oriented sense might help overcoming this issue.

How is this supposed to work?

A first example

Let's look at a concrete example before we hammer out a big theory, which turns out to be worth nothing.

Assume (in some meta syntax) a class Person with the following declaration:

class Person {
 name : string // full name of the person
 friends : list of Person // the person's friends

 Person(name) // constructor
 string getName() // get the full name of the person
 void setName(name) // set, that is, overwrite the full name of the person

and to make it a bit more interesting some instances, etc:

michael = new Person('Michael Hausenblas')
toby = new Person('Toby Inkster')

Now, let's see how the DATA part of a potential WoDo would look like:

@PREFIX : <http:/example.org/person-wodo#>

:michael a foaf:Person;
         foaf:name 'Michael Hausenblas' ;
         foaf:knows :toby .

:toby a foaf:Person;
        foaf:name 'Toby Inkster' .

Further, the michael.getName() method, that is, a fragment of the WoDo's CODE part, might render as follows in SPARQL:

PREFIX foaf: <http://xmlns.com/foaf/0.1/>
PREFIX : <http:/example.org/person-wodo#>

SELECT ?name FROM <http:/example.org/person-wodo> WHERE {
 :michael foaf:name ?name .

A proof of concept in Perl

TobyInkster hacked together a first WoDo proof of concept in Perl.

This has been done before, right ?

Sort of. ActiveRDF is in this vein, however is bound to Ruby, hence not programming language agnostic. To make WoDos happen, one would need to create a sort of mapping for a certain target language, but approaches such as Redland indicate that such language bindings are feasible.