-
-
Notifications
You must be signed in to change notification settings - Fork 489
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
Editor / Add keywords even if thesaurus not available in record languages #8268
Conversation
…ages Add english as default language for thesaurus searches in order to populate metadata with english label if the thesaurus is not available in the current record language. Can happen with some DCAT-AP related vocabularies that have to be used in Member States records not often in english. This will also avoid the message box when keywords are not found due to language mismatch. The message will still be displayed if a keyword in the metadata is not found in the thesaurus, proposing the user to only keep keywords from the thesaurus. Funded by Service Public de Wallonie
Quality Gate passedIssues Measures |
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.
A question, this is still as previously. I guess is not cover in the changes, correct?
With a thesaurus having French and English keywords:
- With French UI: Create a metadata with French language and adding keywords in French
- Switch to English UI: Edit the metadata
I see: Warning! Keywords Conditions atmosphériques, Bâtiments not found in thesaurus.
@@ -501,7 +501,12 @@ private Object getKeyword( | |||
if (langs == null) { | |||
langs = context.getLanguage().split(","); | |||
} | |||
String[] iso3langCodes = Arrays.copyOf(langs, langs.length); | |||
List<String> langList = new ArrayList<>(List.of(langs)); | |||
if (!langList.contains("'eng'")) { |
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.
Why is checking the string with the single quotes?
Yes, one option to overcome this on the long run would be to only rely on the concept ID but it is only available when Anchor encoding is used so it would not work on all records. |
Quality Gate passedIssues Measures |
…k/core-geonetwork#8268 is useful when language is not available in vocabulary. More generic keyword indexing.
|
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.
@fxprunayre tested and looks working fine. Applied some code improvements to KeywordsApi
.
Quality Gate failedFailed conditions |
Add english as default language for thesaurus searches in order to populate metadata with english label if the thesaurus is not available in the current record language. For example, this can happen when using DCAT-AP related vocabularies only avilable in english that have to be used in Member States records not in english.
Display english label if UI and record language is not available in thesaurus
After/Before
Use the english label when encoding the keyword in the metadata (API changes):
http://localhost:8080/geonetwork/srv/api/registries/vocabularies/keyword?thesaurus=external.theme.gemet&id=http:%2F%2Fwww.eionet.europa.eu%2Fgemet%2Fconcept%2F3599,http:%2F%2Fwww.eionet.europa.eu%2Fgemet%2Fconcept%2F15034,http:%2F%2Fwww.eionet.europa.eu%2Fgemet%2Fconcept%2F105,http:%2F%2Fwww.eionet.europa.eu%2Fgemet%2Fconcept%2F10170,http:%2F%2Fwww.eionet.europa.eu%2Fgemet%2Fconcept%2F10140&transformation=to-iso19115-3.2018-keyword-with-anchor&langMap=%7B%22fre%22:%22%23FR%22%7D&lang=fre&textgroupOnly=false
will return keyword in french (if GEMET is loaded with french)
but requesting ukrainian will return english terms
http://localhost:8080/geonetwork/srv/api/registries/vocabularies/keyword?thesaurus=external.theme.gemet&id=http:%2F%2Fwww.eionet.europa.eu%2Fgemet%2Fconcept%2F3599,http:%2F%2Fwww.eionet.europa.eu%2Fgemet%2Fconcept%2F15034,http:%2F%2Fwww.eionet.europa.eu%2Fgemet%2Fconcept%2F105,http:%2F%2Fwww.eionet.europa.eu%2Fgemet%2Fconcept%2F10170,http:%2F%2Fwww.eionet.europa.eu%2Fgemet%2Fconcept%2F10140&transformation=to-iso19115-3.2018-keyword-with-anchor&langMap=%7B%22ukr%22:%22%23UK%22%7D&lang=ukr&textgroupOnly=false
This will also avoid the message box when keywords are not found due to language mismatch. The message will still be displayed if a keyword in the metadata is not found in the thesaurus, proposing the user to only keep keywords from the thesaurus.
Funded by Service Public de Wallonie
Checklist
main
branch, backports managed with labelREADME.md
filespom.xml
dependency management. Update build documentation with intended library use and library tutorials or documentation