use of org.globalbioticinteractions.doi.DOI in project eol-globi-data by jhpoelen.
the class LinkerDOITest method shouldResolveStudy.
@Test
public void shouldResolveStudy() {
StudyImpl study = new StudyImpl("some title", new DOI("some", "doi"), "some citation");
assertFalse(LinkerDOI.shouldResolve(study));
}
use of org.globalbioticinteractions.doi.DOI in project eol-globi-data by jhpoelen.
the class DatasetImplTest method doiExpectedPrefix.
@Test
public void doiExpectedPrefix() throws IOException {
Dataset dataset = new DatasetImpl("some/namespace", URI.create("some:uri"), inStream -> inStream);
dataset.setConfig(new ObjectMapper().readTree("{\"doi\": \"doi:10.2980/1195-6860(2006)13[23:TDOFUB]2.0.CO;2\" }"));
assertThat(dataset.getDOI(), is(new DOI("2980", "1195-6860(2006)13[23:TDOFUB]2.0.CO;2")));
}
use of org.globalbioticinteractions.doi.DOI in project eol-globi-data by jhpoelen.
the class DatasetImplTest method doiExpected.
@Test
public void doiExpected() throws IOException {
Dataset dataset = new DatasetImpl("some/namespace", URI.create("some:uri"), inStream -> inStream);
dataset.setConfig(new ObjectMapper().readTree("{\"doi\": \"http://dx.doi.org/10.2980/1195-6860(2006)13[23:TDOFUB]2.0.CO;2\" }"));
assertThat(dataset.getDOI(), is(new DOI("2980", "1195-6860(2006)13[23:TDOFUB]2.0.CO;2")));
}
use of org.globalbioticinteractions.doi.DOI in project eol-globi-data by jhpoelen.
the class DOIResolverCacheTest method initCache.
@Test
public void initCache() throws IOException, PropertyEnricherException {
String bla = "doi\tcitation" + "\ndoi:10.some/doi\tsome citation" + "\ndoi:10.some/other/doi\tsome other citation";
Reader reader = new StringReader(bla);
doiResolverCache.init(reader);
Map<String, DOI> doiForReference = doiResolverCache.resolveDoiFor(Arrays.asList("some citation", "some other citation"));
assertThat(doiForReference.get("some other citation").toString(), is("10.some/other/doi"));
assertThat(doiForReference.get("some citation").toString(), is("10.some/doi"));
}
use of org.globalbioticinteractions.doi.DOI in project eol-globi-data by jhpoelen.
the class DOIResolverCacheTest method initCache3.
@Test
public void initCache3() throws IOException, PropertyEnricherException {
String bla = "doi\tcitation\n" + "10.some/A\tcitationA\n" + "\tcitationX\n" + "\t\n" + "10.some/B\tcitationB";
Reader reader = new StringReader(bla);
doiResolverCache.init(reader);
Map<String, DOI> doiForReference = doiResolverCache.resolveDoiFor(Collections.singletonList("citationA"));
assertThat(doiForReference.get("citationA"), is(new DOI("some", "A")));
}
Aggregations