Reference

class pyobo.Reference(**data)[source]

Bases: Reference

A namespace, identifier, and label.

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

Raises ValidationError if the input data cannot be parsed to form a valid model.

Attributes Summary

bioregistry_link

Get the bioregistry link.

Methods Summary

auto(prefix, identifier)

Create a reference and auto-populate its name.

from_curie(curie[, name, strict, auto])

Get a reference from a CURIE.

from_iri(iri[, name, auto])

Get a reference from an IRI using the Bioregistry.

validate_prefix(v)

Validate the prefix for this reference.

Attributes Documentation

Get the bioregistry link.

Methods Documentation

classmethod auto(prefix, identifier)[source]

Create a reference and auto-populate its name.

Return type:

Reference

classmethod from_curie(curie, name=None, *, strict=True, auto=False)[source]

Get a reference from a CURIE.

Parameters:
  • curie (str) – The compact URI (CURIE) to parse in the form of <prefix>:<identifier>

  • name (Optional[str]) – The name associated with the CURIE

  • strict (bool) – If true, raises an error if the CURIE can not be parsed.

  • auto (bool) – Automatically look up name

Return type:

Optional[Reference]

classmethod from_iri(iri, name=None, *, auto=False)[source]

Get a reference from an IRI using the Bioregistry.

Parameters:
  • iri (str) – The IRI to parse

  • name (Optional[str]) – The name associated with the CURIE

  • auto (bool) – Automatically look up name

Return type:

Optional[Reference]

classmethod validate_prefix(v)[source]

Validate the prefix for this reference.