Project

General

Profile

bug #6220

Improve definition of orphaned taxon and synonym

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

Status:
Feedback
Priority:
New
Assignee:
Category:
cdmlib
Target version:
Start date:
11/24/2016
Due date:
% Done:

80%

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 search Closed 11/24/2016

Associated revisions

Revision 0ec16ff8 (diff)
Added by Patrick Plitzner almost 3 years ago

Implement isOrphaned() #5824

Synonym counts as orphaned if all of the accepted taxa are orphaned

Revision f476ff86 (diff)
Added by Andreas Müller over 2 years ago

ref #5974 Remove synonym relationship first compiling implementation in cdmlib

Revision 4b80789a (diff)
Added by Andreas Müller over 2 years ago

fix #6220 Improve isOrphaned definition for Taxon.

History

#1 Updated by Andreas Müller over 2 years ago

  • Parent task set to #5616

#2 Updated by Andreas Müller over 2 years ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 50

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

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

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

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

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

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

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

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

#11 Updated by Patrick Plitzner 10 months ago

  • Parent task deleted (#5616)

#12 Updated by Patrick Plitzner 10 months ago

  • Target version changed from Release 4.4 to Release 5.1

moving to current milestone while closing #5616

#13 Updated by Patrick Plitzner 10 months ago

#14 Updated by Andreas Müller 10 months 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.

#15 Updated by Andreas Müller 10 months ago

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

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 40 MB)