Skip to content

Commit

Permalink
Use term suggestions finding existing annotations
Browse files Browse the repository at this point in the history
Don't report a duplicate annotation if the term suggestion is
different.

Refs #2846
  • Loading branch information
kimrutherford committed Jul 10, 2024
1 parent 2b566a7 commit df83a65
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/Canto/Curs/ServiceUtils.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2009,6 +2009,21 @@ sub find_existing_annotation

my $existing_data = $existing_annotation->data();

my $existing_term_suggestion_name = undef;
my $existing_term_suggestion_def = undef;

if ($existing_data->{term_suggestion}) {
$existing_term_suggestion_name = $existing_data->{term_suggestion}->{name};
$existing_term_suggestion_def = $existing_data->{term_suggestion}->{definition};
}

if (!safe_equals($existing_term_suggestion_name, $details->{term_suggestion_name})) {
next;
}
if (!safe_equals($existing_term_suggestion_def, $details->{term_suggestion_definition})) {
next;
}

if ($existing_data->{term_ontid} ne $term_ontid) {
next;
}
Expand Down

0 comments on commit df83a65

Please sign in to comment.