Skip to content

Commit

Permalink
Apply IncertaeSedis taxon in case of no matches, fixes http://dev.gbi…
Browse files Browse the repository at this point in the history
  • Loading branch information
mdoering committed Jan 5, 2017
1 parent a00a16a commit bf744aa
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.gbif.api.model.occurrence.Occurrence;
import org.gbif.api.model.occurrence.VerbatimOccurrence;
import org.gbif.api.vocabulary.Extension;
import org.gbif.api.vocabulary.Kingdom;
import org.gbif.api.vocabulary.OccurrenceIssue;
import org.gbif.api.vocabulary.Rank;
import org.gbif.common.parsers.RankParser;
Expand Down Expand Up @@ -239,9 +240,17 @@ public void interpretTaxonomy(VerbatimOccurrence verbatim, Occurrence occ) {
} else {
LOG.debug("No backbone match for occurrence {}", occ.getKey());
occ.addIssue(OccurrenceIssue.TAXON_MATCH_NONE);
// assign unknown kingdom
applyKingdom(occ, Kingdom.INCERTAE_SEDIS);
}
}

private static void applyKingdom(Occurrence occ, Kingdom k){
occ.setTaxonKey(k.nubUsageKey());
occ.setScientificName(k.scientificName());
occ.setTaxonRank(Rank.KINGDOM);
}

private static Rank interpretRank(Map<Term, String> terms){
Rank rank = null;
if (hasTerm(terms, DwcTerm.taxonRank)) {
Expand Down

0 comments on commit bf744aa

Please sign in to comment.