The Freebase API
Shawn Simister, September 2010
An entity graph of
people, places, and things.
13 million entities
Every entity has one or more IDs
Each entity has one or more IDs
 /en/u2
 /m/0dw4g
 /wikipedia/en_id/52780
 /authority/facebook/u2
 /authority/musicbrainz/...
Entities are connected
… with meaningful properties
Approx. 400 million connections
Where does the data come from?
Freebase schema
  10,448 Properties
     describing ...

    4,936 Types*
   organized into ...

     641 Domains
    (~72...
One entity, many types

                            Person
                            /people/person



                 ...
Freebase Commons
American Football   Cricket                 Language             Projects
Architecture        Data world ...
Developing applications
  with Freebase data
REST API

http://api.freebase.com/api/service/mqlread    Read structured data


http://api.freebase.com/api/service/mqlwri...
MQL

Metaweb Query Language
Rhymes with “pickle”
JSON format
Query by example
Querying Freebase

  [{
       "id" :   null,
       "name" : null,
       "type" : "/film/film"
  }]
Query results
[{
      "id" :   "/en/3_10_to_yuma_1957",
      "name" : "3:10 to Yuma",
      "type" : "/film/film"
},{
  ...
Querying Freebase

  [{
       "id" :   null,
       "name" : null,
       "type" : "/film/film"
  }]
Querying Freebase
[{
     "id" :      null,
     "name" : null,
     "type" : "/film/film",
     "directed_by" : {
       ...
Querying Freebase
[{
     "id" :      null,
     "name" : null,
     "type" : "/film/film",
     "directed_by" : {
       ...
http://freebase.com/tools/queryeditor
Libraries

freebase-python (best supported)
http://code.google.com/p/freebase-python

          Other languages
  http://w...
Acre
http://acre.freebase.com
Templating language
<acre:block if=”f”>
    <h2>$f women with this name, including ...</h2>
    <ul acre:for=”w in women”>...
Freebase Suggest




http://code.google.com/p/freebase-suggest/
Thank you

Everything you need to get started is
        available in the wiki

http://wiki.freebase.com/wiki/HackTO2
Freebase API @ HackTO 2
Freebase API @ HackTO 2
Freebase API @ HackTO 2
Freebase API @ HackTO 2
Freebase API @ HackTO 2
Freebase API @ HackTO 2
Freebase API @ HackTO 2
Freebase API @ HackTO 2
Freebase API @ HackTO 2
Freebase API @ HackTO 2
Upcoming SlideShare
Loading in …5
×

Freebase API @ HackTO 2

5,009 views

Published on

My presentation about using the Freebase API that I gave at HackTO 2 in Toronto on September 25, 2010.

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,009
On SlideShare
0
From Embeds
0
Number of Embeds
1,601
Actions
Shares
0
Downloads
37
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Freebase API @ HackTO 2

  1. 1. The Freebase API Shawn Simister, September 2010
  2. 2. An entity graph of people, places, and things.
  3. 3. 13 million entities
  4. 4. Every entity has one or more IDs
  5. 5. Each entity has one or more IDs /en/u2 /m/0dw4g /wikipedia/en_id/52780 /authority/facebook/u2 /authority/musicbrainz/name/ARTIST197 ...
  6. 6. Entities are connected
  7. 7. … with meaningful properties
  8. 8. Approx. 400 million connections
  9. 9. Where does the data come from?
  10. 10. Freebase schema 10,448 Properties describing ... 4,936 Types* organized into ... 641 Domains (~72 Commons) *types with 10 or more instances
  11. 11. One entity, many types Person /people/person Actor /film/actor /en/arnold_schwarzenegger Politician /government/politician
  12. 12. Freebase Commons American Football Cricket Language Projects Architecture Data world Law Protected places Astronomy Digicams Library Radio Automotive Education Location Rail Aviation Engineering Martial arts Religion Awards Events Measurement unit Royalty Baseball Fashion Media commons Soccer Basketball Fictional universes Medicine Spaceflight Bicycles Film Meteorology Sports Biology Food Miltary Symbols Boats Freebase Music Tennis Books Games Olympics Theater Broadcast Geology Opera Time Business Government Organization Transportation Celebrities Hobbies and interests People Travel Chemistry Ice hockey Periodicals TV Computers Influence Physical geography Video games Conferences Internet Physics Visual arts
  13. 13. Developing applications with Freebase data
  14. 14. 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
  15. 15. MQL Metaweb Query Language Rhymes with “pickle” JSON format Query by example
  16. 16. Querying Freebase [{ "id" : null, "name" : null, "type" : "/film/film" }]
  17. 17. 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 }]
  18. 18. Querying Freebase [{ "id" : null, "name" : null, "type" : "/film/film" }]
  19. 19. Querying Freebase [{ "id" : null, "name" : null, "type" : "/film/film", "directed_by" : { "id" : "/en/george_lucas" } }]
  20. 20. Querying Freebase [{ "id" : null, "name" : null, "type" : "/film/film", "directed_by" : { "id" : "/en/george_lucas" }, "starring" : [{ "actor" : { "id" : "/en/harrison_ford" } }] }]
  21. 21. http://freebase.com/tools/queryeditor
  22. 22. Libraries freebase-python (best supported) http://code.google.com/p/freebase-python Other languages http://wiki.freebase.com/wiki/Libraries
  23. 23. Acre
  24. 24. http://acre.freebase.com
  25. 25. 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
  26. 26. Freebase Suggest http://code.google.com/p/freebase-suggest/
  27. 27. Thank you Everything you need to get started is available in the wiki http://wiki.freebase.com/wiki/HackTO2

×