@Test public void testIncertaeSedisSynonyms() throws Exception { NormalizerStats stats = normalize(5); assertEquals(5, stats.getSynonyms()); assertEquals(2, stats.getCountByOrigin(Origin.MISSING_ACCEPTED)); assertEquals(3, stats.getCountByOrigin(Origin.VERBATIM_ACCEPTED)); try (Transaction tx = beginTx()) { NameUsage syn = getUsageByTaxonId("por10083"); assertEquals("Megalithistida", syn.getScientificName()); assertTrue(syn.isSynonym()); NameUsage sedis = getUsageByKey(syn.getAcceptedKey()); assertFalse(sedis.isSynonym()); assertEquals(INCERTAE_SEDIS, sedis.getScientificName()); NameUsage parent = getUsageByKey(sedis.getParentKey()); assertFalse(parent.isSynonym()); assertEquals("Demospongea", parent.getScientificName()); assertEquals(Rank.CLASS, parent.getRank()); syn = getUsageByTaxonId("mol101988"); assertEquals("Tubiferidae Cossmann, 1895", syn.getScientificName()); assertTrue(syn.isSynonym()); sedis = getUsageByKey(syn.getAcceptedKey()); assertFalse(sedis.isSynonym()); assertEquals(INCERTAE_SEDIS, sedis.getScientificName()); parent = getUsageByKey(sedis.getParentKey()); assertFalse(parent.isSynonym()); assertEquals("Heterostropha", parent.getScientificName()); assertEquals(Rank.ORDER, parent.getRank()); syn = getUsageByTaxonId("hex1088048"); assertEquals("Acanthophora Hulst, 1896", syn.getScientificName()); assertTrue(syn.isSynonym()); NameUsage acc = getUsageByKey(syn.getAcceptedKey()); assertEquals("Acanthotoca", acc.getScientificName()); assertFalse(acc.isSynonym()); assertEquals(syn.getParentKey(), acc.getParentKey()); parent = getUsageByKey(acc.getParentKey()); assertFalse(parent.isSynonym()); assertEquals("Geometridae", parent.getScientificName()); assertEquals(Rank.FAMILY, parent.getRank()); syn = getUsageByTaxonId("hex1090241"); assertEquals("Acanthophora Borgmeier, 1922", syn.getScientificName()); assertTrue(syn.isSynonym()); acc = getUsageByKey(syn.getAcceptedKey()); assertFalse(acc.isSynonym()); assertEquals("Acanthophorides", acc.getScientificName()); parent = getUsageByKey(acc.getParentKey()); assertFalse(parent.isSynonym()); assertEquals("Phoridae", parent.getScientificName()); assertEquals(Rank.FAMILY, parent.getRank()); } }
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();  }