+ All Categories
Home > Technology > "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

"RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Date post: 06-May-2015
Category:
Upload: shamod-lacoul
View: 6,465 times
Download: 2 times
Share this document with a friend
Description:
These slides define RDFa. It was a presentation for the Silicon Valley Code Camp 2010 held on Oct. 9-10, 2010.
55
Mike Hewett ([email protected]) Shamod Lacoul ([email protected]) Members of the League of Extraordinary Modelers (LEM) Silicon Valley CodeCamp 2010 October 9, 2010 What, Why and How Licensed under a Creative Commons Attribution- Noncommercial-Share Alike 3.0 Unported License
Transcript
Page 1: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Mike Hewett ([email protected])

Shamod Lacoul ([email protected])

Members of the League of Extraordinary Modelers (LEM)

Silicon Valley CodeCamp 2010

October 9, 2010

What, Why and How

Licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 Unported License

Page 2: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

The Speakers

Mike Hewett has 25 years of experience in building AI systems, focusing on constructing knowledge bases and reasoning about knowledge. He is the author of the Algernon rule engine and the Jatha LISP library. Mike has a Masters in AI from Stanford University and a PhD in Computer Science from the University of Texas at Austin.

Shamod Lacoul is a software entrepreneur, developer and consultant. He has been working as a software consultant for 7 years, focusing on back-end and data integration technologies. He is an assistant organizer of the Silicon Valley Semantic Technologies (SVST) Meetup. He has a Masters in Software Engineering and Bachelors in Computer Science from San Jose State University.

Page 3: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Outline

A quick overview of RDFa and a scenario setup

What is RDFa? Why use RDFa? How to use RDFa? How is RDFa related to Semantic Web? Current websites using RDFa

Page 4: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Overview of RDFa

RDFa adds semantics to web page content.

Semantics == Meaning

However, RDFa can be added to any XML-like

structured content.

Page 5: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

What is Semantics?

What does this sentence mean?

“The Bears are in New York”

1. Bears are migrating to New York state.

2. Bears are migrating to New York City.

3. Chicago is playing the Giants in football.

4. Prices are lower on the NY Stock Exchange.

5. Is it the title of a book?

Page 6: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Scenario: Lou’s Café hours

Scraping information from web pages.

Can a program find out when Lou’s Café is open on Saturday?

Page 7: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Scenario: Lou’s Café hours

When is Lou’s Café open on Saturday? The hours are hard to find by eye. Even harder to find with a program.

But… The hours could be annotated with RDFa tags. Programs can easily find the information. Easier than scraping the web page and

guessing.

Page 8: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Scraping information from the web

People often use programs to scrape information from web pages

Database

Web Server

Web Page

Program

CopyFindExtractUse

Page 9: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Scraping information is easier:

RDFa makes it easier to find and retrieve information from web pages

Database

Web Server

Web Page

Program

CopyFindExtractUse

Page 10: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

The vision of the Semantic Web

Agents access information in DBs directly.

RDFDatabase

Web Server

Web Page

Program

QueryUse

Page 11: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

What is RDF?

RDF is a data model where all data consists of 3-tuples of entities, commonly called triples.

<subject> <predicate> <object>

<x:Person-9372> <x:firstName> “Don”

<x:Person-9372> <x:lastName> “Knuth”

<x:Person-9372> <x:friendOf> <x:Person-8614>

Page 12: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Outline

A quick overview of RDFa and a scenario setup What is RDFa? Why use RDFa? How to use RDFa? How is RDFa related to Semantic Web? Current websites using RDFa

Page 13: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

What is RDFa?

RDFa defines attributes for words or phrases that should be treated as semantic entities.

<div xmlns:v=“http://rdf.data-vocabulary.org/#”

typeof="v:Person">

<span typeof="v:Address">

<span property="v:locality">Albuquerque</span>

<span property="v:region">NM</span>

</span>

</div>

RDFa is a W3C recommendation

Page 14: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

RDFa example – metadata

<div about="/id/rdfa-course">

<h3 property="dc:title">RDFa Course</h3>

<p property="dc:description" lang="en">

This course covers the basics of RDFa...

</p>

Last modified:

<span property="dc:modified" datatype="xsd:date” content="2009-02-06">

6th Feb 2009

</span>

</div>

Borrowed from a talk by Jeni Tennison at the XML Summer School

Page 15: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

subject predicate objectabout

src

propertyrelrevtypeof

contenthrefresourcedatatype

about=”rdfa-course"

property="dc:title"

RDFa Course

The attributes map to RDF components

RDFa attributes

<div about=”rdfa-course"> <h3 property="dc:title">RDFa Course</h3>

Page 16: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

RDFa vocabulary

Provides the keywords and the semantics Often called a microformat Examples of vocabularies:

DC = Dublin Core Describes document metadata dc:title dc:author

FOAF = Friend of a Friend foaf:name foaf:mbox

Page 17: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Other useful vocabularies

hReview (recognized by Google): itemreviewed, rating, reviewer, dtreviewed, description, summary

hCard (Person) (rec. by Google): name, nickname, photo, title, role, url, affiliation, address, …

