-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
bug/MET-5110_fix_entity_status_when_no_entity_found_for_existing_vocabulary #611
bug/MET-5110_fix_entity_status_when_no_entity_found_for_existing_vocabulary #611
Conversation
…ect status when no vocabulary is found
dereferenceResult = new DereferenceResult( | ||
result.values().stream().map(Pair::getLeft).collect(Collectors.toList()), | ||
result.values().stream().map(Pair::getRight).filter(Objects::nonNull).findFirst() | ||
.orElse(DereferenceResultStatus.UNKNOWN_EUROPEANA_ENTITY)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this is correct. I think here you can't use UNKNOWN_EUROPEANA_ENTITY, as this condition should never trigger. In fact, for now it's probably best to always return DereferenceResultStatus.SUCCESS
at this point (because you know that at least the top level entity was retrieved successfully). In a future ticket we will make it nicer and allow reporting on individual URLs.
Does this make sense?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. This is the case when no status was found after doing all processing so I wanted to report UKNOWN or not DEFINED. As you mention looking it from the perspective of the whole process we can use DereferenceResultStatus.SUCCESS
then.
} | ||
try { | ||
Map<ReferenceTerm, List<EnrichmentBase>> result = new HashMap<>(); | ||
entityResolver.resolveById(resourceIds).forEach((key, value) -> result.put(key, List.of(value))); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you probably need to check against the europeana URL.
Instead of line 249, something like:
var ownEntities = resourceIds.stream()
.filter(id -> EntityResolver.europeanaLinkPattern.matcher(id.getReference().toString()).matches())
.collect(Collectors.toSet());
entityResolver.resolveById(ownEntities)
.forEach((key, value) -> result.put(key, List.of(value)));
ownEntities.stream().filter(id -> result.get(id) == null || result.get(id).isEmpty())
.forEach(notFoundOwnId -> {
setDereferenceStatusInReport(notFoundOwnId.getReference().toString(),
reports, DereferenceResultStatus.UNKNOWN_EUROPEANA_ENTITY);
result.putIfAbsent(notFoundOwnId, Collections.emptyList());
});
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understand what this means now, because of the previous way the status was computed never thought to explicitly validate it. will proceed to update the code.
No description provided.