pds-data-dictionaries / PDS4-LDD-Issue-Repo

Issue repository for tracking all PDS4 Discipline Dictionary-related issues, new feature requests, and releases.
Apache License 2.0
2 stars 1 forks source link

[ldd-vgr] <fds_scet_epoch_1-4 elements, times incorrectly fail pattern match validation> #254

Closed katecrombie closed 11 months ago

katecrombie commented 11 months ago

Issue Type Using the LABELS section to the right of this window >>>> , please indicate if this is a BUG or ENHANCEMENT request. If unknown, feel free to leave that blank and the LDD Steward can triage appropriately.

Describe the issue identified (if applicable) When validating labels the fds_scet_epoch_1-4 fail the pattern match. They should not fail, as their patterns do match the required pattern.

ERROR [error.label.schema] line 116, 33: cvc-pattern-valid: Value '1978-08-15T22:21:36.232776Z' is not facet-valid with respect to pattern 'YYYY-MM-DDTHH:MM:SS.SSSSSSZ' for type 'fds_scet_epoch_1'.

Describe the solution you'd like Please update the LDD so that the error does not occur.

Describe alternatives you've considered

LDD Dictionary Version

PDS4 IM Version 1.16

Need-by Date July 20, 2023

Additional context Add any other context or examples products

cgobat commented 11 months ago

@matthewtiscareno FYI, the <pattern> in the attribute definition is for a RegEx pattern. By setting it to YYYY-MM-DDTHH:MM:SS.SSSSSSZ, validate will only accept the literal string "YYYY-MM-DDTHH:MM:SS.SSSSSSZ", since none of those characters are symbolic/meaningful RegEx symbols (you'd need something like \d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{6}Z to do this using a RegEx, and you'd need something even more complicated if you wanted to ensure things like month<=12, hour<=23, etc.).

It strikes me as probably better to just set the <value_data_type> to ASCII_​Date_​Time_​YMD_​UTC (or similar—these types validate the format of the value already) and omit the re-definition of <pattern> entirely.

katecrombie commented 11 months ago

Using the ASCII​Date​Time​YMD​UTC sounds very reasonable to me. I have no issues with omitting the pattern.

matthewtiscareno commented 11 months ago

https://github.com/pds-data-dictionaries/ldd-vgr/pull/9