use of org.eol.globi.service.DOIResolverImpl in project eol-globi-data by jhpoelen.
the class Normalizer method importData.
void importData(GraphDatabaseService graphService, String cacheDir) {
NodeFactoryNeo4j factory = new NodeFactoryNeo4j(graphService);
factory.setEcoregionFinder(getEcoregionFinder());
factory.setDoiResolver(new DOIResolverImpl());
try {
CacheFactory cacheFactory = dataset -> new CacheLocalReadonly(dataset.getNamespace(), cacheDir);
DatasetFinder finder = new DatasetFinderLocal(cacheDir, cacheFactory);
StudyImporter importer = new StudyImporterForGitHubData(new ParserFactoryLocal(), factory, finder);
importer.setDataset(new DatasetLocal());
importer.setLogger(new StudyImportLogger());
importer.importStudy();
} catch (StudyImporterException e) {
LOG.error("problem encountered while importing [" + StudyImporterForGitHubData.class.getName() + "]", e);
}
EcoregionFinder regionFinder = getEcoregionFinder();
if (regionFinder != null) {
regionFinder.shutdown();
}
}
use of org.eol.globi.service.DOIResolverImpl in project eol-globi-data by jhpoelen.
the class NodeFactoryIT method createStudyWithDOIResolving.
@Test
public void createStudyWithDOIResolving() throws NodeFactoryException {
NodeFactoryNeo4j fullNodeFactory = new NodeFactoryNeo4j(getGraphDb());
fullNodeFactory.setDoiResolver(new DOIResolverImpl());
Study study = fullNodeFactory.getOrCreateStudy(new StudyImpl("bla", "source", "doi:10.1073/pnas.1216534110", ""));
assertThat(study.getCitation(), is("DePalma RA, Burnham DA, Martin LD, Rothschild BM, Larson PL. Physical evidence of predatory behavior in Tyrannosaurus rex. Proceedings of the National Academy of Sciences [Internet]. 2013 July 15;110(31):12560–12564. Available from: http://dx.doi.org/10.1073/pnas.1216534110"));
assertThat(study.getDOI(), is("doi:10.1073/pnas.1216534110"));
}
Aggregations