Skip to content

GeoNetwork 4.2.14: Thesaurus ConceptScheme generates invalid empty <gco:Date/> in iso19139.ca.HNAP metadata #9185

@erick-ouellette

Description

@erick-ouellette

Describe the bug

When creating or modifying a local Thesaurus/Theme in GeoNetwork 4.2.14 (schema iso19139.ca.HNAP), GeoNetwork auto-generates invalid <gmd:CI_Citation> date elements in metadata records referencing that thesaurus.

Specifically:

  • A gmd:thesaurusName/gmd:CI_Citation block is materialized in metadata.
  • GeoNetwork inserts two <gmd:date> elements.
  • Each contains <gco:Date/> (empty).
  • HNAP validation fails because empty dates are not permitted.

Attempts to manually remove these date elements in metadata do not persist. On save/reopen, GeoNetwork re-inserts the empty <gco:Date/> elements.

This behavior appears tied to thesaurus registry enrichment logic.

To Reproduce

  1. In GN 4.2.14, create a new local Theme (Thesaurus) under

config/codelist/local/thesauri/theme

using RDF similar to:

<rdf:Description rdf:about="https://registry.geonetwork-opensource.org/theme/Theme_name">
    <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#ConceptScheme"/>
    <dc:title xml:lang="en">Theme_name</dc:title>
    <dc:title xml:lang="fr">Theme_name/dc:title>
    <dc:description xml:lang="en">...</dc:description>
    <dc:identifier>Theme_name.rdf</dc:identifier>
    <dc:type>theme</dc:type>
</rdf:Description>
  1. Restart GeoNetwork to load the new thesaurus.
  2. Add a keyword from this theme to an iso19139.ca.HNAP metadata record.
  3. Save metadata.
  4. Open XML view.

GeoNetwork generates:

<gmd:date>
  <gmd:CI_Date>
    <gmd:date>
      <gco:Date/>
    </gmd:date>
    ...
  1. Validate record.

Validation fails with:

Invalid or missing value. '' is not a valid value for Date (gco:Date)
Invalid or missing value. '' is not a valid value for (Date_Type)
  1. Manually delete the <gmd:date> blocks.
  2. Save metadata.
  3. Re-open metadata.

The <gmd:date> blocks reappear automatically.

Expected behavior

If a thesaurus does not define publication/creation dates, GeoNetwork should either:

  • Not generate <gmd:date> elements, or
  • Generate valid ISO date values, or
  • Allow citation without date elements when schema permits.

GeoNetwork should not generate invalid ISO elements that immediately fail schema validation.

Additionally:

  • Editing RDF thesaurus files should take effect without requiring a full server restart.
  • UI editing of Thesaurus should not corrupt or rewrite RDF metadata unexpectedly.
  • Metadata edits should not re-materialize invalid citation fragments.

Observed Workaround

The issue can be temporarily resolved by:

  1. Editing the RDF ConceptScheme to match minimal structure used by older (working) themes:
<rdf:Description rdf:about="https://registry.geonetwork-opensource.org/theme/Theme_name">
    <dc:identifier>Theme_name.rdf</dc:identifier>
    <dc:description xml:lang="fr">...</dc:description>
    <dc:description xml:lang="en">...</dc:description>
    <dc:title xml:lang="fr">...</dc:title>
    <dc:title xml:lang="en">...</dc:title>
    <rdf:type rdf:resource="http://www.w3.org/2004/02/skos/core#ConceptScheme"/>
</rdf:Description>
  1. Performing a full server restart.

Without restart, GeoNetwork continued using cached thesaurus metadata and kept generating invalid date elements.

  1. Re-editing affected metadata records.
  2. Saving and validating again.
  3. After restart and RDF normalization, new metadata saves no longer injected empty <gco:Date/>.

Important Observations

  • Thesaurus definitions appear to be cached at startup.
  • Editing RDF files does not reliably refresh in-memory registry models.
  • Editing thesauri via UI may re-write RDF in unexpected ways.
  • Metadata referencing registry-linked themes triggers automatic citation enrichment.
  • That enrichment can produce schema-invalid XML.

Impact

  • Causes all affected metadata to fail HNAP validation.
  • Batch edits do not persist because GN re-materializes invalid elements.
  • Requires server restart to apply RDF corrections.
  • Risk of metadata corruption if thesaurus edited in UI.
  • Operationally significant in multi-environment deployments.

Desktop (please complete the following information):

  • Browser: Edge
  • GeoNetwork Version: 4.2.14
  • Schema: iso19139.ca.HNAP 4.2.14
  • Server:
    • Tomcat 9.0.106
    • Java Adoptium 8u462b08
    • ElasticSearch 7.17.15

Additional context

This issue did not occur with themes created in GN <= 4.2.11.

It appears specific to:

  • GN 4.2.14
  • iso19139.ca.HNAP schema behavior
  • Thesaurus registry materialization logic

It would be helpful if:

  • Thesaurus reload could be triggered without full restart.
  • Citation enrichment did not generate invalid empty ISO elements.
  • Validation-aware generation logic was implemented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions