bdq
bdq copied to clipboard
TG2-VALIDATION_COUNTRYCOUNTRYCODE_CONSISTENT
| TestField | Value |
|---|---|
| GUID | b23110e7-1be7-444a-a677-cdee0cf4330c |
| Label | VALIDATION_COUNTRYCOUNTRYCODE_CONSISTENT |
| Description | Does the ISO country code, determined from the value of dwc:country, equal the value of dwc:countryCode? |
| TestType | Validation |
| Darwin Core Class | dcterms:Location |
| Information Elements ActedUpon | dwc:country |
| dwc:countryCode | |
| Information Elements Consulted | |
| Expected Response | EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if either of the terms dwc:country or dwc:countryCode are bdq:Empty; COMPLIANT if the values of dwc:country and dwc:countryCode match national-level country name and matching country code respectively in the bdq:sourceAuthority |
| Data Quality Dimension | Consistency |
| Term-Actions | COUNTRYCOUNTRYCODE_CONSISTENT |
| Parameter(s) | |
| Source Authority | bdq:sourceAuthority default = "The Getty Thesaurus of Geographic Names (TGN)" {[https://www.getty.edu/research/tools/vocabularies/tgn/index.html]} |
| Specification Last Updated | 2024-09-25 |
| Examples | [dwc:country="Australia", dwc:countryCode="AU": Response.status=RUN_HAS_RESULT, Response.result=COMPLIANT, Response.comment="dwc:country matches dwc:countryCode"] |
| [dwc:country="United States Minor Outlying Islands", dwc:countryCode="US": Response.status=RUN_HAS_RESULT, Response.result=NOT_COMPLIANT, Response.comment="dwc:country does not match dwc:countryCode"] | |
| Source | GBIF |
| References |
|
| Example Implementations (Mechanisms) | |
| Link to Specification Source Code | |
| Notes | The country code determination service should be able to match the name of a country in the original or any language in the source authority. When dwc:countryCode="XZ" to mark the high seas, country should be empty until a time when a dwc:country="High seas" or similar is adopted. This test must return NOT_COMPLIANT if there is leading or trailing whitespace or there are leading or trailing non-printing characters. |
Comment by Paula Zermoglio (@pzermoglio) migrated from spreadsheet: In the cases when country was derived from coordinates, this would only make sense AFTER that step.
Comment by Paul Morris (@chicoreus) migrated from spreadsheet: In the example given, country=Australia, countryCode=4, I would expect this validation to return a result status INTERNAL_PREREQUISITES_NOT_MET, as 4 is not a valid ISO 2 letter or 3 letter country code or three digit country code (004 would be), and thus can't be compared with "Australia". A better example might be country=Australia, countryCode=GM. Specification should note specific acceptable controlled vocabularies for countryCode
Comment by Paul Morris (@chicoreus) migrated from spreadsheet: Rename: COUNTRY_COUNTRYCODE_CONSISTENT
Added to Notes: "This test will fail if there are leading or trailing white space or non-printing characters."
Should the Expected Response make a reference to bdq:sourceAuthority or to "ISO 3166-1-alpha-2"? Most similar tests do. @chicoreus @Tasilee
@ArthurChapman yes, it should.
Updated Expected Response (add bolded text) and updated Specification Last Updated
EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if either of the terms dwc:country or dwc:countryCode are EMPTY; COMPLIANT if the value of the country code determined from the value of dwc:country from the bdq:sourceAuthority is equal to the value of dwc:countryCode; otherwise NOT_COMPLIANT |
Changed Source Authority value from
bdq:sourceAuthority is "ISO 3166-1-alpha-2" [https://restcountries.eu/#api-endpoints-list-of-codes, https://www.iso.org/obp/ui/#search]
to
{bdq:sourceAuthority = ISO 3166-1-alpha-2} { Country codes [https://www.iso.org/obp/ui/#search]}
to align syntax and provide a better link.
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]}
Corrected syntax on Source Authority
Changed Source Authority from
bdq:sourceAuthority default = "ISO 3166-1-alpha-2 country codes" {[https://www.iso.org/obp/ui/#search]}
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]}
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"
Updated notes to change "fail" text to more explict "This test must return NOT_COMPLIANT if there is leading or trailing whitespace or there are leading or trailing non-printing characters." The expected response is clear about exact matching, so this applies.