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

G4.58 - Phenotypes Share Values Validator #58

Open
reynoldtan opened this issue Dec 4, 2023 · 3 comments
Open

G4.58 - Phenotypes Share Values Validator #58

reynoldtan opened this issue Dec 4, 2023 · 3 comments
Labels
Group 4 - API | Services | Plugins Any issue related to developing an API (i.e. services + plugins)

Comments

@reynoldtan
Copy link
Contributor

reynoldtan commented Dec 4, 2023

Branch

g4.58-Phenoshare-Values-Validator

Groups

Group 4 - API | Services | Plugins

Describe

Focuses on validating values in a data file submitted to Tripal Cultivate Phenotypes Share Importer.

There is a Plugin Type for validators which was created as part of #37. Each type of validation we want to do is an instance of this plugin. A scope is assigned to each validator instance to indicate what part of the file it validates and the order it should be in.

This issue is to design validator instances focused on validating the new phenotypes file format. The first attempt of this by Reynold, validated all values/columns in the file in a single validator. However, we would like to move to a different model.

Design

Create an instance of validator plugin: PhenoShareImportValues

 * @TripalCultivatePhenotypesValidator(
 *   id = "trpcultivate_phenotypes_validator_share_values",
 *   validator_name = @Translation("Phenoypes Share Importer Values Validator"),
 *   validator_scope = "SHARE IMPORT VALUES",
 * )

The plugin will validate the following:

  1. Trait Name - Trait name exists in the cv configured for trait in the genus selected. This column is required.
  2. Method Name - Method name exists in cv configured for method in the genus selected and is one of the methods paired to the trait name. This column is required.
  3. Unit - Unit must exists in the cv configured for the unit in the genus selected. This column is required.
  4. Germplasm Accession - Must exists in chado.stock table. This column is required.
  5. Germplasm Name - Must exists in chado.stock table. This column is required
  6. Year - A four digit value and must not exceed the current year. This column is required.
  7. Replicate - an integer value. This column is required
  8. Value - Use the unit data type to determine the data type for this column. A quantitative unit will require numeric value whereas qualitative value will be descriptive text. This column is required
  9. Data Collector - String, name of a person, institute or organization. This column is required.
@reynoldtan reynoldtan added the Group 4 - API | Services | Plugins Any issue related to developing an API (i.e. services + plugins) label Dec 4, 2023
@reynoldtan reynoldtan self-assigned this Dec 4, 2023
@laceysanderson
Copy link
Member

Here are the files from Reynolds first attempt at this:

These have been removed from the linked PR to allow it to be merged.
We are going another direction here with a row-level validator rather then needing a helper and each validator looping through the entire file. Also the columns are changing which changes this validation in particular.

That said, there is important code in these files that will be useful so I am attaching them here for use later.

@laceysanderson
Copy link
Member

Note: The validator plugin API was set up in this PR: #37 and the following PRs are examples of simple validator plugin instances: #48, #47, #41.

@reynoldtan
Copy link
Contributor Author

This issue relates to Phenotypes Share, but the new model relating to validator plugin API is an ongoing work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Group 4 - API | Services | Plugins Any issue related to developing an API (i.e. services + plugins)
Projects
None yet
Development

No branches or pull requests

3 participants