Context

pydantic model Context[source]

A prescriptive context contains configuration for generating fit-for-purpose prefix maps to serve various communities based on the standard Bioregistry prefix map, custom prefix remapping rules, custom URI prefix remapping rules, custom prefix maps, and other community-specific logic.

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": "Context",
   "description": "A prescriptive context contains configuration for generating fit-for-purpose\nprefix maps to serve various communities based on the standard Bioregistry\nprefix map, custom prefix remapping rules, custom URI prefix remapping rules,\ncustom prefix maps, and other community-specific logic.",
   "type": "object",
   "properties": {
      "name": {
         "title": "Name",
         "description": "The name of the context",
         "type": "string"
      },
      "description": {
         "title": "Description",
         "description": "A description of the context, can include Markdown",
         "type": "string"
      },
      "maintainers": {
         "title": "Maintainers",
         "description": "A list of maintainers for the context",
         "type": "array",
         "items": {
            "$ref": "#/definitions/Author"
         }
      },
      "prefix_priority": {
         "title": "Prefix Priority",
         "description": "This ordering of metaprefixes (i.e., prefixes for registries) is used to determine the priority of which registry's prefixes are used. By default, the canonical Bioregistry prefixes are highest priority. Add in \"preferred\" for explicitly using preferred prefixes or \"default\" for explicitly using Bioregistry canonical prefixes.",
         "type": "array",
         "items": {
            "type": "string"
         }
      },
      "include_synonyms": {
         "title": "Include Synonyms",
         "description": "Should synonyms be included in the prefix map?",
         "default": false,
         "type": "boolean"
      },
      "uri_prefix_priority": {
         "title": "Uri Prefix Priority",
         "description": "This ordering of metaprefixes (i.e., prefixes for registries) is used to determine the priority of which registry's URI prefixes are used. By default, the canonical Bioregistry URI prefixes are highest priority.",
         "type": "array",
         "items": {
            "type": "string"
         }
      },
      "prefix_remapping": {
         "title": "Prefix Remapping",
         "description": "This is a mapping from canonical Bioregistry prefixes to custom prefixes used in this context.",
         "type": "object",
         "additionalProperties": {
            "type": "string"
         }
      },
      "custom_prefix_map": {
         "title": "Custom Prefix Map",
         "description": "This is a custom prefix map (which contains custom URL/URI expansions) that is added after all other logic is applied. Keys must either be canonical Bioregistry prefixes, prefixes used based on the given prefix priority, or values in the given prefix remapping.",
         "type": "object",
         "additionalProperties": {
            "type": "string"
         }
      },
      "blacklist": {
         "title": "Blacklist",
         "description": "This is a list of canonical Bioregistry prefixes that should not be included in the context.",
         "type": "array",
         "items": {
            "type": "string"
         }
      }
   },
   "required": [
      "name",
      "description",
      "maintainers",
      "prefix_priority",
      "uri_prefix_priority",
      "prefix_remapping",
      "custom_prefix_map",
      "blacklist"
   ],
   "definitions": {
      "Author": {
         "title": "Author",
         "description": "Metadata for an author.",
         "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",
            "orcid"
         ]
      }
   }
}

Fields
field blacklist: Optional[List[str]] [Required]

This is a list of canonical Bioregistry prefixes that should not be included in the context.

field custom_prefix_map: Optional[Dict[str, str]] [Required]

This is a custom prefix map (which contains custom URL/URI expansions) that is added after all other logic is applied. Keys must either be canonical Bioregistry prefixes, prefixes used based on the given prefix priority, or values in the given prefix remapping.

field description: str [Required]

A description of the context, can include Markdown

field include_synonyms: bool = False

Should synonyms be included in the prefix map?

field maintainers: List[Author] [Required]

A list of maintainers for the context

field name: str [Required]

The name of the context

field prefix_priority: Optional[List[str]] [Required]

This ordering of metaprefixes (i.e., prefixes for registries) is used to determine the priority of which registry’s prefixes are used. By default, the canonical Bioregistry prefixes are highest priority. Add in “preferred” for explicitly using preferred prefixes or “default” for explicitly using Bioregistry canonical prefixes.

field prefix_remapping: Optional[Dict[str, str]] [Required]

This is a mapping from canonical Bioregistry prefixes to custom prefixes used in this context.

field uri_prefix_priority: Optional[List[str]] [Required]

This ordering of metaprefixes (i.e., prefixes for registries) is used to determine the priority of which registry’s URI prefixes are used. By default, the canonical Bioregistry URI prefixes are highest priority.