@Test public void parseFoodItemII() throws StudyImporterException { final List<Map<String, String>> links = new ArrayList<>(); InputStream is = getClass().getResourceAsStream("fooditems_fishbase_first100.tsv"); DatasetImporterForFishbase3.importFoodItemsByFoodII(links::add, is, speciesMap, references, countries, "FB"); Map<String, String> firstItem = links.get(0); assertThat(firstItem.get("referenceCitation"), Is.is("Hickley, P. and R.G. Bailey. 1987. Food and feeding relationships of fish in the Sudd swamps (River Nile, southern Sudan). J. Fish Biol. 30:147-159.")); assertThat(firstItem.get("decimalLongitude"), Is.is("30.0899425353")); assertThat(firstItem.get("decimalLatitude"), Is.is("15.8871414568")); assertThat(firstItem.get("referenceUrl"), Is.is("http: assertThat(firstItem.get("localityName"), Is.is("Sudan|Sudd swamps, River Nile.")); assertThat(firstItem.get("localityId"), Is.is("FB_COUNTRY:736|")); assertThat(firstItem.get("sourceTaxonId"), Is.is("FBC:FB:SPECCODE:2")); assertThat(firstItem.get("sourceTaxonName"), Is.is("Oreochromis niloticus")); assertThat(firstItem.get("sourceLifeStageName"), Is.is("juv./adults")); assertThat(firstItem.get("targetTaxonName"), Is.is("detritus")); assertThat(firstItem.get("studyTitle"), Is.is("FB_REF:6160")); assertThat(firstItem.get(DatasetImporterForTSV.INTERACTION_TYPE_NAME), Is.is("eats")); assertThat(firstItem.get(DatasetImporterForTSV.INTERACTION_TYPE_ID), Is.is("http: }
protected static void importFoodItemsByFoodII(InteractionListener interactionListener, InputStream is, Map<String, Map<String, String>> speciesMap, Map<String, Map<String, String>> references, Map<String, Map<String, String>> countries, String namespace) throws StudyImporterException { RecordListener listener = record -> { Map<String, String> props = generateFoodItemInteraction(speciesMap, references, countries, namespace, record, "FoodII"); interactionListener.newLink(props); }; handleTsvInputStream(listener, is); }
DatasetImporterForFishbase3 extends DatasetImporterWithListener { protected static void importFoodItemsByFoodII(InteractionListener interactionListener, InputStream is, Map<String, Map<String, String>> speciesMap, Map<String, Map<String, String>> references, Map<String, Map<String, String>> countries, String namespace) throws StudyImporterException { RecordListener listener = record -> { Map<String, String> props = generateFoodItemInteraction(speciesMap, references, countries, namespace, record, "FoodII"); interactionListener.newLink(props); }; handleTsvInputStream(listener, is); } }
DatasetImporterForFishbase3 extends DatasetImporterWithListener { protected static void importFoodItemsByFoodII(InteractionListener interactionListener, InputStream is, Map<String, Map<String, String>> speciesMap, Map<String, Map<String, String>> references, Map<String, Map<String, String>> countries, String namespace) throws StudyImporterException { RecordListener listener = record -> { Map<String, String> props = generateFoodItemInteraction(speciesMap, references, countries, namespace, record, "FoodII"); interactionListener.newLink(props); }; handleTsvInputStream(listener, is); } DatasetImporterForFishbase3(ParserFactory parserFactory, NodeFactory nodeFactory); }
DatasetImporterForFishbase3 extends DatasetImporterWithListener { protected static void importFoodItemsByFoodII(InteractionListener interactionListener, InputStream is, Map<String, Map<String, String>> speciesMap, Map<String, Map<String, String>> references, Map<String, Map<String, String>> countries, String namespace) throws StudyImporterException { RecordListener listener = record -> { Map<String, String> props = generateFoodItemInteraction(speciesMap, references, countries, namespace, record, "FoodII"); interactionListener.newLink(props); }; handleTsvInputStream(listener, is); } DatasetImporterForFishbase3(ParserFactory parserFactory, NodeFactory nodeFactory); @Override void importStudy(); static void handleTsvInputStream(RecordListener listener, InputStream is); }
DatasetImporterForFishbase3 extends DatasetImporterWithListener { protected static void importFoodItemsByFoodII(InteractionListener interactionListener, InputStream is, Map<String, Map<String, String>> speciesMap, Map<String, Map<String, String>> references, Map<String, Map<String, String>> countries, String namespace) throws StudyImporterException { RecordListener listener = record -> { Map<String, String> props = generateFoodItemInteraction(speciesMap, references, countries, namespace, record, "FoodII"); interactionListener.newLink(props); }; handleTsvInputStream(listener, is); } DatasetImporterForFishbase3(ParserFactory parserFactory, NodeFactory nodeFactory); @Override void importStudy(); static void handleTsvInputStream(RecordListener listener, InputStream is); static final String C_CODE_GLOBAL; }