Search in sources :

Example 76 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class DataThresholdsForm method performFinish.

@Override
public boolean performFinish() {
    String min = lowerText.getText();
    String max = higherText.getText();
    if ("".equals(min) && "".equals(max)) {
        // $NON-NLS-1$ //$NON-NLS-2$
        parameters.setDataValidDomain(null);
    } else {
        IndicatorHelper.setDataThreshold(parameters, min, max);
        Indicator indicator = (Indicator) parameters.eContainer();
        IndicatorHelper.propagateDataThresholdsInChildren(indicator);
    }
    return true;
}
Also used : Indicator(org.talend.dataquality.indicators.Indicator)

Example 77 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class PresentationParameterImpl method setIndicator.

/**
 * <!-- begin-user-doc -->
 * <!-- end-user-doc -->
 * @generated
 */
public void setIndicator(Indicator newIndicator) {
    Indicator oldIndicator = indicator;
    indicator = newIndicator;
    if (eNotificationRequired())
        eNotify(new ENotificationImpl(this, Notification.SET, ReportsPackage.PRESENTATION_PARAMETER__INDICATOR, oldIndicator, indicator));
}
Also used : ENotificationImpl(org.eclipse.emf.ecore.impl.ENotificationImpl) Indicator(org.talend.dataquality.indicators.Indicator)

Example 78 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class MatchRuleAnlaysisUtils method getNeedIndicatorFromAna.

/**
 * Get recording matching indicator and Blocking Indicator from analysis
 *
 * @param analysis
 * @return the index 0 will be RecordMatchingIndicator and index 1 will be BlockKeyIndicator
 */
public static Object[] getNeedIndicatorFromAna(Analysis analysis) {
    Object[] returnList = new Object[2];
    EList<Indicator> indicators = analysis.getResults().getIndicators();
    for (Indicator ind : indicators) {
        if (ind instanceof RecordMatchingIndicator) {
            returnList[0] = ind;
        } else if (ind instanceof BlockKeyIndicator) {
            returnList[1] = ind;
        }
    }
    // If match rule definition is null, create a default.
    if (returnList[0] == null) {
        returnList[0] = ColumnsetPackage.eINSTANCE.getColumnsetFactory().createRecordMatchingIndicator();
    }
    // If blocking key indicator is nul, create a default.
    if (returnList[1] == null) {
        returnList[1] = ColumnsetPackage.eINSTANCE.getColumnsetFactory().createBlockKeyIndicator();
    }
    return returnList;
}
Also used : BlockKeyIndicator(org.talend.dataquality.indicators.columnset.BlockKeyIndicator) RecordMatchingIndicator(org.talend.dataquality.indicators.columnset.RecordMatchingIndicator) RecordMatchingIndicator(org.talend.dataquality.indicators.columnset.RecordMatchingIndicator) Indicator(org.talend.dataquality.indicators.Indicator) BlockKeyIndicator(org.talend.dataquality.indicators.columnset.BlockKeyIndicator)

Example 79 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class IndicatorHelper method propagateDataThresholdsInChildren.

/**
 * Method "propagateDataThresholdsInChildren" will propage the data threshold to the indicator if the given
 * indicator is a BoxIndicator (Otherwise, nothing is done).
 *
 * @param indicator an instance of BoxIndicator
 */
