3. The web was / is fragmented
Funny pictures
Super secret
military site
Friend¡¯s
website
University Cool
event page bookmarks
4. So we added search to ?nd stuff
Google Yahoo
Super
Funny
secret
pictures
military site
Friend¡¯s
University Cool
website
event page bookmarks
5. But there are many similar sites
Facebook Events Evite Events Upcoming Events
Youtube Metacafe Vimeo
Digg Reddit Technorati
Let¡¯s treat these as ¡°views¡± onto ¡°objects¡±
6. Wouldn¡¯t it be cool if you could do:
?? object:video creator:¡±Paul Tarjan¡±
length<=60s
7. Wouldn¡¯t it be cool if you could do:
?? object:video creator:http://paulisageek.com/
length<=60s
8. Wouldn¡¯t it be cool if you could do:
?? object:game name:¡±Desktop Tower Defense¡±
version:1.5 publishdate:¡±May 2 2005¡±
9. Wouldn¡¯t it be cool if you could do:
?? object:video author:¡±The Escapist¡±
game:¡±Left 4 Dead¡±
15. The Semantic What?
?? Web pages are views of data for people to
read
?? Search Engines are a hack
?? They treat pages as a bucket of words
?? Lets turn the web into a database
?? APIs are good, but there is no ¡°web¡± of APIs
?? If you ?gure out a good way of doing that, let
me know ?
17. Recommendation: ?F
?? If there is a microformat for your data, use it
¨C? hcard
¨C? hreview
¨C? hresume
¨C? hcalendar
¨C? rel-tag
¨C? rel-licence
¨C? xfn
¨C? hatom
¨C? geo
18. ?F in a nutshell
?? Change your @class to something that is known
?? <div>
¨C? <span class=¡°name¡±>Paul Tarjan</span>
¨C? <span class=¡®email¡¯>spam@paulisageek.com</span>
?? </div>
?? BECOMES
?? <div class=¡°vcard¡±>
¨C? <span class=¡°fn¡±>Paul Tarjan</span>
¨C? <span class=¡°email¡±>spam@paulisageek.com</span>
?? </div>
19. Recommendation: RDFa
?? If you have data that doesn¡¯t really ?t in a
?F
?? Examples:
¨C? Markup APIs (YUI, javadoc, etc)
¨C? Media (Audios, Videos, Games, Presentations)
¨C? Job Postings
20. RDFa in a nutshell
?? Make a namespace
?? Use @property, @rel and @resource
?? For DATA: @property makes the node
contents into the value
?? For URLs: @rel makes the @resource into
the value
21. Normal HTML
?? <html>
¡
<div class=quot;private¡±>
private static String
<strong>_createCookieHash </strong>
(hash)
¡
23. That¡¯s it!
?? Automatically picked up by semantic
parsers / crawlers
?? Can build a SearchMonkey app on it
?? Can make a mashup way easier than screen
scraping
?? Can get the data from Yahoo! BOSS
24. What is SearchMonkey?
an open platform for using structured data to build more
useful and relevant search results
Before After
27. Part of the puzzle
Semantic vocabularies
Semantic markup on web pages
SearchMonkey
28. Vocabularies
?? Need to speak the same language
?? I like to see girls of that... caliber.
?? English, French, Spanish, Esparanto?
?? URLs to the rescue
¨C? Dublin Core (http://purl.org/dc/elements/1.1/)
¨C? Friend of a Friend (http://xmlns.com/foaf/0.1/)
¨C? X-Friend Network (http://gmpg.org/xfn/11/)
¨C? ¡ (many more)
29. Syntax
?? Nouns, Verbs, and Adjectives, oh my!
?? All phrases become lots of triples
?? (Subject, Verb / Adj. / Prep. / etc, Object)
?? Key / Value pairs ++
¨C? Everything is a URL or String
¨C? Subject doesn¡¯t have to be the document
35. Innards of SearchMonkey
?? You build a web-service inside our
framework
?? When a search page renders
¨C? We check which SM apps are enabled
¨C? We call them
??50ms for in-page
??Long time for AJAX
¨C? They return data in our template
¨C? We render them (and cache)
36. Prototyping with XSLT
?? What if I don¡¯t have structured data?
¨C? I don¡¯t own the site
¨C? I do own the site, but I want to prototype ?rst
?? Build an XSLT custom data service ?rst
¨C? Write some XSLT to extract the data and
transform it into DataRSS
¨C? Mostly about ?nding the right XPath (use
Firebug or XPather )
¨C? Quick to implement, but brittle
¨C? Can¡¯t do a good Enhanced Result
#26: A SearchMonkey Enhanced result contains a great deal of structured data. It could have a picture, key/value pairs, deep links¡This kind of information goes far beyond what normal search results give you ¨C a title and an autoextracted summary. Where does this information come from? <number>
#27: Likewise, an Infobar has a summary (what the user sees before the pane is expanded) and a ¡°blob¡±, an area of free-form HTML. <number>
#37: XSLT custom data services are excellent when there is no good structured data available, either because you don¡¯t own the site in question, or because you just want to get a prototype out quickly without having to to change your site¡¯s template markup. You can use these data services to mock up what is possible with SearchMonkey.As with the PHP, the XSLT is fairly simple. The ¡°hard¡± part of writing the stylesheet is really just finding the right xpath expression for extracting the information you want. The other thing you need to do is pick a good vocabulary for describing the extracted data. For example, a description is a dc:description (Dublin Core description) and so on.If the page is not well-formed XHTML, have no fear, we tidy up the page ahead of time and run the XSLT on that. The tidying can fail, but only if the markup is really pathologically bad.As we mentioned before, XSLT custom data services are good for mocking up Enhanced Results, but they¡¯re too slow in practice. For a production-quality app, you¡¯ll need to use them in infobars.[Show demo]