-
Notifications
You must be signed in to change notification settings - Fork 1
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
1) org country improved to contain only id, type, and prefLabel; 2) #311
Conversation
multiple retrieval improved to handle old org ids
public class XmlEdmCountry { | ||
|
||
@XmlAttribute(namespace = NAMESPACE_RDF, name = XmlConstants.RESOURCE) | ||
private String about; |
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.
we should rename this field to match the xml field name
|
||
for (EntityRecord entityRecord : entityRecords) { | ||
sortedEntityRecordMap.replace(entityRecord.getEntityId(), entityRecord); | ||
Optional<EntityRecord> recordIdMatched= entityRecords.stream().filter(er -> id.equals(er.getEntityId()) || er.getEntity().getSameReferenceLinks().contains(id)).findFirst(); |
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.
this sorting and generation of the final list needs to be moved to the Service, it is business logic that doesn't belong to the controller
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.
the filtering of null values on line 662 is now redundant, as the null values are not added to the map values anymore
@@ -586,7 +586,7 @@ protected void processCountryReference(Organization org) { | |||
// replace wikidata country ids | |||
org.setCountryId(europeanaCountryId); | |||
// search reference | |||
EntityRecord orgCountry = entityRecordRepository.findByEntityId(europeanaCountryId); | |||
EntityRecord orgCountry = entityRecordRepository.findEntityRecord(europeanaCountryId); |
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.
this still retrieves the whole record from the database, while we only need the entityId and the pref labels.
multiple retrieval improved to handle old org ids