Iterate over relationships

async AsyncCogniteClient.relationships.__call__(
chunk_size: int | None = None,
source_external_ids: SequenceNotStr[str] | None = None,
source_types: SequenceNotStr[str] | None = None,
target_external_ids: SequenceNotStr[str] | None = None,
target_types: SequenceNotStr[str] | None = None,
data_set_ids: int | Sequence[int] | None = None,
data_set_external_ids: str | SequenceNotStr[str] | None = None,
start_time: dict[str, int] | None = None,
end_time: dict[str, int] | None = None,
confidence: dict[str, int] | None = None,
last_updated_time: dict[str, int] | None = None,
created_time: dict[str, int] | None = None,
active_at_time: dict[str, int] | None = None,
labels: LabelFilter | None = None,
limit: int | None = None,
fetch_resources: bool = False,
) AsyncIterator[Relationship] | AsyncIterator[RelationshipList]

Iterate over relationships

Fetches relationships as they are iterated over, so you keep a limited number of relationships in memory.

Parameters:
  • chunk_size (int | None) – Number of Relationships to return in each chunk. Defaults to yielding one relationship at a time.

  • source_external_ids (SequenceNotStr[str] | None) – Include relationships that have any of these values in their source External Id field

  • source_types (SequenceNotStr[str] | None) – Include relationships that have any of these values in their source Type field

  • target_external_ids (SequenceNotStr[str] | None) – Include relationships that have any of these values in their target External Id field

  • target_types (SequenceNotStr[str] | None) – Include relationships that have any of these values in their target Type field

  • data_set_ids (int | Sequence[int] | None) – Return only relationships in the specified data set(s) with this id / these ids.

  • data_set_external_ids (str | SequenceNotStr[str] | None) – Return only relationships in the specified data set(s) with this external id / these external ids.

  • start_time (dict[str, int] | None) – Range between two timestamps, minimum and maximum milliseconds (inclusive)

  • end_time (dict[str, int] | None) – Range between two timestamps, minimum and maximum milliseconds (inclusive)

  • confidence (dict[str, int] | None) – Range to filter the field for (inclusive).

  • last_updated_time (dict[str, int] | None) – Range to filter the field for (inclusive).

  • created_time (dict[str, int] | None) – Range to filter the field for (inclusive).

  • active_at_time (dict[str, int] | None) – Limits results to those active at any point within the given time range, i.e. if there is any overlap in the intervals [activeAtTime.min, activeAtTime.max] and [startTime, endTime], where both intervals are inclusive. If a relationship does not have a startTime, it is regarded as active from the beginning of time by this filter. If it does not have an endTime is will be regarded as active until the end of time. Similarly, if a min is not supplied to the filter, the min will be implicitly set to the beginning of time, and if a max is not supplied, the max will be implicitly set to the end of time.

  • labels (LabelFilter | None) – Return only the resource matching the specified label constraints.

  • limit (int | None) – No description.

  • fetch_resources (bool) – No description.

Yields:

Relationship | RelationshipList – yields Relationship one by one if chunk_size is not specified, else RelationshipList objects.