Graph Traversal
Production - Path finding, cycle detection, pattern matching, statistics
Graph Traversal provides algorithms for navigating the context graph to discover paths between entities, detect cycles, find patterns, and compute graph statistics.
12.5.2.1Traversal Operations
# Find shortest path between entities
curl -X POST http://localhost:8000/api/v1/context-graph/traverse/path \
-H "Content-Type: application/json" \
-H "X-Tenant-ID: acme-corp" \
-d '{
"source": "orders_table",
"target": "customer_segment_metric",
"max_depth": 5
}'
# Find all neighbors within depth
curl "http://localhost:8000/api/v1/context-graph/traverse/neighbors?entity_id=orders_table&depth=2&tenant_id=acme-corp"
# Get graph statistics
curl "http://localhost:8000/api/v1/context-graph/statistics?tenant_id=acme-corp"{
"statistics": {
"total_entities": 1247,
"total_relationships": 3842,
"entity_types": {"table": 89, "column": 734, "metric": 156, "concept": 268},
"relationship_types": {"belongs_to": 734, "references": 412, "derived_from": 156},
"avg_degree": 6.2,
"max_depth": 8
}
}