use of org.eol.globi.data.DatasetImporterForTSV.LOCALITY_NAME in project eol-globi-data by jhpoelen.
the class InteractionImporterTest method importWithLocalityAndLatLng.
@Test
public void importWithLocalityAndLatLng() throws StudyImporterException {
final InteractionListener listener = getAssertingInteractionImporter();
final TreeMap<String, String> link = new TreeMap<>();
link.put(SOURCE_TAXON_NAME, "donald");
link.put(SOURCE_TAXON_ID, "duck");
link.put(DatasetImporterForTSV.INTERACTION_TYPE_ID, "http://purl.obolibrary.org/obo/RO_0002470");
link.put(TARGET_TAXON_NAME, "mini");
link.put(TARGET_TAXON_ID, "mouse");
link.put(LOCALITY_ID, "back:yard");
link.put(LOCALITY_NAME, "my back yard");
link.put(DECIMAL_LATITUDE, "12.2");
link.put(DECIMAL_LONGITUDE, "13.2");
link.put(REFERENCE_ID, "123");
link.put(DATASET_CITATION, "some source ref");
link.put(REFERENCE_CITATION, "");
link.put(REFERENCE_DOI, "doi:10.12/34");
listener.on(link);
AtomicBoolean foundSpecimen = new AtomicBoolean(false);
RelationshipListener someListener = relationship -> {
final SpecimenNode someSpecimen = new SpecimenNode(relationship.getEndNode());
assertTrue(someSpecimen.getUnderlyingNode().hasRelationship(Direction.INCOMING, NodeUtil.asNeo4j(RelTypes.COLLECTED)));
LocationNode sampleLocation = someSpecimen.getSampleLocation();
assertThat(sampleLocation.getLatitude(), is(12.2d));
assertThat(sampleLocation.getLongitude(), is(13.2d));
assertThat(sampleLocation.getLocality(), is("my back yard"));
assertThat(sampleLocation.getLocalityId(), is("back:yard"));
foundSpecimen.set(true);
};
handleRelations(someListener, RelTypes.COLLECTED);
assertThat(foundSpecimen.get(), is(true));
}
Aggregations