Search in sources :

Example 1 with DatasetImporterForRegistry

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

the class IndexerDataset method indexDatasets.

private static void indexDatasets(DatasetRegistry registry, NodeFactory nodeFactory) {
    try {
        final Collection<String> namespaces = registry.findNamespaces();
        String namespacelist = StringUtils.join(namespaces, CharsetConstant.SEPARATOR);
        LOG.info("found dataset namespaces: {" + namespacelist + "}");
        DatasetImporterForRegistry importer = new DatasetImporterForRegistry(new ParserFactoryLocal(), nodeFactory, registry);
        importer.setDatasetFilter(x -> !DatasetUtil.isDeprecated(x));
        importer.setDataset(new DatasetLocal(inStream -> inStream));
        importer.setLogger(new NullImportLogger());
        importer.importStudy();
    } catch (DatasetRegistryException | StudyImporterException e) {
        LOG.error("problem encountered while importing [" + DatasetImporterForRegistry.class.getName() + "]", e);
    }
}
Also used : DatasetRegistryException(org.globalbioticinteractions.dataset.DatasetRegistryException) Logger(org.slf4j.Logger) Collection(java.util.Collection) NodeFactory(org.eol.globi.data.NodeFactory) LoggerFactory(org.slf4j.LoggerFactory) StringUtils(org.apache.commons.lang3.StringUtils) DatasetLocal(org.eol.globi.service.DatasetLocal) StudyImporterException(org.eol.globi.data.StudyImporterException) GraphDatabaseService(org.neo4j.graphdb.GraphDatabaseService) ParserFactoryLocal(org.eol.globi.data.ParserFactoryLocal) GraphServiceFactory(org.eol.globi.db.GraphServiceFactory) DatasetImporterForRegistry(org.eol.globi.data.DatasetImporterForRegistry) DatasetUtil(org.globalbioticinteractions.dataset.DatasetUtil) Transaction(org.neo4j.graphdb.Transaction) CharsetConstant(org.eol.globi.data.CharsetConstant) DatasetRegistry(org.globalbioticinteractions.dataset.DatasetRegistry) DatasetImporterForRegistry(org.eol.globi.data.DatasetImporterForRegistry) DatasetRegistryException(org.globalbioticinteractions.dataset.DatasetRegistryException) StudyImporterException(org.eol.globi.data.StudyImporterException) ParserFactoryLocal(org.eol.globi.data.ParserFactoryLocal) DatasetLocal(org.eol.globi.service.DatasetLocal)

Aggregations

Collection (java.util.Collection)1 StringUtils (org.apache.commons.lang3.StringUtils)1 CharsetConstant (org.eol.globi.data.CharsetConstant)1 DatasetImporterForRegistry (org.eol.globi.data.DatasetImporterForRegistry)1 NodeFactory (org.eol.globi.data.NodeFactory)1 ParserFactoryLocal (org.eol.globi.data.ParserFactoryLocal)1 StudyImporterException (org.eol.globi.data.StudyImporterException)1 GraphServiceFactory (org.eol.globi.db.GraphServiceFactory)1 DatasetLocal (org.eol.globi.service.DatasetLocal)1 DatasetRegistry (org.globalbioticinteractions.dataset.DatasetRegistry)1 DatasetRegistryException (org.globalbioticinteractions.dataset.DatasetRegistryException)1 DatasetUtil (org.globalbioticinteractions.dataset.DatasetUtil)1 GraphDatabaseService (org.neo4j.graphdb.GraphDatabaseService)1 Transaction (org.neo4j.graphdb.Transaction)1 Logger (org.slf4j.Logger)1 LoggerFactory (org.slf4j.LoggerFactory)1