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

INSPIRE registry - thesauri identifier clash when importing several different thesauri #4966

Open pmauduit opened 4 years ago

pmauduit commented 4 years ago

Bug description

When using the INSPIRE registry thesauri loader in the admin UI, it is possible to load several different thesauri. But the created ones will share the same title / identifier. Once loaded, if 2 or more thesauri are sharing the same title/identifier, the following xsl code will fail when editing a metadata and trying to select a keyword from a thesaurus:

https://github.com/geonetwork/core-geonetwork/blob/master/schemas/iso19139/src/main/plugin/iso19139/layout/layout-custom-fields-keywords.xsl#L174-L178

Error on line 178 of layout-custom-fields-keywords.xsl:
  XTTE0570: A sequence of more than one item is not allowed as the value of variable
  $thesaurusConfig (<thesaurus/>, <thesaurus/>) 

How to reproduce

  1. got to thesaurus admin UI
  2. load a first thesaurus from the INSPIRE registry
  3. load a second one different from the first
  4. both are sharing the same title & the same identifier
  5. create a new MD
  6. Try to select a keyword from a thesaurus

(see screenshots below)

Expected behaviour

It should be possible to add a keyword. Maybe by concatenating the thesaurus type in the identifier & title to avoid clashes ?

Screenshot

See screenshots below: Screenshot from 2020-08-27 12-14-04 Screenshot from 2020-08-27 12-15-52

Desktop infos

fxprunayre commented 4 years ago

. Maybe by concatenating the thesaurus type in the identifier & title to avoid clashes ?

Maybe change the API to not allowed to load same thesaurus more than one time even with different types ?

pmauduit commented 4 years ago

Maybe change the API to not allowed to load same thesaurus more than one time even with different types ?

I think it is an interesting feature to be able to load several thesauri having a different type from the INSPIRE registry, but I don't know if it makes sense from a metdata editor point of view, what do you think about it ?

Maybe a fix for it could be to suffix the title / thesaurus identifier with the type + checking before downloading a new one that the identifier / title won't clash ? That is what I did by hand from the GN datadir and it fixed the issue.

fxprunayre commented 4 years ago

I think it is an interesting feature to be able to load several thesauri having a different type from the INSPIRE registry, but I don't know if it makes sense from a metdata editor point of view, what do you think about it ?

So far, I've never seen user with the need of the same thesaurus with different types.

pmauduit commented 4 years ago

So far, I've never seen user with the need of the same thesaurus with different types.

So grabbing several different thesauri from the inspire registry does not make sense ? I would assume that one can have the need of inspire - theme, inspire - disciple, inspire - temporal and so on at the same time. But you're right, looking at the downloaded thesauri, the content seems identical each time, regardless of the thesaurus type. In fact, I think I misunderstood the UI, I was expecting that selecting a different type in the web interface will download a different thesaurus.