Source code for linkml.utils.datavalidator
from dataclasses import dataclass
from typing import Union
from linkml_runtime.linkml_model import ClassDefinitionName, SchemaDefinition
[docs]@dataclass
class DataValidator:
"""
Base class for all validators
"""
schema: Union[str, SchemaDefinition] = None
"""
LinkML Schema to validate against
"""
[docs] def validate_dict(self, data: dict, target_class: ClassDefinitionName = None, closed: bool = True) -> None:
raise NotImplementedError