RDF in Drupal: The Future - RDF in Drupal 7

Published June 19, 2009

We've seen in the previous four articles that RDF has the potential to be a game-changer when it comes to linked data on the web. The fact that is it an open standard, easy to understand, and implementable on sites from those powered by the most complex web applications to simple hand-built web pages makes it easy to understand why so many people are starting to look at RDF as one of the future cornerstones of the web.

Luckily for the Drupal community, our fearless leader Dries Buytaert recognized this in 2008 and suggested that Drupal take the lead in implementing RDF among open source content management systems.

Since then, a number of individuals have stepped up and committed to working to get RDF functionality in Drupal 7. The Semantic Web group on Drupal.org is the focal point of the work that is going on in this effort. Earlier this year, they posted a video about what will be possible when RDF functionality is available. They showcased advanced search results and the ability to navigate the relationships that RDF triples provide with HTML documents.

As part of the effort to get RDF in Drupal core, a week-long code sprint was held in Ireland with the aim to organize and to start implementing the various RDF plans and patches for Drupal 7. The result of the sprint was a "lightweight basic design for integrating RDF". Specifically, it was decided to implement RDF classes and properties for nodes, users, comments, and taxonomy terms. These RDF "mappings" could then be defined and altered programatically similar to the way forms and links are handled today. In a nutshell, it is an RDF API.

The code sprint participants split into two groups - one focused on figuring out the best ontology mappings for standard Drupal content. They worked on questions like, "What's the best way to mark up an article with comments with RDF? What ontologies should we use? What's the best way to mark up taxonomy terms?. Fortunately, they had some help in the form of Mark Birbeck, who is one of the designers of RDFa. The second group tasked themselves with figuring out how to build the RDF API.

Once the RDF API gets committed to core, this will allow helper functions to be written to push the RDF data to the theme layer in order to output RDFa (RDF data will only be output as RDFa in core - it will be up to contributed modules to output the RDF data in other formats). Then, individual core modules (node, user, blog, etc...) can be updated to output default RDFa attributes.

One of the key aspects of using RDF with Drupal is having the ability to define Compact URIs (CURIES) which allow you to use shorthand when writing RDFa attributes. In order to implement CURIES, an "RDF Namespace Registry" is needed to manage the various CURIES (to avoid duplicates). Much of this work has already been completed and committed to Drupal 7 core.

So, how does the work done so far compare with Dries' original vision of adding RDF support into Drupal? It's actually pretty close. A site deployed on the Drupal 7 platform will, (probably) by default, start exposing RDF data immediately. With well-over 100,000 downloads per month, that's a lot of new RDF data getting exposed every day. In this sense, Drupal will be way out in front of the curve compared to virtually every other content management system - open-source or not.

While the majority of the RDF effort for both Drupal 6 and Drupal 7 has been focused on the provider side of things, as RDF data becomes more prevalent, there will no doubt be a push to start consuming all of the newly-found data relationships.

Wrap Up

At the outset of the first article in this series, I indicated that I was motivated to write these articles in an effort to figure out if I could find a compelling reason to convince my clients that they should implement RDF on their Drupal sites. What did I learn?

For Drupal 6 sites, unless the client specifically requests RDF functionality, I would probably only recommend using Calais (or one of its companion modules) unless there is a clear indication that a more robust solution would be beneficial to them. With most of the Drupal 6 RDF modules still in the development phase, there is still a risk that a custom implementation will be a rocky (and costly) road for all but the simplest of cases.

Moving into the future, for Drupal 7 sites the question is moot. RDF will be there regardless. There will definitely be an opportunity to offer clients the ability to RDF-ize their custom content types using the next version of RDF CCK, but the decision to do so won't be nearly as difficult (or costly) as it is today.

RDF is coming. As a developer, I look at it this way: I will be able to offer RDF functionality to my clients at a fraction of the cost that my non-Drupal-developer competitors will be able to. Organizations that want an RDF solution will see that it will be baked right in to Drupal 7 - this will be a big advantage to us all. We're ahead of the curve.

Additional Resources

Interested in learning more? Here's some of the articles and videos I found useful while writing these articles:

  • CMSWire article about RDF, RDFa, and Drupal. Most of this article isn't Drupal-specific, but it does give a nice introduction into the Semantic Web.
  • Drupal.org RDF Glossary provides a bunch of RDF-related links neatly organized.
  • W3C RDFa Primer - the official introductory information from the official working group that is officially in charge of RDFa (it's all very official).
  • RDFa Use Cases: Scenarios for Embedding RDF in HTML - another official introductory article - this one focusing on different ways to use RDFa (events, blogs, articles, etc...)
  • RDFa for HTML Authors - More RDFa introductory information, this time mainly geared towards beginners
  • Quick Intro to RDF - a non-official RDF introductory article.
  • Linux Journal article titled, "Semantic Web Publishing with RDFa" - another nice, introductory article about implementing RDFa.
  • Video: Video: RDFa Basics - a most excellent video laying out the basics of RDFa.
  • Video: Video: Intro to the Semantic Web - a most excellent video introducing the Semantic Web. This is the video you want to show your boss when trying to convince him to implement RDF.
  • RDFa - a great resource for RDFa articles and news from around the web. Well-written with a clean design.
  • RDFa Wikipedia page - a good overview.
  • Friend-of-a-Friend (FOAF) Wikipedia page - again, a nice, quick read to get you up-to-speed.
  • Dublin Core Wikipedia page - see the pattern here? Wikipedia has some nice, introductory articles about most of the more popular ontologies.
  • LinkedData.org provides a list of linked data (RDF and microfomats, primarily) available on the web. The cloud diagram on its home page is often used to illustrate the current extent of the linked data web.
  • DBPedia is a fantastic resource for RDF-enabled data. It is a "Community effort to extract structured information from Wikipedia" for use by RDF applications. DBPedia is one of the more popular (and useful) RDF data stores available today. Take a look at the LinkedData home page for proof.
  • The Data Portability Project is an organization whose goal is to promote linked data. Many large organizations and companies (Google, Facebook, Yahoo!, Microsoft) are part of this organization.

Thanks to  Benjamin Melançon of the Agaric Design Collective for his assistance with this article. Benjamin is an active member of the Drupal community and attended the "RDF in Core" sprint in May, 2009.

This is part 5 in a 5 part series about RDF and Drupal.

  1. RDF in Drupal: What is it and Why Should We Care?
  2. RDF in Drupal: Benefits to Casual Web Surfers
  3. RDF in Drupal: Super-Simple Primer
  4. RDF in Drupal: What can I do now? Drupal 6 and the Semantic Web
  5. RDF in Drupal: The Future - RDF and Drupal 7

Comments

Hi Mike!

Fantastic series here! Question though: how does RDF deal with descriptions about the same subject but in different languages, i.e. "hat" & "chapeau"? Is someone talking about this somewhere?

Sign up to receive email notifications of whenever we publish a new blog post or quicktip!

Name
CAPTCHA