Introduction to RDF & Microformats

la meetup

Tim Wright

Work: www.usc.edu/web

Play: www.csskarma.com

Noise: twitter.com/csskarma

Who is this guy?

wee tim

Web Developer/Designer at The University of Southern California

CSSKarma.com

SitePoint

Who are you?

Let's meet.

What you're in for

After a long a day of work we get to talk about MORE work.

RDF > A Little History

RDF and "The Semantic Web"

W3C's "Semantic Web Vision" is a future where:

w3schools

RDF > What is it?

RDF > Data Sharing

RDF > Formats

RDF is most commonly written in 2 formats

RDF > XML Anatomy

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:dc="http://purl.org/dc/elements/1.1/">
 <rdf:Description rdf:about="http://en.wikipedia.org/wiki/Tony_Benn">
   <dc:title>Tony Benn</dc:title>
   <dc:publisher>Wikipedia</dc:publisher>
 </rdf:Description>
</rdf:RDF>

The title [property] of this resource, which is published by wikipedia [resource] is “Tony Benn [value]

RDF > A quick look at N3

<http://en.wikipedia.org/wiki/Tony_Benn> 
<http://purl.org/dc/elements/1.1/title>
"Tony Benn" .
<http://en.wikipedia.org/wiki/Tony_Benn>
<http://purl.org/dc/elements/1.1/publisher>
"Wikipedia" . (should be on 1 line)

RDF > Popular applications

rss icon

RSS

RSS 1.0 > Header

<?xml version="1.0"?>

<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns="http://purl.org/rss/1.0/">

<channel rdf:about="http://www.xml.com/xml/news.rss">
<title>XML.com</title>
<link>http://xml.com/pub</link>
<description>
XML.com features a rich mix of information and services
for the XML community.
</description>
...

RSS

RSS 1.0 > Item

 <item rdf:about="http://xml.com/pub/2000/08/09/xslt/xslt.html">
<title>Processing Inclusions with XSLT</title>
<link>http://xml.com/pub/2000/08/09/xslt/xslt.html</link>
<description>blah blah blah</description>
</item>

Kind of a pain to write...

RSS

RSS 2.0 > Header

<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>Lift Off News</title>
<link>http://liftoff.msfc.nasa.gov/</link>
<description>Liftoff to Space Exploration.</description>
<language>en-us</language>
...

RSS

RSS 2.0 > Item

<item>
<title>Title of post</title>
<link>http://www.csskarma.com/blog/p=13</link>
<description>This is a little about the article</description>
<pubDate>Thurs, 15 Jan 2009</pubDate>
</item>

RDF > RDFa & XHTML

RDF > RDFa & XHTML

How does it apply to you?

creative commons icon

Marking up contact information

From:

<div>
<p>Alice Birpemswick</p>
<p>Email: <a href="mailto:alice@example.com">alice@example.com</a></p> 
<p>Phone: <a href="tel:+1-617-555-7332">+1 617.555.7332</a></p>
</div>
    

Marking up contact information

To:

<div typeof="foaf:Person" xmlns:foaf="http://xmlns.com/foaf/0.1/">
<p property="foaf:name">Alice Birpemswick</p>
<p>Email: <a rel="foaf:mbox" href="mailto:alice@example.com">alice@example.com</a></p> 
<p>Phone: <a rel="foaf:phone" href="tel:+1-617-555-7332">+1 617.555.7332</a></p>
</div>

FOAF stands for "friend of a friend". It's use to describe people and their relationships.

The Problem & Solution

Microformats > Basic Types

Microformats > The "rel" attribute

microformats logo

This link's relationship to the current document [This is an external site]

<a href="/tags/css/" rel="tag">CSS</a>

or

<a href="http://www.yahoo.com" rel="external">CSS</a>

Benefits: Search engines already using nofollow, license and tag

Microformats > vote links & "rev"

microformats logo

Current document's relationship to the link [I support this link]

