Skip to content
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

Metadata editor creates an empty topicCategory tag (dataset - rndt) #25

Closed
silvia-starnini opened this issue Jan 18, 2022 · 5 comments
Closed

Comments

@silvia-starnini
Copy link

Using metadata editor on rndt dataset, the metadata XML is filled with empty topicCategory tag like the following:

<gmd:topicCategory>        
    <gmd:MD_TopicCategoryCode>farming</gmd:MD_TopicCategoryCode>
</gmd:topicCategory>
<gmd:topicCategory/>      <!-- this empty tag is a problem for RNDT validation-->

The wrong empty tag seems to be added :

  • changing tab view to "Dataset e serie"
  • adding a new topic category (the new category is correctly added but at the end also the empty tag is added)
@procino
Copy link

procino commented May 17, 2022

Dear support,
I've the same problem on geonetwork v.3.10.4
May I have feedback on this Issue?

@nancyva
Copy link

nancyva commented May 23, 2022

I also have the same problem, has anyone solved it?

@etj
Copy link
Contributor

etj commented Jul 18, 2022

It seems that the element is internally added, here the relevant log

Log
2022-07-15 18:55:24,280 DEBUG [geonetwork.editoraddelement] - Inserting at location gmd:identificationInfo/*/gmd:topicCategory th
e snippet or value org.fao.geonet.kernel.AddElemValue@50e407cc
2022-07-15 18:55:24,281 DEBUG [geonetwork.editoraddelement] - 1 element matching XPath found.
2022-07-15 18:55:24,281 DEBUG [geonetwork.editoraddelement] - Inserting at location gmd:identificationInfo/*/gmd:topicCategory th
e snippet or value org.fao.geonet.kernel.AddElemValue@3675cef1
2022-07-15 18:55:24,281 DEBUG [geonetwork.editoraddelement] - 0 element matching XPath found.
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - Check if gmd:topicCategory exists in MD_DataIdentification
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] -  > add new node gmd:topicCategory inserted in MD_DataIdentification
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### in addElement()
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - parent = MD_DataIdentification
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child name = topicCategory
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child namespace = http://www.isotc211.org/2005/gmd
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child prefix = gmd
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - parents first child = Optional[[Element: <gmd:citation [Name
space: http://www.isotc211.org/2005/gmd]/>]]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - child qname = gmd:topicCategory
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - parent name for type retrieval = root
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - type name = gmd:MD_DataIdentification_Type
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - #### - metadata type = IsOrType = FALSE gmd:citation/1-1 gmd:abstra
ct/1-1 gmd:purpose/0-1 gmd:credit/0-n gmd:status/0-n gmd:pointOfContact/0-n gmd:resourceMaintenance/0-n gmd:graphicOverview/0-n g
md:resourceFormat/0-n gmd:descriptiveKeywords/0-n gmd:resourceSpecificUsage/0-n gmd:resourceConstraints/0-n gmd:aggregationInfo/0
-n gmd:spatialRepresentationType/0-n gmd:spatialResolution/0-n gmd:language/1-n gmd:characterSet/0-n gmd:topicCategory/0-n gmd:en
vironmentDescription/0-1 gmd:extent/0-n gmd:supplementalInformation/0-1  Attributes: Attribute (0) id: Default Value: nullAttribu
te (1) uuid: Default Value: null
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:citation, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:citation [Namespace: h
ttp://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:abstract, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:abstract [Namespace: h
ttp://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:purpose, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:purpose [Namespace: ht
tp://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:credit, list size = 0
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:status, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:status [Namespace: htt
p://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:pointOfContact, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:pointOfContact [Namesp
ace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:resourceMaintenance, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:resourceMaintenance [N
amespace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:graphicOverview, list size = 0
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:resourceFormat, list size = 0
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:descriptiveKeywords, list size = 2
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:descriptiveKeywords [N
amespace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:descriptiveKeywords [Namespace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:resourceSpecificUsage, list size = 0
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:resourceConstraints, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:resourceConstraints [Namespace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:aggregationInfo, list size = 0
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:spatialRepresentationType, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:spatialRepresentationType [Namespace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:spatialResolution, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:spatialResolution [Namespace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:language, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:language [Namespace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:characterSet, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:characterSet [Namespace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:topicCategory, list size = 0
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:environmentDescription, list size = 0
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:extent, list size = 2
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:extent [Namespace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:extent [Namespace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####   - child of type gmd:supplementalInformation, list size = 1
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] - ####              - add child [Element: <gmd:supplementalInformation [Namespace: http://www.isotc211.org/2005/gmd]/>]
2022-07-15 18:55:24,282 DEBUG [geonetwork.editoraddelement] -  > add <gmd:topicCategory xmlns:gmd="http://www.isotc211.org/2005/gmd">
  <gmd:MD_TopicCategoryCode>boundaries</gmd:MD_TopicCategoryCode>
</gmd:topicCategory>

This also happens on plain 19139 schema plugin, where this extra element is being taken care of in the update-fixed-info.xsl,

  <xsl:template
    match="gmd:topicCategory[not(gmd:MD_TopicCategoryCode)]"
    priority="10" />

We're going to solve this in the same way.

@fxprunayre
Copy link

See also geonetwork/core-geonetwork#6239 "Editing fix" section (but the update-fixed-info.xsl works fine too).

etj added a commit that referenced this issue Jul 18, 2022
@etj
Copy link
Contributor

etj commented Jul 18, 2022

  • fix b69d664: when editing the metadata, the empty topicCat will be automatically removed
  • workaround f2927e5: empty topicCategories will be removed in CSW output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants