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());
}
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;
}
Aggregations