Registry

pydantic model Registry[source]

Metadata about a registry.

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.

Show JSON schema
{
   "title": "Registry",
   "description": "Metadata about a registry.",
   "type": "object",
   "properties": {
      "prefix": {
         "title": "Prefix",
         "description": "The metaprefix for the registry itself. For example, the metaprefix for Identifiers.org is `miriam`.",
         "type": "string"
      },
      "name": {
         "title": "Name",
         "description": "The human-readable label for the registry",
         "type": "string"
      },
      "description": {
         "title": "Description",
         "description": "A full description of the registry.",
         "type": "string"
      },
      "homepage": {
         "title": "Homepage",
         "description": "The URL for the homepage of the registry.",
         "type": "string"
      },
      "example": {
         "title": "Example",
         "description": "An example prefix inside the registry.",
         "type": "string"
      },
      "availability": {
         "title": "Availability",
         "description": "A structured description of the metadata that the registry collects",
         "allOf": [
            {
               "$ref": "#/definitions/RegistrySchema"
            }
         ]
      },
      "download": {
         "title": "Download",
         "description": "A download link for the data contained in the registry",
         "type": "string"
      },
      "provider_uri_format": {
         "title": "Provider Uri Format",
         "description": "A URL with a $1 for a prefix to resolve in the registry",
         "type": "string"
      },
      "resolver_uri_format": {
         "title": "Resolver Uri Format",
         "description": "A URL with a $1 for a prefix and $2 for an identifier to resolve in the registry",
         "type": "string"
      },
      "resolver_type": {
         "title": "Resolver Type",
         "description": "An optional type annotation for what kind of resolver it is (i.e., redirect or lookup)",
         "type": "string"
      },
      "contact": {
         "title": "Contact",
         "description": "The contact for the registry.",
         "allOf": [
            {
               "$ref": "#/definitions/Attributable"
            }
         ]
      },
      "bioregistry_prefix": {
         "title": "Bioregistry Prefix",
         "description": "The prefix for this registry in the Bioregistry",
         "type": "string"
      },
      "logo_url": {
         "title": "Logo Url",
         "description": "The URL for the logo of the resource",
         "type": "string"
      },
      "license": {
         "title": "License",
         "description": "The license under which the resource is redistributed",
         "type": "string"
      },
      "short_name": {
         "title": "Short Name",
         "description": "A short name for the resource, e.g., for use in charts",
         "type": "string"
      }
   },
   "required": [
      "prefix",
      "name",
      "description",
      "homepage",
      "example",
      "availability",
      "contact"
   ],
   "definitions": {
      "RegistrySchema": {
         "title": "RegistrySchema",
         "description": "Metadata about a registry's schema.",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "enum": [
                  "required",
                  "required*",
                  "present",
                  "present*",
                  "missing",
                  "irrelevant",
                  "irrelevant*"
               ],
               "type": "string"
            },
            "homepage": {
               "title": "Homepage",
               "enum": [
                  "required",
                  "required*",
                  "present",
                  "present*",
                  "missing",
                  "irrelevant",
                  "irrelevant*"
               ],
               "type": "string"
            },
            "description": {
               "title": "Description",
               "enum": [
                  "required",
                  "required*",
                  "present",
                  "present*",
                  "missing",
                  "irrelevant",
                  "irrelevant*"
               ],
               "type": "string"
            },
            "example": {
               "title": "Example",
               "enum": [
                  "required",
                  "required*",
                  "present",
                  "present*",
                  "missing",
                  "irrelevant",
                  "irrelevant*"
               ],
               "type": "string"
            },
            "pattern": {
               "title": "Pattern",
               "enum": [
                  "required",
                  "required*",
                  "present",
                  "present*",
                  "missing",
                  "irrelevant",
                  "irrelevant*"
               ],
               "type": "string"
            },
            "provider": {
               "title": "Provider",
               "enum": [
                  "required",
                  "required*",
                  "present",
                  "present*",
                  "missing",
                  "irrelevant",
                  "irrelevant*"
               ],
               "type": "string"
            },
            "alternate_providers": {
               "title": "Alternate Providers",
               "enum": [
                  "required",
                  "required*",
                  "present",
                  "present*",
                  "missing",
                  "irrelevant",
                  "irrelevant*"
               ],
               "type": "string"
            },
            "synonyms": {
               "title": "Synonyms",
               "enum": [
                  "required",
                  "required*",
                  "present",
                  "present*",
                  "missing",
                  "irrelevant",
                  "irrelevant*"
               ],
               "type": "string"
            },
            "license": {
               "title": "License",
               "enum": [
                  "required",
                  "required*",
                  "present",
                  "present*",
                  "missing",
                  "irrelevant",
                  "irrelevant*"
               ],
               "type": "string"
            },
            "version": {
               "title": "Version",
               "enum": [
                  "required",
                  "required*",
                  "present",
                  "present*",
                  "missing",
                  "irrelevant",
                  "irrelevant*"
               ],
               "type": "string"
            },
            "contact": {
               "title": "Contact",
               "enum": [
                  "required",
                  "required*",
                  "present",
                  "present*",
                  "missing",
                  "irrelevant",
                  "irrelevant*"
               ],
               "type": "string"
            },
            "search": {
               "title": "Search",
               "description": "Does this resource have a search functionality for prefixes",
               "type": "boolean"
            },
            "fair": {
               "title": "Fair",
               "description": "Does this resource provide a structured dump of the data is easily findable, accessible, and in a structured format in bulk",
               "type": "boolean"
            },
            "fair_note": {
               "title": "Fair Note",
               "description": "Explanation for why data isn't FAIR",
               "type": "string"
            }
         },
         "required": [
            "name",
            "homepage",
            "description",
            "example",
            "pattern",
            "provider",
            "alternate_providers",
            "synonyms",
            "license",
            "version",
            "contact",
            "search",
            "fair"
         ]
      },
      "Attributable": {
         "title": "Attributable",
         "description": "An upper-level metadata for a researcher.",
         "type": "object",
         "properties": {
            "name": {
               "title": "Name",
               "description": "The full name of the researcher",
               "type": "string"
            },
            "orcid": {
               "title": "Open Researcher and Contributor Identifier",
               "description": "The Open Researcher and Contributor Identifier (ORCiD) provides researchers with an open, unambiguous identifier for connecting various digital assets (e.g., publications, reviews) across the semantic web. An account can be made in seconds at https://orcid.org.",
               "type": "string"
            },
            "email": {
               "title": "Email address",
               "description": "The email address specific to the researcher.",
               "type": "string"
            },
            "github": {
               "title": "GitHub handle",
               "description": "The GitHub handle enables contacting the researcher on GitHub: the *de facto* version control in the computer sciences and life sciences.",
               "type": "string"
            }
         },
         "required": [
            "name"
         ]
      }
   }
}

