@Test public void createStudyDOIlookupCitationEnabled() throws NodeFactoryException { StudyImpl title = new StudyImpl("title", null, "some citation"); DatasetImpl originatingDataset = new DatasetImpl("some/namespace", URI.create("some:uri"), inStream -> inStream); ObjectNode objectNode = new ObjectMapper().createObjectNode(); objectNode.put(DatasetConstant.SHOULD_RESOLVE_REFERENCES, true); originatingDataset.setConfig(objectNode); title.setOriginatingDataset(originatingDataset); StudyNode study = getNodeFactory().getOrCreateStudy(title); LinkerDOI.linkStudy(new TestDOIResolver(), study); assertThat(study.getDOI().toString(), is("10.some/some citation")); assertThat(study.getExternalId(), is("https: 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; }