Search in sources :

Example 1 with DQCategory

use of org.talend.dataquality.semantic.model.DQCategory in project data-prep by Talend.

the class StatisticsAdapter method updateMetadataWithCategoryInfo.

private void updateMetadataWithCategoryInfo(ColumnMetadata column, CategoryFrequency categoryFrequency) {
    final String categoryId = categoryFrequency.getCategoryId();
    DQCategory categoryMetadataByName = CategoryRegistryManager.getInstance().getCategoryMetadataByName(categoryId);
    if (categoryMetadataByName == null) {
        LOGGER.error("Could not find {} in known categories.", categoryId);
        column.setDomain(categoryId);
        column.setDomainLabel(categoryId);
    } else {
        column.setDomain(categoryMetadataByName.getName());
        column.setDomainLabel(categoryMetadataByName.getLabel());
    }
    column.setDomainFrequency(categoryFrequency.getScore());
}
Also used : DQCategory(org.talend.dataquality.semantic.model.DQCategory)

Example 2 with DQCategory

use of org.talend.dataquality.semantic.model.DQCategory in project data-prep by Talend.

the class AnalyzerServiceTest method createMetadata.

private Map<String, DQCategory> createMetadata() {
    Map<String, DQCategory> metadata = new HashMap<>();
    DQCategory airportCodeCategory = new DQCategory();
    airportCodeCategory.setId("1");
    airportCodeCategory.setName("AIRPORT_CODE");
    airportCodeCategory.setLabel("Airport code");
    metadata.put("AIRPORT_CODE", airportCodeCategory);
    return metadata;
}
Also used : HashMap(java.util.HashMap) DQCategory(org.talend.dataquality.semantic.model.DQCategory)

Aggregations

DQCategory (org.talend.dataquality.semantic.model.DQCategory)2 HashMap (java.util.HashMap)1