Skip to content

Instantly share code, notes, and snippets.

@simonw
Created August 15, 2009 08:58
Show Gist options
  • Select an option

  • Save simonw/168307 to your computer and use it in GitHub Desktop.

Select an option

Save simonw/168307 to your computer and use it in GitHub Desktop.
import freebase # http://code.google.com/p/freebase-python/
def bulk_lookup(ids):
return freebase.mqlreadmulti([species_query(i) for i in ids])
def _species_query(id):
return {
'id': id,
'type': '/biology/organism_classification',
'name': None,
'scientific_name': None
}
details = bulk_lookup(['/en/narwhal', '/en/tiger'])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment