-
Notifications
You must be signed in to change notification settings - Fork 7
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-VALIDATION_STARTDAYOFYEAR_INRANGE #130
Comments
Like #131, the information element should not include dwc:eventDate. |
Note that the current specification will lead to a very large number of cases of internal prerequisites not met that can be asserted as compliant. We really only need to evaluate year when start day of year = 366. I would advocate changing from:
to:
This lets startDayOfYear=5, year=null be reported as compliant, matching the intent of the test to assess whether startDayOfYear is inside a valid range. Year only needs to be examined if day is 366. |
Makes sense to me @chicoreus |
@chicoreus Do you mean 366 and not 365 in your new text of Expected Response? We have assumed you meant 366 |
@ArthurChapman yes, 366. |
…dwg/bdq#84 tdwg/bdq#26 tdwg/bdq#130 tdwg/bdq#61 PURPOSE: Updating tests to reflect updates in definitions and latest discussion in tdwg/bdq issues. DESCRIPTION: Removing confirmed unused isMonthInRange() method. Updating VALIDATION_STARTDAYOFYEAR_OUTOFRANGE to match new specification. Switching from #141 to #84 to test year for valid range. Correcting handling of ambiguity in AMENDMENT_EVENTDATE_STANDARDIZED and AMENDMENT_DATEIDENTIFIED_STANDARDIZED to conform with specifications.
On further consideration, this one still has problems. I would replace the current Expected response "INTERNAL_PREREQUISITES_NOT_MET if dwc:startDayOfYear is EMPTY, or if the value of dwc:startDayOfYear = 366 and the value of dwc:year is EMPTY; COMPLIANT if the value of dwc:startDayOfYear is a valid day given the year; otherwise NOT_COMPLIANT" with "INTERNAL_PREREQUISITES_NOT_MET if dwc:startDayOfYear is EMPTY or if the value of dwc:startDayOfYear is equal to 366 and (dwc:eventDate is EMPTY or the value of dwc:eventDate can not be interpreted to find single year or a start year in a range); COMPLIANT if the value of dwc:startDayOfYear is an integer between 1 and 365, inclusive, or if the value of dwc:startDayOfYear is 366 and the start year interpreted from dwc:eventDate is a leap year (see test VALIDATION_DAY_OUTOFRANGE); otherwise NOT_COMPLIANT" I would change the example from dwc:startDayOfYear="451"; dwc:startDayOfYear="366" with dwc:year="2017" to dwc:startDayOfYear="451"; dwc:startDayOfYear="366" with dwc:eventDate="2017" I would change the Note from: "This test must take into account the given year, if present, to account for leap years. This is part of a group of similar tests (#125, #130, #131). This test should be run after the test TG2-AMENDMENT_EVENT_FROM_EVENTDATE (#52)" to "This test only asks if startDayOfYear is a valid value for the relevant year, not if it is consistent with the start day of the range specified in dwc:eventDate. In a non-leap year, the valid range is 1-365 inclusive, in a leap year 366 is also valid. This test should be run after the series of tests that assure that dwc:eventDate is populated, if possible (i.e., AMENDMENT_EVENTDATE_FROM_VERBATIM , AMENDMENT_EVENTDATE_STANDARDIZED, and AMENDMENT_EVENT_DATE_FROM_YEARMONTHDAY)." For Information Elements I would remove dwc:year and instead include dwc:eventDate. I would also remove the following from References (see issue #184), dwc:startDayOfYear (https://rs.tdwg.org/dwc/terms/index.htm#startDayOfYear) |
Under #125 we go into great detail on what constitutes a Leap Year - but here we just say "start year interpreted from dwc:eventDate is a leap year" Should we be consistent? |
Looking back at @tucotuco's last comment - ideally we would have an order in which tests are run, but we decided against that and that every test had to be standalone. |
Looking at the test dataset - as written leap year is only determined from dwc:eventDate - should we not include "or year". For example - in the test data we currently have an example dwc:dateIdentified="", dwc:day="", dwc:month="", dwc:year="2004", dwc:eventDate="", dwc:verbatimEventDate="", dwc:startDayOfYear="366", dwc:endDayOfYear="366"@Tasilee had this as COMPLIANT - but from the wording above is INTERNAL_PREREQUISTES_NOT_MET because dwc:eventDate is EMPTY |
There was a diagram we drew in Ganesville that lead us to the conclusion - test a term against eventDate, not all of the other possible places where date data might be stored. Then separately test for consistency among the Event terms, and separately try to fill in an empty eventDate from the other event terms. If we follow this pattern (as we do) across the tests, then the tests become much more easily defined, and still work well, particularly when run in pre-amendment, amendment, and post-amendment phases. So I'd say the @ArthurChapman example from @Tasilee should indeed assert INTERNAL_PREREQUISITES_NOT_MET, not compliant. |
I concur. |
…sts to current specifications. DESCRIPTION: Updating implementation of VALIDATION_STARTDAYOFYEAR_OUTOFRANGE to updated (2022-03-10) specification, adding and fixing unit tests to confirm with current specification. Removing instead of deprecating and using as wrapper previous startDayOfYearInRangeForYear() method, as it takes year instead of eventDate and can't conform to the current standard. Updating implementation and fixing unit tests for VALIDATION_DAY_NOTSTANDARD to conform with current specification.
Changed Note - changed "VALIDATION_DAY_OUTOFRANGE to VALIDATION_DAY_INRANGE", added GUIDs to all the references to tests and changed "startDayOfYear" to "dwc:startDayOfYear" |
Splitting bdqffdq:Information Elements into "Information Elements ActedUpon" and "Information Elements Consulted". Also changed "Field" to "TestField", "Output Type" to "TestType" and updated "Specification Last Updated" |
The text was updated successfully, but these errors were encountered: