Search in sources :

Example 16 with DatasetImporter

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

the class DatasetImporterFactoryImplIT method getTemplateImporter.

DatasetImporter getTemplateImporter(DatasetRegistry datasetRegistry, String repo) throws DatasetRegistryException, StudyImporterException {
    Dataset dataset = new DatasetFactory(datasetRegistry).datasetFor(repo);
    DatasetImporter importer = new StudyImporterFactoryImpl(null).createImporter(dataset);
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(DatasetImporterForTSV.class)));
    return importer;
}
Also used : Dataset(org.globalbioticinteractions.dataset.Dataset) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) DatasetFactory(org.globalbioticinteractions.dataset.DatasetFactory)

Example 17 with DatasetImporter

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

the class DatasetImporterFactoryImplIT method createSzoboszlai.

@Test
public void createSzoboszlai() throws StudyImporterException, DatasetRegistryException {
    final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
    DatasetImporter importer = importerFor(datasetFinderGitHubRemote, "globalbioticinteractions/szoboszlai2015");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(DatasetImporterForSzoboszlai.class)));
    DatasetImporterForSzoboszlai importerz = (DatasetImporterForSzoboszlai) importer;
    assertThat(importerz.getSourceCitation(), containsString("Szoboszlai"));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) DatasetImporterForSzoboszlai(org.eol.globi.data.DatasetImporterForSzoboszlai) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) Test(org.junit.Test)

Example 18 with DatasetImporter

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

the class DatasetImporterFactoryImplIT method createWood.

@Test
public void createWood() throws StudyImporterException, DatasetRegistryException, IOException {
    final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
    DatasetImporter importer = importerFor(datasetFinderGitHubRemote, "globalbioticinteractions/wood2015");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(DatasetImporterForWood.class)));
    DatasetImporterForWood importerz = (DatasetImporterForWood) importer;
    assertThat(importerz.getSourceCitation(), containsString("Wood"));
    assertThat(importerz.getDataset().retrieve(URI.create("links")).toString(), is(notNullValue()));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) DatasetImporterForWood(org.eol.globi.data.DatasetImporterForWood) Test(org.junit.Test)

Example 19 with DatasetImporter

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

the class DatasetImporterFactoryImplIT method createGoMexSI.

@Test
public void createGoMexSI() throws StudyImporterException, DatasetRegistryException {
    final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
    DatasetImporter importer = importerFor(datasetFinderGitHubRemote, "gomexsi/interaction-data");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(DatasetImporterForGoMexSI2.class)));
    DatasetImporterForGoMexSI2 gomexsiImporter = (DatasetImporterForGoMexSI2) importer;
    assertThat(gomexsiImporter.getSourceCitation(), is("http://gomexsi.tamucc.edu"));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) DatasetImporterForGoMexSI2(org.eol.globi.data.DatasetImporterForGoMexSI2) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) Test(org.junit.Test)

Example 20 with DatasetImporter

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

the class NodeFactoryTest method createStudyImporter.

private static DatasetImporter createStudyImporter(Class<? extends DatasetImporter> studyImporter, NodeFactory factory) throws StudyImporterException {
    DatasetImporter importer = new StudyImporterTestFactory(factory).instantiateImporter(studyImporter);
    importer.setLogger(new NullImportLogger());
    return importer;
}
Also used : StudyImporterTestFactory(org.eol.globi.data.StudyImporterTestFactory) DatasetImporter(org.eol.globi.data.DatasetImporter)

Aggregations

DatasetImporter (org.eol.globi.data.DatasetImporter)21 BaseDatasetImporter (org.eol.globi.data.BaseDatasetImporter)16 Test (org.junit.Test)16 DatasetRegistryGitHubRemote (org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote)15 JsonNode (com.fasterxml.jackson.databind.JsonNode)6 Dataset (org.globalbioticinteractions.dataset.Dataset)6 StudyImporterException (org.eol.globi.data.StudyImporterException)5 DatasetFactory (org.globalbioticinteractions.dataset.DatasetFactory)5 DatasetRegistry (org.globalbioticinteractions.dataset.DatasetRegistry)5 InputStream (java.io.InputStream)4 URI (java.net.URI)4 DatasetImporterForCoetzer (org.eol.globi.data.DatasetImporterForCoetzer)4 DatasetImporterForGoMexSI2 (org.eol.globi.data.DatasetImporterForGoMexSI2)4 DatasetImporterForHafner (org.eol.globi.data.DatasetImporterForHafner)4 DatasetImporterForMetaTable (org.eol.globi.data.DatasetImporterForMetaTable)4 DatasetImporterForPlanque (org.eol.globi.data.DatasetImporterForPlanque)4 DatasetImporterForSzoboszlai (org.eol.globi.data.DatasetImporterForSzoboszlai)4 DatasetImporterForTSV (org.eol.globi.data.DatasetImporterForTSV)4 DatasetImporterForWood (org.eol.globi.data.DatasetImporterForWood)4 MatcherAssert.assertThat (org.hamcrest.MatcherAssert.assertThat)4