Fields
field availability: bioregistry.schema.struct.RegistrySchema [Required]

A structured description of the metadata that the registry collects

field bioregistry_prefix: Optional[str] = None

The prefix for this registry in the Bioregistry

field contact: bioregistry.schema.struct.Attributable [Required]

The contact for the registry.

field description: str [Required]

A full description of the registry.

field download: Optional[str] = None

A download link for the data contained in the registry

field example: str [Required]

An example prefix inside the registry.

field homepage: str [Required]

The URL for the homepage of the registry.

field license: Optional[str] = None

The license under which the resource is redistributed

field logo_url: Optional[str] = None

The URL for the logo of the resource

field name: str [Required]

The human-readable label for the registry

field prefix: str [Required]

The metaprefix for the registry itself. For example, the metaprefix for Identifiers.org is miriam.

field provider_uri_format: Optional[str] = None

A URL with a $1 for a prefix to resolve in the registry

field resolver_type: Optional[str] = None

An optional type annotation for what kind of resolver it is (i.e., redirect or lookup)

field resolver_uri_format: Optional[str] = None

A URL with a $1 for a prefix and $2 for an identifier to resolve in the registry

field short_name: Optional[str] = None

A short name for the resource, e.g., for use in charts

add_triples(graph)[source]

Add triples to an RDF graph for this registry.

Parameters

graph (rdflib.Graph) – An RDF graph

Return type

rdflib.term.Node

Returns

The RDF node representing this registry using a Bioregistry IRI.

Get a link to the code on github that downloads this resource.

Return type

Optional[str]

get_provider_uri_format(prefix)[source]

Get the provider string.

Parameters

prefix (str) – The prefix used in the metaregistry

Return type

Optional[str]

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/go'
get_provider_uri_prefix()[source]

Get provider URI prefix.

Return type

str

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/'
get_resolver_uri_format(prefix)[source]

Generate a provider URI string based on mapping through this registry’s vocabulary.

Parameters

prefix (str) – The prefix used in the metaregistry

Return type

str

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'
get_short_name()[source]

Get the short name or full name if none annotated.

Return type

str

resolve(prefix, identifier)[source]

Resolve the registry-specific prefix and identifier.

Parameters
  • prefix (str) – The prefix used in the metaregistry

  • identifier (str) – The identifier in the semantic space

Return type

Optional[str]

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'
score()[source]

Calculate a metadata score/goodness for this registry.

Return type

int