Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TG2-MEASURE_EVENTDATE_DURATIONINSECONDS #140

Open
godfoder opened this issue Feb 20, 2018 · 54 comments
Open

TG2-MEASURE_EVENTDATE_DURATIONINSECONDS #140

godfoder opened this issue Feb 20, 2018 · 54 comments
Labels
CODED CORE TG2 CORE tests Measure Test Tests created by TG2, either CORE, Supplementary or DO NOT IMPLEMENT TG2 TIME

Comments

@godfoder
Copy link
Contributor

godfoder commented Feb 20, 2018

TestField Value
GUID 56b6c695-adf1-418e-95d2-da04cad7be53
Label MEASURE_EVENTDATE_DURATIONINSECONDS
Description What is the duration of dwc:eventDate in seconds?
TestType Measure
Darwin Core Class Event
Information Elements ActedUpon dwc:eventDate
Information Elements Consulted
Expected Response INTERNAL_PREREQUISITES_NOT_MET if dwc:eventDate is EMPTY or if the value of dwc:eventDate is not a valid ISO 8601-1 date; otherwise RUN_HAS_RESULT with the result being the duration (sensu ISO 8601-1) expressed in the dwc:eventDate, in seconds.
Data Quality Dimension Resolution
Term-Actions EVENTDATE_DURATIONINSECONDS
Parameter(s)
Source Authority
Specification Last Updated 2023-09-18
Examples [dwc:eventDate="1880-05-08/10": Response.status=RUN_HAS_RESULT, Response.result="259200", Response.comment="dwc:eventDate duration is 3 days = 259,200 seconds"]
[dwc:eventDate="95": Response.status=INTERNAL_PREREQUISITES_NOT_MET, Response.result=NOT_REPORTED, Response.comment="dwc:eventDate does not contain a valid ISO 8601-1:2019 date"]
Source Alex Thompson
References
Example Implementations (Mechanisms) FilteredPush/Kurator:event_date_qc 10.5281/zenodo.596795.
Link to Specification Source Code event_date_qc v3.0.0 DwCEventDQ.measureEventdateDurationinseconds()
Notes The duration of a day is 86400 seconds. Implementations should treat all days as 86400 seconds, but should include leap days (but not leap seconds) in durations that encompass them. Consumers should treat assertions about event date duration as approximations, see: https://xkcd.com/2867/
@chicoreus
Copy link
Collaborator

Isn't this a duplicate of #124?

Information elements should only include eventDate.

Remove the " expected to run this test after the amendments to populate dwc:eventDate." All measures are expected to be run in a pre-amendment phase and in a post-amendment phase.

@Tasilee Tasilee added the Test Tests created by TG2, either CORE, Supplementary or DO NOT IMPLEMENT label Mar 21, 2018
@ArthurChapman
Copy link
Collaborator

Should this one be better named MEASURE_EVENTDATE_PRECISIONINSECONDS?

@Tasilee
Copy link
Collaborator

Tasilee commented Sep 2, 2018

Yes indeed. Changed in label and table, where Term-Actions was also incorrect.

@Tasilee Tasilee changed the title TG2-MEASURE_EVENT_PRECISIONINSECONDS TG2-MEASURE_EVENTDATE_PRECISIONINSECONDS Sep 2, 2018
@Tasilee Tasilee added Test and removed Test labels Sep 25, 2018
@chicoreus
Copy link
Collaborator

This test has no path to a response state of NOT_RUN, so the last clause shouldn't be included in the specification, similarly, "REPORTED" is confusing, this means Result.State=RUN_HAS_RESULT Result.Value={duration in seconds, long integer}.

Suggest changing: "INTERNAL_PREREQUISITES_NOT_MET if dwc:eventDate is EMPTY or does not contain a valid ISO 8601-1:2019 date; REPORT on the length of the period expressed in the dwc:eventDate in seconds; otherwise NOT_REPORTED" to:

INTERNAL_PREREQUISITES_NOT_MET if dwc:eventDate is EMPTY or does not contain a valid ISO 8601-1:2019 date; otherwise RUN_HAS_RESULT with the result value being the length of the period expressed in the dwc:eventDate in seconds"

@ArthurChapman
Copy link
Collaborator

@chicoreus - the suggested change looks OK to me.

@chicoreus
Copy link
Collaborator

@ArthurChapman great. I've updated accordingly.

@Tasilee
Copy link
Collaborator

