LiteralMapping
- class LiteralMapping(*, reference: R, predicate: Reference = NamedReference(prefix='oboInOwl', identifier='hasRelatedSynonym', name='has related synonym'), text: str, language: LanguageAlpha2 | None = None, type: Reference | None = None, provenance: list[Reference] = <factory>, contributor: Reference | None = None, comment: str | None = None, source: str | None = None, date: date | None = None, taxon: Reference | None = None)[source]
-
A data model for literal 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
Get the reference's CURIE.
Get the date as a string.
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Get the reference's (optional) name.
Methods Summary
from_gilda(-> ~ssslm.model.LiteralMapping)Construct a synonym from a
gildaterm.from_row(-> ~ssslm.model.LiteralMapping)Parse a dictionary representing a row in a TSV.
Get all references made by this object.
to_gilda()Get this synonym as a
gildaterm.Attributes Documentation
- curie
Get the reference’s CURIE.
- date_str
Get the date as a string.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- name
Get the reference’s (optional) name.
Methods Documentation
- classmethod from_gilda(term: gilda.Term, *, reference_cls: type[R] = None) LiteralMapping[source]
- classmethod from_gilda(term: gilda.Term, *, reference_cls: None = None) LiteralMapping[NamableReference]
Construct a synonym from a
gildaterm.- Parameters:
term – A Gilda term
reference_cls – the class to use to instantiate references
- Returns:
A literal mapping object
Warning
Gilda’s data model is less detailed, so resulting synonym objects will not have detailed curation provenance
- classmethod from_row(row: dict[str, Any], *, names: Mapping[Reference, str] | None = None, reference_cls: type[R] = None) LiteralMapping[source]
- classmethod from_row(row: dict[str, Any], *, names: Mapping[Reference, str] | None = None, reference_cls: None = None) LiteralMapping[NamableReference]
Parse a dictionary representing a row in a TSV.