@Test public void createStudyDOIlookup() throws NodeFactoryException { StudyNode study = getNodeFactory().getOrCreateStudy(new StudyImpl("title", null, "some citation")); LinkerDOI.linkStudy(new DOIResolverThatExplodes(), study); assertThat(study.getCitation(), is("some citation")); assertThat(study.getTitle(), is("title")); }
public static void linkStudy(DOIResolver doiResolver, StudyNode study) { if (shouldResolve(study)) { try { DOI doiResolved = doiResolver.resolveDoiFor(study.getCitation()); setDOIForStudy(study, doiResolved); } catch (IOException e) { LOG.warn("failed to lookup doi for citation [" + study.getCitation() + "] with id [" + study.getTitle() + "]", e); } } }
LinkerDOI implements IndexerNeo4j { public static void linkStudy(DOIResolver doiResolver, StudyNode study) { if (shouldResolve(study)) { try { DOI doiResolved = doiResolver.resolveDoiFor(study.getCitation()); setDOIForStudy(study, doiResolved); } catch (IOException e) { LOG.warn("failed to lookup doi for citation [" + study.getCitation() + "] with id [" + study.getTitle() + "]", e); } } } }
LinkerDOI implements IndexerNeo4j { public static void linkStudy(DOIResolver doiResolver, StudyNode study) { if (shouldResolve(study)) { try { DOI doiResolved = doiResolver.resolveDoiFor(study.getCitation()); setDOIForStudy(study, doiResolved); } catch (IOException e) { LOG.warn("failed to lookup doi for citation [" + study.getCitation() + "] with id [" + study.getTitle() + "]", e); } } } LinkerDOI();  LinkerDOI(DOIResolver resolver); }
LinkerDOI implements IndexerNeo4j { public static void linkStudy(DOIResolver doiResolver, StudyNode study) { if (shouldResolve(study)) { try { DOI doiResolved = doiResolver.resolveDoiFor(study.getCitation()); setDOIForStudy(study, doiResolved); } catch (IOException e) { LOG.warn("failed to lookup doi for citation [" + study.getCitation() + "] with id [" + study.getTitle() + "]", e); } } } LinkerDOI();  LinkerDOI(DOIResolver resolver); @Override void index(GraphServiceFactory factory); void resolveBatch(DOIResolver doiResolver, Map<String, StudyNode> batch); void resolve(DOIResolver doiResolver, Map<String, StudyNode> batch, Collection<String> citations); String logProgress(int counter, StopWatch stopWatch); static void linkStudy(DOIResolver doiResolver, StudyNode study); static boolean shouldResolve(Study study); }
LinkerDOI implements IndexerNeo4j { public static void linkStudy(DOIResolver doiResolver, StudyNode study) { if (shouldResolve(study)) { try { DOI doiResolved = doiResolver.resolveDoiFor(study.getCitation()); setDOIForStudy(study, doiResolved); } catch (IOException e) { LOG.warn("failed to lookup doi for citation [" + study.getCitation() + "] with id [" + study.getTitle() + "]", e); } } } LinkerDOI();  LinkerDOI(DOIResolver resolver); @Override void index(GraphServiceFactory factory); void resolveBatch(DOIResolver doiResolver, Map<String, StudyNode> batch); void resolve(DOIResolver doiResolver, Map<String, StudyNode> batch, Collection<String> citations); String logProgress(int counter, StopWatch stopWatch); static void linkStudy(DOIResolver doiResolver, StudyNode study); static boolean shouldResolve(Study study); static final int BATCH_SIZE; }