get_entity_relationship_map_for_asset

CatalogApi.get_entity_relationship_map_for_asset(role_id, datasource_id, asset_id, depth=None, traversal_direction=None, _request_timeout=None, _request_auth=None, _content_type=None, _headers=None, _host_index=0)

Get the entity relationship map for an asset

Returns the dependency graph of a catalog asset: the asset itself plus the assets it depends on and that depend on it, as a flat node list with edges carried inside each node. Important restriction: this operation is supported only for ArcGIS datasources. Calling it for a datasource of any other type is rejected with IPV-1002, regardless of whether the asset exists. The caller needs at least read-only access on the datasource. An asset with no dependencies is not an error: the response is HTTP 200 with a single-element graph describing the asset itself and empty Input and Output arrays. Note this returns a different shape from GET /{resource}/{id}/lineageV2, which uses the OpenLineage-based LineageResponse schema.

Parameters:
  • role_id (str) – Amorphic role ID the request is authorized against. Must be a role the caller belongs to. (required)

  • datasource_id (str) – Identifier of the datasource that owns the asset. Must exist and must be of type “arcgis”. (required)

  • asset_id (str) – Identifier of the asset to start traversal from. Must exist within the given datasource. (required)

  • depth (int) – Maximum number of relationship hops to traverse from the starting asset. Must be between 1 and 500 inclusive; anything outside that range, or a non-integer, is rejected with IPV-1002.

  • traversal_direction (str) – Direction to traverse. “downstream” follows dependents and “upstream” follows dependencies. Omitting the parameter is a third, distinct behaviour: the graph is traversed in both directions. Any other value is rejected with IPV-1002.

  • _request_timeout (int, tuple(int, int), optional) – timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts.

  • _request_auth (dict, optional) – set to override the auth_settings for an a single request; this effectively ignores the authentication in the spec for a single request.

  • _content_type (str, Optional) – force content-type for the request.

  • _headers (dict, optional) – set to override the headers for a single request; this effectively ignores the headers in the spec for a single request.

  • _host_index (int, optional) – set to override the host_index for a single request; this effectively ignores the host_index in the spec for a single request.

Return type:

CatalogItemDependenciesResponse

Returns:

Returns the result object.

Request and Response Examples

HTTP: GET /catalog/{datasource_id}/item-dependencies/{asset_id}

Parameter examples

Name

In

Example

role_id

header

"role-admin"

datasource_id

path

"c2f7d3b1-1a2b-4d8e-9f3a-2b3c4d5e6f70"

asset_id

path

"b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f"

depth

query

10

traversal_direction

query

"downstream"

Success (HTTP 200)

The dependency graph. Returned even when the asset has no dependencies, in which case the graph holds only the asset itself.

Feature service with a dependent layer

{
  "LineageGraph": [
    {
      "ResourceId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f",
      "ResourceType": "FeatureService",
      "ResourceName": "Customer Service",
      "Input": [],
      "Output": [
        {
          "Origin": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f",
          "Destination": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f#layers/0"
        }
      ],
      "Metadata": {
        "description": "Customer feature service",
        "tags": [
          "geo",
          "customers"
        ],
        "url": "https://services.arcgis.com/abc/arcgis/rest/services/Customers/FeatureServer"
      },
      "IsOutsideCatalog": false,
      "AccessType": "read-only"
    },
    {
      "ResourceId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f#layers/0",
      "ResourceType": "FeatureLayer",
      "ResourceName": "Customer Locations",
      "Input": [
        {
          "Origin": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f",
          "Destination": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f#layers/0"
        }
      ],
      "Output": [],
      "Metadata": {
        "description": "Customer location feature layer",
        "tags": [
          "geo"
        ],
        "url": "https://services.arcgis.com/abc/arcgis/rest/services/Customers/FeatureServer/0"
      },
      "IsOutsideCatalog": true,
      "AccessType": "read-only"
    }
  ]
}

Asset with no dependencies, still HTTP 200

{
  "LineageGraph": [
    {
      "ResourceId": "b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f",
      "ResourceType": "FeatureLayer",
      "ResourceName": "Standalone Layer",
      "Input": [],
      "Output": [],
      "Metadata": {
        "description": "A layer with no relationships",
        "tags": [],
        "url": "https://services.arcgis.com/abc/arcgis/rest/services/Standalone/FeatureServer/0"
      },
      "IsOutsideCatalog": false,
      "AccessType": "owner"
    }
  ]
}

Errors

Documented error codes: IPV-1002, AUTH-1012, AUTH-1001.

HTTP 400

Input validation or authorization failure. Body is {“Message”: “<CODE> - <text>”}.

Note that IPV-1002 covers four distinct causes, distinguishable only by the message text: the datasource does not exist, the datasource is not an ArcGIS datasource, the asset does not exist within that datasource, and depth is out of range or not an integer. An invalid traversal_direction also uses IPV-1002. AUTH-1012 indicates the caller lacks read-only access on the datasource, and AUTH-1001 that the role_id header is missing.

Unknown datasource

{
  "Message": "IPV-1002 - Invalid DatasourceId - c2f7d3b1-1a2b-4d8e-9f3a-2b3c4d5e6f70, resource not found."
}

Datasource is not an ArcGIS datasource

{
  "Message": "IPV-1002 - Dependency graph is only supported for ArcGIS Datasource Assets"
}

Unknown asset within the datasource

{
  "Message": "IPV-1002 - Invalid AssetId - b1e6c2a0-9f4d-4c7a-8f2e-1a2b3c4d5e6f, resource not found."
}

depth outside the 1 to 500 range

{
  "Message": "IPV-1002 - Invalid value for depth, must be an integer between 1 and 500"
}

Caller lacks read-only access on the datasource

{
  "Message": "AUTH-1012 - User is not authorized to perform this operation"
}

HTTP 500

Backend failure. Body is {“Message”: “<CODE> - <text>”}.