MATIH Platform is in active MVP development. Documentation reflects current implementation status.
10. Data Catalog & Governance
Data Lineage
Full Lineage Graph

Full Lineage Graph

Full lineage provides complete bidirectional graph traversal, path finding between entities, and lineage statistics. It combines both upstream and downstream edges into a single connected graph.


Traverse Full Lineage

Traverse the lineage graph in both directions with configurable depth:

GET /v1/lineage/entity/{entityId}/traverse?tenantId={tenantId}&direction=BOTH&maxDepth=3
curl "http://localhost:8086/v1/lineage/entity/550e8400-e29b-41d4-a716-446655440001/traverse?tenantId=550e8400-e29b-41d4-a716-446655440000&direction=BOTH&maxDepth=5" \
  -H "Authorization: Bearer $TOKEN"

Parameters

ParameterDefaultDescription
tenantIdrequiredTenant UUID
directionBOTHUPSTREAM, DOWNSTREAM, or BOTH
maxDepth3Maximum traversal depth (1-10)

Response

{
  "entityId": "tbl-dim-orders",
  "direction": "BOTH",
  "maxDepth": 5,
  "upstream": [
    {
      "id": "edge-001",
      "sourceEntityFqn": "warehouse.raw.orders",
      "targetEntityFqn": "warehouse.analytics.dim_orders",
      "lineageType": "DIRECT",
      "lineageSource": "PIPELINE"
    },
    {
      "id": "edge-002",
      "sourceEntityFqn": "warehouse.raw.customers",
      "targetEntityFqn": "warehouse.analytics.dim_orders",
      "lineageType": "DIRECT",
      "lineageSource": "QUERY_ANALYSIS"
    }
  ],
  "downstream": [
    {
      "id": "edge-010",
      "sourceEntityFqn": "warehouse.analytics.dim_orders",
      "targetEntityFqn": "warehouse.reporting.monthly_sales",
      "lineageType": "DIRECT",
      "lineageSource": "PIPELINE"
    }
  ],
  "totalUpstreamEdges": 2,
  "totalDownstreamEdges": 1,
  "maxUpstreamDepth": 1,
  "maxDownstreamDepth": 1
}

Full Graph Visualization

Generate a complete lineage graph for rendering in the UI:

POST /api/v1/lineage/visualization/graph
curl -X POST "http://localhost:8086/api/v1/lineage/visualization/graph" \
  -H "Content-Type: application/json" \
  -H "X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "entityId": "550e8400-e29b-41d4-a716-446655440001",
    "direction": "BOTH",
    "maxDepth": 5,
    "includeColumnLineage": true,
    "entityTypeFilter": ["TABLE", "VIEW"],
    "lineageTypeFilter": ["DIRECT", "DERIVED"]
  }'

Response

{
  "graph": {
    "nodes": [
      {
        "id": "tbl-raw-orders",
        "name": "raw.orders",
        "type": "TABLE",
        "depth": -1,
        "metadata": {
          "database": "warehouse",
          "schema": "raw",
          "rowCount": 5000000
        }
      },
      {
        "id": "tbl-dim-orders",
        "name": "analytics.dim_orders",
        "type": "TABLE",
        "depth": 0,
        "metadata": {
          "database": "warehouse",
          "schema": "analytics",
          "rowCount": 4500000
        }
      },
      {
        "id": "tbl-monthly-sales",
        "name": "reporting.monthly_sales",
        "type": "TABLE",
        "depth": 1
      }
    ],
    "edges": [
      {
        "sourceId": "tbl-raw-orders",
        "targetId": "tbl-dim-orders",
        "lineageType": "DIRECT",
        "columnLineage": [
          { "sourceColumn": "amount", "targetColumn": "total_amount", "transformation": "CAST" },
          { "sourceColumn": "order_date", "targetColumn": "order_date", "transformation": "DIRECT_COPY" }
        ]
      },
      {
        "sourceId": "tbl-dim-orders",
        "targetId": "tbl-monthly-sales",
        "lineageType": "DERIVED"
      }
    ]
  },
  "metadata": {
    "entityId": "tbl-dim-orders",
    "direction": "BOTH",
    "maxDepth": 5,
    "actualDepth": 1,
    "totalNodes": 3,
    "totalEdges": 2
  }
}

Path Finding

Find all paths between two entities in the lineage graph:

GET /v1/lineage/path?tenantId={tenantId}&sourceEntityId={source}&targetEntityId={target}&maxDepth=5
curl "http://localhost:8086/v1/lineage/path?tenantId=550e8400-e29b-41d4-a716-446655440000&sourceEntityId=tbl-raw-orders&targetEntityId=tbl-monthly-sales&maxDepth=5" \
  -H "Authorization: Bearer $TOKEN"

Response

{
  "sourceEntityId": "tbl-raw-orders",
  "targetEntityId": "tbl-monthly-sales",
  "pathsFound": 1,
  "paths": [
    {
      "length": 2,
      "edges": [
        {
          "sourceEntityFqn": "warehouse.raw.orders",
          "targetEntityFqn": "warehouse.analytics.dim_orders",
          "lineageType": "DIRECT"
        },
        {
          "sourceEntityFqn": "warehouse.analytics.dim_orders",
          "targetEntityFqn": "warehouse.reporting.monthly_sales",
          "lineageType": "DERIVED"
        }
      ]
    }
  ]
}

Advanced Path Finding (Visualization Controller)

POST /api/v1/lineage/visualization/paths
curl -X POST "http://localhost:8086/api/v1/lineage/visualization/paths" \
  -H "Content-Type: application/json" \
  -H "X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer $TOKEN" \
  -d '{
    "sourceEntityId": "550e8400-e29b-41d4-a716-446655440001",
    "targetEntityId": "550e8400-e29b-41d4-a716-446655440002",
    "maxPaths": 3,
    "maxPathLength": 10
  }'

Lineage Statistics

Get aggregate lineage statistics for a tenant:

GET /v1/lineage/statistics?tenantId={tenantId}
curl "http://localhost:8086/v1/lineage/statistics?tenantId=550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer $TOKEN"

Response

{
  "totalEdges": 1247,
  "activeEdges": 1198,
  "deletedEdges": 49,
  "edgesByType": {
    "DIRECT": 892,
    "INDIRECT": 203,
    "DERIVED": 152
  },
  "edgesBySource": {
    "PIPELINE": 567,
    "QUERY_ANALYSIS": 389,
    "MANUAL": 45,
    "OPENMETADATA": 156,
    "INTEGRATION": 90
  },
  "averageConfidence": 0.87,
  "entitiesWithLineage": 456,
  "maxUpstreamDepth": 7,
  "maxDownstreamDepth": 5
}

Recent Lineage Changes

Track recently modified lineage edges:

GET /v1/lineage/recent?tenantId={tenantId}&limit=50
curl "http://localhost:8086/v1/lineage/recent?tenantId=550e8400-e29b-41d4-a716-446655440000&limit=20" \
  -H "Authorization: Bearer $TOKEN"

Lineage Overview

Get a comprehensive lineage health overview from the visualization controller:

GET /api/v1/lineage/visualization/overview
curl "http://localhost:8086/api/v1/lineage/visualization/overview" \
  -H "X-Tenant-ID: 550e8400-e29b-41d4-a716-446655440000" \
  -H "Authorization: Bearer $TOKEN"

Source Reference

ComponentFile
Graph traversalLineageController.java -- traverseLineage()
Path findingLineageController.java -- findPath()
StatisticsLineageController.java -- getStatistics()
Recent changesLineageController.java -- getRecentChanges()
Full graph visualizationLineageVisualizationController.java -- getLineageGraph()
Advanced path findingLineageVisualizationController.java -- findPaths()
OverviewLineageVisualizationController.java -- getLineageOverview()