Skip to content

SQL

SQLImplementation dataclass

Bases: EntityInterface, AssociationInterface

Implementation of Monarch Interfaces for SQL endpoint

get_associations

Retrieve paginated association records, with filter options

Parameters:

Name Type Description Default
category str

Filter to only associations matching the specified category. Defaults to None.

None
predicate str

Filter to only associations matching the specified predicate. Defaults to None.

None
subject str

Filter to only associations matching the specified subject. Defaults to None.

None
object str

Filter to only associations matching the specified object. Defaults to None.

None
subject_closure str

Filter to only associations with the specified term ID as an ancestor of the subject. Defaults to None.

None
object_closure str

Filter to only associations the specified term ID as an ancestor of the object. Defaults to None.

None
entity str

Filter to only associations where the specified entity is the subject or the object. Defaults to None.

None
association_type str

Filter to only associations matching the specified association label. Defaults to None.

required
compact bool

Whether to return compact or full association records. Defaults to False.

False
offset int

Result offset, for pagination. Defaults to 0.

0
limit int

Limit results to specified number. Defaults to 20.

20

Returns:

Name Type Description
AssociationResults Union[AssociationResults, CompactAssociationResults]

Dataclass representing results of an association search.

get_entity

Retrieve a specific entity by exact ID match, writh optional extras

Parameters:

Name Type Description Default
id str

id of the entity to search for.

required
get_association_counts bool

Whether to get association counts. Defaults to False.

required
get_hierarchy bool

Whether to get the entity hierarchy. Defaults to False.

required

Returns:

Name Type Description
Entity Entity

Dataclass representing results of an entity search.