@Test public void testProParteSynonyms() throws Exception { NormalizerStats stats = normalize(8); try (Transaction tx = beginTx()) { assertEquals(1, stats.getRoots()); assertEquals(17, stats.getCount()); assertEquals(6, stats.getSynonyms()); assertEquals(17, stats.getCountByOrigin(Origin.SOURCE)); assertEquals(2, stats.getCountByRank(Rank.GENUS)); assertEquals(7, stats.getCountByRank(Rank.SPECIES)); assertEquals(5, stats.getCountByRank(Rank.SUBSPECIES)); NameUsage nu = getUsageByTaxonId("101"); assertEquals("Cladendula Döring", nu.getScientificName()); assertEquals(Rank.GENUS, nu.getRank()); assertEquals(TaxonomicStatus.SYNONYM, nu.getTaxonomicStatus()); assertTrue(nu.isSynonym()); NameUsage acc = getUsageByKey(nu.getAcceptedKey()); assertEquals("Calendula L.", acc.getScientificName()); assertEquals(Rank.GENUS, acc.getRank()); assertEquals(TaxonomicStatus.ACCEPTED, acc.getTaxonomicStatus()); assertFalse(acc.isSynonym()); Set<Integer> accIds = Sets.newHashSet(); List<NameUsage> pps = getUsagesByName("Calendula eckerleinii Ohle"); assertEquals(1, pps.size()); for (NameUsage u : pps) { assertEquals("Calendula eckerleinii Ohle", u.getScientificName()); assertEquals(Rank.SPECIES, u.getRank()); assertEquals(TaxonomicStatus.PROPARTE_SYNONYM, u.getTaxonomicStatus()); assertTrue(u.isSynonym()); assertFalse(accIds.contains(u.getAcceptedKey())); accIds.add(u.getAcceptedKey()); } for (Integer aid : accIds) { acc = getUsageByKey(aid); assertFalse(acc.isSynonym()); assertEquals(TaxonomicStatus.ACCEPTED, acc.getTaxonomicStatus()); if (acc.getTaxonID().equals("1000")) { assertEquals("Calendula arvensis (Vaill.) L.", acc.getScientificName()); assertEquals(Rank.SPECIES, acc.getRank()); } else if (acc.getTaxonID().equals("10000")) { assertEquals("Calendula incana Willd. subsp. incana", acc.getScientificName()); assertEquals(Rank.SUBSPECIES, acc.getRank()); } else if (acc.getTaxonID().equals("10002")) { assertEquals("Calendula incana subsp. maderensis (DC.) Ohle", acc.getScientificName()); assertEquals(Rank.SUBSPECIES, acc.getRank()); } else { fail("Unknown pro parte synonym"); } } } }
private void normalize() throws NormalizationFailedException { LOG.info("Start processing explicit relations ..."); int counter = 0; Transaction tx = dao.getNeo().beginTx(); try { for (Node n : dao.getNeo().getAllNodes()) { setupRelation(n); counter++; relationMeter.mark(); tx = renewTx(tx); if (counter % 10000 == 0) { LOG.debug("Processed relations for {} nodes", counter); checkInterrupted(); } } } finally { tx.success(); tx.close(); } applyDenormedClassification(); cleanupRelations(); LOG.info("Relation setup completed, {} nodes processed. Setup rate: {}", counter, relationMeter.getMeanRate()); }
Normalizer extends ImportDb implements Runnable { private void normalize() throws NormalizationFailedException { LOG.info("Start processing explicit relations ..."); int counter = 0; Transaction tx = dao.getNeo().beginTx(); try { for (Node n : dao.getNeo().getAllNodes()) { setupRelation(n); counter++; relationMeter.mark(); tx = renewTx(tx); if (counter % 10000 == 0) { LOG.debug("Processed relations for {} nodes", counter); checkInterrupted(); } } } finally { tx.success(); tx.close(); } applyDenormedClassification(); cleanupRelations(); LOG.info("Relation setup completed, {} nodes processed. Setup rate: {}", counter, relationMeter.getMeanRate()); } }
Normalizer extends ImportDb implements Runnable { private void normalize() throws NormalizationFailedException { LOG.info("Start processing explicit relations ..."); int counter = 0; Transaction tx = dao.getNeo().beginTx(); try { for (Node n : dao.getNeo().getAllNodes()) { setupRelation(n); counter++; relationMeter.mark(); tx = renewTx(tx); if (counter % 10000 == 0) { LOG.debug("Processed relations for {} nodes", counter); checkInterrupted(); } } } finally { tx.success(); tx.close(); } applyDenormedClassification(); cleanupRelations(); LOG.info("Relation setup completed, {} nodes processed. Setup rate: {}", counter, relationMeter.getMeanRate()); } private  Normalizer(UUID datasetKey, UsageDao dao, File dwca, int batchSize,
                     MetricRegistry registry, Map<String, UUID> constituents, IdLookup lookup); }
