Search in sources :

Example 91 with TaxonImpl

use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.

the class StudyImporterForICES method atePrey.

private Specimen atePrey(Specimen predatorSpecimen, String preyName, Study study) throws NodeFactoryException {
    Specimen preySpecimen = nodeFactory.createSpecimen(study, new TaxonImpl(preyName, null));
    predatorSpecimen.ate(preySpecimen);
    return preySpecimen;
}
Also used : Specimen(org.eol.globi.domain.Specimen) TaxonImpl(org.eol.globi.domain.TaxonImpl)

Example 92 with TaxonImpl

use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.

the class TaxonUtilTest method homonymBacteria.

@Test
public void homonymBacteria() {
    TaxonImpl taxon = new TaxonImpl();
    taxon.setName("Bacteria");
    taxon.setExternalId("some:id");
    taxon.setPath(" | Eukaryota | Opisthokonta | Metazoa | Eumetazoa | Bilateria | Protostomia | Ecdysozoa | Panarthropoda | Arthropoda | Mandibulata | Pancrustacea | Hexapoda | Insecta | Dicondylia | Pterygota | Neoptera | Orthopteroidea | Phasmatodea | Verophasmatodea | Anareolatae | Diapheromeridae | Diapheromerinae | Diapheromerini | Bacteria");
    taxon.setPathNames(" | superkingdom |  | kingdom |  |  |  |  |  | phylum |  |  | superclass | class |  |  | subclass | infraclass | order | suborder | infraorder | family | subfamily | tribe | genus");
    TaxonImpl otherTaxon = new TaxonImpl();
    otherTaxon.setName("Bacteria");
    otherTaxon.setExternalId("some:otherid");
    otherTaxon.setPath("Bacteria");
    otherTaxon.setPathNames("kingdom");
    assertThat(TaxonUtil.likelyHomonym(taxon, otherTaxon), is(true));
}
Also used : TaxonImpl(org.eol.globi.domain.TaxonImpl) Test(org.junit.Test)

Example 93 with TaxonImpl

use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.

the class TaxonUtilTest method notHomonymSparseHigherOrderRanks.

@Test
public // see https://github.com/jhpoelen/eol-globi-data/issues/249
void notHomonymSparseHigherOrderRanks() {
    TaxonImpl taxon = new TaxonImpl();
    taxon.setName("Medicago sativa");
    taxon.setPath("Biota | Plantae | Tracheophyta | Magnoliopsida | Fabales | Fabaceae | Medicago | Medicago sativa");
    taxon.setPathNames("Unranked|Kingdom|Phylum|Class|Order|Family|Genus|Species");
    TaxonImpl otherTaxon = new TaxonImpl();
    otherTaxon.setName("Medicago sativa");
    otherTaxon.setPath("Eukaryota|Streptophyta|Medicago|Medicago sativa|Papilionoideae|Trifolieae||Fabaceae|Viridiplantae|Fabales");
    otherTaxon.setPathNames("superkingdom|phylum|genus|species|subfamily|tribe|subclass|family|kingdom|order");
    assertFalse(TaxonUtil.likelyHomonym(taxon, otherTaxon));
}
Also used : TaxonImpl(org.eol.globi.domain.TaxonImpl) Test(org.junit.Test)

Example 94 with TaxonImpl

use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.

the class TaxonUtilTest method notHomonym.

@Test
public void notHomonym() {
    TaxonImpl taxon = new TaxonImpl();
    taxon.setName("Lestes");
    taxon.setPath("Insecta|Lestidae|Lestes");
    taxon.setPathNames("class|family|genus");
    TaxonImpl otherTaxon = new TaxonImpl();
    otherTaxon.setName("Lestes");
    otherTaxon.setPath("Insecta|Lestidae|Lestes");
    otherTaxon.setPathNames("class|family|genus");
    assertThat(TaxonUtil.likelyHomonym(taxon, otherTaxon), is(false));
}
Also used : TaxonImpl(org.eol.globi.domain.TaxonImpl) Test(org.junit.Test)

Example 95 with TaxonImpl

use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.

the class TaxonUtilTest method noHomonymNotEnoughPathInfo.

@Test
public void noHomonymNotEnoughPathInfo() {
    TaxonImpl taxon = new TaxonImpl();
    taxon.setName("Lestes");
    taxon.setPath("x|y|z");
    taxon.setPathNames("a|b|c");
    TaxonImpl otherTaxon = new TaxonImpl();
    otherTaxon.setName("Lestes");
    otherTaxon.setPath("Mammalia|Mesonychidae|Lestes");
    otherTaxon.setPathNames("class|family|genus");
    assertFalse(TaxonUtil.likelyHomonym(taxon, otherTaxon));
}
Also used : TaxonImpl(org.eol.globi.domain.TaxonImpl) Test(org.junit.Test)

Aggregations

TaxonImpl (org.eol.globi.domain.TaxonImpl)123 Specimen (org.eol.globi.domain.Specimen)59 Test (org.junit.Test)54 Taxon (org.eol.globi.domain.Taxon)42 StudyImpl (org.eol.globi.domain.StudyImpl)34 Study (org.eol.globi.domain.Study)32 Location (org.eol.globi.domain.Location)16 LocationImpl (org.eol.globi.domain.LocationImpl)15 TaxonNode (org.eol.globi.domain.TaxonNode)13 LabeledCSVParser (com.Ostermiller.util.LabeledCSVParser)12 IOException (java.io.IOException)11 TermImpl (org.eol.globi.domain.TermImpl)11 StringWriter (java.io.StringWriter)9 ArrayList (java.util.ArrayList)7 Date (java.util.Date)7 HashMap (java.util.HashMap)7 NonResolvingTaxonIndex (org.eol.globi.taxon.NonResolvingTaxonIndex)7 Map (java.util.Map)5 Node (org.neo4j.graphdb.Node)5 File (java.io.File)4