Validators¶
Schema validation for SSSOM files.
sssom.validators
¶
Validators.
validate(msdf, validation_types=None, fail_on_error=True)
¶
Validate SSSOM files against sssom-schema using linkML's validator function.
:param msdf: MappingSetDataFrame. :param validation_types: SchemaValidationType :param fail_on_error: If true, throw an error when execution of a method has failed
:returns: A dictionary from validation types to validation reports
Source code in src/sssom/validators.py
print_linkml_report(report, fail_on_error=True)
¶
Print the error messages in the report. Optionally throw exception.
:param report: A LinkML validation report :param fail_on_error: if true, the function will throw an ValidationError exception when there are errors
Source code in src/sssom/validators.py
validate_json_schema(msdf, fail_on_error=True)
¶
Validate JSON Schema using linkml's JsonSchemaDataValidator.
:param msdf: MappingSetDataFrame to eb validated. :param fail_on_error: if true, the function will throw an ValidationError exception when there are errors
Source code in src/sssom/validators.py
validate_shacl(msdf, fail_on_error=True)
¶
Validate SCHACL file.
:param msdf: TODO: https://github.com/linkml/linkml/issues/850 . :param fail_on_error: if true, the function will throw an ValidationError exception when there are errors
:raises NotImplementedError: Not yet implemented.
Source code in src/sssom/validators.py
validate_sparql(msdf, fail_on_error=True)
¶
Validate SPARQL file.
:param msdf: MappingSetDataFrame :param fail_on_error: if true, the function will throw an ValidationError exception when there are errors
:raises NotImplementedError: Not yet implemented.
Source code in src/sssom/validators.py
check_all_prefixes_in_curie_map(msdf, fail_on_error=True)
¶
Check all EntityReference slots are mentioned in 'curie_map'.
:param msdf: MappingSetDataFrame :param fail_on_error: if true, the function will throw an ValidationError exception when there are errors
:raises ValidationError: If all prefixes not in curie_map.
Source code in src/sssom/validators.py
check_strict_curie_format(msdf, fail_on_error=True)
¶
Check all EntityReference slots are formatted as unambiguous curies.
Implemented rules:
- CURIE does not contain pipe "|" character to ensure that multivalued processing of in TSV works correctly.
:param msdf: MappingSetDataFrame :param fail_on_error: if true, the function will throw an ValidationError exception when there are errors
:raises ValidationError: If any entity reference does not follow the strict CURIE format