Documentation Index
Fetch the complete documentation index at: https://docs.getcollate.io/llms.txt
Use this file to discover all available pages before exploring further.
Get Lineage
Retrieve the lineage graph for an entity, including upstream and downstream edges. You can query by entity ID or fully qualified name.
Get by Entity Type and ID
Type of the entity. Options: table, dashboard, pipeline, topic, mlmodel, container, searchIndex, storedProcedure, dashboardDataModel, apiEndpoint.
UUID of the entity to retrieve lineage for.
Number of hops to traverse upstream (min: 0, max: 3).
Number of hops to traverse downstream (min: 0, max: 3).
Include soft-deleted entities in the lineage graph.
Get by Entity Type and FQN
Use GET /v1/lineage/{entityType}/name/{fqn} to retrieve lineage by fully qualified name.
Type of the entity. Options: table, dashboard, pipeline, topic, mlmodel, container, searchIndex, storedProcedure, dashboardDataModel, apiEndpoint.
Fully qualified name of the entity (e.g., sample_data.ecommerce_db.shopify.dim_customer).
Number of hops to traverse upstream (min: 0, max: 3).
Number of hops to traverse downstream (min: 0, max: 3).
Include soft-deleted entities in the lineage graph.
GET /v1/lineage/{entityType}/{id}
from metadata.generated.schema.entity.data.table import Table
from metadata.ingestion.ometa.ometa_api import OpenMetadata
from metadata.generated.schema.entity.services.connections.metadata.openMetadataConnection import (
OpenMetadataConnection,
)
from metadata.generated.schema.security.client.openMetadataJWTClientConfig import (
OpenMetadataJWTClientConfig,
)
server_config = OpenMetadataConnection(
hostPort="https://your-company.getcollate.io/api",
authProvider="openmetadata",
securityConfig=OpenMetadataJWTClientConfig(
jwtToken="<YOUR-JWT-TOKEN>"
),
)
metadata = OpenMetadata(server_config)
# Get lineage by fully qualified name
lineage = metadata.get_lineage_by_name(
entity=Table,
fqn="sample_data.ecommerce_db.shopify.dim_customer",
up_depth=1,
down_depth=1,
)
print(f"Entity: {lineage['entity']['fullyQualifiedName']}")
print(f"Upstream edges: {len(lineage.get('upstreamEdges', []))}")
print(f"Downstream edges: {len(lineage.get('downstreamEdges', []))}")
# Get lineage by ID
lineage = metadata.get_lineage_by_id(
entity=Table,
entity_id="455e3d9d-dbbf-455e-b3be-7191daa825f3",
up_depth=3,
down_depth=2,
)
{
"entity": {
"id": "455e3d9d-dbbf-455e-b3be-7191daa825f3",
"type": "table",
"name": "dim_customer",
"fullyQualifiedName": "sample_data.ecommerce_db.shopify.dim_customer",
"deleted": false,
"href": "http://localhost:8585/api/v1/tables/455e3d9d-dbbf-455e-b3be-7191daa825f3"
},
"nodes": [
{
"id": "800caa0f-a149-48d2-a0ce-6ca84501767e",
"type": "table",
"name": "raw_customer",
"fullyQualifiedName": "sample_data.ecommerce_db.shopify.raw_customer",
"deleted": false,
"href": "http://localhost:8585/api/v1/tables/800caa0f-a149-48d2-a0ce-6ca84501767e"
},
{
"id": "c3d4e5f6-a1b2-7890-abcd-ef1234567890",
"type": "dashboard",
"name": "customer_dashboard",
"fullyQualifiedName": "sample_superset.customer_dashboard",
"deleted": false,
"href": "http://localhost:8585/api/v1/dashboards/c3d4e5f6-a1b2-7890-abcd-ef1234567890"
}
],
"upstreamEdges": [
{
"fromEntity": "800caa0f-a149-48d2-a0ce-6ca84501767e",
"toEntity": "455e3d9d-dbbf-455e-b3be-7191daa825f3",
"lineageDetails": {
"sqlQuery": "INSERT INTO dim_customer SELECT id, name FROM raw_customer",
"columnsLineage": [
{
"fromColumns": [
"sample_data.ecommerce_db.shopify.raw_customer.id"
],
"toColumn": "sample_data.ecommerce_db.shopify.dim_customer.customer_id"
}
]
}
}
],
"downstreamEdges": [
{
"fromEntity": "455e3d9d-dbbf-455e-b3be-7191daa825f3",
"toEntity": "c3d4e5f6-a1b2-7890-abcd-ef1234567890"
}
]
}
Returns
Returns the lineage graph centered on the requested entity, including upstream and downstream edges up to the specified depth.
Response
The entity reference for the node at the center of the lineage graph.
Unique identifier (UUID).
Entity type (e.g., table, dashboard, pipeline).
Fully qualified name of the entity.
Whether the entity has been soft-deleted.
List of entity references for all nodes in the lineage graph (excluding the center entity).
Edges pointing into the center entity (data sources).
UUID of the source entity.
UUID of the destination entity.
Optional details about the lineage edge.
SQL query driving the transformation.
Column-level lineage mappings.
List of source column FQNs.
Entity reference for the pipeline powering the transformation.
Edges pointing away from the center entity (data destinations). Same structure as upstreamEdges.
Error Handling
| Code | Error Type | Description |
|---|
401 | UNAUTHORIZED | Invalid or missing authentication token |
403 | FORBIDDEN | User lacks permission to view lineage |
404 | NOT_FOUND | Entity with given ID or FQN does not exist |