SlideShare ist ein Scribd-Unternehmen logo
1 von 28
Freebase on the iPhone

Alec Flett
<alecf@metaweb.com>
Freebase on the iPhone


Tonight:
 •   Freebase.framework
 •   PhotoBase
 •   Hacking
Freebase.framework


What’s included:
•   Static library
•   Fully Asynchronous API access
•   CocoaTouch (iPhone) widgets
Freebase.framework


•   Static library
    •   Help. I don’t know what I’m doing
    •   API stuff mostly works on OS X too
    •   Even works with PyObjC!
Freebase.framework

•   Freebase APIs
    •   login
    •   mqlread, mqlwrite
    •   search, geosearch
    •   imageThumb, blurb
    •   image upload
    •   touch
Freebase.framework APIs


  Delegate/selector model
FreebaseSession *session = [FreebaseSession session];
[session <apicall>:<query>
              name:@”convenience_name”
          delegate:obj
    didFinishSelector:@selector(someselector:name:etc:)
           options:[NSDictionary dictionary...]];

• “name” is just useful
• “options” is optional
Freebase.framework APIs

 delegates and didFinishSelector
• specific selector called on success
 - (void)querydone:(id)result

              name:(NSString*)name

            cursor:(NSString*)cursor;


• cursor is mqlread only
• errorDidOccur:name: on failure
Freebase.framework


•   CocoaTouch widgets
    •   FreebaseTable - infinite scrolling, sections,
        thumbnails
    •   FreebaseSuggest - pick a topic, with location
        support
    •   FreebaseDetail - minimalistic topic view
FreebaseTable
FreebaseSuggest
Geolocation
Topic chosen
PhotoBase




More than just a sample app...
PhotoBase
  Take a picture

  Choose a topic

Upload to Freebase
PhotoBase
            Logging in
[[Freebase session] login:@”alecf”
                 password:@”nice try”,
                 delegate:self
 didFinishSelector:@selector(loggedin:)];
PhotoBase
   Choosing a topic

     FreebaseSuggest

 uses search/geosearch,
mqlread, blurb, imageThumb
PhotoBase
Use FreebaseSuggest
FreebaseSuggest *fbs = [[FreebaseSuggest alloc] init];
fbs.delegate = self;
[self presentModalViewController:fbs animated:YES];



// callback definition
- (void)suggest:(FreebaseSuggest*)suggest
   itemSelected:(NSDictionary*)item
{
    NSString* topicName = [item objectForKey:@”name”];
    ...
}
FreebaseSuggest
Finding topics:
[session search:@”x-men” name:@”suggest”
       delegate:self
didFinishSelector:@selector(haveResult:)];

Or geolocate:
NSString *location =
    [[NSDictionary dictionaryWithObjectsAndKeys:
        @"Point", @"type",
        [NSArray arrayWithObjects:
            [NSNumber numberWithDouble:longtitude],
            [NSNumber numberWithDouble:latitude], nil],
        @"coordinates",
        nil] JSONRepresentation];


[session geosearch:location name:@”suggest-geo”
          delegate:self
 didFinishSelector:@selector(haveResult:)];


(geolocate + search string is complex)
PhotoBase
Choose or take a picture

  (Built into iPhone API:
 UIImagePickerController)
PhotoBase
Now upload...
PhotoBase


Upload implementation:
  [[FreebaseSession session] uploadImage:image
                             contentType:@"image/jpeg"
                                   topic:[topic objectForKey:@"id"]
                                delegate:self
                       didFinishSelector:@selector(uploaded:)
                                 options:
   [NSDictionary dictionaryWithObjectsAndKeys:

          @"/en/creative_commons_by_sa_2_0", @"license", nil]];
PhotoBase

What’s left:
• UI stuff - user feedback, login setup, etc
Whats next:
• Topic geotagging
• QR importing
• Flickr search
• English/metric, distances, etc
Freebase.framework
Freebase.framework


Do a little dance
Freebase.framework


Do a little dance
Make a little app
Freebase.framework


Do a little dance
Make a little app
Lets hack tonight
Freebase.framework


Do a little dance
Make a little app
Lets hack tonight
Freebase.framework


Do a little dance
Make a little app
Lets hack tonight


Questions?

Weitere ähnliche Inhalte

Was ist angesagt? (7)

ECMA5 approach to building JavaScript frameworks with Anzor Bashkhaz
ECMA5 approach to building JavaScript frameworks with Anzor BashkhazECMA5 approach to building JavaScript frameworks with Anzor Bashkhaz
ECMA5 approach to building JavaScript frameworks with Anzor Bashkhaz
 
