@Test public void parseTaxon() throws IOException { String taxonChunk = getTestTaxonChunk(); Map<String, Taxon> taxonObjs = DatasetImporterForBatPlant.parseTaxa(taxonChunk, getFooPrefixer()); assertThat(taxonObjs.size(), is(3)); assertThat(taxonObjs.get("974").getName(), is("Micronycteris hirsuta")); assertThat(taxonObjs.get("974").getId(), is("foo:taxon:974")); assertThat(taxonObjs.get("974").getRank(), is("species")); assertThat(taxonObjs.get("974").getPath(), is("Micronycteris | Micronycteris hirsuta")); assertThat(taxonObjs.get("974").getPathIds(), is("foo:taxon:322 | foo:taxon:974")); assertThat(taxonObjs.get("974").getPathNames(), is("genus | species")); assertThat(taxonObjs.get("885").getName(), is("Sphingidae")); assertThat(taxonObjs.get("885").getId(), is("foo:taxon:885")); assertThat(taxonObjs.get("885").getRank(), is("family")); assertThat(taxonObjs.get("885").getPath(), is("Sphingidae")); assertThat(taxonObjs.get("885").getPathIds(), is("foo:taxon:885")); assertThat(taxonObjs.get("885").getPathNames(), is("family")); }
static Map<String, Taxon> parseTaxa(String taxonChunk, Prefixer prefixer) throws IOException { InputStream in = IOUtils.toInputStream(taxonChunk, StandardCharsets.UTF_8); return parseTaxa(in, prefixer); }
DatasetImporterForBatBase extends DatasetImporterWithListener { static Map<String, Taxon> parseTaxa(String taxonChunk, Prefixer prefixer) throws IOException { InputStream in = IOUtils.toInputStream(taxonChunk, StandardCharsets.UTF_8); return parseTaxa(in, prefixer); } }
DatasetImporterForBatBase extends DatasetImporterWithListener { static Map<String, Taxon> parseTaxa(String taxonChunk, Prefixer prefixer) throws IOException { InputStream in = IOUtils.toInputStream(taxonChunk, StandardCharsets.UTF_8); return parseTaxa(in, prefixer); } DatasetImporterForBatBase(ParserFactory parserFactory, NodeFactory nodeFactory); }
DatasetImporterForBatBase extends DatasetImporterWithListener { static Map<String, Taxon> parseTaxa(String taxonChunk, Prefixer prefixer) throws IOException { InputStream in = IOUtils.toInputStream(taxonChunk, StandardCharsets.UTF_8); return parseTaxa(in, prefixer); } DatasetImporterForBatBase(ParserFactory parserFactory, NodeFactory nodeFactory); @Override void importStudy(); static void parseInteractions(Map<String, Taxon> taxa,
                                         Map<String, String> sources,
                                         InteractionListener testListener,
                                         InputStream in,
                                         Map<String, Map<String, String>> locations,
                                         Prefixer prefixer); }
DatasetImporterForBatBase extends DatasetImporterWithListener { static Map<String, Taxon> parseTaxa(String taxonChunk, Prefixer prefixer) throws IOException { InputStream in = IOUtils.toInputStream(taxonChunk, StandardCharsets.UTF_8); return parseTaxa(in, prefixer); } DatasetImporterForBatBase(ParserFactory parserFactory, NodeFactory nodeFactory); @Override void importStudy(); static void parseInteractions(Map<String, Taxon> taxa,
                                         Map<String, String> sources,
                                         InteractionListener testListener,
                                         InputStream in,
                                         Map<String, Map<String, String>> locations,
                                         Prefixer prefixer);  }