import org.openmetadata.sdk.api.Lineage;// Get lineage by entity type and IDLineage.LineageGraph graph = Lineage.of("table", tableId) .upstream(3) .downstream(2) .fetch();String raw = graph.getRaw();// Get lineage with default depth (1 upstream, 1 downstream)Lineage.LineageGraph graph = Lineage.of("table", tableId).fetch();// Include deleted entitiesLineage.LineageGraph graph = Lineage.of("table", tableId) .includeDeleted(true) .fetch();
# Get lineage by entity type and IDcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3" \ -H "Authorization: Bearer {access_token}"# Get lineage with custom depthcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3?upstreamDepth=3&downstreamDepth=2" \ -H "Authorization: Bearer {access_token}"# Get lineage by fully qualified namecurl "{base_url}/api/v1/lineage/table/name/sample_data.ecommerce_db.shopify.dim_customer" \ -H "Authorization: Bearer {access_token}"# Get lineage including deleted entitiescurl "{base_url}/api/v1/lineage/table/name/sample_data.ecommerce_db.shopify.dim_customer?includeDeleted=true&upstreamDepth=2&downstreamDepth=2" \ -H "Authorization: Bearer {access_token}"
import org.openmetadata.sdk.api.Lineage;// Get lineage by entity type and IDLineage.LineageGraph graph = Lineage.of("table", tableId) .upstream(3) .downstream(2) .fetch();String raw = graph.getRaw();// Get lineage with default depth (1 upstream, 1 downstream)Lineage.LineageGraph graph = Lineage.of("table", tableId).fetch();// Include deleted entitiesLineage.LineageGraph graph = Lineage.of("table", tableId) .includeDeleted(true) .fetch();
# Get lineage by entity type and IDcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3" \ -H "Authorization: Bearer {access_token}"# Get lineage with custom depthcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3?upstreamDepth=3&downstreamDepth=2" \ -H "Authorization: Bearer {access_token}"# Get lineage by fully qualified namecurl "{base_url}/api/v1/lineage/table/name/sample_data.ecommerce_db.shopify.dim_customer" \ -H "Authorization: Bearer {access_token}"# Get lineage including deleted entitiescurl "{base_url}/api/v1/lineage/table/name/sample_data.ecommerce_db.shopify.dim_customer?includeDeleted=true&upstreamDepth=2&downstreamDepth=2" \ -H "Authorization: Bearer {access_token}"
Retrieve the lineage graph for an entity, including upstream and downstream edges. You can query by entity ID or fully qualified name.
The Python examples on this page use the original client (metadata.ingestion.ometa.ometa_api.OpenMetadata) because SDK 2.0 (metadata.sdk) doesn’t include lineage operations. For more information, see Which Python SDK Should I Use?.
import org.openmetadata.sdk.api.Lineage;// Get lineage by entity type and IDLineage.LineageGraph graph = Lineage.of("table", tableId) .upstream(3) .downstream(2) .fetch();String raw = graph.getRaw();// Get lineage with default depth (1 upstream, 1 downstream)Lineage.LineageGraph graph = Lineage.of("table", tableId).fetch();// Include deleted entitiesLineage.LineageGraph graph = Lineage.of("table", tableId) .includeDeleted(true) .fetch();
# Get lineage by entity type and IDcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3" \ -H "Authorization: Bearer {access_token}"# Get lineage with custom depthcurl "{base_url}/api/v1/lineage/table/455e3d9d-dbbf-455e-b3be-7191daa825f3?upstreamDepth=3&downstreamDepth=2" \ -H "Authorization: Bearer {access_token}"# Get lineage by fully qualified namecurl "{base_url}/api/v1/lineage/table/name/sample_data.ecommerce_db.shopify.dim_customer" \ -H "Authorization: Bearer {access_token}"# Get lineage including deleted entitiescurl "{base_url}/api/v1/lineage/table/name/sample_data.ecommerce_db.shopify.dim_customer?includeDeleted=true&upstreamDepth=2&downstreamDepth=2" \ -H "Authorization: Bearer {access_token}"