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
410 stars 487 forks source link

example to add xml element using geonetwork api #8246

Open tp0b opened 1 month ago

tp0b commented 1 month ago

Hi everyone,

I am looking for some example to add publication date element in geonetwork using api so that i can run a code to check if existing memetadata records having this element or not. If not, I would like this code to add this element because we want to integrate to get this information updated.

For example, in geonetwork UI I can manually open the record, and choose editing in xml mode and scrolling down to the section of this element and the content of xml element for publication date

the xpath for this information is .//mdb:identificationInfo/mri:MD_DataIdentification/mri:citation/cit:CI_Citation/cit:date/cit:CI_Date

By looking at geonetwork API documentation, it seems to me that [/{portal}/api/0.1/records/{metadataUuid}/editor/elements] might help, but i don't know how to put ref parameter

Anyone has a working example for this api and would like to share with me, that will be helpful for me image

Thank you very much.

Cheers, Thu

fxprunayre commented 1 month ago

ref references requires to open the record in edit mode (which combines the XML and XSD). May be easier to use batch edit API to update the XML eg. https://docs.geonetwork-opensource.org/4.4/user-guide/workflow/batchediting/