biocontext_kb.core.ols#
Functions#
Query OLS for all available ontologies with their metadata. Use this first to discover available ontologies. |
|
|
Search OLS for Cell Ontology (CL) terms using a controlled vocabulary for cell types. |
|
Search OLS for ChEBI (Chemical Entities of Biological Interest) terms for a chemical or drug name. |
|
Search OLS for EFO/Mondo/HP IDs related to a disease name. Use this to get EFO IDs for Open Targets queries. |
|
Search OLS for Gene Ontology (GO) terms related to a gene name using structured vocabularies. |
|
Get comprehensive details about a specific ontology term including definition, synonyms, hierarchical relationships. |
|
Get hierarchical children of an ontology term from OLS. Includes subclasses and hierarchical properties. |
|
Search for terms across multiple ontologies in OLS. Use get_available_ontologies() first to discover ontologies. |
Package Contents#
- biocontext_kb.core.ols.get_available_ontologies()#
Query OLS for all available ontologies with their metadata. Use this first to discover available ontologies.
- Returns:
Ontologies list with id, name, description, prefix, homepage, number of terms, status or error message.
- Return type:
- biocontext_kb.core.ols.get_cell_ontology_terms(cell_type, size=10, exact_match=False)#
Search OLS for Cell Ontology (CL) terms using a controlled vocabulary for cell types.
- Returns:
Cell ontology terms with cl_terms array containing id, label, definition, synonyms or error message.
- Return type:
- Parameters:
- biocontext_kb.core.ols.get_chebi_terms_by_chemical(chemical_name, size=10, exact_match=False)#
Search OLS for ChEBI (Chemical Entities of Biological Interest) terms for a chemical or drug name.
- Returns:
ChEBI terms with chebi_terms array containing id, label, description, synonyms or error message.
- Return type:
- Parameters:
- biocontext_kb.core.ols.get_efo_id_by_disease_name(disease_name, size=5, exact_match=False)#
Search OLS for EFO/Mondo/HP IDs related to a disease name. Use this to get EFO IDs for Open Targets queries.
- Returns:
EFO IDs with efo_ids array containing id, label, description or error message.
- Return type:
- Parameters:
- biocontext_kb.core.ols.get_go_terms_by_gene(gene_name, size=10, exact_match=False)#
Search OLS for Gene Ontology (GO) terms related to a gene name using structured vocabularies.
- Returns:
GO terms with go_terms array containing id, label, description, type or error message.
- Return type:
- Parameters:
- biocontext_kb.core.ols.get_term_details(term_id, ontology_id)#
Get comprehensive details about a specific ontology term including definition, synonyms, hierarchical relationships.
- Returns:
Term details with id, label, definition, synonyms, hierarchical info, num_descendants or error message.
- Return type:
- Parameters:
- biocontext_kb.core.ols.get_term_hierarchical_children(term_id, ontology_id, size=20)#
Get hierarchical children of an ontology term from OLS. Includes subclasses and hierarchical properties.
- Returns:
Parent term, hierarchical_children array with id/label/definition, total_children, page_info or error message.
- Return type:
- Parameters:
- biocontext_kb.core.ols.search_ontology_terms(search_term, ontologies='', size=20, exact_match=False)#
Search for terms across multiple ontologies in OLS. Use get_available_ontologies() first to discover ontologies.
- Returns:
Terms array, terms_by_ontology grouped results, total_results, ontologies_found list or error message.
- Return type:
- Parameters:
search_term (Annotated[str, Field(description='Term to search for')])
ontologies (Annotated[str, Field(description="Comma-separated ontology IDs (e.g., 'efo,go,chebi'). Leave empty for all. Use get_available_ontologies() to see options")])
size (Annotated[int, Field(description='Maximum number of results to return')])
exact_match (Annotated[bool, Field(description='Whether to perform exact match search')])