HOT TOPICS: Customer Experience Marketing Automation Social Business SharePoint 2013 Document Management Big Data Mobile DAM

RDFa, Drupal and a Practical Semantic Web - Page 2

(Page 2 of 3)

RDFa provides the "rel" attribute to help bridge this gap. You add this attribute like you would any other. Instead of using the following to point to the W3C's RDFa primer:

<a href="http://www.w3.org/TR/xhtml-rdfa-primer/"
   >The W3C's RDFa Primer</a>

You might use:

<a href="http://www.w3.org/TR/xhtml-rdfa-primer/"
   rel="cite" 
   >The W3C's RDFa Primer</a>

…to designate that you're citing the standard's official primer page.

If you can't find the metadata types or terms you need already defined, before making up your own, look to see if an additional vocabulary has already been created. Two popular vocabularies for RDFa include the Dublin Core Metadata Initiative (DCMI) and the Friend of a Friend Project (FOAF).

The Dublin Core Metadata Initiative offers, among other things, a collection of metadata terms built around documents, such as "creator" for the original author, "type" for the type of document, and "description" for a short description of the document. To use a term from an external vocabulary, you need to first import the vocabulary (see our RDF tidbit above).

Expanding the example from earlier, perhaps the link was created to go into a larger document that starts something like this:

<div>
  <h1>All About RDFa</h1>
  <h3>CMSWire Staff Writer</h3>
  <h4>All you ever wanted to know about RDFa but 
      were terrified to ask.</h4>
  <a 
     href="http://www.w3.org/TR/xhtml-rdfa-primer/"
     rel="cite"
       >The W3C's RDFa Primer</a> is the definitive resource ...
</div>

Now, in this section, to tell computers that you're importing vocabulary from DCMI, I add an XML namespace statement to the div that links to the machine-readable vocabulary definition document

<div xmlns:dcmi="http://purl.org/dc/elements/1.1">

The dcmi tells computers that when they see dcmi in front of a vocabulary term, they should look to the DCMI document to know how to handle it. Now that the vocabulary's imported for this section, the title, the creator and the description can all be marked with metadata, allowing computers to decide how to format and present the information: 

<div xmlns:dcmi="http://purl.org/dc/elements/1.1">
  <h1 property="dcmi:title">All About RDFa</h1>
  <h3 property="dcmi:creator">CMSWire Staff Writer</h3>
  <h4 property="dcmi:description">All you ever wanted to know about RDFa 
      but were terrified to ask.</h4>
  <a  
     href="http://www.w3.org/TR/xhtml-rdfa-primer/"
     rel="cite"       
       >The W3C's RDFa Primer</a> is the definitive resource ...
</div>

Using "property" tells the computers that there's extra markup terms being added so they better pay attention.

As you might imagine, using a technology like RDFa can make creating a document a bit more work, but it also means that machines can now understand the context of the content they're serving. A  program on one site looking at document after document marked up in the methods discussed above might be programmed to display all documents sortable by title or author.

A program on another site might be more interested in the titles and descriptions, de-emphasizing the author information in the listing so people can focus on what the documents are about.

One search engine might know to ignore the document because they're only interested in product information, while others focus on helping researchers and so would definitely index this content, presenting its search results in a way that helps the user quickly find what they need.

Giving machines context about what they're processing adds a whole new depth to what they can accomplish.

Drupal and RDFa

A web content management system such as Drupal can contain gigabytes of structured data. However, that structure remains safely tucked away in the database, contributing nothing to the context of the data — nothing for machines, nothing for humans.

 

Continue reading this article:

 
 
 
Useful article?
  Email It      

Tags: , , , , , , , ,
 
 

Resources

 

Featured Events  View All Events | Add Your Event | feed Events RSS