use of org.eol.globi.opentree.OpenTreeTaxonIndex in project eol-globi-data by jhpoelen.
the class LinkerOpenTreeOfLifeTest method assertOTTLink.
protected void assertOTTLink(String name, int expectedCount, String ottId) throws NodeFactoryException, PropertyEnricherException {
OpenTreeTaxonIndex index = null;
try {
index = new OpenTreeTaxonIndex(getClass().getResource("taxonomy-small.tsv"));
taxonIndex.getOrCreateTaxon(new TaxonImpl(name, null));
new LinkerTermMatcher(getGraphDb()).link();
new LinkerOpenTreeOfLife(getGraphDb(), index).link();
Collection<String> externalIds = LinkerTestUtil.assertHasOther(name, expectedCount, taxonIndex, RelTypes.SAME_AS);
assertThat(externalIds, hasItem(TaxonomyProvider.OPEN_TREE_OF_LIFE.getIdPrefix() + ottId));
} finally {
if (index != null) {
index.destroy();
}
}
}
Aggregations