Project

General

Profile

Actions

bug #9047

closed

Search does not return orphaned synonyms

Added by Andreas Müller over 2 years ago. Updated over 2 years ago.

Status:
Closed
Priority:
Highest
Category:
cdmlib
Target version:
Start date:
Due date:
% Done:

50%

Estimated time:
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.

Actions #1

Updated by Andreas Müller over 2 years ago

  • Status changed from New to In Progress
Actions #2

Updated by Andreas Müller over 2 years ago

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

Updated by Andreas Müller over 2 years 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).

Actions #4

Updated by Katja Luther over 2 years 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.

Actions #5

Updated by Andreas Müller over 2 years 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.

Actions #6

Updated by Katja Luther over 2 years 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".

Actions #7

Updated by Andreas Müller over 2 years 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.

Actions #8

Updated by Katja Luther over 2 years ago

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

Also available in: Atom PDF