Project

General

Profile

bug #9047

Search does not return orphaned synonyms

Added by Andreas Müller 5 months ago. Updated 5 months ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib
Target version:
Start date:
05/29/2020
Due date:
% Done:

50%

Severity:
normal
Found in Version:

Description

A name which is currently only used in a synonym which has no accepted taxon (which is dirty data but exists) is currently not found in the TaxEditor search.

This needs to be fixed to avoid creation of duplicates when names are not found and therefore are expected not to exist yet.

Associated revisions

Revision ea076318 (diff)
Added by Andreas Müller 5 months ago

fix #9047 fix search does not return orphaned synonyms

History

#1 Updated by Andreas Müller 5 months ago

  • Status changed from New to In Progress

#2 Updated by Andreas Müller 5 months ago

  • Status changed from In Progress to Resolved
  • % Done changed from 0 to 50

#3 Updated by Andreas Müller 5 months ago

  • Category changed from taxeditor to cdmlib
  • Assignee changed from Andreas Müller to Katja Luther

I tested on rem_conf_am with "Orphaned syn*" . It seems to work. I change category as this is a general cdmlib issue.

Please review (including code).

#4 Updated by Katja Luther 5 months ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Katja Luther to Andreas Müller

I think the left join is not necessary because only the id of the synonyms/taxa are collected in the sql query, but the query works as expected.

#5 Updated by Andreas Müller 5 months ago

  • Status changed from Feedback to Resolved
  • Assignee changed from Andreas Müller to Katja Luther

Katja Luther wrote:

I think the left join is not necessary because only the id of the synonyms/taxa are collected in the sql query, but the query works as expected.

The left join is necessary to allow further optional filtering on the taxon itself. This is currently only the case for setting the "published" filter. In this case also the accepted taxon needs to be published to be on the safe side (in case someone forgot to set the flag also for all synonyms).
I agree that for orphaned synonyms it is maybe not necessary to also check the accepted taxon but handling this separately will make the query more complex and at the same time orphaned taxa should be an exception so it is maybe not really worth handling them explicitly and making the query more complicated then it is already.

#6 Updated by Katja Luther 5 months ago

Andreas Müller wrote:

Katja Luther wrote:

I think the left join is not necessary because only the id of the synonyms/taxa are collected in the sql query, but the query works as expected.

The left join is necessary to allow further optional filtering on the taxon itself. This is currently only the case for setting the "published" filter. In this case also the accepted taxon needs to be published to be on the safe side (in case someone forgot to set the flag also for all synonyms).
I agree that for orphaned synonyms it is maybe not necessary to also check the accepted taxon but handling this separately will make the query more complex and at the same time orphaned taxa should be an exception so it is maybe not really worth handling them explicitly and making the query more complicated then it is already.

ah, you are right, but then I think it should be "LEFT JOIN s.acceptedTaxon as t".

#7 Updated by Andreas Müller 5 months ago

Katja Luther wrote:

ah, you are right, but then I think it should be "LEFT JOIN s.acceptedTaxon as t".

no the t is taken from the main query where the FROM Taxon is replaced by this subquery. Tests do run so this is definetely not an issue.

#8 Updated by Katja Luther 5 months ago

  • Status changed from Resolved to Closed
  • Assignee changed from Katja Luther to Andreas Müller

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)