ReasonedEvidence

class ReasonedEvidence(*, evidence_type: Literal['reasoned'] = 'reasoned', justification: NormalizedNamableReference, mappings: list[Mapping], author: NormalizedNamableReference | None = None, confidence_factor: float = 1.0)[source]

Bases: BaseModel, KeyedMixin[(typing.Union[curies.triples.Triple, ForwardRef(‘Mapping’)],), tuple[StrTriple, ReasonedEvidenceKey]], EvidenceMixin, ConfidenceMixin

A complex evidence based on multiple mappings.

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

Attributes Summary

explanation

Get a textual explanation for this reasoned evidence.

mapping_set

Return an empty mapping set, since this is a reasoned evidence.

mapping_set_names

Get a set containing the union of all the mappings' evidences' mapping set names.

model_config

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Methods Summary

get_confidence()

Calculate confidence for the reasoned evidence.

key(triple)

Get a key suitable for hashing the evidence.

Attributes Documentation

explanation

Get a textual explanation for this reasoned evidence.

Returns:

Assuming this reasoned evidence represents a pathway where each mapping in the chain’s subject shares the object from the previous mapping, returns a space-delmited list of the CURIEs for these entities.

mapping_set

Return an empty mapping set, since this is a reasoned evidence.

mapping_set_names

Get a set containing the union of all the mappings’ evidences’ mapping set names.

model_config: ClassVar[ConfigDict] = {'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].

Methods Documentation

get_confidence() float[source]

Calculate confidence for the reasoned evidence.

Returns:

The joint binomial probability that all reasoned evidences are correct. This is calculated with the following:

$alpha times (1 - sum_{e in E} 1 - text{confidence}_e)$

where $E$ is the set of all evidences in this object and $alpha$ is the confidence factor for the reasoning approach.

key(triple: Triple | Mapping) tuple[StrTriple, ReasonedEvidenceKey][source]

Get a key suitable for hashing the evidence.

Returns:

A key for deduplication based on the mapping set.

Note: this should be extended to include basically _all_ fields