Domain Knowledge Graph
DKG (mira.dkg)
Construction of domain knowledge graphs.
ASKEMO (mira.dkg.askemo)
- EQUIVALENCE_TYPES = {'skos:broadBarch', 'skos:exactMatch', 'skos:narrowMatch', 'skos:relatedMatch'}
Valid equivalence annotations in ASKEMO
- SYNONYM_TYPES = {'oboInOwl:hasBroadSynonym': 'BROAD', 'oboInOwl:hasExactSynonym': 'EXACT', 'oboInOwl:hasNarrowSynonym': 'NARROW', 'oboInOwl:hasRelatedSynonym': 'RELATED', 'referenced_by_latex': 'RELATED', 'referenced_by_symbol': 'RELATED'}
Keys are values in ASKEMO and values are OBO specificities
- pydantic model Term[source]
Bases:
BaseModelA term in the ASKEMO ontology.
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.
Show JSON schema
{ "title": "Term", "description": "A term in the ASKEMO ontology.", "type": "object", "properties": { "id": { "title": "Id", "type": "string" }, "name": { "title": "Name", "type": "string" }, "type": { "enum": [ "class", "property", "individual", "unknown" ], "title": "Type", "type": "string" }, "obsolete": { "default": false, "title": "Obsolete", "type": "boolean" }, "description": { "title": "Description", "type": "string" }, "xrefs": { "items": { "$ref": "#/$defs/Xref" }, "title": "Xrefs", "type": "array" }, "parents": { "description": "A list of CURIEs for parent terms", "items": { "type": "string" }, "title": "Parents", "type": "array" }, "synonyms": { "items": { "$ref": "#/$defs/Synonym" }, "title": "Synonyms", "type": "array" }, "part_ofs": { "description": "A list of CURIEs for terms that this term is part of", "items": { "type": "string" }, "title": "Part Ofs", "type": "array" }, "physical_min": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Physical Min" }, "physical_max": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Physical Max" }, "suggested_data_type": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Suggested Data Type" }, "suggested_unit": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Suggested Unit" }, "typical_min": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Typical Min" }, "typical_max": { "anyOf": [ { "type": "number" }, { "type": "null" } ], "default": null, "title": "Typical Max" }, "dimensionality": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Dimensionality" } }, "$defs": { "Synonym": { "description": "Represents a typed synonym.", "properties": { "value": { "description": "The text of the synonym", "title": "Value", "type": "string" }, "type": { "description": "The CURIE for the synonym predicate", "examples": [ "skos:exactMatch" ], "title": "Type", "type": "string" } }, "required": [ "value", "type" ], "title": "Synonym", "type": "object" }, "Xref": { "description": "Represents a typed cross-reference.", "properties": { "id": { "description": "The CURIE of the cross reference", "title": "Id", "type": "string" }, "type": { "description": "The CURIE for the cross reference predicate", "examples": [ "skos:exactMatch" ], "title": "Type", "type": "string" } }, "required": [ "id", "type" ], "title": "Xref", "type": "object" } }, "required": [ "id", "name", "type", "description" ] }
Client (mira.dkg.client)
Neo4j client module.
- class Neo4jClient(url=None, user=None, password=None)[source]
Bases:
objectA client to Neo4j.
Initialize the Neo4j client.
- create_tx(query, **query_params)[source]
Run a query that creates nodes and/or relations.
- Parameters:
query (
str) – The query string to be executed.query_params – The parameters to be used in the query.
- Returns:
The result of the query
- add_node(entity)[source]
Add a node to the DKG
- Parameters:
entity – The node object that will be added to the DKG
- add_relation(relation)[source]
Add a relation to the DKG
- Parameters:
relation – The relation object that will be added to the DKG
- create_single_property_node_index(index_name, label, property_name, exist_ok=False)[source]
Create a single-property node index.
- query_nodes(query)[source]
Run a read-only query for nodes.
- Parameters:
query (
str) – The query string to be executed.- Returns:
A list of
Nodeinstances corresponding to the results of the query- Return type:
values
- search(query, limit=25, offset=0, prefixes=None, labels=None, wikidata_fallback=False)[source]
Search nodes for a given name or synonym substring.
- Parameters:
query (
str) – The query string to search (by a normalized substring search).limit (
int) – The number of results to return. Useful for pagination.offset (
int) – The offset of the entities to return. Useful for pagination.prefixes (
Union[None,str,Iterable[str]]) – A prefix or list of prefixes. If given, any result matching any of the prefixes will be retained.labels (
Union[None,str,Iterable[str]]) – A label or list of labels used for filtering results. If given, any result with any of the labels will be retained.wikidata_fallback (
bool) – If true, use wikidata for searching if DKG returns no results
- Return type:
A list of entity objects that match all of the query parameters
- get_transitive_closure(rels=None)[source]
Return transitive closure with respect to one or more relations.
Transitive closure is constructed as a set of pairs of node IDs ordered as (successor, descendant). Note that if rels are ones that point towards taxonomical parents (e.g., subclassof, part_of), then the pairs are interpreted as (taxonomical child, taxonomical ancestor).
- pydantic model Entity[source]
Bases:
BaseModelAn entity in the domain knowledge graph.
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.
Show JSON schema
{ "title": "Entity", "description": "An entity in the domain knowledge graph.", "type": "object", "properties": { "id": { "description": "The CURIE of the entity", "examples": [ "ido:0000511" ], "title": "Compact URI", "type": "string" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the entity", "examples": [ "infected population" ], "title": "Name" }, "type": { "description": "The type of the entity", "enum": [ "class", "property", "individual", "unknown" ], "examples": [ "class" ], "title": "Type", "type": "string" }, "obsolete": { "description": "Is the entity marked obsolete?", "examples": [ false ], "title": "Obsolete", "type": "boolean" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The description of the entity.", "examples": [ "An organism population whose members have an infection." ], "title": "Description" }, "synonyms": { "description": "A list of string synonyms", "examples": [ [] ], "items": { "$ref": "#/$defs/Synonym" }, "title": "Synonyms", "type": "array" }, "alts": { "description": "A list of alternative identifiers, given as CURIE strings.", "examples": [ [] ], "items": { "type": "string" }, "title": "Alternative Identifiers", "type": "array" }, "xrefs": { "description": "A list of database cross-references, given as CURIE strings.", "examples": [ [] ], "items": { "$ref": "#/$defs/Xref" }, "title": "Database Cross-references", "type": "array" }, "labels": { "description": "A list of Neo4j labels assigned to the entity.", "examples": [ [ "ido" ] ], "items": { "type": "string" }, "title": "Labels", "type": "array" }, "properties": { "type": "object", "additionalProperties": { "items": { "type": "string" }, "type": "array" }, "description": "A mapping of properties to their values", "examples": [ {} ], "title": "Properties" }, "link": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Link" } }, "$defs": { "Synonym": { "description": "Represents a typed synonym.", "properties": { "value": { "description": "The text of the synonym", "title": "Value", "type": "string" }, "type": { "description": "The CURIE for the synonym predicate", "examples": [ "skos:exactMatch" ], "title": "Type", "type": "string" } }, "required": [ "value", "type" ], "title": "Synonym", "type": "object" }, "Xref": { "description": "Represents a typed cross-reference.", "properties": { "id": { "description": "The CURIE of the cross reference", "title": "Id", "type": "string" }, "type": { "description": "The CURIE for the cross reference predicate", "examples": [ "skos:exactMatch" ], "title": "Type", "type": "string" } }, "required": [ "id", "type" ], "title": "Xref", "type": "object" } }, "required": [ "id", "type", "obsolete" ] }
- Fields:
- Validators:
-
field type:
Literal['class','property','individual','unknown'] [Required] The type of the entity
- classmethod from_data(data)[source]
Create from a data dictionary as it’s stored in neo4j.
- Parameters:
data – Either a plain python dictionary or a
neo4j.graph.Nodeobject that will get unpacked. These correspond to the structure of data inside the neo4j graph, and therefore have parallel lists representing dictionaries for properties, xrefs, and synonyms.- Return type:
A MIRA entity
Construct (mira.dkg.construct)
Generate the nodes and edges file for the MIRA domain knowledge graph.
After these are generated, see the /docker folder in the repository for loading a neo4j instance.
Example command for local bulk import on mac with neo4j 4.x:
neo4j-admin import --database=mira --delimiter='TAB' --force --skip-duplicate-nodes=true --skip-bad-relationships=true --nodes ~/.data/mira/demo/import/nodes.tsv.gz --relationships ~/.data/mira/demo/import/edges.tsv.gz
Then, restart the neo4j service with homebrew brew services neo4j restart
- pydantic model DKGConfig[source]
Bases:
BaseModelCreate 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.
Show JSON schema
{ "title": "DKGConfig", "type": "object", "properties": { "use_case": { "title": "Use Case", "type": "string" }, "prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Prefix" }, "func": { "default": null, "title": "Func" }, "iri": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": [ null ], "title": "Iri" }, "prefixes": { "items": { "type": "string" }, "title": "Prefixes", "type": "array" } }, "required": [ "use_case" ] }
- Fields:
- class UseCasePaths(use_case, config=None)[source]
Bases:
objectA configuration containing the file paths for use case-specific files.
- class NodeInfo(curie, prefix, label, synonyms, deprecated, type, definition, xrefs, alts, version, property_predicates, property_values, xref_types, synonym_types)[source]
Bases:
NamedTupleCreate new instance of NodeInfo(curie, prefix, label, synonyms, deprecated, type, definition, xrefs, alts, version, property_predicates, property_values, xref_types, synonym_types)
- extract_ontology_subtree(curie, add_subtree=False)[source]
Takes in a curie and extracts the information from the entry in its respective resource ontology to add as a node into the Epidemiology DKG.
There is an option to extract all the information from the entries under the corresponding entry’s subtree in its respective ontology. Relation information is also extracted with this option.
Execution of this method will take a few seconds as the pickled graph object has to be loaded.
Currently we only support the addition of ncbitaxon terms.
- Parameters:
- Returns:
nodes (List[dict]) – A list of node information added to the DKG, where each node is represented as a dictionary.
edges (List[dict]) – A list of edge information added to the DKG, where each edge is represented as a dictionary.
Constructing Registry (mira.dkg.construct_registry)
Constants for the MIRA Metaregistry.
Configuration Models (mira.dkg.models)
Configuration for the DKG.
- pydantic model Config[source]
Bases:
BaseModelConfiguration for a custom metaregistry instance.
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.
Show JSON schema
{ "title": "Config", "description": "Configuration for a custom metaregistry instance.", "type": "object", "properties": { "web": { "additionalProperties": true, "description": "Configuration for the web application", "title": "Web", "type": "object" }, "registry": { "additionalProperties": { "$ref": "#/$defs/Resource" }, "description": "Custom registry entries", "title": "Registry", "type": "object" }, "collections": { "additionalProperties": { "$ref": "#/$defs/Collection" }, "description": "Custom collections", "title": "Collections", "type": "object" } }, "$defs": { "AnnotatedURL": { "description": "A URL annotated with its file type and data schema.", "properties": { "url": { "title": "Url", "type": "string" }, "rdf_format": { "default": "ttl", "enum": [ "ttl", "rdf", "xml", "n3", "trix", "nt" ], "title": "RDF Format", "type": "string" } }, "required": [ "url" ], "title": "AnnotatedURL", "type": "object" }, "Attributable": { "description": "An upper-level metadata for a researcher.", "properties": { "name": { "description": "The full name of the researcher", "title": "Name", "type": "string" }, "orcid": { "anyOf": [ { "pattern": "^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$", "type": "string" }, { "type": "null" } ], "default": null, "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.", "title": "Open Researcher and Contributor Identifier" }, "email": { "anyOf": [ { "format": "email", "type": "string" }, { "type": "null" } ], "default": null, "description": "The email address specific to the researcher.", "title": "Email address" }, "github": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The GitHub handle enables contacting the researcher on GitHub: the *de facto* version control in the computer sciences and life sciences.", "title": "GitHub handle" }, "wikidata": { "anyOf": [ { "pattern": "^Q\\d+$", "type": "string" }, { "type": "null" } ], "default": null, "examples": [ "Q47475003" ], "title": "Wikidata identifier" } }, "required": [ "name" ], "title": "Attributable", "type": "object" }, "Author": { "description": "Metadata for an author.", "properties": { "name": { "description": "The full name of the researcher", "title": "Name", "type": "string" }, "orcid": { "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.", "pattern": "^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$", "title": "Open Researcher and Contributor Identifier", "type": "string" }, "email": { "anyOf": [ { "format": "email", "type": "string" }, { "type": "null" } ], "default": null, "description": "The email address specific to the researcher.", "title": "Email address" }, "github": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The GitHub handle enables contacting the researcher on GitHub: the *de facto* version control in the computer sciences and life sciences.", "title": "GitHub handle" }, "wikidata": { "anyOf": [ { "pattern": "^Q\\d+$", "type": "string" }, { "type": "null" } ], "default": null, "examples": [ "Q47475003" ], "title": "Wikidata identifier" } }, "required": [ "name", "orcid" ], "title": "Author", "type": "object" }, "Collection": { "description": "A collection of resources.", "properties": { "identifier": { "description": "The collection's identifier", "title": "Identifier", "type": "string" }, "name": { "description": "The name of the collection", "title": "Name", "type": "string" }, "description": { "description": "A description of the collection", "minLength": 30, "title": "Description", "type": "string" }, "resources": { "description": "A list of prefixes of resources appearing in the collection", "items": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/CollectionAnnotation" } ] }, "minItems": 1, "title": "Resources", "type": "array" }, "contributors": { "description": "A list of authors/contributors to the collection", "items": { "$ref": "#/$defs/Attributable" }, "minItems": 1, "title": "Contributors", "type": "array" }, "maintainers": { "anyOf": [ { "items": { "$ref": "#/$defs/Author" }, "minItems": 1, "type": "array" }, { "type": "null" } ], "default": null, "description": "A list of maintainers for the collection", "title": "Maintainers" }, "logo": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Logo" }, "organizations": { "anyOf": [ { "items": { "$ref": "#/$defs/Organization" }, "minItems": 1, "type": "array" }, { "type": "null" } ], "default": null, "description": "A list of organizations that contribute to this collection", "title": "Organizations" }, "context": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The JSON-LD context's name", "title": "Context" }, "references": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "URL references", "title": "References" }, "keywords": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Keywords" }, "mappings": { "anyOf": [ { "items": { "$ref": "#/$defs/Reference" }, "type": "array" }, { "type": "null" } ], "default": null, "title": "Mappings" } }, "required": [ "identifier", "name", "description", "resources", "contributors" ], "title": "Collection", "type": "object" }, "CollectionAnnotation": { "description": "Collection annotation.", "properties": { "prefix": { "title": "Prefix", "type": "string" }, "comment": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Comment" } }, "required": [ "prefix" ], "title": "CollectionAnnotation", "type": "object" }, "Organization": { "description": "Model for organizations.", "properties": { "ror": { "anyOf": [ { "pattern": "^0[a-hj-km-np-tv-z|0-9]{6}[0-9]{2}$", "type": "string" }, { "type": "null" } ], "default": null, "examples": [ "03yrm5c26" ], "title": "Research Organization Registry identifier" }, "wikidata": { "anyOf": [ { "pattern": "^Q\\d+$", "type": "string" }, { "type": "null" } ], "default": null, "examples": [ "Q47475003" ], "title": "Wikidata identifier" }, "gnd": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Gemeinsame Normdatei (Integrated Authority File) identifier" }, "name": { "description": "Name of the organization", "title": "Name", "type": "string" }, "partnered": { "default": false, "description": "Has this organization made a specific connection with Bioregistry?", "title": "Partnered", "type": "boolean" } }, "required": [ "name" ], "title": "Organization", "type": "object" }, "Provider": { "description": "A provider.", "properties": { "code": { "description": "A locally unique code within the prefix for the provider", "title": "Code", "type": "string" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Name of the provider", "title": "Name" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Description of the provider", "title": "Description" }, "homepage": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Homepage of the provider", "title": "Homepage" }, "uri_format": { "description": "The URI format string, which must have at least one ``$1`` in it. Note that this field is generic enough to accept IRIs. See the URI specification (https://www.rfc-editor.org/rfc/rfc3986) and IRI specification (https://www.ietf.org/rfc/rfc3987.txt) for more information.", "title": "URI Format", "type": "string" }, "first_party": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "Annotates whether a provider is from the first-party organization", "title": "First Party" }, "publications": { "anyOf": [ { "items": { "$ref": "#/$defs/Publication" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "A list of publications about the provider. See the `indra` provider for `hgnc` for an example.", "title": "Publications" }, "example": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "An example local identifier, specific to the provider. Providing this value is only necessary if the example associated with the prefix for which this is a provider is not resolvable by the provider. The example identifier should exclude any redundant usage of the prefix. For example, a GO identifier should only look like ``1234567`` and not like ``GO:1234567``", "title": "Example" }, "status": { "anyOf": [ { "$ref": "#/$defs/StatusCheck" }, { "type": "null" } ], "default": null, "description": "Tracks the status of the provider. If this isn't set, assume that the provider is still active. See discussion in in https://github.com/biopragmatics/bioregistry/issues/1387." }, "organization": { "anyOf": [ { "$ref": "#/$defs/Organization" }, { "type": "null" } ], "default": null } }, "required": [ "code", "uri_format" ], "title": "Provider", "type": "object" }, "Publication": { "description": "Metadata about a publication.", "properties": { "pubmed": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The PubMed identifier for the article", "title": "PubMed" }, "doi": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The DOI for the article. DOIs are case insensitive, so these are required by the Bioregistry to be standardized to their lowercase form.", "title": "DOI" }, "pmc": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The PubMed Central identifier for the article", "title": "PMC" }, "arxiv": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The arXiv identifier for the article", "title": "arXiv" }, "title": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The title of the article", "title": "Title" }, "year": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The year the article was published", "title": "Year" } }, "title": "Publication", "type": "object" }, "Reference": { "description": "A reference to an entity in a given identifier space.\n\nThis class uses Pydantic to make it easier to build other more complex data types\nwith Pydantic that also uses a first- class notion of parsed reference (instead of\nmerely stringified CURIEs). Instances of this class can also be hashed because of\nthe \"frozen\" configuration from Pydantic (see\nhttps://docs.pydantic.dev/latest/usage/model_config/ for more details).\n\nA reference can be constructed several ways:\n\n>>> Reference(prefix=\"chebi\", identifier=\"1234\")\nReference(prefix='chebi', identifier='1234')\n\n>>> Reference.from_curie(\"chebi:1234\")\nReference(prefix='chebi', identifier='1234')\n\nA reference can also be constructued using Pydantic's parsing utilities, but keep in\nmind if you're using Pydantic v1 or Pydantic v2.\n\nA reference can be formatted as a CURIE string with the ``curie`` attribute\n\n>>> Reference.from_curie(\"chebi:1234\").curie\n'chebi:1234'\n\nReferences can't be sliced like reference tuples, but they can still be accessed\nthrough attributes\n\n>>> t = Reference.from_curie(\"chebi:1234\")\n>>> t.prefix\n'chebi'\n>>> t.identifier\n'1234'\n\nIf you need a performance gain, you can get a :class:`ReferenceTuple` using the\n``pair`` attribute:\n\n>>> reference = Reference.from_curie(\"chebi:1234\")\n>>> reference.pair\nReferenceTuple(prefix='chebi', identifier='1234')", "properties": { "prefix": { "description": "The prefix used in a compact URI (CURIE).", "title": "Prefix", "type": "string" }, "identifier": { "description": "The local unique identifier used in a compact URI (CURIE).", "title": "Identifier", "type": "string" } }, "required": [ "prefix", "identifier" ], "title": "Reference", "type": "object" }, "Resource": { "description": "Metadata about an ontology, database, or other resource.", "properties": { "prefix": { "description": "The prefix for this resource", "title": "Prefix", "type": "string" }, "name": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The name of the resource", "title": "Name" }, "description": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "A description of the resource", "title": "Description" }, "pattern": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The regular expression pattern for local unique identifiers in the resource", "title": "Pattern" }, "uri_format": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The URI format string, which must have at least one ``$1`` in it. Note that this field is generic enough to accept IRIs. See the URI specification (https://www.rfc-editor.org/rfc/rfc3986) and IRI specification (https://www.ietf.org/rfc/rfc3987.txt) for more information.", "title": "URI format string" }, "uri_format_resolvable": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "If false, denotes if the URI format string is known to be not resolvable", "title": "URI format string resolvable" }, "rdf_uri_format": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The RDF URI format string, which must have at least one ``$1`` in it. Note that this field is generic enough to accept IRIs. See the URI specification (https://www.rfc-editor.org/rfc/rfc3986) and IRI specification (https://www.ietf.org/rfc/rfc3987.txt) for more information.", "title": "RDF URI format string" }, "providers": { "anyOf": [ { "items": { "$ref": "#/$defs/Provider" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "Additional, non-default providers for the resource", "title": "Providers" }, "homepage": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The URL for the homepage of the resource, preferably using HTTPS", "title": "Homepage" }, "repository": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The URL for the repository of the resource", "title": "Repository" }, "contact": { "anyOf": [ { "$ref": "#/$defs/Attributable" }, { "type": "null" } ], "default": null, "description": "The contact email address for the resource. This must correspond to a specific person and not be a listserve nor a shared email account." }, "contact_extras": { "anyOf": [ { "items": { "$ref": "#/$defs/Attributable" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "Secondary contacts. It's required to have a primary contact to have this field.", "title": "Contact Extras" }, "contact_group_email": { "anyOf": [ { "format": "email", "type": "string" }, { "type": "null" } ], "default": null, "description": "A group contact email (e.g., a mailing list, a shared address) for the project. It's required to have a primary contact to have this field.", "title": "Contact Group Email" }, "contact_page": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "A URL for a web page that has contact information, e.g., containing a contact form. It's required to have a primary contact to have this field, even if the primary contact isn't the preferred mechanism for contact. Only curate this field if a direct email is not available, as this is the least transparent option for contact.", "title": "Contact Page" }, "owners": { "anyOf": [ { "items": { "$ref": "#/$defs/Organization" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "The owner of the corresponding identifier space. See also https://github.com/biopragmatics/bioregistry/issues/755.", "title": "Owners" }, "example": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "An example local identifier for the resource, explicitly excluding any redundant usage of the prefix in the identifier. For example, a GO identifier should only look like ``1234567`` and not like ``GO:1234567``", "title": "Example" }, "example_extras": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "Extra example identifiers", "title": "Example Extras" }, "example_decoys": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "Extra example identifiers that explicitly fail regex tests", "title": "Example Decoys" }, "license": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The license for the resource", "title": "License" }, "version": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The version for the resource", "title": "Version" }, "part_of": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "An annotation between this prefix and a super-prefix. For example, ``chembl.compound`` is a part of ``chembl``.", "title": "Part Of" }, "part_of_database": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Part Of Database" }, "provides": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "An annotation between this prefix and a prefix for which it is redundant. For example, ``ctd.gene`` has been given a prefix by Identifiers.org, but it actually just reuses identifies from ``ncbigene``, so ``ctd.gene`` provides ``ncbigene``.", "title": "Provides" }, "download_owl": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The URL to download the resource as an ontology encoded in the OWL format. More information about this format can be found at https://www.w3.org/TR/owl2-syntax/.", "title": "OWL Download URL" }, "download_obo": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The URL to download the resource as an ontology encoded in the OBO format. More information about this format can be found at https://owlcollab.github.io/oboformat/doc/obo-syntax.html.", "title": "OBO Download URL" }, "download_json": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The URL to download the resource as an ontology encoded in the OBO Graph JSON format. More information about this format can be found at https://github.com/geneontology/obographs.", "title": "OBO Graph JSON Download URL" }, "download_rdf": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/AnnotatedURL" }, { "type": "null" } ], "default": null, "description": "The URL to download the resource as an RDF file, in one of many formats.", "title": "RDF Download URL" }, "download_skos": { "anyOf": [ { "type": "string" }, { "$ref": "#/$defs/AnnotatedURL" }, { "type": "null" } ], "default": null, "description": "The URL to download the resource as an SKOS RDF file.", "title": "SKOS RDF Download URL" }, "download_jskos": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The URL to download the resource as an JSKOS JSON file.", "title": "JSKOS Download URL" }, "banana": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The `banana` is a generalization of the concept of the \"namespace embedded in local unique identifier\". Many OBO foundry ontologies use the redundant uppercased name of the ontology in the local identifier, such as the Gene Ontology, which makes the prefixes have a redundant usage as in ``GO:GO:1234567``. The `banana` tag explicitly annotates the part in the local identifier that should be stripped, if found. While the Bioregistry automatically knows how to handle all OBO Foundry ontologies' bananas because the OBO Foundry provides the \"preferredPrefix\" field, the banana can be annotated on non-OBO ontologies to more explicitly write the beginning part of the identifier that should be stripped. This allowed for solving one of the long-standing issues with the Identifiers.org resolver (e.g., for ``oma.hog``; see https://github.com/identifiers-org/identifiers-org.github.io/issues/155) as well as better annotate new entries, such as SwissMap Lipids, which have the prefix ``swisslipid`` but have the redundant information ``SLM:`` in the beginning of identifiers. Therefore, ``SLM:`` is the banana.", "title": "Banana" }, "banana_peel": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "Delimiter used in banana", "title": "Banana Peel" }, "deprecated": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "A flag denoting if this resource is deprecated. Currently, this is a blanket term that covers cases when the prefix is no longer maintained, when it has been rolled into another resource, when the website related to the resource goes down, or any other reason that it's difficult or impossible to find full metadata on the resource. If this is set to true, please add a comment explaining why. This flag will override annotations from the OLS, OBO Foundry, and others on the deprecation status, since they often disagree and are very conservative in calling dead resources.", "title": "Deprecated" }, "mappings": { "anyOf": [ { "additionalProperties": { "type": "string" }, "type": "object" }, { "type": "null" } ], "default": null, "description": "A dictionary of metaprefixes (i.e., prefixes for registries) to prefixes in external registries. These also correspond to the registry-specific JSON fields in this model like ``miriam`` field.", "title": "Mappings" }, "synonyms": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "A list of synonyms for the prefix of this resource. These are used in normalization of prefixes and are a useful reference tool for prefixes that are written many ways. For example, ``snomedct`` has many synonyms including typos like ``SNOWMEDCT``, lexical variants like ``SNOMED_CT``, version-variants like ``SNOMEDCT_2010_1_31``, and tons of other nonsense like ``SNOMEDCTCT``.", "title": "Synonyms" }, "keywords": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "A list of keywords for the resource", "title": "Keywords" }, "domain": { "anyOf": [ { "enum": [ "chemical", "tissue", "reaction", "gene", "cell and cell line", "cellular component", "model", "metabolite", "organization", "clinical trial", "pathway", "protein family", "gene family", "disease", "data model", "vaccine", "multiple", "variant", "publication", "protein complex", "mirna", "taxonomy", "project", "grant", "classification", "protein", "study", "relationship", "relationship type", "antibody", "peptide", "schema", "strain", "license", "semantic web", "geography", "assay", "ptm", "bibliometrics", "experiment", "genetic code", "mathematics", "registry", "equipment" ], "type": "string" }, { "type": "null" } ], "default": null, "description": "A high-level semantic type of the entities in the semantic space.", "examples": [ "chemical", "tissue", "reaction", "gene", "cell and cell line", "cellular component", "model", "metabolite", "organization", "clinical trial", "pathway", "protein family", "gene family", "disease", "data model", "vaccine", "multiple", "variant", "publication", "protein complex", "mirna", "taxonomy", "project", "grant", "classification", "protein", "study", "relationship", "relationship type", "antibody", "peptide", "schema", "strain", "license", "semantic web", "geography", "assay", "ptm", "bibliometrics", "experiment", "genetic code", "mathematics", "registry", "equipment" ], "title": "Domain" }, "references": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "A list of URLs to also see, such as publications describing the resource", "title": "References" }, "publications": { "anyOf": [ { "items": { "$ref": "#/$defs/Publication" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "A list of URLs to also see, such as publications describing the resource", "title": "Publications" }, "appears_in": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "A list of prefixes that use this resource for xrefs, provenance, etc.", "title": "Appears In" }, "depends_on": { "anyOf": [ { "items": { "type": "string" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "A list of prefixes that use this resource depends on, e.g., ontologies that import each other.", "title": "Depends On" }, "namespace_in_lui": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "A flag denoting if the namespace is embedded in the LUI (if this is true and it is not accompanied by a banana, assume that the banana is the prefix in all caps plus a colon, as is standard in OBO). Currently this flag is only used to override identifiers.org in the case of ``gramene.growthstage``, ``oma.hog``, and ``vario``.", "title": "Namespace Embedded in Local Unique Identifier" }, "no_own_terms": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "A flag denoting if the resource mints its own identifiers. Omission or explicit marking as false means that the resource does have its own terms. This is most applicable to ontologies, specifically application ontologies, which only reuse terms from others. One example is ChIRO.", "title": "No Own Terms" }, "comment": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "A field for a free text comment", "title": "Comment" }, "contributor": { "anyOf": [ { "$ref": "#/$defs/Author" }, { "type": "null" } ], "default": null, "description": "The contributor of the prefix to the Bioregistry, including at a minimum their name and ORCiD and optional their email address and GitHub handle. All entries curated through the Bioregistry GitHub Workflow must contain this field." }, "contributor_extras": { "anyOf": [ { "items": { "$ref": "#/$defs/Author" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "Additional contributors besides the original submitter.", "title": "Contributor Extras" }, "reviewer": { "anyOf": [ { "$ref": "#/$defs/Author" }, { "type": "null" } ], "default": null, "description": "The reviewer of the prefix to the Bioregistry, including at a minimum their name and ORCiD and optional their email address and GitHub handle. All entries curated through the Bioregistry GitHub Workflow should contain this field pointing to the person who reviewed it on GitHub." }, "reviewer_extras": { "anyOf": [ { "items": { "$ref": "#/$defs/Author" }, "type": "array" }, { "type": "null" } ], "default": null, "description": "Additional reviewers of the prefix.", "title": "Reviewer Extras" }, "proprietary": { "anyOf": [ { "type": "boolean" }, { "type": "null" } ], "default": null, "description": "A flag to denote if this database is proprietary and therefore can not be included in normal quality control checks nor can it be resolved. Omission or explicit marking as false means that the resource is not proprietary.", "title": "Proprietary" }, "has_canonical": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "If this shares an IRI with another entry, maps to which should be be considered as canonical", "title": "Has Canonical" }, "preferred_prefix": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "An annotation of stylization of the prefix. This appears in OBO ontologies like FBbt as well as databases like NCBIGene. If it's not given, then assume that the normalized prefix used in the Bioregistry is canonical.", "title": "Preferred Prefix" }, "mastodon": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The mastodon handle for the project", "title": "Mastodon" }, "github_request_issue": { "anyOf": [ { "type": "integer" }, { "type": "null" } ], "default": null, "description": "The GitHub issue for the new prefix request", "title": "Github Request Issue" }, "logo": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "description": "The URL of the logo for the project/resource", "title": "Logo" }, "miriam": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Miriam" }, "n2t": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "N2T" }, "prefixcommons": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Prefixcommons" }, "wikidata": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Wikidata" }, "wikidata_entity": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Wikidata Entity" }, "go": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Go" }, "obofoundry": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Obofoundry" }, "bioportal": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Bioportal" }, "ecoportal": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Ecoportal" }, "agroportal": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Agroportal" }, "cropoct": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Cropoct" }, "ols": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Ols" }, "aberowl": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Aberowl" }, "ncbi": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Ncbi" }, "uniprot": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Uniprot" }, "biolink": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Biolink" }, "cellosaurus": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Cellosaurus" }, "ontobee": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Ontobee" }, "cheminf": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Cheminf" }, "fairsharing": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Fairsharing" }, "biocontext": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Biocontext" }, "edam": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Edam" }, "re3data": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Re3Data" }, "hl7": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Hl7" }, "bartoc": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "BARTOC" }, "rrid": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "RRID" }, "lov": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "LOV" }, "zazuko": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Zazuko" }, "togoid": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Togoid" }, "integbio": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Integbio" }, "pathguide": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Pathguide" }, "tib": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Tib" }, "biodivportal": { "anyOf": [ { "additionalProperties": true, "type": "object" }, { "type": "null" } ], "default": null, "title": "Biodivportal" } }, "required": [ "prefix" ], "title": "Resource", "type": "object" }, "StatusCheck": { "description": "A status check.", "properties": { "value": { "enum": [ "available", "moved", "gone", "hijacked", "degraded", "misconfigured" ], "title": "Value", "type": "string" }, "date": { "pattern": "^\\d{4}-\\d{2}-\\d{2}$", "title": "Date", "type": "string" }, "contributor": { "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.", "pattern": "^\\d{4}-\\d{4}-\\d{4}-\\d{3}(\\d|X)$", "title": "Open Researcher and Contributor Identifier", "type": "string" }, "notes": { "anyOf": [ { "type": "string" }, { "type": "null" } ], "default": null, "title": "Notes" } }, "required": [ "value", "date", "contributor" ], "title": "StatusCheck", "type": "object" } } }
- Fields:
- pydantic model Xref[source]
Bases:
BaseModelRepresents a typed cross-reference.
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.
Show JSON schema
{ "title": "Xref", "description": "Represents a typed cross-reference.", "type": "object", "properties": { "id": { "description": "The CURIE of the cross reference", "title": "Id", "type": "string" }, "type": { "description": "The CURIE for the cross reference predicate", "examples": [ "skos:exactMatch" ], "title": "Type", "type": "string" } }, "required": [ "id", "type" ] }
- Fields:
- pydantic model Synonym[source]
Bases:
BaseModelRepresents a typed synonym.
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.
Show JSON schema
{ "title": "Synonym", "description": "Represents a typed synonym.", "type": "object", "properties": { "value": { "description": "The text of the synonym", "title": "Value", "type": "string" }, "type": { "description": "The CURIE for the synonym predicate", "examples": [ "skos:exactMatch" ], "title": "Type", "type": "string" } }, "required": [ "value", "type" ] }
- Fields:
Units (mira.dkg.units)
App Utilities (mira.dkg.utils)
Utilities and constants for the MIRA app.
- class MiraState(client, grounder, refinement_closure, lexical_dump, vectors)[source]
Bases:
objectRepresents the state associated with the MIRA app.
- PREFIXES = ['oboinowl', 'owl', 'rdfs', 'bfo', 'caro', 'hp', 'disdriv', 'symp', 'ido', 'vo', 'ovae', 'oae', 'trans', 'doid', 'apollosv', 'efo', 'ncit', 'cemo', 'vido', 'cido', 'idocovid19', 'idomal', 'vsmo', 'covoc', 'probonto', 'geonames']
A list of all prefixes used in MIRA
- DOCKER_FILES_ROOT = PosixPath('/sw')
The root path of the MIRA app when running in a container
Web Client (mira.dkg.web_client)
- web_client(endpoint, method, query_json=None, api_url=None)[source]
A wrapper for sending requests to the REST API and returning the results
- Parameters:
endpoint (
str) – The endpoint to send the request to.method (
Literal['get','post']) – Which method to use. Must be one of ‘post’ and ‘get’.query_json (
Union[Dict[str,Any],List[Tuple[str,Any]],None]) –The data to send with the request. This parameter must be filled if method is ‘post’. If method is ‘get’, and the endpoint expects a list, this parameter needs to be a list of tuples of key-value pairs, i.e. [(key, value)], as per the requests api: https://requests.readthedocs.io/en/latest/api/#requests.get To provide a list for one parameter, repeat the key with each value of the list.
Example: If the endpoint expect key1 to be a list and key2 to be parameter, sending [(key1, value1), (key1, value2), (key2, value3)] as query_json will result in the endpoint receiving the variables key1=[value1, value2], key2=value3
api_url (
Optional[str]) – Provide the base URL to the REST API. Use this argument to override the default set in MIRA_REST_URL or rest_url from the config file.
- Return type:
- Returns:
The data sent back from the endpoint as a json, unless the response is empty, in which case None is returned.
- get_relations_web(relations_model, api_url=None)[source]
Get relations based on the query contained in the RelationQuery model
A wrapper that call the REST API’s get_relations endpoint.
- Parameters:
- Return type:
- Returns:
If any relation exists, a list of RelationResponse models or FullRelationResponse models if a full query was requested.
Examples
To populate the RelationQuery BaseModel, follow this example:
from mira.dkg.api import RelationQuery from mira.dkg.web_client import get_relations_web relation_query = RelationQuery(target_curie="ncbitaxon:10090", relations="vo:0001243") relations = get_relations_web(relations_model=relation_query) print(relations[:5])
- get_entity_web(curie, api_url=None)[source]
Get information about an entity based on its compact URI (CURIE)
A wrapper that calls the REST API’s entity endpoint.
- Parameters:
- Return type:
- Returns:
Returns an Entity model, if the entity exists in the graph.
- get_entities_web(curies)[source]
Get information about multiple entities (e.g., their names, description synonyms, alternative identifiers, database cross-references, etc.) based on their respective compact URIs (CURIEs).
A wrapper that calls the REST API’s entities endpoint.
- get_lexical_web(api_url=None)[source]
Get lexical information for all entities in the graph
A wrapper that calls the REST API’s lexical endpoint.
- ground_web(text, namespaces=None, api_url=None)[source]
Ground text with Gilda to an ontology identifier
A wrapper that calls the REST API’s grounding POST endpoint
- Parameters:
- Return type:
Optional[GroundResults]- Returns:
If the query results in at least one grounding, a GroundResults model is returned with all the results.
- search_web(term, limit=25, offset=0, api_url=None)[source]
Get nodes based on a search to their name/synonyms
A wrapper that call the REST API’s search endpoint
- Parameters:
- Return type:
- Returns:
A list of the matching entities.
- get_transitive_closure_web(relation_types=None, api_url=None)[source]
Get a transitive closure for the given relation type(s)
- Parameters:
- Return type:
- Returns:
A set of tuples of CURIEs representing a transitive closure set for the relations of the requested type(s). The pairs are ordered as (successor, descendant). Note that if the relations are ones that point towards taxonomical parents (e.g., subclassof, part_of), then the pairs are interpreted as (taxonomical child, taxonomical ancestor).
- is_ontological_child_web(child_curie, parent_curie, api_url=None)[source]
Check if one curie is a child term of another curie
- Parameters:
child_curie (
str) – The entity, identified by its CURIE that is assumed to be a child termparent_curie (
str) – The entity, identified by its CURIE that is assumed to be a parent termapi_url (
Optional[str]) – Use this parameter to specify the REST API base url or to override the url set in the environment or the config
- Return type:
- Returns:
True if the assumption that child_curie is an ontological child of parent_curie holds
- exception MissingBaseUrlError[source]
Bases:
ValueErrorRaised when the base url for the REST API is missing