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
OpenAIRE metadata export: fix how location information is expressed (production place and geospatial metadata) #6117
Conversation
…production place and geospatial metadata)
Can one of the admins verify this patch? |
* @param language current language | ||
* @throws XMLStreamException | ||
*/ | ||
public static void writeGeoLocationsElement(XMLStreamWriter xmlw, Set<FieldDTO> foo, String language) throws XMLStreamException { |
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.
While we're in this code and QA'ing it, should we use this opportunity to replace "foo" here and elsewhere in this pull request with a word that's more meaningful?
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.
Could "set" be used instead of "foo"?
The pattern used in the code is the following:
for (HashSet<FieldDTO> foo : fieldDTO.getMultipleCompound()) {
String awardNumber = null;
String funderName = null;
for (Iterator<FieldDTO> iterator = foo.iterator(); iterator.hasNext();) {
FieldDTO next = iterator.next();
Here the variable "foo" is used as a "general set".
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.
@fcadili sure, "set" sounds much better than "foo" to me! 😄 Would it be a big change?
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.
It can be done (about 35 matches on OpenAireExportUtil or 17 code refactor).
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.
@fcadili ok. We have standup in half an hour. I'll ask if we'd like this refactoring as part of this pull request or not. Please stay tuned!
@scolapasta @sekmiller what do you think?
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.
Changing from foo is a good idea; rather than "set" I would suggest something that adds a little context to what is on the set, even if it's just "fieldDTOs".
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.
@fcadili please change "foo" to "fieldDTOs" as @scolapasta suggested above. Thanks!!
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've committed the new version with the required changes.
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.
As of 9349e08 I'm fine with this from a code perspective (thanks, @fcadili !) but I know @jggautier spun up the branch to play with the feature and might have further feedback.
Thanks so much for these improvements @fcadili and team! Changes to the OpenAIRE export look great to me. I have no further feedback :) |
This Pull request is related to issue #6049. It fixes the location information generated by OpenAIRE export. For example, setting geolocation place to "Production Place" and geospatial metadata to [4, 3, 1, 2] and [d, c, a, b], we obtain as Openaire export:
Related Issues