Definition

class pronto.Definition[source]

A human-readable text definition of an entity.

Definitions are human-readable descriptions of an entity in the ontology graph, with some optional cross-references to support the definition.

Example

Simply create a Definition instance by giving it a string:

>>> def1 = pronto.Definition('a structural anomaly')

Additional cross-references can be passed as arguments, or added later to the xrefs attribute of the Definition:

>>> def2 = pronto.Definition('...', xrefs={pronto.Xref('MGI:Anna')})
>>> def2.xrefs.add(pronto.Xref('ORCID:0000-0002-3947-4444'))

The text content of the definition can be accessed by casting the definition object to a plain string:

>>> str(def1)
'a structural anomaly'

Caution

A Definition compare only based on its textual value, independently of the Xref it may contains:

>>> def2 == pronto.Definition('...')
True

Note

Some ontologies use the xrefs of a description to attribute the authorship of that definition:

>>> cio = pronto.Ontology.from_obo_library("cio.obo")
>>> sorted(cio['CIO:0000011'].definition.xrefs)
[Xref('Bgee:fbb')]

The common usecase however is to refer to the source of a definition using persistent identifiers like ISBN book numbers or PubMed IDs.

>>> pl = pronto.Ontology.from_obo_library("plana.obo")
>>> sorted(pl['PLANA:0007518'].definition.xrefs)
[Xref('ISBN:0-71677033-4'), Xref('PMID:4853064')]
static __new__(cls, text: str, xrefs=None) → pronto.definition.Definition[source]

Create and return a new object. See help(type) for accurate signature.

__init__(text: str, xrefs: Optional[Iterable[pronto.xref.Xref]] = None) → None[source]

Initialize self. See help(type(self)) for accurate signature.

__repr__()[source]

Return repr(self).