Retrieve multiple relationships by external id

async AsyncCogniteClient.relationships.retrieve_multiple(
external_ids: SequenceNotStr[str],
fetch_resources: bool = False,
ignore_unknown_ids: bool = False,
) → RelationshipList

Retrieve multiple relationships by external id.

Deprecated since version 8.23.0: The Relationships API is deprecated and is scheduled for removal on 2027-12-31. Model connections as edges or direct relations in the data modeling service. See https://docs.cognite.com/cdf/deprecated for details and migration guidance.

Parameters:
  • external_ids (SequenceNotStr[str]) – External IDs

  • fetch_resources (bool) – If true, will try to return the full resources referenced by the relationship in the source and target fields.

  • ignore_unknown_ids (bool) – Ignore IDs and external IDs that are not found rather than throw an exception.

Returns:

The requested relationships.

Return type:

RelationshipList

Examples

Get relationships by external id:

>>> from cognite.client import CogniteClient, AsyncCogniteClient
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> res = client.relationships.retrieve_multiple(external_ids=["abc", "def"])