bdq icon indicating copy to clipboard operation
bdq copied to clipboard

TG2-VALIDATION_COUNTRYCOUNTRYCODE_CONSISTENT

Open iDigBioBot opened this issue 7 years ago • 24 comments

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
  • ISO (n.dat.) ISO 3166 Country Codes. https://www.iso.org/iso-3166-country-codes.html
  • ISO (n.dat.) ISO 3166 Country Codes. https://www.iso.org/iso-3166-country-codes.html/li>
  • DataHub (2018) List of all countries with their two digit codes (ISO 3166-1). https://datahub.io/core/country-list
  • Chapman AD and Wieczorek JR (2020) Georeferencing Best Practices. Copenhagen: GBIF Secretariat. https://doi.org/10.15468/doc-gg7h-s853
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.

iDigBioBot avatar Jan 05 '18 15:01 iDigBioBot

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.

iDigBioBot avatar Jan 05 '18 15:01 iDigBioBot

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

iDigBioBot avatar Jan 12 '18 16:01 iDigBioBot

Comment by Paul Morris (@chicoreus) migrated from spreadsheet: Rename: COUNTRY_COUNTRYCODE_CONSISTENT

iDigBioBot avatar Jan 12 '18 16:01 iDigBioBot

Added to Notes: "This test will fail if there are leading or trailing white space or non-printing characters."

Tasilee avatar Sep 12 '22 02:09 Tasilee

Should the Expected Response make a reference to bdq:sourceAuthority or to "ISO 3166-1-alpha-2"? Most similar tests do. @chicoreus @Tasilee

ArthurChapman avatar Jun 27 '23 23:06 ArthurChapman

@ArthurChapman yes, it should.

chicoreus avatar Jun 28 '23 10:06 chicoreus

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 |

ArthurChapman avatar Jun 28 '23 23:06 ArthurChapman

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.

Tasilee avatar Jul 04 '23 00:07 Tasilee

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 avatar Jul 04 '23 22:07 Tasilee

Corrected syntax on Source Authority

Tasilee avatar Jul 10 '23 20:07 Tasilee

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]}

Tasilee avatar Jul 16 '23 23:07 Tasilee

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"

Tasilee avatar Sep 18 '23 00:09 Tasilee

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.

chicoreus avatar Feb 23 '24 20:02 chicoreus