agiorguk / gemini

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

DateTime with fractions of a second #160

Open PeterParslow opened 1 month ago

PeterParslow commented 1 month ago

Are these allowed?

GEMINI for Metadata date says its domain is:

"Single date as specified by BS ISO 8601 in the extended date format (YYYY-MM-DD), where YYYY is the year, MM is the month and DD is the day. Time (HH:MM:SS, where HH is the hour, MM the minutes and SS the seconds) may be added if required, separated from the day by 'T'."

& for Reference date:

"The extended date format (YYYY-MM-DD) defined in BS ISO 8601 should be used, where YYYY is the year, MM is the month and DD is the day. It may be extended to include time (HH:MM:SS), where HH is the hour, MM the minutes and SS the seconds, with the two parts separated by the character 'T'."

See also https://agiorguk.github.io/gemini/1048-uk-gemini-encoding-guidance.html#_dates_and_times

But ISO 19103:2005, ISO 19115:2003, ISO 19139:2006, ISO 8601:2004 and XML schema all allow fractions of a second.

I ask because GeoNetwork 4 is time stamping my records with fractions of a second; see https://[osmetadata.astuntechnology.com/geonetwork/srv/api/records/5ce5bb7e-cf14-49f5-ac0e-23e36aa27644/formatters/xml](https://osmetadata.astuntechnology.com/geonetwork/srv/api/records/5ce5bb7e-cf14-49f5-ac0e-23e36aa27644/formatters/xml) as opposed to https://[ckan.publishing.service.gov.uk/harvest/object/7610b649-23a8-4f15-b93a-48eccca82a0d](https://ckan.publishing.service.gov.uk/harvest/object/7610b649-23a8-4f15-b93a-48eccca82a0d) that was created in an older GeoNetwork. And data.gov.uk won't harvest them, saying:

"Error importing Gemini document: Could not extract reference date for GUID 5ce5bb7e-cf14-49f5-ac0e-23e36aa27644 (2024-07-19T10:03:40.543Z)"

So, do we think GEMINI deliberately restricted the underlying standard to only use whole seconds? (In which case I need to find out how to tweak the setting in GeoNetwork) Or is it only a matter of examples & GEMINI should allow fractions of a second (in which case I suggest we change the text & lobby data.gov.uk to change their harvester).

nmtoken commented 1 month ago

https://osmetadata.astuntechnology.com/geonetwork/srv/api/records/5ce5bb7e-cf14-49f5-ac0e-23e36aa27644/formatters/xml does have a validation error for GEMINI 2.3 ~ AT-6: Free text elements should not be empty (on the lineage statement), that aside though the date with decimal seconds (<gco:DateTime>2024-07-19T10:03:40.543Z</gco:DateTime>) isn't an issue for the validator.

nmtoken commented 1 month ago

Or is it only a matter of examples & GEMINI should allow fractions of a second

IMHO Yes, GEMINI should allow fractions of a second, and the situation is we don't have examples that cover this. We also don't have examples that mention time zone (Z), but probably should

PeterParslow commented 1 month ago

https://osmetadata.astuntechnology.com/geonetwork/srv/api/records/5ce5bb7e-cf14-49f5-ac0e-23e36aa27644/formatters/xml does have a validation error for GEMINI 2.3 ~ AT-6: Free text elements should not be empty (on the lineage statement), that aside though the date with decimal seconds (<gco:DateTime>2024-07-19T10:03:40.543Z</gco:DateTime>) isn't an issue for the validator.

That "Free text elements" error (warning) is "just" data.gov.uk doing its old trick of trying to validate my records against the GEMINI 2.2 schematron. I've re-opened my ticket for that. I was checking that it was only a warning - but slightly updating one of my records. Having changed GeoNetwork version, that revealed this issue (in their harvest)

nmtoken commented 1 month ago

My GEMINI 2.3 validator is flagging the "Free text elements" error (warning)

PeterParslow commented 1 month ago

My mistake - yes, there are other problems with this record! As a Service record, it shouldn't (needn't) contain a Lineage statement at all. I'll fix that. But that's not what this issue is about.

PeterParslow commented 1 month ago

I've fixed the other issues, and meanwhile data.gov.uk have fixed their other issues, so this issue is now the only one reported on harvesting my records: https://ckan.publishing.service.gov.uk/harvest/ordnancesurveycsw/job/last

I've raised as a bug in data.gov.uk harvest.

@nmtoken : I see that BGS's records are harvested OK. From a sample of one, this appears to be because the GEMINI Metadata date stamp is only to the whole day - how do you configure GeoNetwork (4.2) to give a lower resolution time stamp? (As a work around until data.gov.uk can harvest sub-second date stamps)

archaeogeek commented 1 month ago

@PeterParslow it is possible to configure GeoNetwork to create the datestamp with a different granularity- by overriding this xsl transformation https://github.com/geonetwork/core-geonetwork/blob/4.2.x/schemas/iso19139/src/main/plugin/iso19139/update-fixed-info.xsl#L217 in Gemini 2.3. If you think this should be done, can you create an issue for it in https://github.com/AstunTechnology/iso19139.gemini23 please?

nmtoken commented 1 month ago

From a sample of one, this appears to be because the GEMINI Metadata date stamp is only to the whole day - how do you configure GeoNetwork (4.2) to give a lower resolution time stamp? (As a work around until data.gov.uk can harvest sub-second date stamps)

We don't. We currently don't use GeoNetwork to create metadata, only as a distributor