Search in sources :

Example 1 with Interaction

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

the class LinkerTrustyNanoPubsTest method populateDataset.

public NodeFactoryWithDatasetContext populateDataset(DatasetImpl dataset) throws NodeFactoryException {
    TaxonIndex taxonIndex = getOrCreateTaxonIndex();
    // see https://github.com/jhpoelen/eol-globi-data/wiki/Nanopubs
    StudyImpl study = new StudyImpl("some study", "some source", "http://doi.org/123.23/222", "some study citation");
    NodeFactoryWithDatasetContext factory = new NodeFactoryWithDatasetContext(nodeFactory, dataset);
    Interaction interaction = factory.createInteraction(factory.createStudy(study));
    TaxonImpl donaldTaxon = new TaxonImpl("donald duck", "NCBI:1234");
    Specimen donald = factory.createSpecimen(interaction, donaldTaxon);
    donald.classifyAs(taxonIndex.getOrCreateTaxon(donaldTaxon));
    Taxon mickeyTaxon = new TaxonImpl("mickey mouse", "NCBI:4444");
    Taxon mickeyTaxonEOL = taxonIndex.getOrCreateTaxon(new TaxonImpl("mickey mouse", "EOL:567"));
    NodeUtil.connectTaxa(mickeyTaxon, (TaxonNode) mickeyTaxonEOL, getGraphDb(), RelTypes.SAME_AS);
    Specimen mickey = factory.createSpecimen(interaction, mickeyTaxonEOL);
    mickey.classifyAs(taxonIndex.getOrCreateTaxon(mickeyTaxonEOL));
    donald.ate(mickey);
    return factory;
}
Also used : Specimen(org.eol.globi.domain.Specimen) Interaction(org.eol.globi.domain.Interaction) TaxonImpl(org.eol.globi.domain.TaxonImpl) Taxon(org.eol.globi.domain.Taxon) StudyImpl(org.eol.globi.domain.StudyImpl) TaxonIndex(org.eol.globi.data.TaxonIndex) NodeFactoryWithDatasetContext(org.eol.globi.data.NodeFactoryWithDatasetContext)

Aggregations

NodeFactoryWithDatasetContext (org.eol.globi.data.NodeFactoryWithDatasetContext)1 TaxonIndex (org.eol.globi.data.TaxonIndex)1 Interaction (org.eol.globi.domain.Interaction)1 Specimen (org.eol.globi.domain.Specimen)1 StudyImpl (org.eol.globi.domain.StudyImpl)1 Taxon (org.eol.globi.domain.Taxon)1 TaxonImpl (org.eol.globi.domain.TaxonImpl)1