Search in sources :

Example 6 with StudyImporter

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

the class GitHubImporterFactoryIT method createMetaTable.

@Test
public void createMetaTable() throws DatasetFinderException, StudyImporterException {
    final DatasetFinderGitHubRemote datasetFinderGitHubRemote = new DatasetFinderGitHubRemote();
    StudyImporter importer = importerFor(datasetFinderGitHubRemote, "globalbioticinteractions/AfricaTreeDatabase");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(StudyImporterForMetaTable.class)));
    assertThat(((StudyImporterForMetaTable) importer).getConfig(), is(notNullValue()));
    assertThat(((StudyImporterForMetaTable) importer).getBaseUrl(), startsWith("https://raw.githubusercontent.com/globalbioticinteractions/AfricaTreeDatabase/"));
}
Also used : BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) StudyImporter(org.eol.globi.data.StudyImporter) Test(org.junit.Test)

Example 7 with StudyImporter

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

the class GitHubImporterFactoryIT method jsonldImporterCached.

@Test
public void jsonldImporterCached() throws StudyImporterException, DatasetFinderException {
    final DatasetFinder datasetFinder = new DatasetFinderWithCache(new DatasetFinderGitHubArchive());
    Dataset dataset = DatasetFactory.datasetFor("globalbioticinteractions/jsonld-template-dataset", datasetFinder);
    StudyImporter importer = new GitHubImporterFactory().createImporter(dataset, null);
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(StudyImporterForJSONLD.class)));
}
Also used : BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) StudyImporter(org.eol.globi.data.StudyImporter) DatasetFinderWithCache(org.globalbioticinteractions.dataset.DatasetFinderWithCache) Test(org.junit.Test)

Example 8 with StudyImporter

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

the class NormalizerTest method importData.

private static void importData(Class<? extends StudyImporter> importer, NodeFactoryNeo4j factory) throws StudyImporterException {
    StudyImporter studyImporter = createStudyImporter(importer, factory);
    LOG.info("[" + importer + "] importing ...");
    studyImporter.importStudy();
    LOG.info("[" + importer + "] imported.");
}
Also used : StudyImporter(org.eol.globi.data.StudyImporter)

Example 9 with StudyImporter

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

the class GitHubImporterFactoryIT method createGoMexSI.

@Test
public void createGoMexSI() throws StudyImporterException, DatasetFinderException {
    final DatasetFinderGitHubRemote datasetFinderGitHubRemote = new DatasetFinderGitHubRemote();
    StudyImporter importer = importerFor(datasetFinderGitHubRemote, "gomexsi/interaction-data");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(StudyImporterForGoMexSI2.class)));
    StudyImporterForGoMexSI2 gomexsiImporter = (StudyImporterForGoMexSI2) importer;
    assertThat(gomexsiImporter.getSourceCitation(), is("http://gomexsi.tamucc.edu"));
}
Also used : StudyImporterForGoMexSI2(org.eol.globi.data.StudyImporterForGoMexSI2) BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) StudyImporter(org.eol.globi.data.StudyImporter) Test(org.junit.Test)

Example 10 with StudyImporter

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

the class GitHubImporterFactoryIT method createPlanque.

@Test
public void createPlanque() throws StudyImporterException, DatasetFinderException {
    final DatasetFinderGitHubRemote datasetFinderGitHubRemote = new DatasetFinderGitHubRemote();
    StudyImporter importer = importerFor(datasetFinderGitHubRemote, "globalbioticinteractions/planque2014");
    assertThat(importer, is(notNullValue()));
    assertThat(importer, is(instanceOf(StudyImporterForPlanque.class)));
    StudyImporterForPlanque importerz = (StudyImporterForPlanque) importer;
    assertThat(importerz.getSourceCitation(), containsString("Planque"));
    assertThat(importerz.getLinks(), is(notNullValue()));
    assertThat(importerz.getReferences(), is(notNullValue()));
    assertThat(importerz.getReferencesForLinks(), is(notNullValue()));
}
Also used : StudyImporterForPlanque(org.eol.globi.data.StudyImporterForPlanque) BaseStudyImporter(org.eol.globi.data.BaseStudyImporter) StudyImporter(org.eol.globi.data.StudyImporter) Test(org.junit.Test)

Aggregations

StudyImporter (org.eol.globi.data.StudyImporter)20 BaseStudyImporter (org.eol.globi.data.BaseStudyImporter)16 Test (org.junit.Test)15 JsonNode (org.codehaus.jackson.JsonNode)3 StudyImporterForTSV (org.eol.globi.data.StudyImporterForTSV)3 DatasetFinderWithCache (org.globalbioticinteractions.dataset.DatasetFinderWithCache)3 StringContains.containsString (org.junit.internal.matchers.StringContains.containsString)3 StudyImporterException (org.eol.globi.data.StudyImporterException)2 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 MalformedURLException (java.net.MalformedURLException)1 URI (java.net.URI)1 URISyntaxException (java.net.URISyntaxException)1 ArrayList (java.util.ArrayList)1 List (java.util.List)1 BasicParser (org.apache.commons.cli.BasicParser)1 CommandLine (org.apache.commons.cli.CommandLine)1 CommandLineParser (org.apache.commons.cli.CommandLineParser)1 HelpFormatter (org.apache.commons.cli.HelpFormatter)1 Option (org.apache.commons.cli.Option)1 Options (org.apache.commons.cli.Options)1