Skip to content

Search

SearchInterface

Bases: ABC

Abstract interface for searching the Monarch KG in a Lucene way

autocomplete

Parameters:

Name Type Description Default
q str

Query string to match against

required

Raises:

Type Description
NotImplementedError

Use a specific implementation (see the documentation for a list of implementations)

Returns:

Name Type Description
SearchResults SearchResults

Dataclass representing results of a generic entity search.

get_association_counts

Get counts of associations for a given entity Args: entity (str): Entity to get association counts for Returns: List[FacetValue]: List of FacetValue objects representing the counts of associations for the given entity

get_association_facets

Get facet counts and facet query counts for associations Args: facet_fields (List[str]): Facet fields to return counts for facet_queries (List[str]): Facet queries to return counts for category (str): Filter to only associations matching the specified category predicate (str): Filter to only associations matching the specified predicate subject (str): Filter to only associations matching the specified subject subject_closure (str): Filter to only associations with the specified term ID as an ancestor of the subject object (str): Filter to only associations matching the specified object object_closure (str): Filter to only associations with the specified term ID as an ancestor of the object entity (str): Filter to only associations where the specified entity is the subject or the object Returns: SearchResults: Dataclass representing results of a search, with zero rows returned but total count and faceting information populated

get_association_table

Get associations for an entity matching a specified type, with optional search and sort parameters

Parameters:

Name Type Description Default
entity str

Entity to get associations for

required
category str

Category of associations to return

required
query str

Query string to match against

None
sort str

Sort order, defaults to None

None
offset int

Offset of the first result to return, defaults to 0

0
limit int

Limit the number of results to return, defaults to 20

5

Returns:

Name Type Description
AssociationResults AssociationTableResults

Dataclass representing results of an association search.

search abstractmethod

Parameters:

Name Type Description Default
q str

Query string to match against

required
category str

Limit results to only this category

None
taxon str

Limit results to only this taxon

required
offset int

Offset of the first result to return, defaults to 0

0
limit int

Limit the number of results to return, defaults to 20

20

Raises:

Type Description
NotImplementedError

Use a specific implementation (see the documentation for a list of implementations)

Returns:

Name Type Description
EntityResults SearchResults

Dataclass representing results of a generic entity search.