Link Search Menu Expand Document
Consortium of European Social Science Data Archives


The CMV API is available in two forms, a HTTP REST API and a Java API.

Documentation for the REST API is available at In the top right-hand corner select CESSDA Metadata Validator from the list of API definitions.

To use the Java API, include the dependency and repository definition in your Maven project.

    <name>CESSDA Nexus Repository</name>

An example usage of the API is shown below.

boolean validateFiles() throws IOException, NotDocumentException
  // Create the validator factory and the validation service
  CessdaMetadataValidatorFactory factory = new CessdaMetadataValidatorFactory();

  // Load the validation profile; this can be a file, URI or a InputStream
  Profile profile = factory.newProfile(new File("path/to/cmv-profile.xml"));

  // Load the document to validate
  Document documentToValidate = factory.newDocument(new File("path/to/ddi-document-to-validate.xml"));

  // Run the validation.
  ValidationReport validationReport = factory.validate(documentToValidate, profile, ValidationGateName.BASIC);

  // The validation report can now be inspected. A document is valid if no constraint violations are present.
  List<ConstraintViolation> constraintViolations = validationReport.getConstraintViolations();
  boolean isValid = constraintViolations.isEmpty();

  // Constraint violations can be detailed if present.
  for (ConstraintViolation violation : constraintViolations) {

  // Return the validation status
  return isValid;

Consult the JavaDoc for more details.

Table of contents