use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class ExporterOccurrencesTest method eatWolf.
private Specimen eatWolf(Specimen specimen, Study study) throws NodeFactoryException {
Specimen otherSpecimen = nodeFactory.createSpecimen(study, new TaxonImpl("Canis lupus", "EOL:328607"));
otherSpecimen.setVolumeInMilliLiter(124.0);
nodeFactory.setUnixEpochProperty(otherSpecimen, ExportTestUtil.utcTestDate());
specimen.ate(otherSpecimen);
return otherSpecimen;
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class ExporterAssociationsTest method eats.
private void eats(Specimen specimen, String scientificName, String taxonExternalId, Study study) throws NodeFactoryException {
Specimen otherSpecimen = nodeFactory.createSpecimen(study, new TaxonImpl(scientificName, taxonExternalId));
otherSpecimen.setVolumeInMilliLiter(124.0);
specimen.ate(otherSpecimen);
specimen.ate(otherSpecimen);
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class ExporterMeasurementOrFactTest method noMatchNames.
@Test
public void noMatchNames() throws IOException, NodeFactoryException, ParseException {
Study myStudy = nodeFactory.createStudy(new StudyImpl("myStudy", null, null, null));
nodeFactory.createSpecimen(myStudy, new TaxonImpl(PropertyAndValueDictionary.NO_NAME, "externalId1"));
nodeFactory.createSpecimen(myStudy, new TaxonImpl("Some namus", PropertyAndValueDictionary.NO_MATCH));
Study myStudy1 = nodeFactory.findStudy("myStudy");
StringWriter row = new StringWriter();
new ExporterMeasurementOrFact().exportStudy(myStudy1, row, false);
assertThat(row.getBuffer().toString(), equalTo(""));
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class GraphExporterImplTest method exportAll.
@Test
public void exportAll() throws StudyImporterException, IOException {
File tmpDir = FileUtils.getTempDirectory();
File tmpDirPath = new File(tmpDir, "test" + new Random().nextLong());
FileUtils.forceMkdir(tmpDirPath);
assertThat(tmpDirPath.list().length, is(0));
Study study = nodeFactory.getOrCreateStudy(new StudyImpl("a study", "a source", "doi:12345L", null));
Specimen human = nodeFactory.createSpecimen(study, new TaxonImpl("Homo sapiens", "NCBI:123"));
human.ate(nodeFactory.createSpecimen(study, new TaxonImpl("Canis familiaris", "BLA:444")));
resolveNames();
try {
new GraphExporterImpl().export(getGraphDb(), tmpDirPath.getAbsolutePath() + "/");
assertThat(tmpDirPath.list().length, is(6));
} finally {
FileUtils.deleteQuietly(tmpDirPath);
}
}
use of org.eol.globi.domain.TaxonImpl in project eol-globi-data by jhpoelen.
the class ExporterSiteMapForNamesTest method writeSiteMapWithNames.
@Test
public void writeSiteMapWithNames() throws StudyImporterException, IOException {
taxonIndex = new NonResolvingTaxonIndex(getGraphDb());
Study study = nodeFactory.getOrCreateStudy(new StudyImpl("title", "source", null, "citation 123"));
TaxonImpl homoSapiens = new TaxonImpl("Homo sapiens", "homoSapiensId");
homoSapiens.setPath("one two three");
final Specimen human = nodeFactory.createSpecimen(study, homoSapiens);
TaxonImpl dogTaxon = new TaxonImpl("Canis familiaris", null);
final Specimen dog = nodeFactory.createSpecimen(study, dogTaxon);
human.ate(dog);
resolveNames();
final File baseDirNames = createBaseDir("target/sitemap/names");
final GraphExporter siteMapForNames = new ExporterSiteMapForNames();
siteMapForNames.export(getGraphDb(), baseDirNames.getAbsolutePath());
assertSiteMap(baseDirNames, "http://www.globalbioticinteractions.org/?interactionType=interactsWith&sourceTaxon=Homo%20sapiens", "https://depot.globalbioticinteractions.org/snapshot/target/data/sitemap/names/sitemap.xml.gz");
}
Aggregations