Let's say you love Yahoo!

<a href="http://www.yahoo.com" 
rev="vote-for">Yahoo!</a>

Microformats > vote links & "rev"

microformats logo

Or you harbor resentment towards Google

<a href="http://www.google.com" 
rev="vote-against">Google</a>

Microformats > vote links & "rev"

microformats logo

And you have no strong feelings about CNN

<a href="http://www.cnn.com" 
rev="vote-abstain">CNN</a>

Microformats > Ideal rev

Why would you ever use this stuff?

To create more relevant search results

Microformats > XFN

microformats logo

Marking up a link to another site of yours

<a href="http://www.twitter.com/csskarma" 
rel="me">Twitter/CSSKarma</a>

If my mom had a web site

<a href="http://www.timsmom.com" 
rel="parent met">Tim's mom</a>

 

Microformats > XFN Tools

Wordpres blogroll

wordpress xfn screen shot

XFN Creator: gmpg.org/xfn/creator/

Microformats > Advanced Types

microformats logo

Microformats > hCard

<div id="hcard-Tim-C-Wright" class="vcard">
<a class="url n" href="http://www.usc.edu/web/">
  <span class="given-name">Tim</span>
<span class="family-name">Wright</span>
</a> <div class="adr"> <div class="street-address">3434 S. Grand Ave</div> <span class="locality">Los Angeles</span>, <span class="region">CA</span>, <span class="postal-code">90007</span> </div><!--/adr--> </div><!--/vcard-->

hCard generator: microformats.org/code-tools

Microformats > hCal

<div id="hcalendar-LA-Semantic-Web-Meetup" class="vevent">
<a href="http://semweb.meetup.com/32/calendar/9380423/" class="url">
<abbr title="2009-01-15T07:00-08:0000" class="dtstart">
January 15, 2009 7:00pm</abbr>
–
<abbr title="2009-01-15T09:00-08:00" class="dtend">9pm</abbr> :  
<span class="summary">LA Semantic Web Meetup</span> at 
<span class="location">Yahoo! Training Room</span></a>
<div class="description">
The January Semantic Web group 
will Meetup will be from 7pm to 9pm
</div><!--/description-->
</div><!--/vevent-->

hCal generator: microformats.org/code-tools

Microformats > hReview

<div id="hreview-Very-good-book" class="hreview">
<h2 class="summary">Very good book</h2>
<abbr title="2004-01-11T19:15-08:00" class="dtreviewed">
Jan 11, 2004</abbr>
by <span class="reviewer vcard">
<span class="fn">Tim Wright</span>
</span>
<span style="display: none;" class="type">product</span>
<div class="item"><a href="http://www.bulletproofajax.com" class="fn url">Bulletproof Ajax</a>
</div>
<abbr class="rating" title="5">★★★★★</abbr>

hReview generator: microformats.org/code-tools

Microformats > Draft mode

http://microformats.org/wiki/Main_Page#Drafts

Microformats > vEntry

<div class="v120vEntry">
<div class="vstill">
<a href="/user/spoiledmilk"><img src="2.jpg" class="vimg"></a>

</div><!--/vstill-->
<div class="vtitle">
<a href="/profile?user=spoiledmilk">spoiledmilk</a>
</div><!--/vtitle-->
<div class="vfacets">
<span class="grayText">Joined:</span> August 02, 2006<br>
<span class="grayText">Videos:</span> <a href="/profile_videos?user=spoiledmilk">21</a>
</div><!--/vfacets-->
</div><!--/v120vEntry-->

Microformats > Why?

Microformats > In the news

Recently BBC annouced they would drop the hCal format from their site.

Recommended reading

Plugs > S5

ReplyTo: Everyone in this room

ninja

Thanks for listening

tim

That's all.

Contact Info

View these slides at: www.csskarma.com/semantic_web_meetup/

Download these slides at: www.csskarma.com/semantic_web_meetup/slides.zip