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

OpenAIRE metadata export: fix how location information is expressed (production place and geospatial metadata) #6117

Merged
merged 2 commits into from Aug 26, 2019

Conversation

fcadili
Copy link

@fcadili fcadili commented Aug 26, 2019

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:

<geoLocations>
	<geoLocation>
		<geoLocationPlace>Production Place</geoLocationPlace>
	</geoLocation>
	<geoLocation>
		<geoLocationBox>
			<northBoundLatitude>3</northBoundLatitude>
			<eastBoundLongitude>2</eastBoundLongitude>
			<westBoundLongitude>1</westBoundLongitude>
			<southBoundLatitude>4</southBoundLatitude>
		</geoLocationBox>
	</geoLocation>
	<geoLocation>
		<geoLocationBox>
			<northBoundLatitude>c</northBoundLatitude>
			<eastBoundLongitude>b</eastBoundLongitude>
			<westBoundLongitude>a</westBoundLongitude>
			<southBoundLatitude>d</southBoundLatitude>
		</geoLocationBox>
	</geoLocation>
</geoLocations>

Related Issues

@dataversebot
Copy link

Can one of the admins verify this patch?

@coveralls
Copy link

coveralls commented Aug 26, 2019

Coverage Status

Coverage increased (+0.007%) to 19.489% when pulling 9349e08 on 4Science:openaire-6049 into 0c9a229 on IQSS:develop.

* @param language current language
* @throws XMLStreamException
*/
public static void writeGeoLocationsElement(XMLStreamWriter xmlw, Set<FieldDTO> foo, String language) throws XMLStreamException {
Copy link
Member

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?

Copy link
Author

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".

Copy link
Member

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?

Copy link
Author

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).

Copy link
Member

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?

Copy link
Contributor

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".

Copy link
Member

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!!

Copy link
Author

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.

@pdurbin pdurbin moved this from Code Review 🦁 to Community Dev 💻❤️ in IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) Aug 26, 2019
Copy link
Member

@pdurbin pdurbin left a 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.

IQSS/dataverse (TO BE RETIRED / DELETED in favor of project 34) automation moved this from Community Dev 💻❤️ to QA Aug 26, 2019
@jggautier
Copy link
Contributor

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 :)

@kcondon kcondon self-assigned this Aug 26, 2019
@kcondon kcondon merged commit 4d34a8e into IQSS:develop Aug 26, 2019
@abollini abollini deleted the openaire-6049 branch August 27, 2019 08:29
@djbrooke djbrooke added this to the 4.16 milestone Aug 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

8 participants