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-VALIDATION_COUNTRYCODE_STANDARD #20

Open
iDigBioBot opened this issue Jan 5, 2018 · 42 comments
Open

TG2-VALIDATION_COUNTRYCODE_STANDARD #20

iDigBioBot opened this issue Jan 5, 2018 · 42 comments
Labels
Conformance CORE TG2 CORE tests ISO/DCMI STANDARD SPACE Test Tests created by TG2, either CORE, Supplementary or DO NOT IMPLEMENT TG2 Validation VOCABULARY

Comments

@iDigBioBot
Copy link
Collaborator

iDigBioBot commented Jan 5, 2018

TestField Value
GUID 0493bcfb-652e-4d17-815b-b0cce0742fbe
Label VALIDATION_COUNTRYCODE_STANDARD
Description Is the value of dwc:countryCode a valid ISO 3166-1-alpha-2 country code?
TestType Validation
Darwin Core Class dcterms:Location
Information Elements ActedUpon dwc:countryCode
Information Elements Consulted
Expected Response EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if the dwc:countryCode is bdq:Empty; COMPLIANT if dwc:countryCode can be unambiguously interpreted as a valid ISO 3166-1-alpha-2 country code in the bdq:sourceAuthority; otherwise NOT_COMPLIANT
Data Quality Dimension Conformance
Term-Actions COUNTRYCODE_STANDARD
Parameter(s)
Source Authority bdq:sourceAuthority default = "ISO 3166 Country Codes" {[https://www.iso.org/iso-3166-country-codes.html]} {ISO 3166-1-alpha-2 Country Code search [https://www.iso.org/obp/ui/#search]}
Specification Last Updated 2024-09-19
Examples [dwc:countryCode="GL": Response.status=RUN_HAS_RESULT, Response.result=COMPLIANT, Response.comment="dwc:countryCode is a valid ISO (ISO 3166-1-alpha-2 country codes) value"]
[dwc:countryCode="GRL": Response.status=RUN_HAS_RESULT, Response.result=NOT_COMPLIANT, Response.comment="dwc:countryCode is NOT a valid ISO (ISO 3166-1-alpha-2 country codes) value"]
Source TG2
References
Example Implementations (Mechanisms)
Link to Specification Source Code
Notes Locations outside of a jurisdiction covered by a country code may have a value in the field dwc:countryCode, the ISO user defined codes include XZ used by the UN for installations on the high seas and suitable for a marker for the high seas. Also available in the ISO user defined codes is ZZ, used by GBIF to mark unknown countries. This test should accept both XZ and ZZ as COMPLIANT country codes. This test must return NOT_COMPLIANT if there is leading or trailing whitespace or there are leading or trailing non-printing characters.
@iDigBioBot
Copy link
Collaborator Author

Comment by Lee Belbin (@Tasilee) migrated from spreadsheet:
Added post scoring for consistency

@ArthurChapman
Copy link
Collaborator

ArthurChapman commented Jan 16, 2018

Question from Gainesville meeting: what about records outside of country jurisdiction (e.g. Hugh seas). If material is from high seas - country code should be empty. Description altered to: If the dwc:countryCode contains a value but that value is not a valid ISO Code. Pass description is EMPTY if has a valid ISO Code.

We need a standard formalisation of what we mean by "EMPTY" which includes Empty, NULL, /N etc. Use EMPTY in all caps

@chicoreus
Copy link
Collaborator

This test should not be parameterized. Different users will not wish to apply different ISO country codes. The parameterized resource that provides a service for country code lookup is one (which we could recommend, though I suggest not, rather just mention) way of implementing this test, however most implementors will almost certainly want to work with a local data structure that holds the short list of valid country codes rather than making requests to a service on each data record. This parameter is (1) straying too far into forcing a particular form of implementation on implementors, and (2) requiring a parameterized version of the test when none is needed as all use cases refer to the same ISO country code list.

@ArthurChapman
Copy link
Collaborator

I have no idea why this is paramaterized. Particularly when the description says "dwc:countryCode is a valid ISO (ISO 3166-1-alpha-2 country codes)" @tucotuco - you paramaterized this - what was the thinking behind that?

@tucotuco
Copy link
Member

tucotuco commented Sep 5, 2019

I concur that this test should not be parametrized.

@ArthurChapman ArthurChapman removed the Parameterized Test requires a parameter label Sep 5, 2019
@ArthurChapman
Copy link
Collaborator

Removed paramaterized, added new references (Is the one I have listed as bbq:sourceAuthority - the best one here?)

@tucotuco
Copy link
Member

tucotuco commented Sep 6, 2019

To me, the best source is https://restcountries.eu/#api-endpoints-list-of-codes, simply because they have an API. I don't think it will matter too much. This is a straightforward controlled vocabulary.

@Tasilee
Copy link
Collaborator

Tasilee commented Sep 8, 2019

@tucotuco: Agreed.

@Tasilee
Copy link
Collaborator

Tasilee commented Jun 29, 2023

I agree, and wouldn't this apply also to

#38, #133
bdq:sourceAuthority default = "Creative Commons" [https://creativecommons.org/]

#62, #48

bdq:sourceAuthority is "ISO 3166-1-alpha-2" [https://restcountries.eu/#api-endpoints-list-of-codes, https://www.iso.org/obp/ui/#search]

and possibly a few more?

@Tasilee
Copy link
Collaborator

Tasilee commented Jun 30, 2023

References need checking as restcountries.eu is no longer there. We will need a link check through all of the issues.

@ArthurChapman
Copy link
Collaborator

Suggested possibly using https://rapidapi.com/ajayakv/api/rest-countries - awaiting feedback

@ArthurChapman
Copy link
Collaborator

Updated References

@Tasilee
Copy link
Collaborator

Tasilee commented Jul 4, 2023

Added Source Authority value as " {bdq:sourceAuthority = ISO 3166-1-alpha-2} { Country codes [https://dwc.tdwg.org/terms/#dwc:basisOfRecord]](https://www.iso.org/obp/ui/#search]}"

for now.

@Tasilee
Copy link
Collaborator

Tasilee commented Jul 4, 2023

Amended Source Authority to align with @chicoreus suggested syntax

{bdq:sourceAuthority = ISO 3166-1-alpha-2} { Country codes [https://www.iso.org/obp/ui/#search]}

to

bdq:sourceAuthority default = "ISO 3166-1-alpha-2 country codes" { [https://www.iso.org/obp/ui/#search]}

@Tasilee
Copy link
Collaborator

Tasilee commented Jul 10, 2023

Corrected syntax on Source Authority

@Tasilee
Copy link
Collaborator

Tasilee commented Jul 10, 2023

Changed Expected response from

EXTERNAL_PREREQUISITES_NOT_MET if a configured service for checking ISO 3166 country codes is not available; INTERNAL_PREREQUISITES_NOT_MET if the dwc:countryCode was EMPTY; COMPLIANT if it can be unambiguously interpreted as a ISO 3166-1-alpha-2; otherwise NOT_COMPLIANT

to

EXTERNAL_PREREQUISITES_NOT_MET if a configured service for checking ISO 3166 country codes is not available; INTERNAL_PREREQUISITES_NOT_MET if the dwc:countryCode was EMPTY; COMPLIANT if it can be unambiguously interpreted as an ISO 3166-1-alpha-2 country code; otherwise NOT_COMPLIANT

and removed reference to bdq:sourceAuthority in Source Authority

@Tasilee
Copy link
Collaborator

Tasilee commented Jul 16, 2023

Due to recent discussions, changed

EXTERNAL_PREREQUISITES_NOT_MET if a configured service for checking ISO 3166 country codes is not available; INTERNAL_PREREQUISITES_NOT_MET if the dwc:countryCode was EMPTY; COMPLIANT if it can be unambiguously interpreted as a ISO 3166-1-alpha-2 country code; otherwise NOT_COMPLIANT

to

EXTERNAL_PREREQUISITES_NOT_MET if bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if the dwc:countryCode was EMPTY; COMPLIANT if dwc:countryCode can be unambiguously interpreted as an ISO 3166-1-alpha-2 country code; otherwise NOT_COMPLIANT

and Source Authority from blank to

bdq:sourceAuthority default = "ISO 3166 Country Codes" {[https://www.iso.org/iso-3166-country-codes.html]} {ISO 3166-1-alpha-2 Country Code search [https://www.iso.org/obp/ui/#search]}

and updated Specification Last Updated

@Tasilee
Copy link
Collaborator

Tasilee commented Sep 16, 2023

I'm making a start on splitting bdqffdq:Information Elements into "Information Elements ActedUpon" and "Information Elements Consulted". I am working through the tests in numerical sequence. Please check.

@ArthurChapman
Copy link
Collaborator

Does that affect Specification Last Updated?

@Tasilee
Copy link
Collaborator

Tasilee commented Sep 16, 2023

I was wondering about that. Paul Call?

@chicoreus chicoreus added the CORE TG2 CORE tests label Sep 18, 2023
@Tasilee
Copy link
Collaborator

Tasilee commented Sep 21, 2023

Removed TestField "Warning Type" as it highly correlates with "Data Quality Dimension". I will be working through the 99 CORE tests making this change but will not add separate Comments, so to reduce another round of email notifications.

@chicoreus
Copy link
Collaborator

Updated notes to replace "fail" with more explicit: This test must return NOT_COMPLIANT if there is leading or trailing whitespace or there are leading or trailing non-printing characters.

@Tasilee
Copy link
Collaborator

Tasilee commented Apr 7, 2024

Playing with this test as an example for the Example Use Case (replaced 'Source')

@Tasilee
Copy link
Collaborator

Tasilee commented Apr 12, 2024

Recent discussions by the team resulted in recommendations for how we handle Use Cases. This test is an example template for all other tests (CORE, Supplementary, DO NOT IMPLEMENT and Immature/Incomplete) and will not be further commented.

The Use Cases will be documented in the form of Label - Description in the Vocabulary (#152).

Use Case being Informative (non-normative), we will not update 'Specification Last Updated'. Speak now or forever ....

@chicoreus
Copy link
Collaborator

chicoreus commented Apr 12, 2024 via email

@Tasilee
Copy link
Collaborator

Tasilee commented Apr 15, 2024

Changed "was" to "is" to align with standard phrasing in ER as in "INTERNAL_PREREQUISITES_NOT_MET if xxx is EMPTY"

chicoreus added a commit to FilteredPush/geo_ref_qc that referenced this issue Aug 19, 2024
@chicoreus
Copy link
Collaborator

Discussion of how to mark the high seas in TG2 working group meeting in Seattle: Options are "High Seas" in dwc:country, used by three institutions feeding data to GBIF for about 60k occurrences, a three letter country code BNJ (beyond national jurisdiction) used by OBIS (along with BBNJ for biological material beyond national jurisdition), or the UN use of the User assigned codes in the ISO country code standard of XZ for installations on the high seas, in some use for marking origins from the high seas.

dwc:countryCode=XZ, country="" appears the best means to mark occurrences as being in the high seas, this is consistent with the darwin core specification of ISO country code values.

@Tasilee
Copy link
Collaborator

Tasilee commented Aug 20, 2024

Thanks to @davewatts3 for raising the BBJ and BBNJ possibilities which we have noted. Hopefully we get some solution to this in the future.

@Tasilee
Copy link
Collaborator

Tasilee commented Sep 18, 2024

The Expected Response/Specification in this test is now the only odd one in that it references both bdq:sourceAuthority and ISO 3166-1-alpha-2 when the former is the latter, which I think could be confusing:

EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if the dwc:countryCode is bdq:Empty; COMPLIANT if dwc:countryCode can be unambiguously interpreted as a valid ISO 3166-1-alpha-2 country code; otherwise NOT_COMPLIANT

We have at least three instances where it is probably better phrased: #199, #200 and #201.

Thoughts?

@chicoreus
Copy link
Collaborator

chicoreus commented Sep 18, 2024 via email

@Tasilee
Copy link
Collaborator

Tasilee commented Sep 18, 2024

To align the Expected Response/Specification with the standard pattern, I've changed it from

EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if the dwc:countryCode is bdq:Empty; COMPLIANT if dwc:countryCode can be unambiguously interpreted as a valid ISO 3166-1-alpha-2 country code; otherwise NOT_COMPLIANT

to

EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if the dwc:countryCode is bdq:Empty; COMPLIANT if dwc:countryCode can be unambiguously interpreted as a valid ISO 3166-1-alpha-2 country code in the bdq:sourceAuthority; otherwise NOT_COMPLIANT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Conformance CORE TG2 CORE tests ISO/DCMI STANDARD SPACE Test Tests created by TG2, either CORE, Supplementary or DO NOT IMPLEMENT TG2 Validation VOCABULARY
Projects
None yet
Development

No branches or pull requests

5 participants