Tasilee commented Feb 2, 2022

I've also updated the TESTs dump worksheet accordingly and I think I have already done the test data examples correctly.

@chicoreus
Copy link
Collaborator

We probably need to add guidance about leap seconds to the notes. For the purposes of CORE, I would suggest that the guidance be to ignore leap seconds when calculating duration. Standard time libraries that implementers would use tend to ignore leap seconds (e.g. posix seconds from the epoch (affecting python Time), joda time (which excludes leap seconds), and java Time (which treats all days as 86400 seconds), etc.). Including leap seconds is likely to confuse end users, for example by causing event dates known to a day that includes a leap second to be excluded from use by a filter on <=86400 seconds). CORE uses, from the TG3 results and discussed here where we discussed including dwc:eventTime and decided not to include it in core, don't include time, so feels safer for core uses to be explicit in the notes about not including leap seconds.

@chicoreus
Copy link
Collaborator

I propose changing the notes from:

The length of a day is 86400 seconds. Leap days and leap seconds affect the duration of some months and some years.

to:

The length of a day is 86400 seconds. Leap days and leap seconds affect the duration of some months and some years, implementations should not include leap seconds, and treat all days as 86400 seconds, but should include leap days.

@ArthurChapman
Copy link
Collaborator

I am happy with that.

@Tasilee
Copy link
Collaborator

Tasilee commented Feb 24, 2022

I don't understand it. Could it be reworded for simpletons like me? It needs to be self contained or reference definitions.

@tucotuco
Copy link
Member

Would this suffice?

The length of a day is 86400 seconds. Implementations should treat all days as 86400 seconds, but should include leap days.

@Tasilee
Copy link
Collaborator

Tasilee commented Feb 25, 2022

Thanks @tucotuco. Better, but we have two elephants in the room!

  1. We have no dwc:coordinatePrecision test so why this one? I do wonder.
  2. Are we REALLY talking about a RANGE or a PRECISION? The expected response reads

..."RUN_HAS_RESULT with the result value being the length of the period expressed in the dwc:eventDate in seconds"

This implies a RANGE, yet the example

"dwc:eventDate="1880-05-08" has a precision of 86400 seconds. dwc:eventDate="1880-05-08/10" has a precision of 86400 seconds."

IS a PRECISION!

If this test is about PRECISION, and we think it is CORE, then surely the Expected Response should be more like

INTERNAL_PREREQUISITES_NOT_MET if dwc:eventDate is EMPTY or does not contain a valid ISO 8601-1:2019 date; otherwise RUN_HAS_RESULT with the value in seconds of the coarsest temporal unit of dwc:eventDate.

For example, dwc:eventDate="1949-01-15T12:34/1949-01-20" would have a result of 86400 seconds.

Leap anything is irrelevant?

@ArthurChapman
Copy link
Collaborator

Good point @Tasilee

I'd like to question why we have this test as a Core Test. It is unlike any other test we have. It is a measure unlike the other measures. I can't see how it would be valuable in testing the quality of a dataset, record etc. I am having trouble envisioning where a user would want to run this and what value they would get out of it wrt to data quality.

@tucotuco
Copy link
Member

Very astute @Tasilee . That's thinking inside the box. ;-) I agree that precision is not particularly useful, but the uncertainty is, and that is what this measure is really about ("the result value being the length of the period expressed in the dwc:eventDate in seconds"). It would let people filter out records that were less specific than a day (> 86400), which is otherwise not trivial to do.

To fix this test, I would rename it to something like TG2-MEASTURE_EVENTDATE_DURATIONINSECONDS and amend the incorrect example,

dwc:eventDate="1880-05-08/10" has a precision of 86400 seconds.

to

dwc:eventDate="1880-05-08/10" has a precision of 259200 seconds.

@cboelling
Copy link
Member

I think what you are thinking of (requiring) @cboelling is not a Data Quality test but a new term (Darwin Core?) for the Duration. That would have to be taken up in a different forum.

I agree, @ArthurChapman, but I think that some of the difficulties exposed by the discussion here, trying to specify this test, stem from what I think is an ambiguity in how dwc:EventDate is defined and also in how it is actually being used, as pointed out above.

Looking at this from an adopter's perspective, I understand that what the test reports back is the length of a time interval, a duration, expressed in seconds in this instance, from what it finds as value in a dwc:EventDate token. The significance of that duration with regard to the actual or assumed temporal extension of the event or the actual or assumed duration of observing the event may be quite different in different cases. Therefore, based on the current definitions for the test and for dwc:EventDate, I find the term "DURATION" more plausible for describing the test than the alternatives that have been suggested.

chicoreus added a commit to FilteredPush/event_date_qc that referenced this issue Mar 15, 2022
…t specifications. DESCRIPTION: Adding a class LocalDateTimeInterval, which uses java.time.LocalDateTime instead of LocalDate, to support calculating event durations in seconds. Assumes that if a date range is given, the same time zone is used at the start and end of the interval.
chicoreus added a commit to FilteredPush/event_date_qc that referenced this issue Mar 15, 2022
…sts to current specifications. DESCRIPTION: Updating implementation and fixing unit test for VALIDATION_DAY_OUTOFRANGE to conform with current (2022-03-10) specification. Adding support for time in event dates to MEASURE_EVENTDATE_PRECISION/DURATION/?/INSECONDS, using LocalDateTimeInterval class for determining Duration in seconds of supplied eventDate, additional test elements in the unit tests, along with proofing calculations of time across leap years.
@Tasilee
Copy link
Collaborator

Tasilee commented Mar 15, 2022

This one is yet to be finalized, at least here. Two votes for "MEASURE_EVENTDATE_PERIODINSECONDS"?

@ArthurChapman
Copy link
Collaborator

Last email from @chicoreus suggested MEASURE_EVENTDATE_DURATIONINSECONDS

"The question is what to call this....

An option might be to drop the word, and call it MEASURE_EVENTDATE_INSECONDS....

Or use the ISO consistent concept MEASURE_EVENTDATE_DURATIONINSECONDS"

as the duration of the Event Date in seconds is what we are measuring - I vote for that (MEASURE_EVENTDATE_DURATIONINSECONDS)

@ArthurChapman
Copy link
Collaborator

Note you also have another vote for DURATIONINSECONDS from @cboelling above

@Tasilee
Copy link
Collaborator

Tasilee commented Mar 15, 2022

If we want to use "duration" then the Expected Response should be updated accordingly.

"EVENTDATE_INSECONDS" is ambiguous.

@ArthurChapman
Copy link
Collaborator

I'd leave wording of Expected Response to @chicoreus and @tucotuco - but it appears from the recent runs carried out by @chicoreus - we are measuring the duration. i.e. dwc:eventDate="2007-03-01T13:00:00Z/2008-05-11T15:30:00Z" = 37765800 which is different to what we were measuring before where we had it = "0.01"

@tucotuco
Copy link
Member

In an effort to try to wrap this one up, I recommend

Label: TG2_MEASURE_EVENTDATE_DURATIONINSECONDS
Expected Response: INTERNAL_PREREQUISITES_NOT_MET if dwc:eventDate is EMPTY or does not contain a valid ISO 8601-1:2019 value; otherwise RUN_HAS_RESULT with the result value being the length of the duration (sensu ISO 8601-1:2019) expressed in the dwc:eventDate, in seconds.
Term Actions: EVENTDATE_DURATIONINSECONDS
Example: dwc:eventDate="1880-05-08" has a duration of 86400 seconds. dwc:eventDate="1880-05-08/10" has a duration of 259200 seconds.
Notes: The duration of a day is 86400 seconds. Implementations should treat all days as 86400 seconds, but should include leap days in durations that encompass them.

@ArthurChapman
Copy link
Collaborator

Looks good to me - do you want to include leap seconds in the notes

Notes: The duration of a day is 86400 seconds. Implementations should treat all days as 86400 seconds, but should include leap days (but not leap seconds) in durations that encompass them.

@tucotuco
Copy link
Member

I have no attachment to any mention of leap seconds. Not even the IERS is convinced that it was ever a good idea or that the practice should continue.

@chicoreus
Copy link
Collaborator

chicoreus commented Mar 16, 2022 via email

@cboelling
Copy link
Member

In an effort to try to wrap this one up, I recommend

Label: TG2_MEASURE_EVENTDATE_DURATIONINSECONDS
Expected Response: INTERNAL_PREREQUISITES_NOT_MET if dwc:eventDate is EMPTY or does not contain a valid ISO 8601-1:2019 value; otherwise RUN_HAS_RESULT with the result value being the length of the duration (sensu ISO 8601-1:2019) expressed in the dwc:eventDate, in seconds.
Term Actions: EVENTDATE_DURATIONINSECONDS
Example: dwc:eventDate="1880-05-08" has a duration of 86400 seconds. dwc:eventDate="1880-05-08/10" has a duration of 259200 seconds.
Notes: The duration of a day is 86400 seconds. Implementations should treat all days as 86400 seconds, but should include leap days in durations that encompass them.

