[VIVO-1909] Adjust SPARQL node logic so datatype not added if language tag included #175
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
VIVO-1909: 'Edit this Individual' form strips language tags and adds langString datatype
https://groups.google.com/u/2/g/vivo-tech/c/bjBcAJo8ldE/m/xgOfBPcZAwAJ?pli=1
Further discussion on #develop channel of Slack
What does this pull request do?
Fixes a bug where labels edited via 'Edit this Individual' were being added with langString datatypes.
What's new?
Flips logic in the rdf creation logic such that literals provided with a language tag keep a language tag and ditch the datatype. The behavior was previously the opposite. Following discussion at https://wiki.lyrasis.org/display/VIVODOC111x/Data+types+for+string+and+language strings and langStrings datatypes are assumed in RDF 1.1 and don't have to be explicitly stated.
How should this be tested?
Confirm issue by editing a label via 'Edit this Individual' and observing that the langString datatype is added.
Deploy with changes, and do the same. It should now add a language tag instead of a datatype.
Additional Notes:
The label editing available via the 'Edit this Individual' interface is problematic since it does not account for multiple languages. It displays a single label, even if there are many. If you update the label via this form it removes all labels and replaces them with the new label, which is given the 'preferred' language tag, which is en-US.
Vitro/api/src/main/java/edu/cornell/mannlib/vitro/webapp/dao/WebappDaoFactoryConfig.java
Line 22 in 6d64d27
An argument could be made for removing the 'Edit this Individual' editing interface completely, since I believe everything can be edited via the main UI anyway, and I don't think any of the i18n work touches it.
Interested parties
@hudajkhan @vivo-project/vivo-committers