Few queries regarding downloaded occurrence.text data
Hi All,
I am currently trying to display the GBIF data in a format which is currently not supported by the GBIF API. For exmaple, displaying the list of species within few KM radius from a specific location ordered by species occurrence count.
To accomplish this, I decided to use the occurrence download API to fetch the data for all the required regions, store it in a database and query as per my requirement. I decided to go with following 2 simple tables in the database,
1. *Species* - stores species related data like scientific name, vernacular names, representative image url, etc 2. *Occurences* - stores occurence related data like eventDate, gbifid, decimalLatitude, decimalLongitude, etc
After having a quick look at the downloaded occurrences.txt file, following queries came to my mind,
1. What should be my primary key for species table? I see 'speciesKey' column as a candidate, but it is set as null for some species. The occurrence record has a scientific name but no speciesKey. Any suggestions on this? What field I can use as unique identifier for species?
2. Vernacular names are missing for almost all the occurrences. Is there any API by which I can also obtain vernacular names for a species? http://api.gbif.org/v1/species/%7Bint%7D/vernacularNames seems to do the job, but what is {int} (speciesKey?) and how do I get it from occurrence data?
3. I also need few representative images of the species. http://api.gbif.org/v1/species/%7Bint%7D/media seems to do the job, but it returns a large image and I am looking for a small thumbnail image. Any way to accomplish this? Also, any API that can provide me both the vernacular names and imge url in single API call?
Thanks, Priyank
Hi Priyank,
- What should be my primary key for species table? I see 'speciesKey' column as a candidate, but it is set as null for some species. The occurrence record has a scientific name but no speciesKey. Any suggestions on this? What field I can use as unique identifier for species?
taxonKey is the primary key, speciesKey points to the accepted species but your occurrence might be linked to a subspecies or even a synonym name
- Vernacular names are missing for almost all the occurrences. Is there any API by which I can also obtain vernacular names for a species? http://api.gbif.org/v1/species/%7Bint%7D/vernacularNames http://api.gbif.org/v1/species/{int}/vernacularNames seems to do the job, but what is {int} (speciesKey?) and how do I get it from occurrence data?
As you said use the species API to get vernacular names. {int} is the taxonKey from the occurrence record. 212, birds in this case: http://api.gbif.org/v1/species/212/vernacularNames http://api.gbif.org/v1/species/212/vernacularNames
- I also need few representative images of the species. http://api.gbif.org/v1/species/%7Bint%7D/media http://api.gbif.org/v1/species/{int}/media seems to do the job, but it returns a large image and I am looking for a small thumbnail image. Any way to accomplish this? Also, any API that can provide me both the vernacular names and imge url in single API call?
I am afraid that does not exist. We use an image cache internally that produces thumbnails, but its not part of the public API. We also do not have flagged just one image as the representative. And watch out for the media type, it can also be videos or sounds.
cheers, Markus
Thanks, Priyank _______________________________________________ API-users mailing list API-users@lists.gbif.org http://lists.gbif.org/mailman/listinfo/api-users
Thanks Markus.
Let me take a quick example from the downloaded occurrences.txt
The occurrence record has gbifid = 1056676532, taxonKey = 6092438 and speciesKey = 2482473. If we use http://api.gbif.org/v1/species/%7Bint%7D/vernacularNames API with taxonKey = 6092438, then it gives 0 results ( http://api.gbif.org/v1/species/6092438/vernacularNames), where as if we use speciesKey in the API, it gives proper results as I would like to display ( http://api.gbif.org/v1/species/2482473/vernacularNames).
Will taxonKey be unique for every species or does it map to higher order species in the classification hierarchy?
On Tue, Apr 28, 2015 at 7:10 PM, Markus Döring mdoering@gbif.org wrote:
Hi Priyank,
- What should be my primary key for species table? I see 'speciesKey'
column as a candidate, but it is set as null for some species. The occurrence record has a scientific name but no speciesKey. Any suggestions on this? What field I can use as unique identifier for species?
taxonKey is the primary key, speciesKey points to the accepted species but your occurrence might be linked to a subspecies or even a synonym name
- Vernacular names are missing for almost all the occurrences. Is there
any API by which I can also obtain vernacular names for a species? http://api.gbif.org/v1/species/%7Bint%7D/vernacularNames seems to do the job, but what is {int} (speciesKey?) and how do I get it from occurrence data?
As you said use the species API to get vernacular names. {int} is the taxonKey from the occurrence record. 212, birds in this case: http://api.gbif.org/v1/species/212/vernacularNames
- I also need few representative images of the species.
http://api.gbif.org/v1/species/%7Bint%7D/media seems to do the job, but it returns a large image and I am looking for a small thumbnail image. Any way to accomplish this? Also, any API that can provide me both the vernacular names and imge url in single API call?
I am afraid that does not exist. We use an image cache internally that produces thumbnails, but its not part of the public API. We also do not have flagged just one image as the representative. And watch out for the media type, it can also be videos or sounds.
cheers, Markus
Thanks, Priyank _______________________________________________ API-users mailing list API-users@lists.gbif.org http://lists.gbif.org/mailman/listinfo/api-users
Hi,
the taxonKey 6092438 http://api.gbif.org/v1/species/6092438 represents the subspecies Corvus monedula subsp. soemmerringii http://api.gbif.org/v1/species/6092438 http://api.gbif.org/v1/species/6092438
For that subspecies we are lacking a vernacular name. As you have seen we have the vernacular name just for the species. It might be applicable for the subspecies in your case, but we do not retrieve that automatically. The taxonKey can represent any backbone taxon of any rank up to kingom and down to forma. And as you have seen not all taxa do have a common name.
Markus
On 28 Apr 2015, at 16:48, Priyank Tiwari priyankgt@gmail.com wrote:
Thanks Markus.
Let me take a quick example from the downloaded occurrences.txt
The occurrence record has gbifid = 1056676532, taxonKey = 6092438 and speciesKey = 2482473. If we use http://api.gbif.org/v1/species/%7Bint%7D/vernacularNames http://api.gbif.org/v1/species/%7Bint%7D/vernacularNames API with taxonKey = 6092438, then it gives 0 results (http://api.gbif.org/v1/species/6092438/vernacularNames http://api.gbif.org/v1/species/6092438/vernacularNames), where as if we use speciesKey in the API, it gives proper results as I would like to display (http://api.gbif.org/v1/species/2482473/vernacularNames http://api.gbif.org/v1/species/2482473/vernacularNames).
Will taxonKey be unique for every species or does it map to higher order species in the classification hierarchy?
On Tue, Apr 28, 2015 at 7:10 PM, Markus Döring <mdoering@gbif.org mailto:mdoering@gbif.org> wrote: Hi Priyank,
- What should be my primary key for species table? I see 'speciesKey' column as a candidate, but it is set as null for some species. The occurrence record has a scientific name but no speciesKey. Any suggestions on this? What field I can use as unique identifier for species?
taxonKey is the primary key, speciesKey points to the accepted species but your occurrence might be linked to a subspecies or even a synonym name
- Vernacular names are missing for almost all the occurrences. Is there any API by which I can also obtain vernacular names for a species? http://api.gbif.org/v1/species/%7Bint%7D/vernacularNames http://api.gbif.org/v1/species/%7Bint%7D/vernacularNames seems to do the job, but what is {int} (speciesKey?) and how do I get it from occurrence data?
As you said use the species API to get vernacular names. {int} is the taxonKey from the occurrence record. 212, birds in this case: http://api.gbif.org/v1/species/212/vernacularNames http://api.gbif.org/v1/species/212/vernacularNames
- I also need few representative images of the species. http://api.gbif.org/v1/species/%7Bint%7D/media http://api.gbif.org/v1/species/%7Bint%7D/media seems to do the job, but it returns a large image and I am looking for a small thumbnail image. Any way to accomplish this? Also, any API that can provide me both the vernacular names and imge url in single API call?
I am afraid that does not exist. We use an image cache internally that produces thumbnails, but its not part of the public API. We also do not have flagged just one image as the representative. And watch out for the media type, it can also be videos or sounds.
cheers, Markus
Thanks, Priyank _______________________________________________ API-users mailing list API-users@lists.gbif.org mailto:API-users@lists.gbif.org http://lists.gbif.org/mailman/listinfo/api-users http://lists.gbif.org/mailman/listinfo/api-users
-- ~ Priyank
Not a GBIF staffer, just chiming in with my 2c:
1) There should be a taxonKey value in occurence results, which should map to the key value in the species API (which should, probably, always be non-null). If the taxonRank in the occurence is equal to SPECIES, this should be a species record as well (it might be identified only to genus, or it might be identifier below species).
2 & 3) EOL is a good source for both vernacular names, and high quality images of specimens. They also have a pretty decent API: http://eol.org/api You can use the search api ( http://eol.org/api/docs/search ) to query for the pageID of the taxon you're interested in, then use the pages api ( http://eol.org/api/docs/pages ) to pull the list of vernacular names and some media
Alex Thompson iDigBio Infrastructure Team
On 04/28/2015 08:56 AM, Priyank Tiwari wrote:
Hi All,
I am currently trying to display the GBIF data in a format which is currently not supported by the GBIF API. For exmaple, displaying the list of species within few KM radius from a specific location ordered by species occurrence count.
To accomplish this, I decided to use the occurrence download API to fetch the data for all the required regions, store it in a database and query as per my requirement. I decided to go with following 2 simple tables in the database,
- *Species* - stores species related data like scientific name, vernacular names, representative image url, etc
- *Occurences* - stores occurence related data like eventDate, gbifid, decimalLatitude, decimalLongitude, etc
After having a quick look at the downloaded occurrences.txt file, following queries came to my mind,
- What should be my primary key for species table? I see 'speciesKey'
column as a candidate, but it is set as null for some species. The occurrence record has a scientific name but no speciesKey. Any suggestions on this? What field I can use as unique identifier for species?
- Vernacular names are missing for almost all the occurrences. Is
there any API by which I can also obtain vernacular names for a species? http://api.gbif.org/v1/species/%7Bint%7D/vernacularNames http://api.gbif.org/v1/species/%7Bint%7D/vernacularNames seems to do the job, but what is {int} (speciesKey?) and how do I get it from occurrence data?
- I also need few representative images of the species.
http://api.gbif.org/v1/species/%7Bint%7D/media http://api.gbif.org/v1/species/%7Bint%7D/media seems to do the job, but it returns a large image and I am looking for a small thumbnail image. Any way to accomplish this? Also, any API that can provide me both the vernacular names and imge url in single API call?
Thanks, Priyank
API-users mailing list API-users@lists.gbif.org http://lists.gbif.org/mailman/listinfo/api-users
Thanks Alex.
I will explore the EOL API as well.
On Tue, Apr 28, 2015 at 7:10 PM, Alex Thompson godfoder@acis.ufl.edu wrote:
Not a GBIF staffer, just chiming in with my 2c:
- There should be a taxonKey value in occurence results, which should map
to the key value in the species API (which should, probably, always be non-null). If the taxonRank in the occurence is equal to SPECIES, this should be a species record as well (it might be identified only to genus, or it might be identifier below species).
2 & 3) EOL is a good source for both vernacular names, and high quality images of specimens. They also have a pretty decent API: http://eol.org/api You can use the search api ( http://eol.org/api/docs/search ) to query for the pageID of the taxon you're interested in, then use the pages api ( http://eol.org/api/docs/pages ) to pull the list of vernacular names and some media
Alex Thompson iDigBio Infrastructure Team
On 04/28/2015 08:56 AM, Priyank Tiwari wrote:
Hi All,
I am currently trying to display the GBIF data in a format which is currently not supported by the GBIF API. For exmaple, displaying the list of species within few KM radius from a specific location ordered by species occurrence count.
To accomplish this, I decided to use the occurrence download API to fetch the data for all the required regions, store it in a database and query as per my requirement. I decided to go with following 2 simple tables in the database,
- *Species* - stores species related data like scientific name,
vernacular names, representative image url, etc 2. *Occurences* - stores occurence related data like eventDate, gbifid, decimalLatitude, decimalLongitude, etc
After having a quick look at the downloaded occurrences.txt file, following queries came to my mind,
- What should be my primary key for species table? I see 'speciesKey'
column as a candidate, but it is set as null for some species. The occurrence record has a scientific name but no speciesKey. Any suggestions on this? What field I can use as unique identifier for species?
- Vernacular names are missing for almost all the occurrences. Is there
any API by which I can also obtain vernacular names for a species? http://api.gbif.org/v1/species/%7Bint%7D/vernacularNames seems to do the job, but what is {int} (speciesKey?) and how do I get it from occurrence data?
- I also need few representative images of the species.
http://api.gbif.org/v1/species/%7Bint%7D/media seems to do the job, but it returns a large image and I am looking for a small thumbnail image. Any way to accomplish this? Also, any API that can provide me both the vernacular names and imge url in single API call?
Thanks, Priyank
API-users mailing listAPI-users@lists.gbif.orghttp://lists.gbif.org/mailman/listinfo/api-users
API-users mailing list API-users@lists.gbif.org http://lists.gbif.org/mailman/listinfo/api-users
participants (3)
-
Alex Thompson
-
Markus Döring
-
Priyank Tiwari