Search in sources :

Example 1 with OpenTreeTaxonIndex

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();
        }
    }
}
Also used : TaxonImpl(org.eol.globi.domain.TaxonImpl) OpenTreeTaxonIndex(org.eol.globi.opentree.OpenTreeTaxonIndex)

Aggregations

TaxonImpl (org.eol.globi.domain.TaxonImpl)1 OpenTreeTaxonIndex (org.eol.globi.opentree.OpenTreeTaxonIndex)1