[GeoNetwork-devel] Advice adding extensions to schema

Hi Developers,

In Geonetwork 4.2.x I’m struggling a bit with adding some additional elements to an ISO19139 schema. In short, I need to add three new elements to gmd:distributor- what I’m aiming for is this:
<gmd:distributionInfo xmlns:nrw=“http://naturalresources.wales/nrw”>
gmd:MD_Distribution
gmd:distributionFormat/
gmd:transferOptions/
gmd:distributor
nrw:NRW_internalInfo
<nrw:internalLocationInfo gco:nilReason=“missing”>
gco:CharacterString/
</nrw:internalLocationInfo>
<nrw:internalContactInfo gco:nilReason=“missing”>
gco:CharacterString/
</nrw:internalContactInfo>
<nrw:relatedTitle gco:nilReason=“missing”>
gco:CharacterString/
</nrw:relatedTitle>
</nrw:NRW_internalInfo>
</gmd:distributor>
</gmd:MD_Distribution>
</gmd:distributionInfo>

I have defined these in an xsd, which currently looks like this https://github.com/AstunTechnology/iso19139.nrw/blob/4.2.x/src/main/plugin/iso19139.nrw/schema/extensions/nrw/nrw1.xsd

If they are populated in a record then they appear in the editor views, but only if I simply define the gmd:distributor section like so:

I need to be able to define the individual fields in my default view so that I can add buttons to add new elements. I have tried a number of ways of defining the elements in the xsd, and have checked against some existing profiles that have similar things in them but I can’t seem to get it to work. If I have debug logging switched on, I can’t see any errors but the fields simply don’t show in the section at all. I have the gmd:distributor section in inflate-metadata.xsl so the elements are preserved when the record is saved.

This is what the debug log files have for that section:

gmd:distributor
<geonet:child xmlns:geonet=“http://www.fao.org/geonetwork” name=“MD_Distributor” prefix=“gmd” namespace=“http://www.isotc211.org/2005/gmd” uuid=“child_gmd:MD_Distributor_1486e685-da0b
-4088-b19f-b92ba2aac583” min=“1” max=“1” action=“replace” />
nrw:NRW_internalInfo
<nrw:internalLocationInfo gco:nilReason=“missing”>
gco:CharacterString
<geonet:element xmlns:geonet=“http://www.fao.org/geonetwork” ref=“198” parent=“197” uuid=“gco:CharacterString_dd7db7eb-e726-4740-bae1-93335060e95b” />
</gco:CharacterString>
<geonet:element xmlns:geonet=“http://www.fao.org/geonetwork” ref=“197” parent=“196” uuid=“nrw:internalLocationInfo_be0e9a4e-0f78-4ff4-a9a5-6bcb0726c6e9” />
</nrw:internalLocationInfo>
<nrw:internalContactInfo gco:nilReason=“missing”>
gco:CharacterString
<geonet:element xmlns:geonet=“http://www.fao.org/geonetwork” ref=“200” parent=“199” uuid=“gco:CharacterString_d42a2111-25e3-453c-8124-48e061a35e57” />
</gco:CharacterString>
<geonet:element xmlns:geonet=“http://www.fao.org/geonetwork” ref=“199” parent=“196” uuid=“nrw:internalContactInfo_d848ca59-3c54-46ed-860d-d35cb5c00143” />
</nrw:internalContactInfo>
<nrw:relatedTitle gco:nilReason=“missing”>
gco:CharacterString
<geonet:element xmlns:geonet=“http://www.fao.org/geonetwork” ref=“202” parent=“201” uuid=“gco:CharacterString_f8ed2e14-2871-47e0-a355-acc3d746d7fd” />
</gco:CharacterString>
<geonet:element xmlns:geonet=“http://www.fao.org/geonetwork” ref=“201” parent=“196” uuid=“nrw:relatedTitle_a9b779ba-58d5-4a14-a820-d94db81fb22a” />
</nrw:relatedTitle>
<geonet:element xmlns:geonet=“http://www.fao.org/geonetwork” ref=“196” parent=“195” uuid=“nrw:NRW_internalInfo_6ccd4cff-161d-4ac1-8981-70e1abd12739” />
</nrw:NRW_internalInfo>
<geonet:element xmlns:geonet=“http://www.fao.org/geonetwork” ref=“195” parent=“178” uuid=“gmd:distributor_742130b9-3444-4526-b79f-4eadd1b989b6” min=“0” max=“10000” del=“true” add=“tru
e” />
<geonet:attribute xmlns:geonet=“http://www.fao.org/geonetwork” name=“gco:nilReason” add=“true”>
<geonet:text value=“template” />
<geonet:text value=“missing” />
<geonet:text value=“inapplicable” />
<geonet:text value=“withheld” />
<geonet:text value=“unknown” />
</geonet:attribute>
<geonet:attribute xmlns:geonet=“http://www.fao.org/geonetwork” name=“type” add=“true”>
<geonet:default value=“simple” />
</geonet:attribute>
<geonet:attribute xmlns:geonet=“http://www.fao.org/geonetwork” name=“xlink:href” add=“true” />
<geonet:attribute xmlns:geonet=“http://www.fao.org/geonetwork” name=“xlink:role” add=“true” />
<geonet:attribute xmlns:geonet=“http://www.fao.org/geonetwork” name=“xlink:arcrole” add=“true” />
<geonet:attribute xmlns:geonet=“http://www.fao.org/geonetwork” name=“xlink:title” add=“true” />
<geonet:attribute xmlns:geonet=“http://www.fao.org/geonetwork” name=“xlink:show” add=“true”>
<geonet:text value=“new” />
<geonet:text value=“other” />
<geonet:text value=“replace” />
<geonet:text value=“embed” />
<geonet:text value=“none” />
</geonet:attribute>
<geonet:attribute xmlns:geonet=“http://www.fao.org/geonetwork” name=“xlink:actuate” add=“true”>
<geonet:text value=“other” />
<geonet:text value=“onRequest” />
<geonet:text value=“onLoad” />
<geonet:text value=“none” />
</geonet:attribute>
<geonet:attribute xmlns:geonet=“http://www.fao.org/geonetwork” name=“uuidref” add=“true” />
</gmd:distributor>

Quite honestly I’m confused as to how the various definitions in the xsd for types and propertytypes work!

Any advice would be gratefully appreciated!

Thanks

Jo

···

Jo Cook
Data Discovery Lead, Astun Technology
t:+44 7930 524 155 | twitter:@archaeogeek | mastodon:@archaeogeek@…1363…
Please note that currently I do not work on Friday afternoons. For urgent responses at that time, please visit support.astuntechnology.com or phone our office on 01372 744009