solidipes.validators.ontology module

class solidipes.validators.ontology.LinkMLOntology(identifier: str | None = None)[source]

Bases: Ontology

_abc_impl = <_abc._abc_data object>
_get_linkml_validation_report() LinkMLValidationReport[source]
get_class_names() list[str][source]

Get the list of class names of the ontology.

get_file_class_name(obj) str[source]

Get the class name of a File according to the ontology.

validate(obj) bool[source]

Validate a Dataset according to the ontology.

validate_file(obj) bool[source]

Validate a File according to the ontology.

class solidipes.validators.ontology.Ontology[source]

Bases: ABC

_abc_impl = <_abc._abc_data object>
abstractmethod get_class_names() list[str][source]

Get the list of class names of the ontology.

abstractmethod get_file_class_name(obj) str[source]

Get the class name of a File according to the ontology.

get_file_compatible_class_names(obj) list[str][source]

Get the list of compatible class names of a File according to the ontology.

abstractmethod validate(obj) bool[source]

Validate a Dataset according to the ontology.

abstractmethod validate_file(obj) bool[source]

Validate a File according to the ontology.

class solidipes.validators.ontology.OntologyValidator(description: str = 'Ontology is matched', **kwargs)[source]

Bases: Validator

_abc_impl = <_abc._abc_data object>
_validate(obj=None) bool[source]

Validate an object and optionally return a boolean. Can raise exceptions.

ontology: Ontology
class solidipes.validators.ontology.PydanticOntology(identifier: str | None = None)[source]

Bases: Ontology

class ModuleLoadError(error_message: str)[source]

Bases: ModuleLoadResult

class ModuleLoadOk[source]

Bases: ModuleLoadResult

class ModuleLoadResult[source]

Bases: object

__model_instance: PydanticROCrateMetadata
_abc_impl = <_abc._abc_data object>
classmethod _get_validation_errors(unique_identifier: str | None = None) list[str][source]
classmethod _has_validation_errors(unique_identifier: str | None = None) bool[source]
property _model_instance: PydanticROCrateMetadata | None
classmethod _reset_validation_errors() None[source]
_rocrate_metadata_checksum: str | None
_validation_errors: list[str] = []
_validation_errors_per_unique_identifier: dict[str, list[str]] = {}
classmethod add_validation_error(error: str, unique_identifier: str | None = None) None[source]
get_class_names() list[str][source]

Get the list of class names of the ontology.

get_file_class(obj) str[source]
get_file_class_name(obj) str[source]

Get the class name of a File according to the ontology.

get_file_compatible_class_names(obj) list[str][source]

Get the list of compatible class names of a File according to the ontology.

get_file_compatible_classes(obj) list[str][source]
get_file_rocrate_dict(obj) dict[source]
validate(obj) bool[source]

Validate a Dataset according to the ontology.

validate_file(obj) bool[source]

Validate a File according to the ontology.

class solidipes.validators.ontology.RDFOntology(identifier: str)[source]

Bases: Ontology

_abc_impl = <_abc._abc_data object>
get_class_from_name(class_name: str) URIRef | None[source]
get_class_name(class_: URIRef) str[source]
get_class_names() list[str][source]

Get the list of class names of the ontology.

get_classes() list[URIRef][source]
get_file_class_name(obj) str[source]

Get the class name of a File according to the ontology.

validate(obj) bool[source]

Validate a Dataset according to the ontology.

validate_file(obj) bool[source]

Validate a File according to the ontology.

solidipes.validators.ontology.get_available_ontology_identifiers() list[str][source]

Get a list of available ontology identifiers from plugins and dataset.

solidipes.validators.ontology.get_ontology_from_identifier(identifier: str) Ontology[source]
solidipes.validators.ontology.get_ontology_identifier() str[source]
solidipes.validators.ontology.set_ontology_identifier(identifier: str)[source]