Search Interface

The search interface provides a largely implementation-neutral way to query an ontology. It allows for

  • exact or partial matches

  • matching the beginning of a term

  • regular expression search

It also allows you to control which metadata elements are searched over (typically labels and aliases)

Implementations may differ in their behavior. Some implementations may not be able to honor specific requests. For example, the SqlDatabaseImplementation implementation may not be able to fulfil regular expression queries.

Some endpoints may return results that are ranked by relevance, others may be arbitrary

Command Line

A good way to explore this interface is via the search subcommand:

Ubergraph uses relevancy ranking:

runoak -i ubergraph:uberon search limb

Exact match for a label using sqlite:

poetry run runoak -i db/cl.db search l=neuron

Inexact match for a label or synonym using sqlite:

poetry run runoak -i db/cl.db search .~neuron


Search uses the SearchDatamodel to specify both an input query and search results, see Datamodels


class oaklib.interfaces.search_interface.SearchInterface(resource: Optional[oaklib.resource.OntologyResource] = None, strict: bool = False)[source]

An Ontology Interface that supports text-based search

Search over ontology using the specified search term.

The search term may be a CURIE, label, or alias

  • search_term

  • config


As basic_search, using multiple terms

  • search_terms

  • config


class oaklib.interfaces.search_interface.SearchConfiguration(*args, _if_missing: Optional[Callable[[jsonasobj2._jsonobj.JsonObj, str], Tuple[bool, Any]]] = None, **kwargs)[source]

Parameters for altering behavior of search


many of these parameters are not yet implemented