Skip to main content

Entities

Entities​

Entities(client: Connector = None, response: dict = None, type: str = None, spec: Query = None)

Bases: Subscriptable

This class is the common class to query any entity from ApertureDB. The specialized subclasses, which provide a more user friendly interface, are: * Blobs * Bounding Boxes * Images * Polygons * Videos

retrieve_entities classmethod​

retrieve_entities(client: Connector, spec: Query, with_adjacent: Dict[str, Query] = None) -> List[Entities]

Using the Entities.retrieve method, is a simple layer, with typical native queries converted using :class:~aperturedb.Query.Query

Parameters:

NameTypeDescriptionDefault
clientConnector

Connector object to the database.

required
specQuery

description

required

Raises:

TypeDescription
e

description

Returns:

TypeDescription
List[Entities]

List[Entities]: One collection of connected entities for each entity in this collection.

get_connected_entities​

get_connected_entities(etype: Union[ObjectType, str], constraints: Constraints = None) -> List[Entities]

Gets all entities adjacent to and clustered around items of the collection

Parameters:

NameTypeDescriptionDefault
etypeObjectType or str

Type or class of the connected entities to retrieve.

required
constraintsConstraints

Filter applied to the connected entities. Defaults to None.

None

Returns:

TypeDescription
List[Entities]

List[Entities]: One collection of connected entities for each entity in this collection.

get_blob​

get_blob(entity) -> Any

Helper to get blobs for FindImage, FindVideo and FindBlob commands.