Group 2 - Data Importing, Group 4 - API | Services | Plugins
Describe
After spending time thinking about/discussing how to organize plugin instances for validating the phenotype share importer, we realized that the plugin instance to validate columns in the trait importer could be split up into 3 separate instances:
Empty values
That the combination of Trait Name + Method Short Name + Unit is not duplicated within the datafile or the database
The column "Type" contains either the value "Qualitative" or "Quantitative"
See issue #53 for the original design of the current validators
Design
The current validator class TraitImportValues (TraitImportValues.php) will be divided into the following 3 classes:
EmptyCell
DuplicateTraits
TraitTypeColumn
These 3 classes will all be under the scope of "FILE ROW" and the "TRAIT IMPORT VALUES" scope will be removed.
Empty Cell: Currently checks for individual empty cells and if the file is missing data rows (ie. only has a header). We will want to limit this plugin instance to check individual cells, and relocate the functionality check for data rows to another pre-existing plugin or new one altogether. Additionally, we will want a way to specify which cells are allowed to be empty, as this will be the case for other importers that will use this plugin instance.
Duplicate Traits: Currently only checks for duplicate traits in the file. Since this is provided the scope of a row in the file, it will need to keep track of traits that were already processed before it in addition to checking if the trait + method + unit combo already exists at the database level.
TraitTypeColumn: Our plan is to make this validator highly generic in the hopes it can be re-used for the phenotype importers. Renamed to something like "ValidValueFromList"? In addition to being provided with a single row from the input file, the $context array will contain:
indices: an array of indices for which the value is being checked
valid_values: an array of values that are valid for the cell located in any of the indices in the indices array
Branch
g4.76-divideTraitImportValue
Groups
Group 2 - Data Importing, Group 4 - API | Services | Plugins
Describe
After spending time thinking about/discussing how to organize plugin instances for validating the phenotype share importer, we realized that the plugin instance to validate columns in the trait importer could be split up into 3 separate instances:
See issue #53 for the original design of the current validators
Design
The current validator class TraitImportValues (
TraitImportValues.php
) will be divided into the following 3 classes:These 3 classes will all be under the scope of "FILE ROW" and the "TRAIT IMPORT VALUES" scope will be removed.
Empty Cell: Currently checks for individual empty cells and if the file is missing data rows (ie. only has a header). We will want to limit this plugin instance to check individual cells, and relocate the functionality check for data rows to another pre-existing plugin or new one altogether. Additionally, we will want a way to specify which cells are allowed to be empty, as this will be the case for other importers that will use this plugin instance.
Duplicate Traits: Currently only checks for duplicate traits in the file. Since this is provided the scope of a row in the file, it will need to keep track of traits that were already processed before it in addition to checking if the trait + method + unit combo already exists at the database level.
TraitTypeColumn: Our plan is to make this validator highly generic in the hopes it can be re-used for the phenotype importers. Renamed to something like "ValidValueFromList"? In addition to being provided with a single row from the input file, the $context array will contain: