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 t...
Freebase.framework

•   Freebase APIs
    •   login
    •   mqlread, mqlwrite
    •   search, geosearch
    •   imageThumb...
Freebase.framework APIs


  Delegate/selector model
FreebaseSession *session = [FreebaseSession session];
[session <apical...
Freebase.framework APIs

 delegates and didFinishSelector
• specific selector called on success
 - (void)querydone:(id)resu...
Freebase.framework


•   CocoaTouch widgets
    •   FreebaseTable - infinite scrolling, sections,
        thumbnails
    • ...
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”,
               ...
PhotoBase
   Choosing a topic

     FreebaseSuggest

 uses search/geosearch,
mqlread, blurb, imageThumb
PhotoBase
Use FreebaseSuggest
FreebaseSuggest *fbs = [[FreebaseSuggest alloc] init];
fbs.delegate = self;
[self presentMod...
FreebaseSuggest
Finding topics:
[session search:@”x-men” name:@”suggest”
       delegate:self
didFinishSelector:@selector(...
PhotoBase
Choose or take a picture

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


Upload implementation:
  [[FreebaseSession session] uploadImage:image
                             contentType...
PhotoBase

What’s left:
• UI stuff - user feedback, login setup, etc
Whats next:
• Topic geotagging
• QR importing
• Flick...
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?
Upcoming SlideShare
Loading in …5
×

Freebase and the iPhone

2,485 views
2,378 views

Published on

A presentation at the December Freebase meetup about the Freebase.framework iPhone library

Published in: Technology, News & Politics
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,485
On SlideShare
0
From Embeds
0
Number of Embeds
249
Actions
Shares
0
Downloads
20
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide
  • Freebase and the iPhone

    1. 1. Freebase on the iPhone Alec Flett <alecf@metaweb.com>
    2. 2. Freebase on the iPhone Tonight: • Freebase.framework • PhotoBase • Hacking
    3. 3. Freebase.framework What’s included: • Static library • Fully Asynchronous API access • CocoaTouch (iPhone) widgets
    4. 4. 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!
    5. 5. Freebase.framework • Freebase APIs • login • mqlread, mqlwrite • search, geosearch • imageThumb, blurb • image upload • touch
    6. 6. 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
    7. 7. 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
    8. 8. Freebase.framework • CocoaTouch widgets • FreebaseTable - infinite scrolling, sections, thumbnails • FreebaseSuggest - pick a topic, with location support • FreebaseDetail - minimalistic topic view
    9. 9. FreebaseTable
    10. 10. FreebaseSuggest
    11. 11. Geolocation
    12. 12. Topic chosen
    13. 13. PhotoBase More than just a sample app...
    14. 14. PhotoBase Take a picture Choose a topic Upload to Freebase
    15. 15. PhotoBase Logging in [[Freebase session] login:@”alecf” password:@”nice try”, delegate:self didFinishSelector:@selector(loggedin:)];
    16. 16. PhotoBase Choosing a topic FreebaseSuggest uses search/geosearch, mqlread, blurb, imageThumb
    17. 17. 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”]; ... }
    18. 18. 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)
    19. 19. PhotoBase Choose or take a picture (Built into iPhone API: UIImagePickerController)
    20. 20. PhotoBase Now upload...
    21. 21. 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]];
    22. 22. PhotoBase What’s left: • UI stuff - user feedback, login setup, etc Whats next: • Topic geotagging • QR importing • Flickr search • English/metric, distances, etc
    23. 23. Freebase.framework
    24. 24. Freebase.framework Do a little dance
    25. 25. Freebase.framework Do a little dance Make a little app
    26. 26. Freebase.framework Do a little dance Make a little app Lets hack tonight
    27. 27. Freebase.framework Do a little dance Make a little app Lets hack tonight
    28. 28. Freebase.framework Do a little dance Make a little app Lets hack tonight Questions?

    ×