@Test public void copyAndLink() { final TaxonImpl taxon = new TaxonImpl(); taxon.setExternalId("GBIF:123"); final Taxon linkedTaxon = LinkerOpenTreeOfLife.copyAndLinkToOpenTreeTaxon(taxon, 555L); assertThat(linkedTaxon.getExternalId(), is("OTT:555")); assertThat(linkedTaxon.getExternalUrl(), is("https: }
protected static Taxon copyAndLinkToOpenTreeTaxon(Taxon taxon, Long ottId) { Taxon taxonCopy = TaxonUtil.copy(taxon); final String externalId = TaxonomyProvider.OPEN_TREE_OF_LIFE.getIdPrefix() + ottId; taxonCopy.setExternalId(externalId); taxonCopy.setExternalUrl(ExternalIdUtil.urlForExternalId(externalId)); return taxonCopy; }
LinkerOpenTreeOfLife implements IndexerNeo4j { protected static Taxon copyAndLinkToOpenTreeTaxon(Taxon taxon, Long ottId) { Taxon taxonCopy = TaxonUtil.copy(taxon); final String externalId = TaxonomyProvider.OPEN_TREE_OF_LIFE.getIdPrefix() + ottId; taxonCopy.setExternalId(externalId); taxonCopy.setExternalUrl(ExternalIdUtil.urlForExternalId(externalId)); return taxonCopy; } }
LinkerOpenTreeOfLife implements IndexerNeo4j { protected static Taxon copyAndLinkToOpenTreeTaxon(Taxon taxon, Long ottId) { Taxon taxonCopy = TaxonUtil.copy(taxon); final String externalId = TaxonomyProvider.OPEN_TREE_OF_LIFE.getIdPrefix() + ottId; taxonCopy.setExternalId(externalId); taxonCopy.setExternalUrl(ExternalIdUtil.urlForExternalId(externalId)); return taxonCopy; } LinkerOpenTreeOfLife(OpenTreeTaxonIndex index); }
LinkerOpenTreeOfLife implements IndexerNeo4j { protected static Taxon copyAndLinkToOpenTreeTaxon(Taxon taxon, Long ottId) { Taxon taxonCopy = TaxonUtil.copy(taxon); final String externalId = TaxonomyProvider.OPEN_TREE_OF_LIFE.getIdPrefix() + ottId; taxonCopy.setExternalId(externalId); taxonCopy.setExternalUrl(ExternalIdUtil.urlForExternalId(externalId)); return taxonCopy; } LinkerOpenTreeOfLife(OpenTreeTaxonIndex index); @Override void index(GraphServiceFactory factory); }
LinkerOpenTreeOfLife implements IndexerNeo4j { protected static Taxon copyAndLinkToOpenTreeTaxon(Taxon taxon, Long ottId) { Taxon taxonCopy = TaxonUtil.copy(taxon); final String externalId = TaxonomyProvider.OPEN_TREE_OF_LIFE.getIdPrefix() + ottId; taxonCopy.setExternalId(externalId); taxonCopy.setExternalUrl(ExternalIdUtil.urlForExternalId(externalId)); return taxonCopy; } LinkerOpenTreeOfLife(OpenTreeTaxonIndex index); @Override void index(GraphServiceFactory factory);  }