Project

General

Profile

Actions

bug #6220

closed

Improve definition of orphaned taxon and synonym

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

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

80%

Estimated time:
Severity:
normal
Found in Version:

Description

Currently taxa are only orphaned if they have no taxon node AND no concept relationships. The later is critical as taxa with concept relationships may still be handled as orphaned except for misapplied names (a concept relationship that is more synonym relationship like). Later also pro parte and partial synonym relationships may be added to this list.

Also synonyms were unclear when they are orphaned. They should be orphaned if not belonging to an accepted taxon or if the accepted taxon is orphaned.


Related issues

Copied from EDIT - feature request #5616: Add the"Open in..." menu to taxon searchClosedPatrick Plitzner

Actions
Actions #1

Updated by Andreas Müller over 7 years ago

  • Parent task set to #5616
Actions #2

Updated by Andreas Müller over 7 years ago

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

Updated by Andreas Müller over 7 years ago

  • Status changed from Resolved to Feedback
  • Assignee changed from Andreas Müller to Katja Luther
  • % Done changed from 50 to 80

The fix works so far that search result in TaxEditor allow only opening in TaxEditor now. However, an orphaned taxon as described in #5616 still shows the wrong symbol (black for accepted).
Is there also another algorithm that determines orphaned in the search results?

Also orphaned synonyms are not found in TaxEditor taxon bulk editor anymore.

Katja, can you have a look on this? If necessary create a new ticket.

Actions #4

Updated by Katja Luther over 7 years ago

Andreas Müller wrote:

The fix works so far that search result in TaxEditor allow only opening in TaxEditor now. However, an orphaned taxon as described in #5616 still shows the wrong symbol (black for accepted).
Is there also another algorithm that determines orphaned in the search results?

The editor uses the uuidAndTitleCache object and for a misapplied name the orphaned flag is set to false, so the used image is the one for a not orphaned taxon -> black square.

Also orphaned synonyms are not found in TaxEditor taxon bulk editor anymore.

There is a problem with partial and proparte. If there is no values for these attibutes, an exception is thrown because a boolean attribute can not be null.
If I replace NULL with 0 then all synonyms and taxa are found. We need to add this to the update script, if it is not included already.

Katja, can you have a look on this? If necessary create a new ticket.

Actions #5

Updated by Andreas Müller over 7 years ago

Katja Luther wrote:

Andreas Müller wrote:

The fix works so far that search result in TaxEditor allow only opening in TaxEditor now. However, an orphaned taxon as described in #5616 still shows the wrong symbol (black for accepted).
Is there also another algorithm that determines orphaned in the search results?

The editor uses the uuidAndTitleCache object and for a misapplied name the orphaned flag is set to false, so the used image is the one for a not orphaned taxon -> black square.

But it is NOT a misapplied name as far as I remember but only has concept relations. Therefore the "Open in" works correctly now.

Actions #6

Updated by Andreas Müller over 7 years ago

Katja Luther wrote:

Andreas Müller wrote:

Also orphaned synonyms are not found in TaxEditor taxon bulk editor anymore.

There is a problem with partial and proparte. If there is no values for these attibutes, an exception is thrown because a boolean attribute can not be null.
If I replace NULL with 0 then all synonyms and taxa are found. We need to add this to the update script, if it is not included already.

This should already be fixed in the update script. However, the test server was updated before this fix. I thought I did update all test server databases manually. If not, please let me know where you found this problem. Definitely it is not on the example database I mentioned above (cdm_rem_conf_am). I tested with

SELECT *
FROM TaxonBase
WHERE DTYPE = 'Synonym' AND (proParte IS NULL OR partial IS NULL)

Also, if this is the problem, the exception should be thrown (and shown to the user) and not be swallowed by the system.

Actions #7

Updated by Katja Luther over 7 years ago

Andreas Müller wrote:

Katja Luther wrote:

Andreas Müller wrote:

The fix works so far that search result in TaxEditor allow only opening in TaxEditor now. However, an orphaned taxon as described in #5616 still shows the wrong symbol (black for accepted).
Is there also another algorithm that determines orphaned in the search results?

The editor uses the uuidAndTitleCache object and for a misapplied name the orphaned flag is set to false, so the used image is the one for a not orphaned taxon -> black square.

But it is NOT a misapplied name as far as I remember but only has concept relations. Therefore the "Open in" works correctly now.

The open in works correctly now. The wrong symbol for taxa with conceptrelationships/misapplied names is because the orphaned flag is set by the hql query not by the isOrphaned() method.

Actions #8

Updated by Andreas Müller over 7 years ago

Katja Luther wrote:

The open in works correctly now. The wrong symbol for taxa with conceptrelationships/misapplied names is because the orphaned flag is set by the hql query not by the isOrphaned() method.

This is what I expected. So the critical question is here, how we can keep the java based definition of "isOrphaned" in sync with any hql based methods. Or should we simply leave a warning in the according javadoc that some hql also needs to be adapted.
Also exact tests may help for both methods.

Actions #9

Updated by Katja Luther over 7 years ago

Andreas Müller wrote:

Katja Luther wrote:

The open in works correctly now. The wrong symbol for taxa with conceptrelationships/misapplied names is because the orphaned flag is set by the hql query not by the isOrphaned() method.

This is what I expected. So the critical question is here, how we can keep the java based definition of "isOrphaned" in sync with any hql based methods. Or should we simply leave a warning in the according javadoc that some hql also needs to be adapted.
Also exact tests may help for both methods.

I found this http://stackoverflow.com/questions/25382840/loading-transient-field-of-jpa-entity,
I tried to add a transient attribute isOrphaned and add a method which should be called after loading the entity (with PostLoad annotation).
But the first test did not work. But I think this could be a solution to keep it in sync.

Actions #10

Updated by Andreas Müller over 7 years ago

Katja Luther wrote:

Andreas Müller wrote:

Katja Luther wrote:

The open in works correctly now. The wrong symbol for taxa with conceptrelationships/misapplied names is because the orphaned flag is set by the hql query not by the isOrphaned() method.

This is what I expected. So the critical question is here, how we can keep the java based definition of "isOrphaned" in sync with any hql based methods. Or should we simply leave a warning in the according javadoc that some hql also needs to be adapted.
Also exact tests may help for both methods.

I found this http://stackoverflow.com/questions/25382840/loading-transient-field-of-jpa-entity,
I tried to add a transient attribute isOrphaned and add a method which should be called after loading the entity (with PostLoad annotation).
But the first test did not work. But I think this could be a solution to keep it in sync.

This might be a solution but not very nice as it runs the check whenever a taxon is loaded so the performance is going down. We may think about caching this data. Once cache updating works better this might be a solution to keep it more or less in sync and also to retrieve the data directly from database which makes some queries faster (e.g. if you don't want to show orphaned taxa at all)

Actions #11

Updated by Patrick Plitzner almost 6 years ago

  • Parent task deleted (#5616)
Actions #12

Updated by Patrick Plitzner almost 6 years ago

  • Target version changed from Release 4.4 to Release 5.1

moving to current milestone while closing #5616

Actions #13

Updated by Patrick Plitzner almost 6 years ago

Actions #14

Updated by Andreas Müller almost 6 years ago

  • Target version changed from Release 5.1 to Release 4.4

I don't understand why you moved this to the current milestone. The ticket is mostly fixed. The open issues are more about how to guarantee that thinks stay in sync in future which is a minor part of this ticket. We may want to move these open issues to a new ticket.

Actions #15

Updated by Andreas Müller almost 6 years ago

Katja, can you please extract the open issues to a new ticket and close this one?

Actions #16

Updated by Katja Luther over 2 years ago

  • Status changed from Feedback to Closed

Andreas Müller wrote:

Katja, can you please extract the open issues to a new ticket and close this one?

created a new ticket #9845 and close this one

Actions

Also available in: Atom PDF