Normalizer extends ImportDb implements Runnable { private void normalize() throws NormalizationFailedException { LOG.info("Start processing explicit relations ..."); int counter = 0; Transaction tx = dao.getNeo().beginTx(); try { for (Node n : dao.getNeo().getAllNodes()) { setupRelation(n); counter++; relationMeter.mark(); tx = renewTx(tx); if (counter % 10000 == 0) { LOG.debug("Processed relations for {} nodes", counter); checkInterrupted(); } } } finally { tx.success(); tx.close(); } applyDenormedClassification(); cleanupRelations(); LOG.info("Relation setup completed, {} nodes processed. Setup rate: {}", counter, relationMeter.getMeanRate()); } private  Normalizer(UUID datasetKey, UsageDao dao, File dwca, int batchSize,
                     MetricRegistry registry, Map<String, UUID> constituents, IdLookup lookup); static Normalizer create(NormalizerConfiguration cfg, UUID datasetKey, MetricRegistry registry,
                                  Map<String, UUID> constituents, IdLookup lookup); static Normalizer create(UUID datasetKey, UsageDao dao, File dwca, IdLookup lookup, int batchSize); static Normalizer create(NormalizerConfiguration cfg, UUID datasetKey); static Normalizer create(NormalizerConfiguration cfg, MetricRegistry registry, UUID datasetKey); void run(); void run(boolean closeDao); NormalizerStats getStats(); }
Normalizer extends ImportDb implements Runnable { private void normalize() throws NormalizationFailedException { LOG.info("Start processing explicit relations ..."); int counter = 0; Transaction tx = dao.getNeo().beginTx(); try { for (Node n : dao.getNeo().getAllNodes()) { setupRelation(n); counter++; relationMeter.mark(); tx = renewTx(tx); if (counter % 10000 == 0) { LOG.debug("Processed relations for {} nodes", counter); checkInterrupted(); } } } finally { tx.success(); tx.close(); } applyDenormedClassification(); cleanupRelations(); LOG.info("Relation setup completed, {} nodes processed. Setup rate: {}", counter, relationMeter.getMeanRate()); } private  Normalizer(UUID datasetKey, UsageDao dao, File dwca, int batchSize,
                     MetricRegistry registry, Map<String, UUID> constituents, IdLookup lookup); static Normalizer create(NormalizerConfiguration cfg, UUID datasetKey, MetricRegistry registry,
                                  Map<String, UUID> constituents, IdLookup lookup); static Normalizer create(UUID datasetKey, UsageDao dao, File dwca, IdLookup lookup, int batchSize); static Normalizer create(NormalizerConfiguration cfg, UUID datasetKey); static Normalizer create(NormalizerConfiguration cfg, MetricRegistry registry, UUID datasetKey); void run(); void run(boolean closeDao); NormalizerStats getStats();  }