RDFa

From Creative Commons
Revision as of 18:44, 28 January 2009 by Fred Benenson (talk | contribs)
Jump to: navigation, search

RDFa is a way of expressing RDF in XHTML. Creative Commons uses RDFa to express license and other information about works for the semantic web. When you select a license in our license chooser, you are given a snippet of HTML that contains RDFa. Sites like Thingiverse have implemented RDFa across their platform so that every object uploaded expresses semantic information about itself to machines.

By using RDFa, Creative Commons is helping build the semantic web. Here are some frequently asked questions which can help you understand RDFa and the semantic web.

What is the point of the semantic web?

Traditionally, machines have had a very poor understanding of what humans are actually talking about when they create content. Computers may understand that a file is a text file or another file is an image file, but they typically don't understand what knowledge, or semantics, are expressed inside that file. This has been remedied to some extent by metadata such as tags or EXIF data.

But to a machine, the web is merely a heap of human-readable-data that needs to be classified by seemingly arbitrary rules. Google and other search engines have engineered meaning out of how humans create HTML documents. By interpreting a link expressed in HTML as a semantically meaningful "vote" for another page, Google can accurately value and rank all linked pages on the web.

While incoming links are good semantic indicators of value (or popularity) of a page, web pages should be able to express much more sophisticated statements to machines. Currently, web pages only express sophisticated statements to humans, but this can change.

Furthermore, humans should have the ability to query these knowledge statements in sophisticated ways. Just think if you could ask a question to Google about how many US presidents were born in Kentucky and receive an answer not because Google had somehow magically interpreted what you meant, but simply because Google maintained a database of triples that was trivially easy to query?

The vision behind the semantic web is that storing and retrieving information on the web should not require machines parsing human language but rather machines parsing machine language. The web has the potential to offer massive amounts of structured information in conjunction with the massive amounts of unstructured information that already exists and if we are careful to create the proper standards and platforms that can render these statements, then the semantic web will become a reality.

What is RDF?

RDF stands for "Resource Description Framework" which is not a particularly informative acronym. Put simply, RDF is the way to express information semantically on the web. RDF is constituted by triples which are subject-predicate-objects statements. This lets machines understand human knowledge statements.

What is a RDF triple?

A RDF triple can formed from any semantically meaningful statement. Here are some examples: <This website> <has> <a wiki>. <That photo> <is licensed under> <a Creative Commons Attribution license>. Depending on the format chosen, RDF triples can live inside an XML or XHTML file.

What is RDFa?

RDFa is a way of expressing RDF triples inside XHTML pages using tags.

This makes it much easier for people to casually express semantic information in conjunction with a normal web page. While there are many ways to express RDF (such as in serialized XML files that live next to standard webpages), RDFa helps machines and humans read the same exact content.

How does CC use RDFa?

When you fill the "Additional Information" section of our license chooser form, you are given a snippet of XHTML code that contains an image badge, a link to our license, some text, and some span tags. Inside these span tags, RDFa is expressed.

Here's an example:

<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">
<img alt="Creative Commons License" style="border-width:0" 
src="http://i.creativecommons.org/l/by-sa/3.0/us/88x31.png" /></a>
<br /><span xmlns:dc="http://purl.org/dc/elements/1.1/" 
href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type">
RDFa FAQ</span> by <a xmlns:cc="http://creativecommons.org/ns#" 
href="http://www.fredbenenson.com" property="cc:attributionName" 
rel="cc:attributionURL">Fred Benenson</a> is licensed under a 
<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">
Creative Commons Attribution-Share Alike 3.0 United States License</a>.
<br />Based on a work at <a xmlns:dc="http://purl.org/dc/elements/1.1/" 
href="http://wiki.creativecommons.org/RDFa" rel="dc:source">
wiki.creativecommons.org</a>.

dc:title/dc:type

The first bit of RDFa is this:

<span xmlns:dc="http://purl.org/dc/elements/1.1/" 
href="http://purl.org/dc/dcmitype/Text" property="dc:title" rel="dc:type">
RDFa FAQ</span>

cc:attributionName/cc:attributionURL

<a xmlns:cc="http://creativecommons.org/ns#" 
href="http://www.fredbenenson.com" property="cc:attributionName" 
rel="cc:attributionURL">Fred Benenson</a>

rel="license"

<a rel="license" href="http://creativecommons.org/licenses/by-sa/3.0/us/">
Creative Commons Attribution-Share Alike 3.0 United States License</a>.

dc:source

Based on a work at <a xmlns:dc="http://purl.org/dc/elements/1.1/" 
href="http://wiki.creativecommons.org/RDFa" rel="dc:source">
wiki.creativecommons.org</a>

How do I use RDFa?

I'm a developer, how do I implement RDFa into my platform?

Who else uses RDFa?

What is a microformat?

Why don't you use microformats?

What is Dublin Core?

Why does RDFa require XHTML and not HTML?

RDFa allows building metadata into XHTML and other XML documents with attributes. See also RelLicense.

Content discovery

A key use case for RDFa is the annotation of resources included or embedded in web pages. Existing annotations apply to the current document. For example, http://example.com/foo contains

<a rel="license" href="http://creativecommons.org/licenses/by/3.0/">cc</a>

This says that http://example.com/foo is licensed under CC BY 3.0. What about http://example.com/bar.jpg which is displayed in http://example.com/foo via a <img src="/bar.jpg"> element?

To specify that bar.jpg is licensed, even under a different license, we can qualify the link with an about attribute:

<a about="/bar.jpg" rel="license" href="http://creativecommons.org/licenses/by-nc/3.0/">cc</a>

Found in http://example.com/foo this says http://example.com/bar.jpg is licensed under CC BY-NC 3.0.

See Qualifying Other Documents and Document Chunks in the RDFa primer for more examples.

The RDFa highlighter bookmarklet provides visual cues for statements about included resources.

CC Tools

RDFa is used or supported in the following CC tools:


References

Presentations