RDFa in Drupal - examples and use cases

scor's picture

This is the video which was presented during DrupalCon DC 2009 at the Practical Semantic Web and Why You Should Care session.


Below are some details about which technologies were used and how this demo was built, as well its transcript.

Yahoo! SearchMonkey

A couple a SearchMonkey Apps have been built for openspring.net and buytaert.net which enhance the display of search results for these sites. If you want to try them out, make sure you enable these once logged in to Yahoo!:

The deep links right below the title are the tags of the post was tagged with. If a picture is available, it is also displayed on the right handside of the search result. Same for the date. Dries' homepage features some personal data such as his interests, the projects he works for and his picture.

Browsing RDF data with VisiNav and Exhibit

RDFa is not only about search as Dries mentions in his post on Drupal, the semantic web and search:

This kind of technology is not limited to global search. On a social networking site built with Drupal, it opens up the possibility to do all sorts of deep social searches - searching by types and levels of relationships while simultaneously filtering by other criteria.

To illustrate this, a proof of concept social network site has been set up with the following modules: CCK, RDF, Evoc and RDF CCK. It features people with some information about their FOAF identity, the projects they work on, the organizations they work for and the content they published. All of these relationships are built with CCK nodereferences. RDF CCK takes care of the RDF mappings which are injected as RDFa in the HTML code of the page, while Evoc handles the external vocabulary management (FOAF, SIOC, DC, DOAP).

Such a site contains a lot of information expressed as RDF which is not necessarily easy to grasp by simply browsing the site. Tools have been developped to help the user make sense of this RDF data.

VisiNav is an RDF browser which allows to explore RDF data by following different property paths and representing the search results in various forms such as table, graph, map or timeline. On the visinav instance set up for this demo, it is possible to display things like the list of posts one's colleagues made in a particular topic, or the current projects they currently work on in a table or graph form as shown in the screencast. VisiNav is in an early stage and and still being actively developed. The official site currently contains more than 12 million statements retrieved from about 1 million RDF documents on the web.

Exhibit is a lightweight structured data publishing framework that lets you create web pages with support for sorting, filtering, and rich visualizations by writing only HTML and optionally some CSS and Javascript code. Exhibit is able to read RDFa straight from XHTML pages out of the box and represent this data in its faceted interface.

If you're in DrupalCon and are interested in seeing more of the inner working of these demo, I'll schedule a BoF on RDF CCK and SearchMonkey - check out the BoF board for more information.

Production team

Ben Lavender produced the screencast, Josh Huckabee built the exhibit view and Stéphane Corlosquet built the SearchMonkey apps and the social network site. Thanks also to Axel Polleres and Andreas Harth (creator of VisiNav) for their help and support. The work on both this video and the featured modules have been generously sponsored by DERI Galway, Harvard IIC and OpenBand.


Here is a normal Drupal page we've enabled with RDFa. RDFa tags look like this: normal RDF properties embedded within normal XHTML elements. To use them we'll visit SearchMonkey, a search engine provided by yahoo. Note the first result: in addition to the title, we've also got tags, the date it was posted, the picture associated with it, as well as other results from the same site with other information. Compare this to a normal search result, which would you rather have?

Here is another example searching for another user. Note that these taxonomy links are deep links into the site's taxonomy terms.

Even Dries has some RDFa content on his page. Again this query shows a few taxonomy term deep links. Searching for "drupal amnesty" reveals another set of taxonomy term deep links. Here we can see a list of all the drupal sites that Dries has highlighted on his blog.

Searching for Dries himself reveals not ony his wikipedia entry but also his homepage. Now that there's RDFa enabled homepage there is more specific information like his projects, and his interests, whereas his wikipedia page is just the first few sentences form the article.

So it's cool that Drupal can produce RDFa, but what's consuming RDFa? As an example we've made a project blog site. It consists of authors, each with colleagues, and blog posts, current projects, old projects, new writings, old writings and so on and so forth. When we select any individual author from this programme, we'll see things like their name, associated webpages, homepage, email, colleagues, current projects, past projects and so on and so forth.

Here is an example application that consumes RDFa data: VisiNav. Here we're searching for an author, and, once we've found him we're going to view his social network using the knows relation. Once we've found all of his associates, we'd like to see what all they've written, so using the made relation, we can see everything written by this author's social network. But what if we want to visualize this data in a different way? Applications such as Visinav can use the generic nature of RDF to display data in several different formats. Here we can see the same data as a table, and, if we erase a relation, we can go back a level and view the initial social network as a graph. Then we can add a level of complexity and view the current list of projects being undertaken by this author's social network. This project is not very popular, and this one is right in the center of the network.

Drupal can be an RDFa consumer too. Here, using the Exhibit module, we've taken our earlier RDFa enabled page and imported it into Exhibit. This didn't take any other processing. It's machine readable and now we have access to all of the machine readable field available to us before. Very quick, very simple, just what RDFa is supposed to be: human readable data, formatting data and machine readable data all in the same document, all inline, all describing the same thing. We could make this particular Exhibit a little more useful with some more configuration but we can already do some cool things with it.

Once you see what RDFa can do, you might be surprised to find you already know the site or two that can benefit from the extended search options and rich visualization tools available to RDF enabled applications.


Is this limited to certain apps/users?

kerberos's picture

When I search for "dries buytaert" on either Google.com or Yahoo.com, I don't get these fancy RDFa enhanced results (I am traveling in Europe right now). Do you need something special to see them?

Also, while I am very excited about the technology, what are the modules that actually generate this output?



Semantic Web

Group organizers

Group events

  • 2018-05-31 17:00 - 2018-06-02 18:00 Europe/Amsterdam
Add to calendar

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: