-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Treat unknown names slightly nicer, see also gbif/dwc-api#3
- Loading branch information
Showing
11 changed files
with
13,403 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
webservice/src/test/java/life/catalogue/importer/dwca/DwcaInserterTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package life.catalogue.importer.dwca; | ||
|
||
import com.google.common.collect.Lists; | ||
import life.catalogue.api.model.Dataset; | ||
import life.catalogue.api.model.VerbatimRecord; | ||
import life.catalogue.api.vocab.DataFormat; | ||
import life.catalogue.api.vocab.DatasetType; | ||
import life.catalogue.img.ImageService; | ||
import life.catalogue.importer.InserterBaseTest; | ||
import life.catalogue.importer.NeoInserter; | ||
import life.catalogue.importer.neo.model.NeoUsage; | ||
import life.catalogue.importer.reference.ReferenceFactory; | ||
import org.junit.Ignore; | ||
import org.junit.Test; | ||
import org.neo4j.graphdb.Transaction; | ||
|
||
import java.io.IOException; | ||
import java.nio.file.Path; | ||
|
||
import static org.hamcrest.CoreMatchers.is; | ||
import static org.junit.Assert.*; | ||
|
||
public class DwcaInserterTest extends InserterBaseTest { | ||
|
||
@Override | ||
public NeoInserter newInserter(Path resource) throws IOException { | ||
return new DwcaInserter(store, resource, new ReferenceFactory(store), ImageService.passThru()); | ||
} | ||
/** | ||
* EEA redlist file with unknown term columns | ||
*/ | ||
@Test | ||
public void dwca37() throws Exception { | ||
NeoInserter ins = setup("/dwca/37"); | ||
ins.insertAll(); | ||
|
||
try (Transaction tx = store.getNeo().beginTx()) { | ||
NeoUsage u = store.usages().objByID("319088"); | ||
assertNotNull(u.getVerbatimKey()); | ||
VerbatimRecord v = store.getVerbatim(u.getVerbatimKey()); | ||
v.hasTerm(DwcaReaderTest.TERM_CoL_name); | ||
} | ||
} | ||
|
||
@Test | ||
@Ignore | ||
public void readMetadata() throws Exception { | ||
NeoInserter ins = setup("/acef/0"); | ||
Dataset d = ins.readMetadata().get(); | ||
|
||
assertEquals(DatasetType.TAXONOMIC, d.getType()); | ||
assertEquals(DataFormat.ACEF, d.getDataFormat()); | ||
assertEquals("ILDIS World", d.getTitle()); | ||
assertEquals("ILDIS", d.getAlias()); | ||
assertEquals("12, May 2014", d.getVersion()); | ||
assertNotNull(d.getReleased()); | ||
//assertEquals("2014-05-05", d.getReleased().toString()); | ||
assertEquals(1, d.getAuthorsAndEditors().size()); | ||
assertThat(d.getAuthorsAndEditors(), is(Lists.newArrayList("Roskov Y.R."))); | ||
assertEquals("Legumes", d.getGroup()); | ||
assertEquals("The International Legume Database & Information Service (ILDIS) is an international project which aims to document and catalogue the world's legume species diversity in a readily accessible form. Research groups in many countries are participating on a co-operative basis to pool information in the ILDIS World Database of Legumes, which is used to provide a worldwide information service through publications, electronic access and enquiry services.", d.getDescription()); | ||
assertThat(d.getOrganisations(), is(Lists.newArrayList("International"))); | ||
assertEquals("http://www.ildis.org", d.getWebsite().toString()); | ||
assertEquals((Integer)96, d.getCompleteness()); | ||
assertEquals((Integer)4, d.getConfidence()); | ||
assertEquals("YR Roskov & JL", d.getContact()); | ||
|
||
assertNull(d.getLicense()); | ||
assertEquals("http://ILDIS.gif", d.getLogo().toString()); | ||
assertNull(d.getCitation()); | ||
assertNull(d.getCode()); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Pro parte names in dwca with multiple accepted names |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Phylata [phylum] | ||
Anthurium lanceum Engl. [species] | ||
Canna ehemannii [species] | ||
Corydalis gigantea Trautv. & Meyer [species] | ||
Laeliocattleya welsiana [species] | ||
Opisthomonorcheides overstreeti (Ahmad, 1985) Madhavi, 2011 [species] | ||
Paphiopedilum littleanum [species] | ||
Photorhabdus asymbiotica Fischer-Le Saux & al., 1999 [species] | ||
Placostegus crystallinus [species] | ||
Stichotricha cornuta Dumas, 1858 [species] | ||
Strombidium striatum [species] |
Oops, something went wrong.