public static void propagateDataThresholdsInChildren(Indicator indicator) {
    if (IndicatorsPackage.eINSTANCE.getBoxIndicator().equals(indicator.eClass())) {
        BoxIndicator boxIndicator = (BoxIndicator) indicator;
        String[] dataThreshold = IndicatorHelper.getDataThreshold(boxIndicator);
        if (dataThreshold == null) {
            // clear all data thresholds
            final EList<Indicator> allChildIndicators = boxIndicator.getAllChildIndicators();
            for (Indicator ind : allChildIndicators) {
                clearDataThresholds(ind);
            }
            return;
        }
        // --- add thresholds in min and max indicators
        RangeIndicator rangeIndicator = boxIndicator.getRangeIndicator();
        setDataThresholds(rangeIndicator, dataThreshold);
        // --- add thresholds in lower and upper quartile indicators
        IQRIndicator iqr = boxIndicator.getIQR();
        setDataThresholds(iqr, dataThreshold);
        // --- add threholds to the mean and median indicator
        setDataThreshold(boxIndicator.getMeanIndicator(), dataThreshold[0], dataThreshold[1]);
        setDataThreshold(boxIndicator.getMedianIndicator(), dataThreshold[0], dataThreshold[1]);
    } else if (IndicatorsPackage.eINSTANCE.getRangeIndicator().equals(indicator.eClass()) || IndicatorsPackage.eINSTANCE.getIQRIndicator().equals(indicator.eClass())) {
        RangeIndicator rangeIndicator = (RangeIndicator) indicator;
        String[] dataThreshold = IndicatorHelper.getDataThreshold(rangeIndicator);
        if (dataThreshold == null) {
            // clear all data thresholds
            final EList<Indicator> allChildIndicators = rangeIndicator.getAllChildIndicators();
            for (Indicator ind : allChildIndicators) {
                clearDataThresholds(ind);
            }
            return;
        }
        // --- add thresholds in (min and max) or (lower and upper quartile) indicators
        setDataThresholds(rangeIndicator, dataThreshold);
    }
}
Also used : BoxIndicator(org.talend.dataquality.indicators.BoxIndicator) EList(org.eclipse.emf.common.util.EList) RangeIndicator(org.talend.dataquality.indicators.RangeIndicator) IQRIndicator(org.talend.dataquality.indicators.IQRIndicator) UniqueCountIndicator(org.talend.dataquality.indicators.UniqueCountIndicator) MaxValueIndicator(org.talend.dataquality.indicators.MaxValueIndicator) ValidRegCodeCountIndicator(org.talend.dataquality.indicators.ValidRegCodeCountIndicator) PhoneNumbStatisticsIndicator(org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator) MinLengthIndicator(org.talend.dataquality.indicators.MinLengthIndicator) MinValueIndicator(org.talend.dataquality.indicators.MinValueIndicator) AverageLengthIndicator(org.talend.dataquality.indicators.AverageLengthIndicator) MeanIndicator(org.talend.dataquality.indicators.MeanIndicator) DefValueCountIndicator(org.talend.dataquality.indicators.DefValueCountIndicator) WellFormE164PhoneCountIndicator(org.talend.dataquality.indicators.WellFormE164PhoneCountIndicator) RangeIndicator(org.talend.dataquality.indicators.RangeIndicator) JavaUserDefIndicator(org.talend.dataquality.indicators.sql.JavaUserDefIndicator) ValueIndicator(org.talend.dataquality.indicators.ValueIndicator) InvalidRegCodeCountIndicator(org.talend.dataquality.indicators.InvalidRegCodeCountIndicator) UserDefIndicator(org.talend.dataquality.indicators.sql.UserDefIndicator) ValidPhoneCountIndicator(org.talend.dataquality.indicators.ValidPhoneCountIndicator) RowCountIndicator(org.talend.dataquality.indicators.RowCountIndicator) WellFormIntePhoneCountIndicator(org.talend.dataquality.indicators.WellFormIntePhoneCountIndicator) FormatFreqPieIndicator(org.talend.dataquality.indicators.FormatFreqPieIndicator) PossiblePhoneCountIndicator(org.talend.dataquality.indicators.PossiblePhoneCountIndicator) ModeIndicator(org.talend.dataquality.indicators.ModeIndicator) PatternMatchingIndicator(org.talend.dataquality.indicators.PatternMatchingIndicator) MaxLengthIndicator(org.talend.dataquality.indicators.MaxLengthIndicator) RecordMatchingIndicator(org.talend.dataquality.indicators.columnset.RecordMatchingIndicator) NullCountIndicator(org.talend.dataquality.indicators.NullCountIndicator) MedianIndicator(org.talend.dataquality.indicators.MedianIndicator) Indicator(org.talend.dataquality.indicators.Indicator) CompositeIndicator(org.talend.dataquality.indicators.CompositeIndicator) BlankCountIndicator(org.talend.dataquality.indicators.BlankCountIndicator) DistinctCountIndicator(org.talend.dataquality.indicators.DistinctCountIndicator) DuplicateCountIndicator(org.talend.dataquality.indicators.DuplicateCountIndicator) IQRIndicator(org.talend.dataquality.indicators.IQRIndicator) BoxIndicator(org.talend.dataquality.indicators.BoxIndicator) WellFormNationalPhoneCountIndicator(org.talend.dataquality.indicators.WellFormNationalPhoneCountIndicator) WhereRuleIndicator(org.talend.dataquality.indicators.sql.WhereRuleIndicator)

Example 80 with Indicator

use of org.talend.dataquality.indicators.Indicator in project tdq-studio-se by Talend.

the class IndicatorHelper method getNullCountIndicator.

public static NullCountIndicator getNullCountIndicator(ModelElement modelElement, Map<ModelElement, List<Indicator>> elementToIndicator) {
    List<Indicator> list = elementToIndicator.get(modelElement);
    NullCountIndicator nullCountIndicator = null;
    if (list == null) {
        return nullCountIndicator;
    }
    for (Indicator indicator : list) {
        if (IndicatorsPackage.eINSTANCE.getNullCountIndicator().equals(indicator.eClass())) {
            nullCountIndicator = (NullCountIndicator) indicator;
        }
    }
    return nullCountIndicator;
}
Also used : UniqueCountIndicator(org.talend.dataquality.indicators.UniqueCountIndicator) MaxValueIndicator(org.talend.dataquality.indicators.MaxValueIndicator) ValidRegCodeCountIndicator(org.talend.dataquality.indicators.ValidRegCodeCountIndicator) PhoneNumbStatisticsIndicator(org.talend.dataquality.indicators.PhoneNumbStatisticsIndicator) MinLengthIndicator(org.talend.dataquality.indicators.MinLengthIndicator) MinValueIndicator(org.talend.dataquality.indicators.MinValueIndicator) AverageLengthIndicator(org.talend.dataquality.indicators.AverageLengthIndicator) MeanIndicator(org.talend.dataquality.indicators.MeanIndicator) DefValueCountIndicator(org.talend.dataquality.indicators.DefValueCountIndicator) WellFormE164PhoneCountIndicator(org.talend.dataquality.indicators.WellFormE164PhoneCountIndicator) RangeIndicator(org.talend.dataquality.indicators.RangeIndicator) JavaUserDefIndicator(org.talend.dataquality.indicators.sql.JavaUserDefIndicator) ValueIndicator(org.talend.dataquality.indicators.ValueIndicator) InvalidRegCodeCountIndicator(org.talend.dataquality.indicators.InvalidRegCodeCountIndicator) UserDefIndicator(org.talend.dataquality.indicators.sql.UserDefIndicator) ValidPhoneCountIndicator(org.talend.dataquality.indicators.ValidPhoneCountIndicator) RowCountIndicator(org.talend.dataquality.indicators.RowCountIndicator) WellFormIntePhoneCountIndicator(org.talend.dataquality.indicators.WellFormIntePhoneCountIndicator) FormatFreqPieIndicator(org.talend.dataquality.indicators.FormatFreqPieIndicator) PossiblePhoneCountIndicator(org.talend.dataquality.indicators.PossiblePhoneCountIndicator) ModeIndicator(org.talend.dataquality.indicators.ModeIndicator) PatternMatchingIndicator(org.talend.dataquality.indicators.PatternMatchingIndicator) MaxLengthIndicator(org.talend.dataquality.indicators.MaxLengthIndicator) RecordMatchingIndicator(org.talend.dataquality.indicators.columnset.RecordMatchingIndicator) NullCountIndicator(org.talend.dataquality.indicators.NullCountIndicator) MedianIndicator(org.talend.dataquality.indicators.MedianIndicator) Indicator(org.talend.dataquality.indicators.Indicator) CompositeIndicator(org.talend.dataquality.indicators.CompositeIndicator) BlankCountIndicator(org.talend.dataquality.indicators.BlankCountIndicator) DistinctCountIndicator(org.talend.dataquality.indicators.DistinctCountIndicator) DuplicateCountIndicator(org.talend.dataquality.indicators.DuplicateCountIndicator) IQRIndicator(org.talend.dataquality.indicators.IQRIndicator) BoxIndicator(org.talend.dataquality.indicators.BoxIndicator) WellFormNationalPhoneCountIndicator(org.talend.dataquality.indicators.WellFormNationalPhoneCountIndicator) WhereRuleIndicator(org.talend.dataquality.indicators.sql.WhereRuleIndicator) NullCountIndicator(org.talend.dataquality.indicators.NullCountIndicator)

Aggregations

Indicator (org.talend.dataquality.indicators.Indicator)178 ArrayList (java.util.ArrayList)58 RowCountIndicator (org.talend.dataquality.indicators.RowCountIndicator)40 CompositeIndicator (org.talend.dataquality.indicators.CompositeIndicator)31 ModelElement (orgomg.cwm.objectmodel.core.ModelElement)31 ModelElementIndicator (org.talend.dataprofiler.core.model.ModelElementIndicator)28 Analysis (org.talend.dataquality.analysis.Analysis)27 DuplicateCountIndicator (org.talend.dataquality.indicators.DuplicateCountIndicator)27 UniqueCountIndicator (org.talend.dataquality.indicators.UniqueCountIndicator)27 AllMatchIndicator (org.talend.dataquality.indicators.columnset.AllMatchIndicator)26 ReturnCode (org.talend.utils.sugars.ReturnCode)25 SimpleStatIndicator (org.talend.dataquality.indicators.columnset.SimpleStatIndicator)24 UserDefIndicator (org.talend.dataquality.indicators.sql.UserDefIndicator)24 PatternMatchingIndicator (org.talend.dataquality.indicators.PatternMatchingIndicator)23 DistinctCountIndicator (org.talend.dataquality.indicators.DistinctCountIndicator)22 NullCountIndicator (org.talend.dataquality.indicators.NullCountIndicator)22 TdColumn (org.talend.cwm.relational.TdColumn)20 WhereRuleIndicator (org.talend.dataquality.indicators.sql.WhereRuleIndicator)18 FrequencyIndicator (org.talend.dataquality.indicators.FrequencyIndicator)17 Test (org.junit.Test)16