RDFa 1.1 Lite

Summary: RDFa 1.1 Lite is a simple subset of RDFa consisting of the following attributes: vocab, typeof, property, rel, about and prefix.

During the schema.org workshop, a proposal was put forth by RDFa’s resident hero, Ben Adida, for a stripped down version of RDFa 1.1, called RDFa 1.1 Lite. The RDFa syntax is often criticized as having too much functionality, leaving first-time authors confused about the more advanced features. This lighter version of RDFa will help authors easily jump into the Linked Data world. The goal was to create a very minimal subset that will work for 80% of the folks out there doing simple markup for things like search engines.

vocab, typeof and property

RDFa, like Microformats and Microdata, allow us to talk about things on the Web. Typically when we talk about a thing, we use a particular vocabulary to talk about it. So, if you wanted to talk about People, the vocabulary that you would use would specify terms like name and telephone number. When we want to mark up things on the Web, we need to do something very similar, which is specify which Web Vocabulary that we are going to be using. Here is a simple example that specifies a vocabulary that we intend to use to markup things in the paragraph:

<p vocab="http://schema.org/">
   My name is Manu Sporny and you can give me a ring via 1-800-555-0155.
</p>

As you will note above, we have specified that we’re going to be using the vocabulary that can be found at the http://schema.org/ Web address. This is a vocabulary that has been released by Google, Microsoft and Yahoo! to talk about common things on the Web that Search Engines care about – things like People, Places, Reviews, Recipes, and Events. Once we have specified the vocabulary, we need to specify the type of the thing that we’re talking about. In this particular case, we’re talking about a Person.

<p vocab="http://schema.org/" typeof="Person">
   My name is Manu Sporny and you can give me a ring via 1-800-555-0155.
</p>

Now all we need to do is specify which properties of that person we want to point out to the search engine. In the following example, we mark up the person’s name and phone number:

<p vocab="http://schema.org/" typeof="Person">
   My name is 
   <span property="name">Manu Sporny</span> 
   and you can give me a ring via
   <span property="telephone">1-800-555-0155</span>.
</p>

Now, when somebody types in “phone number for Manu Sporny” into a search engine, the search engine can more reliably answer the question directly, or point the person searching to a more relevant Web page.

rel

At times, two things on the Web may be related to one another in a specific way. For example, the current page may describe a thing that has a picture of it somewhere else on the Web.

<p vocab="http://schema.org/" typeof="Person">
   My name is 
   <span property="name">Manu Sporny</span> 
   and you can give me a ring via
   <span property="telephone">1-800-555-0155</span>.
   <img rel="image" src="http://manu.sporny.org/images/manu.png" />
</p>

The example above links the Person on the page to the image elsewhere on the Web using the “image” relationship. A search engine will now be able to divine that the Person on the page is depicted by the image that is linked to in the page.

about

If you want people to link to things on your page, you can identify the thing using a hash and a name. For example:

<p vocab="http://schema.org/" about="#manu" typeof="Person">
   My name is 
   <span property="name">Manu Sporny</span> 
   and you can give me a ring via
   <span property="telephone">1-800-555-0155</span>.
   <img rel="image" src="http://manu.sporny.org/images/manu.png" />
</p>

So, if we assume that the markup above can be found at http://example.org/people, then the identifier for the thing is the address, plus the value in the about attribute. Therefore, the identifier for the thing on the page would be: http://example.org/people#manu. This feature is similar to, but not exactly like, the id attribute in HTML.

prefix

In some cases, a vocabulary may not have all of the terms an author needs when describing their thing. The last feature in RDFa 1.1 Lite that some authors might need is the ability to specify more than one vocabulary. For example, if we are describing a Person and we need to specify that they have a blog, we could do something like the following:

<p vocab="http://schema.org/" prefix="foaf: http://xmlns.com/foaf/0.1/" about="#manu" typeof="Person">
   My name is 
   <span property="name">Manu Sporny</span> 
   and you can give me a ring via
   <span property="telephone">1-800-555-0155</span>.
   <img rel="image" src="http://manu.sporny.org/images/manu.png" />
   I have a <a rel="foaf:weblog" href="http://manu.sporny.org/">blog</a>.
</p>

The example assigns a short-hand prefix to the Friend-of-a-Friend vocabulary, foaf, and uses that prefix to specify the weblog vocabulary term. Since schema.org doesn’t have a clear way of expressing a person’s blog location, we can depend on FOAF to get the job done.

One of the other nice things about RDFa 1.1 (and RDFa 1.1 Lite) is that a number of useful and popular prefixes are pre-defined, so you can skip declaring them altogether and just use the prefixes.

Simplicity

That’s it – that is RDFa 1.1 Lite. It consists of six simple attributes; vocab, typeof, property, rel, about, and prefix. RDFa 1.1 Lite is completely upwards compatible with the full set of RDFa 1.1 attributes.

The Others

The RDFa 1.1 attributes that have been left out of RDFa 1.1 Lite are: content, datatype, resource, and rev. The great thing about RDFa 1.1 Lite and RDFa 1.1 is that you can always choose to use one or more of those advanced attributes and a conformant RDFa 1.1 processor will always pick up on the advanced attributes. That means that you don’t have to do anything to switch back and forth between RDFa 1.1 Lite and the full version of RDFa 1.1

7 Comments

Got something to say? Feel free, I want to hear from you! Leave a Comment

  1. bobdc says:

    What about blank nodes and reification? Just kidding. Looks great to me!

  2. Toby Inkster says:

    Interesting choice to exclude @content from RDFa Lite, when it’s part of one of the largest RDFa deployments on the Web (Open Graph Protocol).

    • ManuSporny says: (Author)

      Good point, Toby. We should probably include @content. The frustrating part is that Facebook and Google seem to want two very different things when it comes to markup, so pleasing both of them is challenging.

  3. H.E.A.T. says:

    If RDFa Lite is simply a specification of a few attributes already specified in the RDFa 1.1 specification, then what is the purpose of a different specification? Now we have 2 specification dealing with RDFa that are not standards.

    Maybe the better choice on addressing the issue would have been to simply rewrite the RDFa 1.1 Primer. In the revised Primer, you can address the “first level” attributes and migrate to the advanced attributes.

    The thing is, the W3C has a problem writing specifications that are comprehensible. Why convolute the RDFa situation by adding yet another specification…about the same thing? Now we have 2 specifications that can cause 2 areas of confusion and will not satisfy everyone trying to use RDFa.

    The truth of the matter is that RDFa Lite was developed simply to accommodate schema.org and its decision to use another non-standard technology, Microdata. I can accept having choices available for the web developers, but my understanding was that RDFa fell into the vision of the W3C to support a “web of data”, or the semantic web.

    Why are the members of the W3C, who are also the creators of schema.org, not supporting this vision? In my honest opinion, I do not feel developers would have had a problem using RDFa, in its fullest, if schema.org implemented RDFa into there schema. When it comes to SEO, developers will find a way.

    I am not against the fact that schema.org is using Microdata, which has the same use as RDFa, but curious about why schema.org has chosen to go against the W3C’s vision and that the W3C has chosen to accommodate this undermining and usurping action by schema.org.

    I have to ask : With schema.org controlling search and using Microdata as the primary syntax and HTML5 being specified to use Microdata as well, what is the point of RDFa? Is RDFa still a viable option for those concerned with SEO? Is there a good reason to bloat lean pages with RDFa (and the extra markup necessary to break up the semantics) when all the major browsers controlled by the WHATWG and schema.org are focused on Microdata?

    Politics aside, can I get a straight up answer from the gut?

  4. John Natoli says:

    Thanks for encapsulating this so nicely. I too am a bit confused as to the need for 2 specs. Isn’t it more accurate to say that RDFa Lite is just a method of using RDFa – sort of the minimum required usage for acceptable machine-readability? I guess that all comes down to semantics (ha), but really, is there an actual difference?

    • ManuSporny says: (Author)

      Yes, that’s a fair statement. RDFa Lite exists because people were looking at RDFa 1.1 and saying it was too complicated. We took just the basics necessary to get the point across and put it in another spec, and that took care of most of the “RDFa 1.1 is too complicated” arguments. Humans are weird. :)

Leave a Comment

Let us know your thoughts on this post but remember to play nicely folks!