<<

NAME

ProductOpener::DataQuality - check the quality of data for products

SYNOPSIS

ProductOpener::DataQuality is used to check the quality of the data of products when they are updated.

    use ProductOpener::DataQuality qw/:all/;
        check_quality($product_ref);

        if (has_tag($product_ref, "data_quality", "en:nutrition-value-total-over-105")) {
                print STDERR "The nutrition facts values are incorrect.";
        }

check_quality() populates the data_quality_[bugs|info|warnings|errors]_tags arrays and sub-facets:

- /data-quality-bugs : data issues that are due to bugs in the software (and not bad data entered by users or supplied by producers)

- /data-quality-info : info about product data that does not indicate that there is an error

- /data-quality-warnings : indications that there may be an error in the data (but it is not certain)

- /data-quality-errors : errors in the product data

The values of all sub-facets are also combined in the data_quality_tags array and /data-quality facet.

check_quality() is run each time products are updated. It can also be run through the scripts/update_all_products.pl script.

DESCRIPTION

ProductOpener::DataQuality uses submodules to check quality issues that can affect different types of products:

ProductOpener::DataQualityCommon for all types of products.

ProductOpener::DataQualityFood for food products.

The type of product is specified through Config.pm

    $options{product_type} = "food";

FUNCTIONS

check_quality( PRODUCT_REF )

check_quality() checks the quality of data for a given product.

   check_quality($product_ref)

<<