bionty.PublicSource

class bionty.PublicSource(entity: str, organism: str, currently_used: bool, source: str, version: str, source_name: str | None, url: str | None, md5: str | None, source_website: str | None)

Bases: Registry, TracksRun, TracksUpdates

Versions of public ontologies.

Warning

Do not modify the records unless you know what you are doing!

Fields

created_at DateTimeField

Time of creation of record.

created_by ForeignKey

Creator of record, a User.

run ForeignKey

Last run that created or updated the record, a Run.

updated_at DateTimeField

Time of last update to record.

id AutoField

Internal id, valid only in one DB instance.

uid CharField

A universal id (hash of selected field).

entity CharField

Entity class name.

organism CharField

Organism name, use ‘all’ if unknown or none applied.

currently_used BooleanField

Whether this record is currently used.

source CharField

Source key, short form, CURIE prefix for ontologies.

source_name TextField

Source full name, long form.

version CharField

Version of the source.

url TextField

URL of the source file.

md5 TextField

Hash md5 of the source file.

source_website TextField

Website of the source.

previous_runs ManyToManyField

Sequence of runs that created or updated the record.

Methods

set_as_currently_used()

Set this record as the currently used public source.

Examples

>>> record = bionty.PublicSource.filter(uid="...").one()
>>> record.set_as_currently_used()