<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        font-size:10.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
span.ng-binding
        {mso-style-name:ng-binding;}
span.small
        {mso-style-name:small;}
span.EmailStyle20
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="en-DK" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">Hi József<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">I am no guru or web developer but looking at the code [1] I
<i>think</i> it is pulling out distinct the ranks in order from the suggest response [2]. I see the code has this:<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;mso-fareast-language:EN-US">  <span ng-repeat="taxa in ['kingdom', 'phylum', 'class', 'order', 'family', 'genus', 'species']"<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;mso-fareast-language:EN-US">     ng-if="match.model[taxa] && taxa != match.model.rank.toLowerCase()"><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;mso-fareast-language:EN-US">        {{match.model[taxa]}}<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;font-family:Consolas;mso-fareast-language:EN-US">  </span><o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">Someone may correct me if I’m wrong, but since it’s the weekend here now it may be some time – I hope this helps for starters…<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">Thanks,<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">Tim<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">[1]
<a href="https://github.com/gbif/portal16/blob/80aa008dcd9442c47e6d9ee5894f4e19de4000d8/app/views/components/filterTaxon/suggestTaxonTemplate.html#L6">
https://github.com/gbif/portal16/blob/80aa008dcd9442c47e6d9ee5894f4e19de4000d8/app/views/components/filterTaxon/suggestTaxonTemplate.html#L6</a>
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US">[2]
<a href="https://api.gbif.org/v1/species/suggest?datasetKey=d7dddbf4-2cf0-4f39-9b2a-bb099caae36c&limit=10&q=Iris%20pumila">
https://api.gbif.org/v1/species/suggest?datasetKey=d7dddbf4-2cf0-4f39-9b2a-bb099caae36c&limit=10&q=Iris%20pumila</a>
<o:p></o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span lang="EN-US" style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="font-size:12.0pt;color:black">From:
</span></b><span style="font-size:12.0pt;color:black">API-users <api-users-bounces@lists.gbif.org> on behalf of Szlamka József <szlajozs@gmail.com><br>
<b>Date: </b>Friday, 11 March 2022 at 18.44<br>
<b>To: </b>api-users@lists.gbif.org <api-users@lists.gbif.org><br>
<b>Subject: </b>[API-users] /species/suggest - higherClassificationMap question<o:p></o:p></span></p>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span style="font-size:11.0pt">Hi API gurus,<br>
<br>
I assume, the search box functionality in the species page of gbif homepage (e.g.:
<a href="https://www.gbif.org/species/5298708">https://www.gbif.org/species/5298708</a>) is based on "suggest". There each result contains the scientific name and the full taxonomic hierarchy e.g. "<span class="ng-binding">Iris pumila subsp. attica (Boiss.
 & Heldr.) K.Richt.</span> <span class="small">Subspecies</span><span class="ng-binding">  | Plantae > Tracheophyta >  Liliopsida > Asparagales >  Iridaceae >  Iris >  Iris pumila".</span><br>
<br>
<span class="ng-binding">My question: how is the hierarchy implemented? Is it based on "higherClassificationMap"? How?</span><br>
<br>
<span class="ng-binding">When I play with the suggest api, the XMLHttpRequest responseText in raw text format contains the taxonomic hierarchy correctly (i.e. the physical order of the entries in "higherClassificationMap" is correct). Unfortunately after JSON.parse
 the resulting javascript object does not hold any information about the physical order of the key/value pairs.</span><br>
<br>
<span class="ng-binding">Is there any smart way to overcome this, or shall I hardcode the hierarchy manually?</span><br>
<br>
<span class="ng-binding">Thanks in advance.</span><br>
<br>
<span class="ng-binding">József Szlamka</span><o:p></o:p></span></p>
</div>
</body>
</html>