use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class LinkerTermMatcherTest method exactMatchMedicagoSativa.
@Test
public // see //see https://github.com/jhpoelen/eol-globi-data/issues/249
void exactMatchMedicagoSativa() throws NodeFactoryException, PropertyEnricherException {
Taxon nbnTaxon = new TaxonImpl("Medicago sativa", "NBN:NBNSYS0000013971");
nbnTaxon.setPath("Biota | Plantae | Tracheophyta | Magnoliopsida | Fabales | Fabaceae | Medicago | Medicago sativa");
nbnTaxon.setPathNames("Unranked | Kingdom | Phylum | Class | Order | Family | Genus | Species");
taxonIndex.getOrCreateTaxon(nbnTaxon);
final Taxon taxonCreated = taxonIndex.getOrCreateTaxon(new TaxonImpl("Medicago sativa L.", null));
assertThat(taxonCreated.getName(), is("Medicago sativa L."));
new LinkerTermMatcher(getGraphDb()).link();
Collection<String> ids = LinkerTestUtil.assertHasOther(taxonCreated.getName(), 7, taxonIndex, RelTypes.SAME_AS);
assertThat(ids, hasItem("ITIS:183623"));
assertThat(ids, hasItem("NCBI:3879"));
assertThat(ids, not(hasItem("NCBI:56066")));
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class LinkerTermMatcherTest method exactMatchMonodelphisAmericana.
@Test
public void exactMatchMonodelphisAmericana() throws NodeFactoryException, PropertyEnricherException {
final Taxon taxonCreated = taxonIndex.getOrCreateTaxon(new TaxonImpl("Monodelphis americana", null));
assertThat(taxonCreated.getName(), is("Monodelphis americana"));
new LinkerTermMatcher(getGraphDb()).link();
Collection<String> ids = LinkerTestUtil.assertHasOther(taxonCreated.getName(), 5, taxonIndex, RelTypes.SAME_AS);
assertThat(ids, hasItems("ITIS:552569", "NCBI:694061", "IRMNG:11060619", "GBIF:2439970", "OTT:446727"));
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class ReportGeneratorTest method createStudy.
protected Study createStudy(Study study1) throws NodeFactoryException {
Study study = nodeFactory.getOrCreateStudy(study1);
Specimen monkey = nodeFactory.createSpecimen(study, new TaxonImpl("Monkey"));
monkey.ate(nodeFactory.createSpecimen(study, new TaxonImpl("Banana")));
monkey.ate(nodeFactory.createSpecimen(study, new TaxonImpl("Banana")));
monkey.ate(nodeFactory.createSpecimen(study, new TaxonImpl("Banana")));
TaxonImpl apple = new TaxonImpl("Apple", "some:id");
apple.setPath("some | path");
monkey.ate(nodeFactory.createSpecimen(study, apple));
return study;
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class LinkerTermMatcherTest method threeTaxa.
@Test
public void threeTaxa() throws NodeFactoryException, PropertyEnricherException {
taxonIndex.getOrCreateTaxon(new TaxonImpl("Homo sapiens", null));
taxonIndex.getOrCreateTaxon(new TaxonImpl("Ariopsis felis", null));
taxonIndex.getOrCreateTaxon(new TaxonImpl("Canis lupus", null));
new LinkerTermMatcher(getGraphDb()).link();
LinkerTestUtil.assertHasOther("Homo sapiens", 5, taxonIndex, RelTypes.SAME_AS);
LinkerTestUtil.assertHasOther("Homo sapiens", 0, taxonIndex, RelTypes.SIMILAR_TO);
LinkerTestUtil.assertHasOther("Canis lupus", 6, taxonIndex, RelTypes.SAME_AS);
LinkerTestUtil.assertHasOther("Canis lupus", 0, taxonIndex, RelTypes.SIMILAR_TO);
LinkerTestUtil.assertHasOther("Ariopsis felis", 8, taxonIndex, RelTypes.SAME_AS);
LinkerTestUtil.assertHasOther("Ariopsis felis", 0, taxonIndex, RelTypes.SIMILAR_TO);
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class LinkerTermMatcherTest method hasSeaLifeBaseLinks.
@Test
public void hasSeaLifeBaseLinks() throws NodeFactoryException, PropertyEnricherException {
taxonIndex.getOrCreateTaxon(new TaxonImpl("Enhydra lutris", null));
new LinkerTermMatcher(getGraphDb()).link();
Collection<String> ids = LinkerTestUtil.assertHasOther("Enhydra lutris", 8, taxonIndex, RelTypes.SAME_AS);
assertThat(ids, hasItem("FBC:SLB:SpecCode:69195"));
}
Aggregations