biocontext_kb.core.ols
======================

.. py:module:: biocontext_kb.core.ols


Functions
---------

.. autoapisummary::

   biocontext_kb.core.ols.get_available_ontologies
   biocontext_kb.core.ols.get_cell_ontology_terms
   biocontext_kb.core.ols.get_chebi_terms_by_chemical
   biocontext_kb.core.ols.get_efo_id_by_disease_name
   biocontext_kb.core.ols.get_go_terms_by_gene
   biocontext_kb.core.ols.get_term_details
   biocontext_kb.core.ols.get_term_hierarchical_children
   biocontext_kb.core.ols.search_ontology_terms


Package Contents
----------------

.. py:function:: 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.
   :rtype: dict


.. py:function:: 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.
   :rtype: dict


.. py:function:: 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.
   :rtype: dict


.. py:function:: 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.
   :rtype: dict


.. py:function:: 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.
   :rtype: dict


.. py:function:: 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.
   :rtype: dict


.. py:function:: 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.
   :rtype: dict


.. py:function:: 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.
   :rtype: dict


