Search in sources :

Example 1 with DatasetRegistryGitHubRemote

use of org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote in project eol-globi-data by jhpoelen.

the class DatasetImporterFactoryImplIT method createHurlbert.

@Test
public void createHurlbert() throws StudyImporterException, DatasetRegistryException {
    final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
    DatasetImporter importer = importerFor(datasetFinderGitHubRemote, "hurlbertlab/dietdatabase");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(DatasetImporterForHurlbert.class)));
    final JsonNode config = ((BaseDatasetImporter) importer).getDataset().getConfig();
    assertThat(config, is(notNullValue()));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) JsonNode(com.fasterxml.jackson.databind.JsonNode) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) Test(org.junit.Test)

Example 2 with DatasetRegistryGitHubRemote

use of org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote in project eol-globi-data by jhpoelen.

the class DatasetImporterFactoryImplIT method createMetaTable.

@Test
public void createMetaTable() throws DatasetRegistryException, StudyImporterException {
    final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
    DatasetImporter importer = importerFor(datasetFinderGitHubRemote, "globalbioticinteractions/AfricaTreeDatabase");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(DatasetImporterForMetaTable.class)));
    assertThat(((DatasetImporterForMetaTable) importer).getConfig(), is(notNullValue()));
    assertThat(((DatasetImporterForMetaTable) importer).getBaseUrl(), startsWith("https://raw.githubusercontent.com/globalbioticinteractions/AfricaTreeDatabase/"));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) Test(org.junit.Test)

Example 3 with DatasetRegistryGitHubRemote

use of org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote in project eol-globi-data by jhpoelen.

the class DatasetImporterFactoryImplIT method createPlanque.

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

Example 4 with DatasetRegistryGitHubRemote

use of org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote in project eol-globi-data by jhpoelen.

the class DatasetImporterFactoryImplIT method createHafner.

@Test
public void createHafner() throws StudyImporterException, DatasetRegistryException, IOException {
    final DatasetRegistry datasetRegistryGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
    Dataset dataset = new DatasetFactory(datasetRegistryGitHubRemote).datasetFor("globalbioticinteractions/hafner");
    DatasetImporter importer = new StudyImporterFactoryImpl(null).createImporter(dataset);
    assertThat(importer, is(notNullValue()));
    DatasetImporterForHafner haftnerImporter = (DatasetImporterForHafner) importer;
    assertThat(haftnerImporter.getDataset().retrieve(URI.create("hafner/gopher_lice_int.csv")), is(notNullValue()));
}
Also used : DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) Dataset(org.globalbioticinteractions.dataset.Dataset) DatasetRegistry(org.globalbioticinteractions.dataset.DatasetRegistry) DatasetImporterForHafner(org.eol.globi.data.DatasetImporterForHafner) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) DatasetFactory(org.globalbioticinteractions.dataset.DatasetFactory) Test(org.junit.Test)

Example 5 with DatasetRegistryGitHubRemote

use of org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote in project eol-globi-data by jhpoelen.

the class DatasetImporterFactoryImplIT method createAfrotropicalBees.

@Test
public void createAfrotropicalBees() throws StudyImporterException, DatasetRegistryException, IOException {
    final DatasetRegistryGitHubRemote datasetFinderGitHubRemote = new DatasetRegistryGitHubRemote(inStream -> inStream);
    String repo = "globalbioticinteractions/Catalogue-of-Afrotropical-Bees";
    DatasetImporter importer = importerFor(datasetFinderGitHubRemote, repo);
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(DatasetImporterForCoetzer.class)));
    assertThat(((DatasetImporterForCoetzer) importer).getDataset(), is(notNullValue()));
    assertThat(((DatasetImporterForCoetzer) importer).getDataset().retrieve(URI.create("archive")), is(notNullValue()));
}
Also used : DatasetImporterForCoetzer(org.eol.globi.data.DatasetImporterForCoetzer) DatasetRegistryGitHubRemote(org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote) Matchers.containsString(org.hamcrest.Matchers.containsString) BaseDatasetImporter(org.eol.globi.data.BaseDatasetImporter) DatasetImporter(org.eol.globi.data.DatasetImporter) Test(org.junit.Test)

Aggregations

BaseDatasetImporter (org.eol.globi.data.BaseDatasetImporter)12 DatasetImporter (org.eol.globi.data.DatasetImporter)12 DatasetRegistryGitHubRemote (org.globalbioticinteractions.dataset.DatasetRegistryGitHubRemote)12 Test (org.junit.Test)12 JsonNode (com.fasterxml.jackson.databind.JsonNode)3 Dataset (org.globalbioticinteractions.dataset.Dataset)2 DatasetRegistry (org.globalbioticinteractions.dataset.DatasetRegistry)2 InputStream (java.io.InputStream)1 DatasetImporterForCoetzer (org.eol.globi.data.DatasetImporterForCoetzer)1 DatasetImporterForGoMexSI2 (org.eol.globi.data.DatasetImporterForGoMexSI2)1 DatasetImporterForHafner (org.eol.globi.data.DatasetImporterForHafner)1 DatasetImporterForMetaTable (org.eol.globi.data.DatasetImporterForMetaTable)1 DatasetImporterForPlanque (org.eol.globi.data.DatasetImporterForPlanque)1 DatasetImporterForSzoboszlai (org.eol.globi.data.DatasetImporterForSzoboszlai)1 DatasetImporterForWood (org.eol.globi.data.DatasetImporterForWood)1 DatasetFactory (org.globalbioticinteractions.dataset.DatasetFactory)1 Matchers.containsString (org.hamcrest.Matchers.containsString)1