Skip to content
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

Merged
merged 3 commits into from
Mar 6, 2024

Conversation

SrdjanStevanetic
Copy link
Contributor

multiple retrieval improved to handle old org ids

multiple retrieval improved to handle old org ids
public class XmlEdmCountry {

@XmlAttribute(namespace = NAMESPACE_RDF, name = XmlConstants.RESOURCE)
private String about;
Copy link
Contributor

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();
Copy link
Contributor

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

Copy link
Contributor

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);
Copy link
Contributor

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.

@gsergiu gsergiu merged commit bf7372c into develop Mar 6, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants