Created
August 15, 2009 08:58
-
-
Save simonw/168307 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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