private static String getPath (final @Nonnull Taxon taxon) { return taxon.as(Entity.class).getQName().getLocalPart().replaceAll(".*/Aves", "/Aves"); }
@Override public String toString() { return String.format("%s -> %s", taxon.getDisplayName(Locale.ENGLISH), otherTaxon.getDisplayName(Locale.ENGLISH)); } });
@Override @Nonnull public Taxon initialize (final @Nonnull Taxon taxon) { getLookup().lookup(ConceptScheme.class).getSkosHasTopConcepts().add(taxon.getLookup().lookup(Concept.class)); // as(ConceptScheme.class).getSkosHasTopConcepts().add(taxon.as(Concept.class)); return taxon; } });
@Override public void preVisit (final @Nonnull Taxon taxon) { final List<? extends Taxon> synonyms = taxon.findSynonyms().results(); if (synonyms.isEmpty()) { // TODO: missing counterpart } else if (synonyms.size() == 1) { final TaxonDifferenceSet taxonDifferenceSet = new TaxonDifferenceSet(taxon, synonyms.iterator().next()); if (!taxonDifferenceSet.isEmpty()) { differenceList.add(taxonDifferenceSet); } } else // FIXME: indeed you should only retain the one of the target taxonomy { System.err.println("WARNING Synonym count > 1 for " + taxon.getDisplayName()); // throw new RuntimeException("Synonym count > 1: " + synonyms); } } });
final Id taxonId = taxon.getScientificNameId(); final String fileNameBase = taxonId.stringValue().replaceAll(":", "_"); "", taxon.getDisplayName(Locale.ENGLISH), taxon.getScientificName(), fileNameBase }); final ObservationSet observationSet = xcObservationSetProvider.createObservationSet(taxonId, taxon.getScientificName()); save(observationSet, fileNameBase); processed++; log.warn("SHOULD NOT OCCUR: cannot translate {} {}", taxonId, taxon.getScientificName()); log.warn("", e);
new ArrayList<Taxon>(getAnonymousSynonym().findSynonyms().results()); if (as(Entity.class).getQName().equals(i.next().as(Entity.class).getQName()))
/******************************************************************************************************************* * * ******************************************************************************************************************/ @Nonnull public String findXenoCantoId (final @Nonnull Taxon taxon) throws NotFoundException { final Id id = taxon.getScientificNameId(); final String lsidScientificName = lsidScientificNameMapById.get(id.stringValue()); String xenoCantoScientificName = lsidToXenoCantoScientificNameMap.get(lsidScientificName); xenoCantoScientificName = (xenoCantoScientificName != null) ? xenoCantoScientificName : lsidScientificName; final String xenoCantoId = xenoCantoIdMapByScientificName.get(xenoCantoScientificName); log.info("TRANSLATE: id: {} -> LSID scientific name: {} -> xenoCantoScientificName: {} xenoCantoId: {}", new Object[] { id, lsidScientificName, xenoCantoScientificName, xenoCantoId }); return xenoCantoId; } }
public void accept (final @Nonnull Taxon taxon, final @Nonnull TaxonomyVisitor visitor) { visitor.preVisit(taxon); visitor.visit(taxon); for (final Taxon subTaxon : taxon.findSubTaxa().results()) { accept(subTaxon, visitor); } visitor.postVisit(taxon); } }
taxon = parentTaxon.createSubTaxon().withScientificName(scientificName). withScientificNameId(scientificNameId). withSpecificEpythet(specificEpythet).
@Override public String toString() { final StringBuilder buffer = new StringBuilder(); buffer.append(taxon.getDisplayName(Locale.ITALIAN)).append("\n"); // FIXME locale for (final Difference difference : differences) { buffer.append(difference.toString()).append("\n"); } return buffer.toString(); } }
public Taxon initialize (final @Nonnull Taxon taxon) { getLookup().lookup(Concept.class).getSkosNarrowers().add(taxon.getLookup().lookup(Concept.class)); // as(Concept.class).getSkosNarrowers().add(taxon.as(Concept.class)); FIXME return taxon; } });
final boolean isSpeciesOrSubSpecies = Character.isLowerCase(taxon.getDisplayName().charAt(0)); if (isSpeciesOrSubSpecies && !nullEquals(taxon.getDisplayName(Locale.ENGLISH), otherTaxon.getDisplayName(Locale.ENGLISH)))