02 beginning code first
02   beginning code first02   beginning code first
02 beginning code first
 
Advancing JavaScript with Libraries (Yahoo Tech Talk)
Advancing JavaScript with Libraries (Yahoo Tech Talk)Advancing JavaScript with Libraries (Yahoo Tech Talk)
Advancing JavaScript with Libraries (Yahoo Tech Talk)
 
Devf (Shoe Lovers)
Devf (Shoe Lovers)Devf (Shoe Lovers)
Devf (Shoe Lovers)
 
Irving iOS Jumpstart Meetup - Objective-C Session 2
Irving iOS Jumpstart Meetup - Objective-C Session 2Irving iOS Jumpstart Meetup - Objective-C Session 2
Irving iOS Jumpstart Meetup - Objective-C Session 2
 
PDF.JS at SwissJeese 2012
PDF.JS at SwissJeese 2012PDF.JS at SwissJeese 2012
PDF.JS at SwissJeese 2012
 
Stepping Into Custom Post Types
Stepping Into Custom Post TypesStepping Into Custom Post Types
Stepping Into Custom Post Types
 

Andere mochten auch (6)

WhereCamp EU talk: iPhone location 101
WhereCamp EU talk: iPhone location 101WhereCamp EU talk: iPhone location 101
WhereCamp EU talk: iPhone location 101
 
Hacking with paper
Hacking with paperHacking with paper
Hacking with paper
 
Iphone developer advance location based
Iphone developer advance location basedIphone developer advance location based
Iphone developer advance location based
 
File000092
File000092File000092
File000092
 
Curso anpe
Curso anpeCurso anpe
Curso anpe
 
File000167
File000167File000167
File000167
 

Ähnlich wie Freebase and the iPhone

iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical Stuff
Petr Dvorak
 
Objective-C Survives
Objective-C SurvivesObjective-C Survives
Objective-C Survives
S Akai
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
Stefano Zanetti
 
MFF UK - Advanced iOS Topics
MFF UK - Advanced iOS TopicsMFF UK - Advanced iOS Topics
MFF UK - Advanced iOS Topics
Petr Dvorak
 
ARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマーARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマー
Satoshi Asano
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
Appsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaolaAppsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaola
drewz lin
 

Ähnlich wie Freebase and the iPhone (20)

Developing iOS REST Applications
Developing iOS REST ApplicationsDeveloping iOS REST Applications
Developing iOS REST Applications
 
MFF UK - Introduction to iOS
MFF UK - Introduction to iOSMFF UK - Introduction to iOS
MFF UK - Introduction to iOS
 
iOS 2 - The practical Stuff
iOS 2 - The practical StuffiOS 2 - The practical Stuff
iOS 2 - The practical Stuff
 
iPhone dev intro
iPhone dev introiPhone dev intro
iPhone dev intro
 
Beginning to iPhone development
Beginning to iPhone developmentBeginning to iPhone development
Beginning to iPhone development
 
Porting Flashblock to Jetpack Platform (draft)
Porting Flashblock to Jetpack Platform (draft)Porting Flashblock to Jetpack Platform (draft)
Porting Flashblock to Jetpack Platform (draft)
 
Objective-C Survives
Objective-C SurvivesObjective-C Survives
Objective-C Survives
 
Webエンジニアから見たiOS5
Webエンジニアから見たiOS5Webエンジニアから見たiOS5
Webエンジニアから見たiOS5
 
Getting started with jQuery
Getting started with jQueryGetting started with jQuery
Getting started with jQuery
 
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
jQuery Makes Writing JavaScript Fun Again (for HTML5 User Group)
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
 
Node.js Patterns for Discerning Developers
Node.js Patterns for Discerning DevelopersNode.js Patterns for Discerning Developers
Node.js Patterns for Discerning Developers
 
MFF UK - Advanced iOS Topics
MFF UK - Advanced iOS TopicsMFF UK - Advanced iOS Topics
MFF UK - Advanced iOS Topics
 
Real World MVC
Real World MVCReal World MVC
Real World MVC
 
What's Parse
What's ParseWhat's Parse
What's Parse
 
Persistences
PersistencesPersistences
Persistences
 
ARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマーARCでめちゃモテiOSプログラマー
ARCでめちゃモテiOSプログラマー
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
 
Appsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaolaAppsec usa2013 js_libinsecurity_stefanodipaola
Appsec usa2013 js_libinsecurity_stefanodipaola
 
Raffaele Rialdi
Raffaele RialdiRaffaele Rialdi
Raffaele Rialdi
 

Kürzlich hochgeladen

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Kürzlich hochgeladen (20)

How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 

Freebase and the iPhone