Project

General

Profile

Actions

bug #10489

closed

Deduplicate Etymology

Added by Andreas Müller 4 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Priority13
Category:
cdm
Target version:
Start date:
Due date:
% Done:

100%

Estimated time:
Severity:
normal
Found in Version:

Description

Currently we have the term 2x, once in ordinary Feature vocabulary and also in the NameFeature vocabulary.

It should exist only once, and this one should be in NameFeature. If necessary, it can be made available also for taxa via "available for".

Note: also cleanup Nepenthaceae where Etymology is attached to taxa, not names.


Related issues

Related to EDIT - feature request #8019: Add "Typification Notes", "Ortography" and "Etymology" to NameFeature vocabularyClosedAndreas Müller

Actions
Actions #1

Updated by Andreas Müller 4 months ago

  • Related to feature request #8019: Add "Typification Notes", "Ortography" and "Etymology" to NameFeature vocabulary added
Actions #2

Updated by Andreas Müller 4 months ago

Script for moving facts from taxon to name

    private static void runScript(CdmApplicationController app) {
        TransactionStatus txStatus = app.startTransaction();

        List<Taxon> taxa = app.getTaxonService().list(Taxon.class, null, null, null, null);
        taxa.forEach(t->{
            Set<TextData> facts = t.getDescriptionItems(Feature.ETYMOLOGY(), TextData.class);
            if (facts.size() > 1) {
                logger.warn("More then 1 etymology fact exists for " + t.getTitleCache() + "/" + t.getUuid());
            }
            facts.forEach(f->{
                f.getInDescription().removeElement(f);
                TextData clone = f.clone();
                //TODO Feature newEtymology = app.getTermService().getUuid();
                //TODO clone.setFeature(newEtymology )
                if (t.getName().getDescriptions().isEmpty()) {
                   TaxonNameDescription d = TaxonNameDescription.NewInstance(t.getName());
                   d.setTitleCache("Etymology fact moved from taxon to name", true);
                }
                t.getName().getDescriptions().iterator().next().addElement(clone);
            });
        });

        app.commitTransaction(txStatus);
    }
Actions #3

Updated by Andreas Müller 4 months ago

The old feature was used in the following DBs: caryo, cichorieae, FM_prospective, Palmweb

SELECT deb.id factId, f.id featureId, f.titleCache feature, db.DTYPE, db.*
FROM DescriptionElementBase deb  INNER JOIN DefinedTermBase f ON f.id = deb.feature_id 
LEFT JOIN DescriptionBase db ON db.id = deb.inDescription_id
WHERE f.uuid IN ('dd653d48-355c-4aec-a4e7-724f6eb29f8d', '3b46f5f2-5619-4f1a-884f-d7a805471942')
SELECT f.id, f.titleCache, f.vocabulary_id
FROM DefinedTermBase f  
WHERE f.uuid IN ('dd653d48-355c-4aec-a4e7-724f6eb29f8d', '3b46f5f2-5619-4f1a-884f-d7a805471942')
UPDATE DescriptionElementBase
SET feature_id = 27xx
WHERE feature_id = 9xx
Actions #4

Updated by Andreas Müller 4 months ago

  • Status changed from New to In Progress
  • Priority changed from New to Highest
  • Target version changed from CDM UML 5.45 to Release 5.47
Actions #5

Updated by Andreas Müller about 1 month ago

  • Target version changed from Release 5.47 to Release 5.43
Actions #6

Updated by Andreas Müller about 1 month ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 70
Actions #7

Updated by Andreas Müller about 1 month ago

  • Priority changed from Highest to Priority13
  • % Done changed from 70 to 90

Final check after release

Actions #8

Updated by Andreas Müller about 1 month ago

  • Status changed from Resolved to Closed
  • % Done changed from 90 to 100

The unwanted feature was deleted on all production DBs.

Actions

Also available in: Atom PDF