ISO-TC211 / XML

XML schema, transforms, schematron rules, and examples for ISO TC211 Metadata Standards
45 stars 26 forks source link

GML schema problem in gmi 1.0 #203

Open tedhabermann opened 5 years ago

tedhabermann commented 5 years ago

We ran into a problem validating ISO 19115-2 using the schemas at standards.iso.org/iso/19115/-2/gmi/1.0. XMLSpy was unable to follow the redirect from www.opengis.net/gml/3.2 to schemas.opengis.net/gml/3.2.1 so the schemas in https://schemas.opengis.net/gml/3.2.1 that are included in xml.xsd could not be found.

This problem emerged when the user switched from http://www.isotc211.org/2005/gmi/gmi.xsd to https://standards.iso.org/iso/19115/-2/gmi/1.0/gmi.xsd. I was curious about why that switch caused the problem. It turns out that the file https://standards.iso.org/iso/19115/-2/gmi/1.0/spatialRepresentationInformation.xsd imports gml from www.opengis.net/gml/3.2 causing the redirect problem. The other schemas in this chain (https://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/gco/basicTypes.xsd) import gml through http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19136_Schemas/gml.xsd, avoiding the redirect. Thus we really have two problems - redundant definitions of the gml schema, and a redirect that is not followed by XMLSpy.

This can be fixed by changing the xml schema location in https://standards.iso.org/iso/19115/-2/gmi/1.0/spatialRepresentationInformation.xsd from www.opengis.net/gml/3.2 to http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19136_Schemas/gml.xsd, removing the redundant schema definition and avoiding the redirect.

cportele commented 5 years ago

Don't use http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19136_Schemas/gml.xsd. This schema is outdated. Use http://schemas.opengis.net/gml/3.2.1/gml.xsd instead. This is and will always be the latest version of the GML 3.2 schema. The revision of ISO 19136 (ISO 19136-1) references the schema on the OGC server, too.

(Most XML parsers do not follow redirects, by the way.)

tedhabermann commented 5 years ago

Clemens, The schema https://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19139_Schemas/gco/basicTypes.xsd (which is imported by gmi.xsd) imports gml as . I'm not sure I have the capability to change that file. Permissions at ISO are becoming more problematic... Ted

smrgeoinfo commented 5 years ago

I'd say the same schema location should be used for http://www.opengis.net/gml/3.2 namespace everywhere in the 19115-2 implementation. Is http://standards.iso.org/ittf/PubliclyAvailableStandards/ISO_19136_Schemas/gml.xsd reliably going to stay accessible at that location? If so, there should be no problem using it; any changes in the openGIS gml 3.2 schema should be backward compatible bug fixes (3.2.1.2 vs 3.2.2 currently); gml 3.2 should not be changing in other ways (else it should be 3.2+n). Changing the schema location for 19139 basicTypes does not seem like a good idea at this point.

cportele commented 5 years ago

I do not know the plans ISO has with the standards.iso.org server, but I recommend to use http://schemas.opengis.net/gml/3.2.1/gml.xsd as the canonical schema location for the GML 3.2 schema. (In retrospect, we probably should not have published a copy of the GML 3.2 schema on the ISO server.)

If you want to import the GML 3.2 schema from the ISO server that should be fine as long you don't depend on corrigenda and as long as all namespaces involved only import the GML 3.2 schema from that schema location.