Crop Wild Relatives Data Portal using web services from the GBIF infrastructure. GBIF Governing Board (GB14) NODES meeting in Amsterdam 14th October 2007.
1. Cover slide GBIF Data Portal Use case of the Crop Wild Relatives Data Portal using web services from the GBIF Data portal Agenda item 6.1 Portal – examples and conclusions October 14, 2007, NODES 9, GB14, Amsterdam Dag Terje Filip Endresen Nordic Gene Bank (Sweden) Bioversity International (Italy)
2.
3.
4.
5. A distributed data network ARM LKA BOL MDG UZB National Datasets are shared using the CWR GRIS system. (Implementation of PyWrapper3 and Darwin Core (DwC) is in progress.) The national CWR datasets and other relevant International datasets are indexed by the CWR data portal. EURISCO SINGER
10. GBIF Portal The CWR Portal provides the summary number of records from the GBIF Data Portal on the CWR species list. This summary number of records is regularly indexed to speed up the loading of the CWR Portal pages for species level and country level metadata. Whenever displayed, this summary number of records provides a deep-link back to the GBIF Data Portal.
11. GBIF Data Portal, web service interface PHP Code: function gbif_count_occurrences ($taxon_name, $country_iso2, $georeferenced_only = 'false') { /** * function : gbif_count_occurrences * Connect to the GBIF Data Portal and calculate summary species level or country level record count * INPUT : Species name, Country ISO-2 Code, Georeferenced_only (true/false) */ $totalMatched = ''; // init variable if ($country_iso2) : $country_iso2 = strtoupper($country_iso2); endif; $rest_url = " http://data.gbif.org/ws/rest/occurrence/count? "; $rest_url .= " stylesheet= "; // switch off stylesheet browser formatting if ($taxon_name) : $rest_url .= " &scientificname= " . urlencode($taxon_name); endif; if ($country_iso2) : $rest_url .= " &originisocountrycode= " . strtoupper($country_iso2); endif; $rest_url .= " &georeferencedonly= " . $georeferenced_only; // switch for georeferenced ONLY on/off $file_content = file_get_contents($rest_url); // Read the GBIF Data Portal web service response as REST URL $xml = new SimpleXMLElement($file_content); $xml->registerXPathNamespace('gbif', 'http://portal.gbif.org/ws/response/gbif'); // Register namespace $result = $xml->xpath('//gbif:summary[1]'); foreach ($result as $data_node) { foreach ($data_node->attributes() as $key => $value) { if ($key == 'totalMatched') { $totalMatched = (string)$value; } // end if key totalMatched } // end foreach data_node attribute } // end foreach result data_node # echo "<xmp>" . $file_content . "</xmp><hr />"; // DEBUG return $totalMatched; } Examples: http://data. gbif .org/ ws /rest/occurrence/count? scientificname = Allium + porrum & georeferencedonly =true& stylesheet = http://data. gbif .org/ ws /rest/occurrence/count? scientificname = Allium + porrum & georeferencedonly =& stylesheet =