To me this looks good, but I propose to change the wording in EXPECTED RESPONSE to: otherwise RUN_HAS_RESULT with the result value being the length of the duration of the time interval (sensu ISO 8601-1:2019) expressed in the dwc:eventDate, in seconds.

In ISO 8601, durations don't have length, they are length (of time).

chicoreus added a commit to FilteredPush/event_date_qc that referenced this issue Mar 17, 2022
…t specifications. DESCRIPTION: Fixing error in multiple tests identified in validation data for MEASURE_EVENTDATE_DURATIONINSECONDS, where by yyyy-mm-dd/dd and other forms where the second part of the date range leaves off less significant parts assuming those carry the values from the first part of the date range. Fix in LocalDateInterval, added cases to unit tests.
@Tasilee Tasilee changed the title TG2-MEASURE_EVENTDATE_PRECISIONINSECONDS TG2-MEASURE_EVENTDATE_DURATIONINSECONDS Mar 20, 2022
@Tasilee
Copy link
Collaborator

Tasilee commented Mar 20, 2022

I have updated the name of the measure to DURATION and edited the relevant specifications and example.

@Tasilee
Copy link
Collaborator

Tasilee commented Mar 7, 2023

Should we have an entry

| Source Authority | bdq:sourceAuthority is "ISO 8601-1:2019" [https://www.iso.org/obp/ui/] |

?

@tucotuco
Copy link
Member

tucotuco commented Mar 7, 2023

I wouldn't think so if we have established that bdq:sourceAuthority should be used for vocabularies.

@Tasilee
Copy link
Collaborator

Tasilee commented Mar 8, 2023

...Just testing :)....

@ArthurChapman
Copy link
Collaborator

I agree with @tucotuco Keep the bdq:sourceAuthority for vocabularies where we are looking up a value - use just ISO... (e.g. in dates) where we are using it as a format (not a vocabulary as we are not looking up values).

@Tasilee
Copy link
Collaborator

Tasilee commented Mar 26, 2023

I've edited the Expected Response according to @tucotuco suggestion:

From

INTERNAL_PREREQUISITES_NOT_MET if dwc:eventDate is EMPTY or does not contain a valid ISO 8601-1:2019 value; otherwise RUN_HAS_RESULT with the result being the duration (sensu ISO 8601-1:2019) expressed in the dwc:eventDate, in seconds.

to

INTERNAL_PREREQUISITES_NOT_MET if dwc:eventDate is EMPTY or if the value of dwc:eventDate is not a valid ISO 8601-1 date; otherwise RUN_HAS_RESULT with the result being the duration (sensu ISO 8601-1) expressed in the dwc:eventDate, in seconds.

and updated the References

@Tasilee
Copy link
Collaborator

Tasilee commented Mar 29, 2023

I have updated the ISO Reference link

chicoreus added a commit to FilteredPush/event_date_qc that referenced this issue Jun 8, 2023
…t current (2023-06-04) test descriptions. Adding ProvidesVersion annotations. Updating method names to match positive sense of validations. Removing now empty file stubs for checked methods. Addressed tdwg/bdq#140 MEASURE_EVENTDATE_DURATIONINSECONDS.  Added maven surefire plugin to pom configured to execute AllTests.java so as to excute *TestDefinition.java test files in test phase.
@chicoreus chicoreus added the CODED label Jun 8, 2023
chicoreus added a commit to kurator-org/bdq_issue_to_csv that referenced this issue Jun 8, 2023
…date_at value provided for issue by github allowing us to make non-normative edits to issues and preserve the date of the last normative change to the issue. See tdwg/bdq#140 for an example.
@chicoreus chicoreus added the CORE TG2 CORE tests label Sep 18, 2023
@chicoreus
Copy link
Collaborator

Added reference to https://xkcd.com/2867/ to note. This can probably also be added as a citation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CODED CORE TG2 CORE tests Measure Test Tests created by TG2, either CORE, Supplementary or DO NOT IMPLEMENT TG2 TIME
Development

No branches or pull requests

7 participants