hCalendar (Event) (rec. by Google): summary, url, location, description, startDate, endDate, duration, eventType, geo, photo

Facebook Share & Yahoo SearchMonkey RDFa (video) (rec. by Google): image_src, video_src, description, title, video_width, video_height, …

Page 18: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

RDFa example – person

<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Person">

My name is <span property="v:name">Bob Smith</span>, but people call me <span property="v:nickname">Smithy</span>.

Here is my homepage: <a href="http://www.example.com" rel="v:url">www.example.com</a>.

I live in <span rel="v:address"> <span typeof="v:Address">

<span property="v:locality">Albuquerque</span>, <span property="v:region">NM</span> </span> </span>

and work as an <span property="v:title">engineer</span>

at <span property="v:affiliation">ACME Corp</span>.

My friends: <a href="http://darryl-blog.example.com" rel="v:friend">Darryl</a>, <a href="http://edna-blog.example.com" rel="v:friend">Edna</a>

</div>

Page 19: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

RDFa example – event

<div xmlns:v="http://rdf.data-vocabulary.org/#" typeof="v:Event">

    <a href="http://www.example.com/events/spinaltap" rel="v:url" property="v:summary">Spinal Tap</a> 

  <img src="spinal_tap.jpg" rel="v:photo" /> 

  <span property="v:description">After their highly-publicized search for a new drummer, Spinal Tap kicks off their latest comeback tour with a San Francisco show. </span>

  When:    <span property="v:startDate" content="2009-10-15T19:00-08:00">Oct 15, 7:00PM</span>—   

<span property="v:endDate" content="2009-10-15T21:00-08:00">9:00PM</span>   

Where:    <span rel="v:location">     <span typeof="v:Organization">     

 <span property="v:name">Warfield Theatre</span>,  

     <span rel="v:address">  

   <span typeof="v:Address">     

 <span property="v:street-address">982 Market St</span>,    

     <span property="v:locality">San Francisco</span>, 

    <span property="v:region">CA</span>         </span>       </span>          

  Category: <span property="v:eventType">Concert</span> </div>

Page 20: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Alternatives for adding Semantics

RDFa – W3C standard + validator Microformat syntax Microdata syntax Proprietary tags and syntax

Facebook: Open Graph

Page 21: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Microformat example – event

<div class="location vcard">

<span class="fn org">Warfield Theatre</span>,

<span class="adr">

<span class="street-address">982 Market St </span>,

<span class="locality">San Francisco</span>,

<span class="region">CA</span> </span>

</span>

</div>

Page 22: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Microdata example - event

<span itemprop="location" itemscope itemtype="http://data-vocabulary.org/Organization">

<span itemprop="name">Warfield Theatre</span> <span itemprop="address" itemscope itemtype="http://data-vocabulary.org/Address">

<span itemprop="street-address">982 Market St</span>, <span itemprop="locality">San Francisco</span>, <span itemprop="region">CA</span>

</span>

</span>

</span>

Page 23: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Outline

A quick overview of RDFa and a scenario setup What is RDFa? Why use RDFa? How to use RDFa? How is RDFa related to Semantic Web? Current websites using RDFa

Page 24: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Why use RDFa?

Embed semantics in XHTML

Re-use attributes

The HTML and the RDF can exist in the same document

For Search Engine Optimization (SEO)

Page 25: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Open Graph

<html xmlns="http://www.w3.org/1999/xhtml"

xmlns:og=http://opengraphprotocol.org/schema/

xmlns:fb="http://www.facebook.com/2008/fbml">

<head> <title>The Rock (1996)</title>

<meta property="og:title" content="The Rock"/>

<meta property="og:type" content="movie"/>

<meta property="og:url"

content="http://www.imdb.com/title/tt0117500/"/>

<meta property="og:image"

content="http://ia.media-imdb.com/rock.jpg"/>

<meta property="og:site_name" content="IMDb"/>

<meta property="og:description" content="A group of U.S. Marines, under command of a renegade general, take over Alcatraz and threaten San Francisco Bay with biological weapons."/>

... </head> ... </html>

Page 26: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

How

Better understanding of the content Better ad placement To build Rich Snippets:

Uses RDFa

Page 27: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Outline

A quick overview of RDFa and a scenario setup What is RDFa? Why use RDFa? How to use RDFa? How is RDFa related to Semantic Web? Current websites using RDFa

Page 28: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

A sample webpage without RDFa

Page 29: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

A sample webpage with RDFa

Page 30: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Can you tell the difference?

NO, it’s tough with your naked eye.

Page 31: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Reasons:

RDFa attributes are meant for machines.

RDFa attributes are embedded inside HTML tags invisible to the user.

Page 32: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

One quick way to find RDFa tags is by using a tool called RDFaDev

RDFaDev is a Firefox plugin

enables you to examine the RDFa markup

allows you to query the data on the page using SPARQL

detects common pitfalls in the use of RDFa

http://rdfadev.sourceforge.net/

Page 33: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Silicon Valley Code Camp</title></head><body><p> <b>Weekend at the Silicon Valley Code Camp 2010</b><br /><br />Starts on: <span>10-09-2010</span><br /> Ends on: <span>10-10-2010</span><br /><br /> See <a href="http://siliconvalley-codecamp.com/">Silicon Valley Code Camp 2010</a>This event is located at <span>Foothills College</span><br /></p></body></html>

HTML without RDFa

Page 34: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

<?xml version="1.0" encoding="UTF-8" ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xmlns:cal="http://www.w3.org/2002/12/cal/icaltzd#" xmlns:xs="http://www.w3.org/2001/XMLSchema#"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Insert title here</title></head><body><p about="#event1" typeof="cal:Vevent"> <b property="cal:summary">Weekend at the Silicon Valley Code Camp 2010</b>Starts on: <span property="cal:dtstart" datatype="xs:date">10-09-2010</span>Ends on: <span property="cal:dtend" datatype="xs:date">10-10-2010</span>See <a rel="cal:url" href="http://siliconvalley-codecamp.com/">Silicon Valley Code Camp 2010</a><br /><br />This event is located at <span property="cal:location">Foothills College</span></p></body></html>

HTML with RDFa

Page 35: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

http://check.rdfa.info/

Use to validate RDFa

Page 36: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Result from http://check.rdfa.info/

NOTE: It also tells you how Facebook, Google parses your RDFa

Page 37: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

GRDDL = Gleaning Resource Descriptions from Dialects of Languages

a technique of extracting RDF data from XML documents (in particular XHTML pages).

Source: http://www.w3.org/TR/2006/WD-grddl-primer-20061002/

Page 38: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

<?xml version="1.0" encoding="UTF-8"?> <html xmlns="http://www.w3.org/1999/xhtml" xml:base="http://www.dc4plus.com/references/rdf_sem.html" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:foaf="http://xmlns.com/foaf/0.1/" ><head profile="http://ns.inria.fr/grddl/rdfa/"> <title>Biblio description</title> </head> <body> <h1>Biblio description</h1> <dl about="http://www.w3.org/TR/2004/REC-rdf-mt-20040210/"> <dt>Title</dt> <dd property="dc:title">RDF Semantics - W3C Recommendation 10 February 2004</dd> <dt>Author</dt> <dd rel="dc:creator" href="#a1"> <span id="a1"> <link rel="rdf:type" href="[foaf:Person]" /> <span property="foaf:name">Patrick Hayes</span> see <a rel="foaf:homepage" href="http://www.ihmc.us/users/user.php?UserID=42">homepage</a> </span> </dd></dl></body></html>

An example of RDFa with GRDDL profile

Source: http://www-sop.inria.fr/acacia/personnel/Fabien.Gandon/tmp/grddl/rdfaprimer/PrimerRDFaSection.html

Page 39: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul
Page 40: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

An output of GRDDL service is RDF

Page 41: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Source: http://www-sop.inria.fr/acacia/personnel/Fabien.Gandon/tmp/grddl/rdfaprimer/PrimerRDFaSection.html

A visual graph of an RDF

Page 42: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Outline

A quick overview of RDFa and a scenario setup What is RDFa? Why use RDFa? How to use RDFa? How is RDFa related to Semantic Web? Current websites using RDFa

Page 43: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

How is RDFa related to the Semantic Web

as a whole?

Page 44: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Source: http://www.flickr.com/photos/ldodds/4043803502/

Linked Data

Page 45: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Source: http://www.semanticfocus.com/blog/entry/title/introduction-to-the-semantic-web-vision-and-technologies-part-2-foundations/

Semantic Web stack

Page 46: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Web Ontology Language (OWL)

- additional vocabulary along with a formal semantics

- an extension to RDF and RDF-Schema (RDF-S)

Page 47: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Triple Store (A database for RDF)

Source: http://test.ical.ly/tags/phpunit/

Page 48: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

SPARQL – a query language for RDF

- a glue to connect, query and reconstructdisparate sources of RDF data

- similar to SQL for RDF

Page 49: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Outline

A quick overview of RDFa and a scenario setup What is RDFa? Why use RDFa? How to use RDFa? How is RDFa related to Semantic Web? Current websites using RDFa

Page 50: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Examples of websites

currently using

RDFa

Page 51: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul
Page 52: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul
Page 53: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul
Page 54: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Summary

RDFa provides semantic tags that are embedded in web pages

RDFa helps software to understand the content of web pages

Useful RDFa tools are RDFaDev, checkrdfa.info, GRDDL Service, HTML editor, etc.

RDFa is a stepping stone to full Semantic Web capability BBC, BestBuy, O’Reilly are the early-adopters.

Page 55: "RDFa - what, why and how?" by Mike Hewett and Shamod Lacoul

Links to related information

http://www.w3.org/TR/rdfa-core/ http://en.wikipedia.org/wiki/Rdfa http://www.google.com/webmasters/tools/richsnippets http://developers.facebook.com/docs/opengraph http://semantic-drupal.com/ http://xmlsummerschool.com/curriculum-2010/semantic-t

echnologies-2010/ http://www.jenitennison.com/talks/xmlss2010/RDFa.pdf http://opengraphprotocol.org/


Recommended