geonetwork / core-geonetwork

GeoNetwork is a catalog application to manage spatially referenced resources. It provides powerful metadata editing and search functions as well as an interactive web map viewer. It is currently used in numerous Spatial Data Infrastructure initiatives across the world.
http://geonetwork-opensource.org/
GNU General Public License v2.0
412 stars 487 forks source link

GEMET-INSPIRE keywords not recognized in Spanish UI #1742

Open fjavierzaragoza opened 7 years ago

fjavierzaragoza commented 7 years ago

The GEMET-INSPIRE thesaurus keywords are not recognized to be added in the Spanish language. It may be because the UI in Spanish, the language code is "spa" and in GEMET-INSPIRE is "es"

Link to geonetwork-user spanish group, in http://osgeo-org.1560.x6.nabble.com/Error-al-a-adir-palabras-clave-del-thesarus-GEMET-INSPIRE-themes-tt5293936.html ![Uploading errorGeonetworkGEMET.png…]()

josegar74 commented 7 years ago

The problem seem the KeywordSearcher doesn't use the language send to the API service to retrieve the keywords to set the main language to set the value field so takes english as default. The language is used to return it in values element as translations:

http://SERVICE/geonetwork/srv/api/registries/vocabularies/search?type=CONTAINS&thesaurus=external.theme.inspire-theme&rows=200&q=&uri=**&lang=spa

[
  {
    "values": {
      "eng": "Addresses",
      "spa": "Direcciones"
    },
    "definitions": {
      "eng": "Location of properties based on address identifiers, usually by road name, house number, postal code.",
      "spa": "Localización de las propiedades, basada en identificadores de direcciones, por ejemplo, el nombre de la vía pública, el número de la finca, el código postal."
    },
    "coordEast": "",
    "coordWest": "",
    "coordSouth": "",
    "coordNorth": "",
    "thesaurusKey": "external.theme.inspire-theme",
    "value": "Addresses",
    "uri": "http://rdfdata.eionet.europa.eu/inspirethemes/themes/5",
    "definition": "Location of properties based on address identifiers, usually by road name, house number, postal code."
  },

An option is to change ThesaurusService.js (https://github.com/geonetwork/core-geonetwork/blob/3.2.x/web-ui/src/main/resources/catalog/components/thesaurus/ThesaurusService.js#L40) to use values element with the current UI language if available, otherwise take the value element as actually.

josegar74 commented 7 years ago

@fxprunayre I have created a branch with a fix, it looks working fine at my end, but would like to double check with you in case you see any possible unwanted side effect, thanks.

amrtn commented 4 years ago

Hi, I'm hitting the same problem. I added an INSPIRE keyword and a GEMET keyword in spanish. The UI is also in spanish. Both thesauri contain english and spanish translations for keywords.

The INSPIRE Data Theme thesaurus was loaded via the registry loader:

image

The GEMET thesauri was generated with https://github.com/geonetwork/util-gemet I also get similar errors:

image

The GEMET thesaurus was generated with https://github.com/geonetwork/util-gemet. The command used was ./gemet-to-simpleskos.sh en es

The keywords are written to the XML in english even if I selected them in spanish:

         <gmd:descriptiveKeywords>
            <gmd:MD_Keywords>
               <gmd:keyword>
                  <gmx:Anchor xlink:href="http://inspire.ec.europa.eu/theme/am">Area management/restriction/regulation zones and reporting units</gmx:Anchor>
               </gmd:keyword>
               <gmd:type>
                  <gmd:MD_KeywordTypeCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_KeywordTypeCode"
                                          codeListValue="theme"/>
               </gmd:type>
               <gmd:thesaurusName>
                  <gmd:CI_Citation>
                     <gmd:title>
                        <gmx:Anchor xlink:href="http://inspire.ec.europa.eu/theme#">GEMET - INSPIRE themes, version 1.0</gmx:Anchor>
                     </gmd:title>
                     <gmd:date>
                        <gmd:CI_Date>
                           <gmd:date>
                              <gco:Date>2008-06-01</gco:Date>
                           </gmd:date>
                           <gmd:dateType>
                              <gmd:CI_DateTypeCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_DateTypeCode"
                                                   codeListValue="publication"/>
                           </gmd:dateType>
                        </gmd:CI_Date>
                     </gmd:date>
                     <gmd:identifier>
                        <gmd:MD_Identifier>
                           <gmd:code>
                              <gmx:Anchor xlink:href="https://sigappsdesa.mapama.es:/ide/geonetwork3/srv/eng/thesaurus.download?ref=external.theme.httpinspireeceuropaeutheme-theme">geonetwork.thesaurus.external.theme.httpinspireeceuropaeutheme-theme</gmx:Anchor>
                           </gmd:code>
                        </gmd:MD_Identifier>
                     </gmd:identifier>
                  </gmd:CI_Citation>
               </gmd:thesaurusName>
            </gmd:MD_Keywords>
         </gmd:descriptiveKeywords>
         <gmd:descriptiveKeywords>
            <gmd:MD_Keywords>
               <gmd:keyword>
                  <gco:CharacterString>public domain</gco:CharacterString>
               </gmd:keyword>
               <gmd:type>
                  <gmd:MD_KeywordTypeCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#MD_KeywordTypeCode"
                                          codeListValue="theme"/>
               </gmd:type>
               <gmd:thesaurusName>
                  <gmd:CI_Citation>
                     <gmd:title>
                        <gco:CharacterString>GEMET</gco:CharacterString>
                     </gmd:title>
                     <gmd:date>
                        <gmd:CI_Date>
                           <gmd:date>
                              <gco:Date>2018-08-16</gco:Date>
                           </gmd:date>
                           <gmd:dateType>
                              <gmd:CI_DateTypeCode codeList="http://standards.iso.org/iso/19139/resources/gmxCodelists.xml#CI_DateTypeCode"
                                                   codeListValue="publication"/>
                           </gmd:dateType>
                        </gmd:CI_Date>
                     </gmd:date>
                     <gmd:identifier>
                        <gmd:MD_Identifier>
                           <gmd:code>
                              <gmx:Anchor xlink:href="https://sigappsdesa.mapama.es:/ide/geonetwork3/srv/eng/thesaurus.download?ref=external.theme.gemet-en-es">geonetwork.thesaurus.external.theme.gemet-en-es</gmx:Anchor>
                           </gmd:code>
                        </gmd:MD_Identifier>
                     </gmd:identifier>
                  </gmd:CI_Citation>
               </gmd:thesaurusName>
            </gmd:MD_Keywords>
         </gmd:descriptiveKeywords>

For INSPIRE compliance the Data Theme keyword should be encoded in the metadata language.

image

In our case we'd like to add both the metadata language (spanish) and the english keyword. Is that possible?

amrtn commented 4 years ago

This issue might also be related to #2916