use of org.eol.globi.service.DatasetImpl in project eol-globi-data by jhpoelen.
the class StudyImporterForArthopodEasyCaptureTest method getDatasetGroupWithProperty.
private DatasetImpl getDatasetGroupWithProperty() throws IOException {
DatasetImpl dataset = new DatasetImpl("some/namespace", URI.create("http://example.com"));
JsonNode config = new ObjectMapper().readTree("{ \"" + DatasetConstant.SHOULD_RESOLVE_REFERENCES + "\": false, \"resources\": { \"rss\": \"http://amnh.begoniasociety.org/dwc/rss.xml\" } }");
dataset.setConfig(config);
return dataset;
}
use of org.eol.globi.service.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"));
dataset.setConfig(new ObjectMapper().readTree("{ \"citation\": \"http://gomexsi.tamucc.edu\" }"));
String citation = CitationUtil.citationFor(dataset);
assertThat(citation, is("http://gomexsi.tamucc.edu"));
}
use of org.eol.globi.service.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")), "some source citation. ");
assertThat(s, startsWith("some source citation. Accessed at <http://example> on "));
assertThat(s, endsWith("."));
}
use of org.eol.globi.service.DatasetImpl in project eol-globi-data by jhpoelen.
the class StudyImporterForArthopodEasyCaptureTest method getDatasetGroup.
private DatasetImpl getDatasetGroup() throws IOException {
DatasetImpl dataset = new DatasetImpl("some/namespace", URI.create("http://example.com"));
JsonNode config = new ObjectMapper().readTree("{ \"resources\": { \"rss\": \"http://amnh.begoniasociety.org/dwc/rss.xml\" } }");
dataset.setConfig(config);
return dataset;
}
use of org.eol.globi.service.DatasetImpl in project eol-globi-data by jhpoelen.
the class StudyImporterForMetaTableTest method assertExpectedColumnCount.
public void assertExpectedColumnCount(String metaTableDef) throws IOException {
final Class<StudyImporterForMetaTable> clazz = StudyImporterForMetaTable.class;
final URL resource = clazz.getResource(metaTableDef);
assertNotNull(resource);
final InputStream inputStream = clazz.getResourceAsStream(metaTableDef);
final JsonNode config = new ObjectMapper().readTree(inputStream);
String baseUrl = resource.toExternalForm().replaceFirst(metaTableDef + "$", "");
List<StudyImporterForMetaTable.Column> columnNames = StudyImporterForMetaTable.columnsFromExternalSchema(config.get("tableSchema"), new DatasetImpl(null, URI.create(baseUrl)));
assertThat(columnNames.size(), is(40));
}
Aggregations