November 22, 2008, Saturday, 326

Mapping-ufs-to-rdfa

From DBWiki

Jump to: navigation, search

Contents

Mapping Microformats to RDFa and Back Again

by Manu Sporny (this document was placed into the public domain on October 12th, 2007)

There are two major attempts at getting the semantic web into the hands of everyday bloggers and website operators as of late 2007: Microformats and RDFa. It is a common misconception that you must pick one over the other, or that one is "better" than the other. Each has it's strengths and weaknesses - rather than focus on those, let's assume that the world is a place filled with many different types of problems and both Microformats and RDFa can be used to solve those problems.

It is important to understand how structured data from these two approaches map to one another - after all, the underlying meaning of the data is the same, it is the mark-up that is slightly different. While syntax and vocabularies differ between the two approaches, the semantics remain the same.

The following page is a good resource if you're wondering how one format maps to another format. If you are not familiar with Microformats or RDFa, this is not the place to learn about it. It is assumed that you have already marked up some data using Microformats or RDFa.

This page will show you how to translate semantics from Microformats to RDF using RDFa. Keep in mind that these are not the only possible mappings. There are multiple RDF vocabularies, the most direct and popular ones are used for the mappings below.

hCard uF and vCard RDFa

hCard Microformat vCard RDFa Comments
The rdf:type should be set to http://www.w3.org/2001/vcard-rdf/3.0#
fn FN
n (family-name, given-name, additional-name, honorific-prefix, honorific-suffix) N (Family, Given, Other, Prefix, Suffix)
nickname NICKNAME
url This is typically the subject of the RDF triple. A property for this value is not needed in RDFa.
email (type, value) EMAIL The type for RDFa is listed in the vCard:EMAILTYPES RDF class.
tel (type, value) TEL The type for RDFa is listed in the vCard:TELTYPES RDF class.
adr (post-office-box, extended-address, street-address, locality, region, postal-code, country-name, type, value) ADR (Pobox, Extadd, Street, Locality, Region, Pcode, Country) The type for RDFa is listed in the vCard:ADRTYPES RDF class.
label LABEL
geo (latitude, longitude) GEO latitude and longitude are not defined for vCard RDF.
tz TZ
photo PHOTO
logo LOGO
sound SOUND
bday BDAY
title TITLE
role ROLE
org (organization-name, organization-unit) ORG (Orgname, Orgunit)
category CATEGORIES
note NOTE
class CLASS
key KEY
mailer MAILER
uid UID
rev REV

hAudio uF and hAudio RDFa

Microformat RDFa Comment
fn dc:title The RDF object is hmedia:Recording.
album dc:title The RDF object is hmedia:Album.
item hmedia:contains In RDFa, to specify that an album has a track, you use rel="hmedia:contains" from the subject (the album) and make the object the track URL.
position hmedia:position
contributor dc:creator (for primary creators), dc:contributor (for any secondary creator)
published dc:date
sample (rel) hmedia:sample
enclosure (rel) hmedia:download
payment (rel) commerce:payment
photo hmedia:depiction
category dc:type
duration hmedia:duration
price commerce:costs
description dc:description
NONE dc:license There is currently no way to specify the licensing information in hAudio uF.

hCalendar uF and vCal RDFa

Microformat RDFa Comment
vevent Vevent The RDF namespace is http://www.w3.org/2002/12/cal/ical#
dtstart dtstart
summary summary
class class
dtend dtend
duration duration
uid uid
dtstamp dtstamp
method method
category category
location location
url url
description description
last-modified lastModified
status status
class class
attendee attendee
contact contact
organizer organizer

TODO

We will map all of the current Draft and Specification Microformats in the following order:

  • hAtom
  • hReview
  • hResume
  • geo
  • adr
  • xFolk
  • XFN
  • VoteLinks
  • XMDP
  • XOXO
  • rel-license
  • rel-nofollow
  • rel-tag
  • rel-directory
  • rel-enclosure
  • rel-home
  • rel-payment
  • robots exclusion