Revision d9ece393
Added by Andreas Müller over 4 years ago
cdm-pesi/src/main/java/eu/etaxonomy/cdm/io/pesi/out/PesiTaxonExport.java | ||
---|---|---|
330 | 330 |
String infraGenericEpithet = taxonName.getInfraGenericEpithet(); |
331 | 331 |
Rank rank = taxonName.getRank(); |
332 | 332 |
|
333 |
//as kingdomFk can not be defined in Phase 01 the below code was switched to use the CDM rank. This may be changed if we move validation to Phase03 or later |
|
333 |
//as kingdomFk can not be defined in Phase 01 the below code was switched to use the CDM rank. |
|
334 |
//This may be changed if we move validation to Phase03 or later |
|
334 | 335 |
// Integer rankFk = getRankFk(taxonName, taxonName.getNameType()); |
335 | 336 |
// if (rankFk == null) { |
336 | 337 |
// logger.error("Rank was not determined: " + taxon.getUuid() + " (" + taxon.getTitleCache() + ")"); |
... | ... | |
341 | 342 |
// 2. Grandchilds of an accepted taxon of rank subgenus that are accepted taxa of rank subspecies have to have an infraGenericEpithet |
342 | 343 |
|
343 | 344 |
int ancestorLevel = 0; |
344 |
if (taxonName.getRank().equals(Rank.SUBSPECIES())) { |
|
345 |
if (rank == null){ |
|
346 |
logger.warn("PhaseOne validation: Taxon name has no rank: " + taxonName.getTitleCache()); |
|
347 |
}else if (rank.equals(Rank.SUBSPECIES())) { |
|
345 | 348 |
// The accepted taxon two rank levels above should be of rank subgenus |
346 | 349 |
ancestorLevel = 2; |
347 |
} |
|
348 |
if (taxonName.getRank().equals(Rank.SPECIES())) { |
|
350 |
}else if (rank.equals(Rank.SPECIES())) { |
|
349 | 351 |
// The accepted taxon one rank level above should be of rank subgenus |
350 | 352 |
ancestorLevel = 1; |
351 | 353 |
} |
... | ... | |
359 | 361 |
} |
360 | 362 |
} |
361 | 363 |
|
362 |
if (infraGenericEpithet == null && rank.isInfraGenericButNotSpeciesGroup()) { |
|
363 |
logger.warn("InfraGenericEpithet was not determined although it should exist for infra generic names: " + taxon.getUuid() + " (" + taxon.getTitleCache() + ")"); |
|
364 |
} |
|
365 |
if (specificEpithet != null && (rank.isInfraGenericButNotSpeciesGroup()||rank.isGenus()||rank.isSupraGeneric())) { |
|
366 |
logger.warn("SpecificEpithet was determined for rank " + rank.getTitleCache() + " although it should only exist for species aggregates, species or infraspecific taxa: TaxonName " + taxonName.getUuid() + " (" + taxonName.getTitleCache() + ")"); |
|
367 |
} |
|
368 |
if (infraSpecificEpithet != null && !rank.isInfraSpecific()) { |
|
369 |
String message = "InfraSpecificEpithet '" +infraSpecificEpithet + "' was determined for rank " + rank.getTitleCache() + " although it should only exist for rank species and higher: " + taxonName.getUuid() + " (" + taxonName.getTitleCache() + ")"; |
|
370 |
if (StringUtils.isNotBlank(infraSpecificEpithet)){ |
|
371 |
logger.warn(message); |
|
372 |
}else{ |
|
373 |
logger.warn(message); |
|
374 |
} |
|
364 |
if (rank != null){ |
|
365 |
if (infraGenericEpithet == null && rank.isInfraGenericButNotSpeciesGroup()) { |
|
366 |
logger.warn("InfraGenericEpithet was not determined although it should exist for infra generic names: " + taxon.getUuid() + " (" + taxon.getTitleCache() + ")"); |
|
367 |
} |
|
368 |
if (specificEpithet != null && (rank.isInfraGenericButNotSpeciesGroup()||rank.isGenus()||rank.isSupraGeneric())) { |
|
369 |
logger.warn("SpecificEpithet was determined for rank " + rank.getTitleCache() + " although it should only exist for species aggregates, species or infraspecific taxa: TaxonName " + taxonName.getUuid() + " (" + taxonName.getTitleCache() + ")"); |
|
370 |
} |
|
371 |
if (infraSpecificEpithet != null && !rank.isInfraSpecific()) { |
|
372 |
String message = "InfraSpecificEpithet '" +infraSpecificEpithet + "' was determined for rank " + rank.getTitleCache() + " although it should only exist for rank species and higher: " + taxonName.getUuid() + " (" + taxonName.getTitleCache() + ")"; |
|
373 |
if (StringUtils.isNotBlank(infraSpecificEpithet)){ |
|
374 |
logger.warn(message); |
|
375 |
}else{ |
|
376 |
logger.warn(message); |
|
377 |
} |
|
378 |
} |
|
375 | 379 |
} |
376 | 380 |
// } |
377 | 381 |
if (infraSpecificEpithet != null && specificEpithet == null) { |
Also available in: Unified diff
ref #8587 handle null rank names in PESI export a bit better