use of org.molgenis.data.importer.MyEntitiesValidationReport in project molgenis by molgenis.
the class EmxMetaDataParser method validate.
@Override
public EntitiesValidationReport validate(RepositoryCollection source) {
MyEntitiesValidationReport report = new MyEntitiesValidationReport();
Map<String, EntityType> metaDataMap = getEntityTypeMap(dataService, source);
return buildValidationReport(source, report, metaDataMap);
}
use of org.molgenis.data.importer.MyEntitiesValidationReport in project molgenis by molgenis.
the class EmxMetaDataParser method buildValidationReport.
private EntitiesValidationReport buildValidationReport(RepositoryCollection source, MyEntitiesValidationReport report, Map<String, EntityType> metaDataMap) {
metaDataMap.values().forEach(entityTypeValidator::validate);
metaDataMap.values().stream().map(EntityType::getAllAttributes).forEach(attributes -> attributes.forEach(attr -> {
attributeValidator.validate(attr, ValidationMode.ADD_SKIP_ENTITY_VALIDATION);
}));
// validate package/entity/attribute tags
metaDataMap.values().stream().map(EntityType::getPackage).filter(Objects::nonNull).forEach(package_ -> package_.getTags().forEach(tagValidator::validate));
metaDataMap.values().forEach(entityType -> entityType.getTags().forEach(tagValidator::validate));
metaDataMap.values().stream().map(EntityType::getAllAttributes).forEach(attributes -> attributes.forEach(attr -> {
attr.getTags().forEach(tagValidator::validate);
}));
report = generateEntityValidationReport(source, report, metaDataMap);
// Add entities without data
for (String entityTypeId : metaDataMap.keySet()) {
if (!report.getSheetsImportable().containsKey(entityTypeId))
report.addEntity(entityTypeId, true);
}
return report;
}
Aggregations