freebase api @ hackto 2
DESCRIPTION
My presentation about using the Freebase API that I gave at HackTO 2 in Toronto on September 25, 2010.TRANSCRIPT
![Page 1: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/1.jpg)
The Freebase API
Shawn Simister, September 2010
![Page 2: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/2.jpg)
![Page 3: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/3.jpg)
An entity graph of people, places, and things.
![Page 4: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/4.jpg)
13 million entities
![Page 5: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/5.jpg)
Every entity has one or more IDs
![Page 6: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/6.jpg)
Each entity has one or more IDs
/en/u2
/m/0dw4g
/wikipedia/en_id/52780
/authority/facebook/u2
/authority/musicbrainz/name/ARTIST197
...
![Page 7: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/7.jpg)
![Page 8: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/8.jpg)
Entities are connected
![Page 9: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/9.jpg)
… with meaningful properties
![Page 10: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/10.jpg)
Approx. 400 million connections
![Page 11: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/11.jpg)
![Page 12: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/12.jpg)
Where does the data come from?
![Page 13: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/13.jpg)
Freebase schema
10,448 Propertiesdescribing ...
4,936 Types*organized into ...
641 Domains(~72 Commons)
*types with 10 or more instances
![Page 14: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/14.jpg)
One entity, many types
Person/people/person
Actor/film/actor
Politician/government/politician
/en/arnold_schwarzenegger
![Page 15: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/15.jpg)
![Page 16: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/16.jpg)
Freebase CommonsAmerican FootballArchitectureAstronomyAutomotiveAviationAwardsBaseballBasketballBicyclesBiologyBoatsBooksBroadcastBusinessCelebritiesChemistryComputersConferences
CricketData worldDigicamsEducationEngineeringEventsFashionFictional universesFilmFoodFreebaseGamesGeologyGovernmentHobbies and interestsIce hockeyInfluenceInternet
LanguageLawLibraryLocationMartial artsMeasurement unitMedia commonsMedicineMeteorologyMiltaryMusicOlympicsOperaOrganizationPeoplePeriodicalsPhysical geographyPhysics
ProjectsProtected placesRadioRailReligionRoyaltySoccerSpaceflightSportsSymbolsTennisTheaterTimeTransportationTravelTVVideo gamesVisual arts
![Page 17: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/17.jpg)
![Page 18: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/18.jpg)
Developing applicationswith Freebase data
![Page 19: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/19.jpg)
REST API
http://api.freebase.com/api/service/mqlread Read structured data
http://api.freebase.com/api/service/mqlwrite Write structured data
http://api.freebase.com/api/service/search Free text search
http://api.freebase.com/api/service/topic Simplified topic data
... and more
http://www.freebase.com/docs/web_services
![Page 20: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/20.jpg)
MQL
Metaweb Query Language
Rhymes with “pickle”
JSON format
Query by example
![Page 21: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/21.jpg)
Querying Freebase
[{"id" : null,"name" : null,"type" : "/film/film"
}]
![Page 22: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/22.jpg)
Query results[{
"id" : "/en/3_10_to_yuma_1957","name" : "3:10 to Yuma","type" : "/film/film"
},{"id" : "/en/20_000_leagues_under_the_sea","name" : "20,000 Leagues Under the Sea","type" : "/film/film"
},{"id" : "/en/2010_the_year_we_make_contact","name" : "2010: The Year We Make Contact","type" : "/film/film"
},... and so on
}]
![Page 23: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/23.jpg)
Querying Freebase
[{"id" : null,"name" : null,"type" : "/film/film"
}]
![Page 24: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/24.jpg)
Querying Freebase
[{"id" : null,"name" : null,"type" : "/film/film","directed_by" : {
"id" : "/en/george_lucas"}
}]
![Page 25: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/25.jpg)
Querying Freebase[{
"id" : null,"name" : null,"type" : "/film/film","directed_by" : {
"id" : "/en/george_lucas"},"starring" : [{
"actor" : {"id" : "/en/harrison_ford"
}}]
}]
![Page 27: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/27.jpg)
Libraries
freebase-python (best supported)http://code.google.com/p/freebase-python
Other languageshttp://wiki.freebase.com/wiki/Libraries
![Page 28: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/28.jpg)
Acre
![Page 30: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/30.jpg)
Templating language
<acre:block if=”f”><h2>$f women with this name, including ...</h2><ul acre:for=”w in women”>
<li><a href=”http://www.freebase.com/view$w.id”>$w.name</a></li></ul>
</acre:block>
<acre:block if=”m”><h2>$m men with this name, including ...</h2><ul acre:for=”m in men”>
<li><a href=”http://www.freebase.com/view$m.id”>$m.name</a></li></ul>
</acre:block>
http://www.freebase.com/docs/acre_templates
![Page 31: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/31.jpg)
![Page 32: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/32.jpg)
![Page 33: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/33.jpg)
![Page 34: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/34.jpg)
![Page 35: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/35.jpg)
![Page 36: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/36.jpg)
Freebase Suggest
http://code.google.com/p/freebase-suggest/
![Page 37: Freebase API @ HackTO 2](https://reader034.vdocument.in/reader034/viewer/2022052618/554bb606b4c9053a298b48b2/html5/thumbnails/37.jpg)
Everything you need to get started is available in the wiki
http://wiki.freebase.com/wiki/HackTO2
Thank you