def validate_mapping(
        cls, schema_mapping: Dict[str, str]
    ) -> "VirtualGroundTruthSchemaMapping":
        """
        Validate and parse the schema mapping dictionary.

        Args:
            schema_mapping (Dict[str, str]): User-provided schema mapping.

        Returns:
            SchemaMapping: Parsed and validated schema mapping.

        Raises:
            ValidationError: If mandatory fields are missing or invalid.
        """
        try:
            return cls(**schema_mapping)
        except ValidationError as e:
            raise ValueError(f"Invalid schema mapping: {e}")

        Validate and parse the schema mapping dictionary.

        Args:
            schema_mapping (Dict[str, str]): User-provided schema mapping.

        Returns:
            SchemaMapping: Parsed and validated schema mapping.

        Raises:
            ValidationError: If mandatory fields are missing or invalid.
        
src/core/trulens/core/schema/groundtruth.py