agiorguk / gemini

Resources relating to the UK Gemini metadata profile
5 stars 3 forks source link

Should all gmx:Anchor instances have content? #76

Open PeterParslow opened 1 year ago

PeterParslow commented 1 year ago

data.gov.uk validation rejects a combination of gco:nilReason & an anchor:

- which seems quite reasonable (the otherConstraints isn't exactly missing) GeoNetwork (at least, my instance!) won't let me create an "xlink only" anchor like the one in example 21 at https://www.agi.org.uk/gemini/40-gemini/1048-uk-gemini-encoding-guidance/ - but should that be allowed? The rest of that generic XML guidance (text & examples) assumes there will be text content as well as an anchor; the same with all the mentions in https://www.agi.org.uk/gemini/40-gemini/1062-gemini-datasets-and-data-series/ My reading of ISO 19139:2008: Anchor is a subtype/specialisation of CharacterString and in XML is realized as an xs:string (with the additional attributes). A CharacterString_PropertyType can have a gco:nilReason. But A.2.1 gives a general rule that "some mechanism ... must be used to restrict a property to be exclusively by-value, or by-reference, or expressing a NULL reason" So, should we (GEMINI) add a clear statement that Anchors shall always have content? Or do we see a case for not having content, and it's (my) GeoNetwork that needs to change - probably by changing the GEMINI Schematron so that TypeNillablePattern checks for elements that try to have it both ways - or (better) the ISO 19139 Schematron to check this for gmx:Anchor?
nmtoken commented 1 year ago

GeoNetwork (at least, my instance!) won't let me create an "xlink only" anchor ~ isn't that the same behaviour discussed by Jo in https://github.com/AGIuk/Schematron/pull/1#issuecomment-622299684

PeterParslow commented 1 year ago

It's the same behaviour but applied to gmx:Anchor rather than gco:CharacterString - and therefore rather different.

I'm proposing that we make the general GEMINI XML requirement not to have empty elements (2.2.10 / Figure 15 at https://www.agi.org.uk/gemini/40-gemini/1048-uk-gemini-encoding-guidance/) more explicit for anchor "even if there is an xlink:href".

gmx:Anchor would have content by-value & by-reference: the ISO 19139 rule only applies to properties, not objects. I'm sure this only applies to anchors, not the other subtypes of CharacterString - 2.2.9 Code lists even says "The element value (i.e. in Figure 13 <gmd:MD_ScopeCode ...>dataset</gmd:MD_ScopeCode>) is human readable text. It can be omitted or given a value different from that of the attribute codeListValue (e.g. Dataset)." (my emphasis)

2.2.10 probably needs a bit of re-wording. "Empty XML elements (see Figure 15) are not permitted in ISO 19139 metadata instances" isn't true & 2.2.1 has several examples of "empty" elements where all the content is by reference: verticalCRS, domainOfValidity, verticalCRS, verticalDatum, srv:operatesOn - but they are all properties, not objects.