use of org.globalbioticinteractions.dataset.DatasetImpl in project eol-globi-data by jhpoelen.
the class DatasetImplTest method doiScrubbing.
@Test
public void doiScrubbing() throws IOException {
Dataset dataset = new DatasetImpl("some/namespace", URI.create("some:uri"), inStream -> inStream);
dataset.setConfig(new ObjectMapper().readTree("{\"doi\": \"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.dataset.DatasetImpl in project eol-globi-data by jhpoelen.
the class ReferenceUtilTest method sourceCitationDatasetLocalResourceURI.
@Test
public void sourceCitationDatasetLocalResourceURI() throws IOException {
DatasetImpl dataset = new DatasetImpl("some/namespace", URI.create("http://example"), inStream -> inStream);
JsonNode config = new ObjectMapper().readTree("{ \"url\": \"https://example.org/foo.tsv\" }");
dataset.setConfig(config);
String citation = CitationUtil.sourceCitationLastAccessed(dataset);
assertThat(citation, startsWith("<http://example>. Accessed at <https://example.org/foo.tsv> on"));
}
use of org.globalbioticinteractions.dataset.DatasetImpl in project eol-globi-data by jhpoelen.
the class ReferenceUtilTest method sourceCitation.
@Test
public void sourceCitation() {
String s = CitationUtil.sourceCitationLastAccessed(new DatasetImpl("some/namespace", URI.create("http://example"), inStream -> inStream), "some source citation.");
assertThat(s, startsWith("some source citation. Accessed at <http://example> on "));
assertThat(s, endsWith("."));
}
use of org.globalbioticinteractions.dataset.DatasetImpl in project eol-globi-data by jhpoelen.
the class ReferenceUtilTest method sourceCitationDatasetLocalResource.
@Test
public void sourceCitationDatasetLocalResource() throws IOException {
DatasetImpl dataset = new DatasetImpl("some/namespace", URI.create("http://example"), inStream -> inStream);
JsonNode config = new ObjectMapper().readTree("{ \"url\": \"interactions.tsv\" }");
dataset.setConfig(config);
String citation = CitationUtil.sourceCitationLastAccessed(dataset);
assertThat(citation, startsWith("<http://example>. Accessed at <http://example> on"));
}
use of org.globalbioticinteractions.dataset.DatasetImpl in project eol-globi-data by jhpoelen.
the class ReferenceUtilTest method citationFor.
@Test
public void citationFor() throws IOException, StudyImporterException {
DatasetImpl dataset = new DatasetImpl(null, URI.create("http://base"), inStream -> inStream);
dataset.setConfig(new ObjectMapper().readTree("{ \"citation\": \"http://gomexsi.tamucc.edu\" }"));
String citation = CitationUtil.citationFor(dataset);
assertThat(citation, is("http://gomexsi.tamucc.edu"));
}
Aggregations