Repository navigation
Description
Parent epic: https://github.com/open-metadata/ai-platform/issues/224 ("Make the MCP knowledge-graph tools usable by non-admin MCP clients for large lineage questions").
Problem
A customer on 2.0.1 needed column-level lineage at scale through MCP:
get_entity_lineagewithincludeColumnLineage=trueclipped the graph to 139 of 4,523 edges;- there is no pagination, no way to start from a column, and no edge filters;
- the workaround was
search_metadatafor each column, then one lineage call per column. That's many calls, and it breaks when a downstream consumer renames the field. - AskCollate couldn't answer either.
The team agreed on two paths, so RDF doesn't become mandatory for OSS:
- Fix
get_entity_lineage(start from a column FQN, a pagination cursor, edge filters). Tracked in the MCP epic, not here. - Offer the knowledge graph through MCP, this issue, with an internal check that RDF is enabled and a graceful answer otherwise.
Most of the MCP graph tooling already exists (#28042, 2026-08-30): sparql_query, entity_neighborhood, ontology_describe, shacl_validate. RdfMcpTool.repository() already throws RdfNotEnabledException when RDF is off, so the graceful check is there. What blocks this use case:
- The tools are admin-only.
RdfMcpTool.executecallsauthorizer.authorizeAdmin(securityContext), and bot tokens are rejected, so ordinary MCP users can't use them at all. - A single answer can't fit. Responses are capped at 80 KB (
RdfBody.MAX_BYTES). 4,523 column edges at about 150 bytes each is roughly 680 KB, so one query comes backtruncated. SPARQL can page (ORDER BY+LIMIT/OFFSET) and filter (type, service, owner), butsparql_query's description doesn't tell external clients to. - Following a column across many hops is unproven. Column lineage is projected (
RdfRepository, the lineage-details node →om:hasColumnLineage→om:ColumnLineagewithom:fromColumn/om:toColumn/om:transformFunction). But the column FQNs are plain string literals, not column resources.- Starting from a column FQN works.
- Following it across hops needs a join on those strings at each hop, e.g.
"<col>" (^om:fromColumn/om:toColumn)+ ?downstream. That's untested, and may be slow at thousands of edges.
- External clients get no vocabulary guidance.
sparql_query's description has examples but not the rules ai-platform'squeryKnowledgeGraphneeded: lineage direction (?output om:upstream ?source), binding assets byom:fullyQualifiedName, binding owners, tiers and tags. The ai-platform My Data and Followers are empty #1348 benchmark showed the model depends on them.
Scope
-
Authorization: non-admin access through the
ExecuteSparqlQuerypermission (as the agent endpoint does, Add permissioned read-only SPARQL execution for the 2.1 graph agent tool #33384) instead ofauthorizeAdmin, keeping the RDF-off check. Decide whether bot tokens are allowed.- Security: without asset-level SPARQL permissions (Add asset-level RBAC for read-only SPARQL queries #33224), a granted user can get aggregates over assets they can't otherwise see. Record the decision: gate this on Add asset-level RBAC for read-only SPARQL queries #33224, or accept the risk in writing. It's the same decision as ai-platform#1370's option (a).
-
Verify column-lineage traversal on a realistic graph (thousands of edges): from one column FQN, return every downstream (and upstream) column across hops, within the query timeout.
- Record the working query, or the reason it doesn't work.
- If the string-literal model can't do it, propose the change (e.g. project columns as resources with
om:hasColumnplus column-to-column edges) before building anything else.
-
Guidance for external clients in
sparql_query's description, within its budget:- how to page large results (
ORDER BY+LIMIT/OFFSET, and what to do withtruncated: true); - how to filter edges;
- the core vocabulary rules above;
- a column-lineage query template.
Point to
ontology_describefor the rest, which must also be reachable by non-admins. - how to page large results (
-
Tests: authorization (admin, granted user, ungranted user, bot token, RDF off → graceful error), and a column-lineage fixture queried across several hops, including paging.
-
Benchmark: add a question of this shape (column lineage from one column, thousands of edges, with a filter) to ai-platform's graph benchmark (
benchmarks/data/collate_graph_routing_v1.tsv). The generated catalog has no column lineage today, so the fixture needs it.
Out of scope
get_entity_lineagechanges: column FQN start, pagination cursor, edge filters. Tracked in the MCP epic.- Asset-level RBAC itself: Add asset-level RBAC for read-only SPARQL queries #33224.
Done when
A non-admin MCP client with ExecuteSparqlQuery can:
- get the complete downstream column lineage of one column on a graph with thousands of edges, paging through
sparql_query; - filter it by asset type;
- get a clear "RDF is not enabled" answer on a deployment without RDF.
Related: ai-platform#224, ai-platform#1370, ai-platform#1348, #28042, #33384, #33224.
Activity
Fixes #34270: Pick the sparql_query profile from the caller's subject…
Fixes #34270: Drop the unused Authorizer parameter from the RDF tools…
12 remaining items
Fixes #34270: Make the projection-not-ready error state-aware so a de…
Fixes #34270: Make non-admin find_by_tag, entity_neighborhood and ont…
Fixes #34270: State that bots hold the SPARQL grant by default and na…
Fixes #34270: Link the ontology literal-versus-IRI follow-up issue fr…
Fixes #34270: Keep the applied 2.1.0 grant statement unchanged and up…
Fixes #34270: Place the rule-description statement beside the grant i…
Fixes #34270: Cover the projection states and the audit service actor…
Fixes #34270: Record why the fixed-read MCP tools check readiness bef…
Fixes #34270: State that the 80,000-byte sparql_query body cap is the…
Fixes #34270: Say that an empty column-lineage result on a store not …
Fixes open-metadata#34270: Make the MCP knowledge-graph tools usable …