metadata101 / iso19139.ca.HNAP

ISO Harmonized North American Profile (HNAP)
GNU General Public License v2.0
4 stars 19 forks source link

[3.12.x] Transition to schemas.metadata.geo.ca #324

Closed jodygarnett closed 1 year ago

jodygarnett commented 1 year ago

This is a back-port of https://github.com/metadata101/iso19139.ca.HNAP/pull/323 to 3.12.x branch.

This pull request prepares the 3.12.x branch for the relocation of hnap schemas and registry to schemas.metadata.geo.ca.

For context and discussion see https://github.com/metadata101/iso19139.ca.HNAP/issues/118

jodygarnett commented 1 year ago

Thanks for the changes @josegar74 they make sense to me.

I am considering this PR approved ... and just blocked until @bo-lu is in position to update schemas.metadata.geo.ca content.

jodygarnett commented 1 year ago

This is rebased, however I am seeing some issues when validating a produced document:

Testing against local metadata101/schemas hnap:

java Validate.java ../hnap/2.3.1/hnap.xsd ~/Downloads/test-record.xml
/Users/jgarnett/Downloads/test-record.xml validation check: ../hnap/2.3.1/hnap.xsd
/Users/jgarnett/Downloads/test-record.xml: valid

When checking agains schemas.metadata.geo.ca (as referenced in downloaded file):

java Validate.java --trace ~/Downloads/test-record.xml    
/Users/jgarnett/Downloads/test-record.xml: validation using schemaLocation
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/metadataApplication.xsd
https://schemas.metadata.geo.ca/2009/gco/gco.xsd
https://schemas.metadata.geo.ca/2009/gco/basicTypes.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/dynamicFeature.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/feature.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/geometryAggregates.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/geometryPrimitives.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/geometryBasic2d.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/geometryBasic0d1d.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/measures.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/units.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/dictionary.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gmlBase.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/basicTypes.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/2009/xlink/xlink.xsd
https://schemas.metadata.geo.ca/2009/xml/xml.xsd
https://schemas.metadata.geo.ca/2009/xml/XMLSchema.dtd --> -//W3C//DTD XMLSCHEMA 200102//EN
https://schemas.metadata.geo.ca/2009/xml/datatypes.dtd --> datatypes
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/temporal.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gmlBase.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/direction.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/geometryBasic0d1d.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/topology.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/geometryComplexes.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/geometryAggregates.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/coverage.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/feature.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/valueObjects.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/geometryBasic0d1d.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/temporal.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/grids.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/geometryBasic0d1d.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/geometryAggregates.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/coordinateReferenceSystems.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/coordinateSystems.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/referenceSystems.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/dictionary.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/datums.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/referenceSystems.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/measures.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/coordinateOperations.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/referenceSystems.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/measures.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/observation.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/feature.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/direction.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/valueObjects.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/temporalReferenceSystems.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/temporalTopology.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/temporal.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/dictionary.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/deprecatedTypes.xsd
https://schemas.metadata.geo.ca/ogc/gml/3.2.1/gml.xsd
https://schemas.metadata.geo.ca/2009/gco/gco.xsd
https://schemas.metadata.geo.ca/2009/gco/gcoBase.xsd
https://schemas.metadata.geo.ca/2009/gco/gco.xsd
https://schemas.metadata.geo.ca/2009/gmd/metadataEntity.xsd
https://schemas.metadata.geo.ca/2009/gmd/spatialRepresentation.xsd
https://schemas.metadata.geo.ca/2009/gss/gss.xsd
https://schemas.metadata.geo.ca/2009/gss/geometry.xsd
https://schemas.metadata.geo.ca/2009/gss/gss.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/citation.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/referenceSystem.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/citation.xsd
https://schemas.metadata.geo.ca/2009/gmd/extent.xsd
https://schemas.metadata.geo.ca/2009/gts/gts.xsd
https://schemas.metadata.geo.ca/2009/gts/temporalObjects.xsd
https://schemas.metadata.geo.ca/2009/gts/gts.xsd
https://schemas.metadata.geo.ca/2009/gsr/gsr.xsd
https://schemas.metadata.geo.ca/2009/gsr/spatialReferencing.xsd
https://schemas.metadata.geo.ca/2009/gsr/gsr.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/referenceSystem.xsd
https://schemas.metadata.geo.ca/2009/gmd/metadataExtension.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/citation.xsd
https://schemas.metadata.geo.ca/2009/gmd/content.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/citation.xsd
https://schemas.metadata.geo.ca/2009/gmd/metadataApplication.xsd
https://schemas.metadata.geo.ca/2009/gmd/applicationSchema.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/citation.xsd
https://schemas.metadata.geo.ca/2009/gmd/portrayalCatalogue.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/citation.xsd
https://schemas.metadata.geo.ca/2009/gmd/dataQuality.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/identification.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/constraints.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/distribution.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/citation.xsd
https://schemas.metadata.geo.ca/2009/gmd/maintenance.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/citation.xsd
https://schemas.metadata.geo.ca/2009/gmd/freeText.xsd
https://schemas.metadata.geo.ca/2009/gmd/gmd.xsd
https://schemas.metadata.geo.ca/2009/gmd/identification.xsd
https://schemas.metadata.geo.ca/2009/napm/napm.xsd
https://schemas.metadata.geo.ca/2009/napm/napmCharacterString.xsd
test-record.xml (473, 142) ERROR: cvc-complex-type.2.4.a: Invalid content was found starting with element '{"http://www.isotc211.org/2005/gmx":Anchor}'. One of '{"http://www.isotc211.org/2005/gco":CharacterString}' is expected.
/Users/jgarnett/Downloads/test-record.xml: invalid
jodygarnett commented 1 year ago

Checking the record downloaded it has:

              <gmd:identifier>
                <gmd:MD_Identifier>
                  <gmd:code>
                    <gmx:Anchor xlink:href="http://localhost:8080/geonetwork/srv/api/registries/vocabularies/external.theme.GC_Core_Subject">geonetwork.thesaurus.external.theme.GC_Core_Subject</gmx:Anchor>
                  </gmd:code>
                </gmd:MD_Identifier>
              </gmd:identifier>

The gmx/extendedTypes.xsd has gmx:Anchor in substation group for gco: CharacterString so this should be okay:

<xs:element name="Anchor" type="gmx:Anchor_Type" substitutionGroup="gco:CharacterString"/>

Looking through the above trace gmx was not downloaded, adding to the schema location allows the document to validate:

xsi:schemaLocation="http://www.isotc211.org/2005/gmx https://schemas.metadata.geo.ca/2009/gmx/gmx.xsd ..."