Skip to content

Commit

Permalink
Work in progress updating tests and metadata to current (2023-06-26) …
Browse files Browse the repository at this point in the history
…tdwg/bdq specifications. Updated metadata (added ProvidesVersion and Specification) for tdwg/bdq#46 VALIDATION_SCIENTIFICNAME_FOUND Removed reviewed stub method.
  • Loading branch information
chicoreus committed Jul 2, 2023
1 parent df55053 commit 9ecc3c4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 37 deletions.
12 changes: 7 additions & 5 deletions src/main/java/org/filteredpush/qc/sciname/DwCSciNameDQ.java
Original file line number Diff line number Diff line change
Expand Up @@ -179,13 +179,16 @@ public static DQResponse<ComplianceValue> validationFamilyFound(@ActedUpon("dwc:
* Is there a match of the contents of dwc:scientificName with bdq:sourceAuthority?
*
* Provides: #46 VALIDATION_SCIENTIFICNAME_FOUND
* Version: 2022-03-22
*
* @param scientificName the provided dwc:scientificName to evaluate
* @param sourceAuthority the bdq:sourceAuthority to consult, defaults to GBIF Backbone Taxonomy if null
* @return DQResponse the response of type ComplianceValue to return
*/
@Validation(label="VALIDATION_SCIENTIFICNAME_FOUND", description="Is there a match of the contents of dwc:scientificName with bdq:sourceAuthority?")
@Provides("3f335517-f442-4b98-b149-1e87ff16de45")
@ProvidesVersion("https://rs.tdwg.org/bdq/terms/3f335517-f442-4b98-b149-1e87ff16de45/2022-03-22")
@Specification("EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if dwc:scientificName is EMPTY; COMPLIANT if there is a match of the contents of dwc:scientificName with the bdq:sourceAuthority; otherwise NOT_COMPLIANT bdq:sourceAuthority default = 'GBIF Backbone Taxonomy' [https://doi.org/10.15468/39omei],API endpoint [https://api.gbif.org/v1/species?datasetKey=d7dddbf4-2cf0-4f39-9b2a-bb099caae36c&name=]")
public static DQResponse<ComplianceValue> validationScientificnameFound(
@ActedUpon("dwc:scientificName") String scientificName,
@Parameter(name="bdq:sourceAuthority") SciNameSourceAuthority sourceAuthority
Expand All @@ -199,13 +202,12 @@ public static DQResponse<ComplianceValue> validationScientificnameFound(
// is not available; INTERNAL_PREREQUISITES_NOT_MET if dwc:scientificName
// is EMPTY; COMPLIANT if there is a match of the contents
// of dwc:scientificName with the bdq:sourceAuthority; otherwise
// NOT_COMPLIANT bdq:sourceAuthority default = "GBIF Backbone
// Taxonomy" [https://doi.org/10.15468/39omei], "API endpoint"
// [https://api.gbif.org/v1/species?datasetKey=d7dddbf4-2cf0-4f39-9b2a-bb099caae36c&name=]
//
// NOT_COMPLIANT

// Parameters. This test is defined as parameterized.
// bdq:sourceAuthority default="GBIF Backbone Taxonomy"
// bdq:sourceAuthority default = "GBIF Backbone Taxonomy"
// [https://doi.org/10.15468/39omei], "API endpoint"
// [https://api.gbif.org/v1/species?datasetKey=d7dddbf4-2cf0-4f39-9b2a-bb099caae36c&name=]

if (sourceAuthority==null) {
try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,15 @@ public static DQResponse<ComplianceValue> validationFamilyFound(@ActedUpon("dwc:
* where bdq:sourceAuthority is the default GBIF Backbone Taxonomy.
*
* Provides: #46 VALIDATION_SCIENTIFICNAME_FOUND
* Version: 2022-03-22
*
* @param scientificName the provided dwc:scientificName to evaluate
* @return DQResponse the response of type ComplianceValue to return
*/
@Validation(label="VALIDATION_SCIENTIFICNAME_FOUND", description="Is there a match of the contents of dwc:scientificName with bdq:sourceAuthority?")
@Provides("3f335517-f442-4b98-b149-1e87ff16de45")
@ProvidesVersion("https://rs.tdwg.org/bdq/terms/3f335517-f442-4b98-b149-1e87ff16de45/2022-03-22")
@Specification("EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if dwc:scientificName is EMPTY; COMPLIANT if there is a match of the contents of dwc:scientificName with the bdq:sourceAuthority; otherwise NOT_COMPLIANT bdq:sourceAuthority default = 'GBIF Backbone Taxonomy' [https://doi.org/10.15468/39omei],API endpoint [https://api.gbif.org/v1/species?datasetKey=d7dddbf4-2cf0-4f39-9b2a-bb099caae36c&name=]")
public static DQResponse<ComplianceValue> validationScientificnameFound(@ActedUpon("dwc:scientificName") String scientificName) {
return validationScientificnameFound(scientificName, null);
}
Expand Down
32 changes: 0 additions & 32 deletions src/main/java/org/filteredpush/qc/sciname/DwCSciNameDQ_stubs.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,6 @@
@Mechanism(value="90516df7-838c-4d53-81d9-8131be6ac713",label="Kurator: Scientific Name Validator - DwCSciNameDQ:v1.0.1-SNAPSHOT")
public class DwCSciNameDQ_stubs {

/**
* Is there a match of the contents of dwc:scientificName with bdq:sourceAuthority?
*
* Provides: VALIDATION_SCIENTIFICNAME_FOUND
* Version: 2022-03-22
*
* @param scientificName the provided dwc:scientificName to evaluate
* @return DQResponse the response of type ComplianceValue to return
*/
@Validation(label="VALIDATION_SCIENTIFICNAME_FOUND", description="Is there a match of the contents of dwc:scientificName with bdq:sourceAuthority?")
@Provides("3f335517-f442-4b98-b149-1e87ff16de45")
@ProvidesVersion("https://rs.tdwg.org/bdq/terms/3f335517-f442-4b98-b149-1e87ff16de45/2022-03-22")
@Specification("EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority is not available; INTERNAL_PREREQUISITES_NOT_MET if dwc:scientificName is EMPTY; COMPLIANT if there is a match of the contents of dwc:scientificName with the bdq:sourceAuthority; otherwise NOT_COMPLIANT bdq:sourceAuthority default = 'GBIF Backbone Taxonomy' [https://doi.org/10.15468/39omei],API endpoint [https://api.gbif.org/v1/species?datasetKey=d7dddbf4-2cf0-4f39-9b2a-bb099caae36c&name=]")
public DQResponse<ComplianceValue> validationScientificnameFound(@ActedUpon("dwc:scientificName") String scientificName) {
DQResponse<ComplianceValue> result = new DQResponse<ComplianceValue>();

//TODO: Implement specification
// EXTERNAL_PREREQUISITES_NOT_MET if the bdq:sourceAuthority
// is not available; INTERNAL_PREREQUISITES_NOT_MET if dwc:scientificName
// is EMPTY; COMPLIANT if there is a match of the contents
// of dwc:scientificName with the bdq:sourceAuthority; otherwise
// NOT_COMPLIANT bdq:sourceAuthority default = "GBIF Backbone
// Taxonomy" [https://doi.org/10.15468/39omei],API endpoint
// [https://api.gbif.org/v1/species?datasetKey=d7dddbf4-2cf0-4f39-9b2a-bb099caae36c&name=]
//

//TODO: Parameters. This test is defined as parameterized.
// bdq:sourceAuthority

return result;
}

/**
* Propose amendment to the value of dwc:taxonID if it can be unambiguously resolved from bdq:sourceAuthority using the available taxon terms.
*
Expand Down

0 comments on commit 9ecc3c4

Please sign in to comment.