class OntologyValidator {

    public ObjectNode verifyAndReplaceFields(JsonNode jsonNode) throws MetadataValidationException {

        ObjectNode transformedJsonNode = jsonNode.deepCopy();

        List<OntologyModel> ontologyModels = ontologyLoader.loadOntologies();
        Map<String, OntologyModel> ontologyModelMap =
            ontologyModels.stream().collect(Collectors.toMap(OntologyModel::getIdentifier, oM -> oM));

        List<String> errors = new ArrayList<>();
        Iterator<Map.Entry<String, JsonNode>> iterator = transformedJsonNode.fields();
        while (iterator.hasNext()) {
            Map.Entry<String, JsonNode> entry = iterator.next();
            verifyLine(transformedJsonNode, ontologyModelMap, errors, entry);
        }

        if (!errors.isEmpty()) {
            String error = "Archive unit contains fields declared in ontology with a wrong format : " +
                CollectionUtils.join(errors, ",");
            throw new MetadataValidationException(MetadataValidationErrorCode.ONTOLOGY_VALIDATION_FAILURE, error);
        }

        return transformedJsonNode;
    }

    public  OntologyValidator(OntologyLoader ontologyLoader);

}