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

Workaround for creating integer literals #314

Merged
merged 1 commit into from Jul 6, 2022

Conversation

litvinovg
Copy link
Contributor

VIVO GitHub issue

What does this pull request do?

Fixes issue related to creating integer literals in web interface by substituting integer data type with int for purpose of creating hash. It is required as for now integer literals are stored as int.

How should this be tested?

  1. Create Room individual
  2. Set seating capacity
  3. Verify that there is no error

Interested parties

@VIVO-project/vivo-committers

@litvinovg litvinovg self-assigned this Jul 4, 2022
@litvinovg litvinovg requested review from chenejac, gneissone and a user July 4, 2022 15:01
Copy link
Contributor

@bkampe bkampe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could reproduce issue 3728. Applying this workaround led to the expected behaviour without throwing an exception.

Copy link
Contributor

@chenejac chenejac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@litvinovg it works and I approve it. However, please check one my comment whether there is any sense in what is written.



private static String replaceIntegerWithInt(String predicate) {
if( predicate.equals("http://www.w3.org/2001/XMLSchema#integer")) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you define constants for http://www.w3.org/2001/XMLSchema#integer and http://www.w3.org/2001/XMLSchema#int? It might be also useful somewhere else. Also, I am not sure we need method here, maybe ternary operator can be used instead (langOrDatatype.equals(XML_INTEGER_TYPE))?XML_INT_TYPE:langOrDatatype.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't create constants as I think that this code is deprecated and should be removed after we replace n3editing with dynamic API. It is a separate method for the same reasons: to emphasize that it is a temporary fix and make it easy to remove it in future. Also ternary operators harder to read and less practical for debugging.

@litvinovg litvinovg requested a review from hudajkhan July 6, 2022 07:50
@chenejac chenejac merged commit acd2bf6 into vivo-project:main Jul 6, 2022
ghost pushed a commit that referenced this pull request Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants