{You can get my Facebook information using my user name with the graph API: http://graph.facebook.com/markwatson314. Adding required OpenGraph markup to your web pages is simple enough; for example, I added the following to my consulting web page:
"id" : "0b6_g82",
"username" : "mark_louis_watson",
"name" : "Mark Louis Watson",
"link" : "http://www.freebase.com/edit/topic/en/mark_louis_watson",
"embed" : "http://www.metaweb.com/topicblocks/en/mark_louis_watson",
"picture" : "http://www.freebase.com/api/trans/image_thumb/en/mark_louis_watson",
"date_of_birth" : "1951",
"nationality" : "United States of America",
"gender" : "Male",
"profession" : "Author",
"metadata" : {
"connections" : {
"spouses" : "http://graph.freebase.com/mark_louis_watson/spouses",
"books" : "http://graph.freebase.com/mark_louis_watson/books"
}
}
}
<meta property="og:title" content="Mark Watson: Ruby and Java Consultant" />There are other per-page attributes that you can optionally set.
<meta property="og:type" content="consulting" />
<meta property="og:url" content="http://markwatson.com/consulting/" />
<meta property="og:image" content="http://markwatson.com/pictures/Mark_hat_small.jpg" />
There is a nice web app on Heroku that lets you check your meta data; for example: http://ogit.heroku.com for my consulting page.
How does Open Graph compare to RDFa? RDFa is a much richer notation for at least two reasons: semantic markup can refer to elements on a web page and not the entire page, and you can use any Ontology in RDFa. Still, in my opinion, any semantic markup is a good thing.
For most web applications you really want to add Open Graph and RDFa markup automatically for data driven web pages. You might as well use both because even though it takes some effort, providing semantic markup may have a long tail of benefits.
No comments:
Post a Comment