Registry
- class Registry(*, prefix: str, name: str, description: str, homepage: str, example: str, bibtex: str | None = None, availability: RegistrySchema | None = None, qualities: RegistryQualities | None = None, governance: RegistryGovernance | None = None, download: str | None = None, provider_uri_format: str | None = None, search_uri_format: str | None = None, resolver_uri_format: str | None = None, resolver_type: str | None = None, contact: Attributable, bioregistry_prefix: str | None = None, logo_url: str | None = None, license: str | None = None, short_name: str | None = None)[source]
Bases:
BaseModelMetadata about a registry.
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
Check if the registry has a permissive license.
Check if it is a lookup service.
Check if the registry is a prefix provider.
Check if it is a resolver.
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Summary
add_triples(graph)Add triples to an RDF graph for this registry.
Get a link to the code on github that downloads this resource.
get_provider_uri_format(external_prefix)Get the provider string.
Get provider URI prefix.
Get the quality score for this registry.
get_resolver_uri_format(prefix)Generate a provider URI string based on mapping through this registry's vocabulary.
Get the short name or full name if none annotated.
resolve(prefix, identifier)Resolve the registry-specific prefix and identifier.
score()Calculate a metadata score/goodness for this registry.
Attributes Documentation
- has_permissive_license
Check if the registry has a permissive license.
- is_lookup
Check if it is a lookup service.
- is_prefix_provider
Check if the registry is a prefix provider.
- is_resolver
Check if it is a resolver.
- model_config = {}
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
Methods Documentation
- add_triples(graph: rdflib.Graph) rdflib.term.Node[source]
Add triples to an RDF graph for this registry.
- Parameters:
graph – An RDF graph
- Returns:
The RDF node representing this registry using a Bioregistry IRI.
- get_provider_uri_format(external_prefix: str) str | None[source]
Get the provider string.
- Parameters:
external_prefix – The prefix used in the metaregistry
- Returns:
The URL in the registry for the prefix, if it’s able to provide one
>>> from bioregistry import get_registry >>> get_registry("fairsharing").get_provider_uri_format("FAIRsharing.62qk8w") 'https://fairsharing.org/FAIRsharing.62qk8w' >>> get_registry("miriam").get_provider_uri_format("go") 'https://registry.identifiers.org/registry/go' >>> get_registry("n2t").get_provider_uri_format("go") 'https://bioregistry.io/metaregistry/n2t/resolve/go'
- get_provider_uri_prefix() str[source]
Get provider URI prefix.
- Returns:
The URI prefix for the provider for prefixes in this registry.
>>> from bioregistry import get_registry >>> get_registry("fairsharing").get_provider_uri_prefix() 'https://fairsharing.org/' >>> get_registry("miriam").get_provider_uri_prefix() 'https://registry.identifiers.org/registry/' >>> get_registry("n2t").get_provider_uri_prefix() 'https://bioregistry.io/metaregistry/n2t/resolve/'
- get_resolver_uri_format(prefix: str) str[source]
Generate a provider URI string based on mapping through this registry’s vocabulary.
- Parameters:
prefix – The prefix used in the metaregistry
- Returns:
The URI format string to be used for identifiers in the semantic space based on this resolver or the Bioregistry’s meta-resolver.
>>> from bioregistry import get_registry >>> get_registry("miriam").get_resolver_uri_format("go") 'https://identifiers.org/go:$1' >>> get_registry("cellosaurus").get_resolver_uri_format("go") 'https://bioregistry.io/metaregistry/cellosaurus/go:$1' >>> get_registry("n2t").get_resolver_uri_format("go") 'https://n2t.net/go:$1'
- resolve(prefix: str, identifier: str) str | None[source]
Resolve the registry-specific prefix and identifier.
- Parameters:
prefix – The prefix used in the metaregistry
identifier – The identifier in the semantic space
- Returns:
The URI format string for the given CURIE.
>>> from bioregistry import get_registry >>> get_registry("miriam").resolve("go", "0032571") 'https://identifiers.org/go:0032571' >>> get_registry("cellosaurus").resolve("go", "0032571") 'https://bioregistry.io/metaregistry/cellosaurus/go:0032571' >>> get_registry("rrid").resolve("AB", "493771") 'https://scicrunch.org/resolver/RRID:AB_493771'