Skip to content

feat(platform): ontology records read and aggregate, and a typed graph with its version - #2033

Draft
venkat202 wants to merge 2 commits into
mainfrom
feat/ontology-records-api
Draft

venkat202 wants to merge 2 commits into
mainfrom
feat/ontology-records-api

Conversation

@venkat202

@venkat202 venkat202 commented Nov 29, 2026 •

Copy link
Copy Markdown
Contributor

Why

Agents that answer business questions from an ontology read data through the Ontology service's Records API: one request with joins written as field paths, plus counts, totals and groups through the aggregate endpoint. OntologyService offered only the raw graph and SQL, so each caller wrote its own HTTP client and models for these calls.

What

OntologyService (uipath-platform) gains:

  • Records calls: read_records and aggregate_records (a count is an aggregate with no group_by), each sync and async, with the ontology binding (resource_override) and @traced like the existing methods.
    • Reads take RecordsQuery: select, filter, any_of, expand, sort and a cursor page, with joins as field paths (placedBy.customerName). trace=True returns the statements sent.
    • Aggregates answer as SqlResult, the shape /sql already answers.
  • Typed graph: get_graph_view, which reads the compiled graph as typed views (objects, properties with codes, filter operators, measures, relationships with cardinality) together with its ETag. It returns None when if_none_match names the current version (304).
  • Refusals: OntologyProblem.of(EnrichedException) reads a refusal's code, message, retriable flag and per-field faults (pointer, didYouMean, fix).

New modules: ontology/records.py and ontology/graph.py. Version 0.3.21 → 0.3.22.

Verified

  • 12 new tests in tests/services/test_ontology_records.py (pytest-httpx): request bodies by alias, nested records, trace statements, aggregate, path encoding, refusal parsing, and the graph view with ETag/304.
  • The full package test suite, ruff check, ruff format --check and mypy src tests pass.
  • Used end to end by the ontology agent (UiPath/uipath-langchain-python, feat/ontology-agent) against a local Ontology runtime and against alpha Data Fabric.

🤖 Generated with Claude Code

…ed graph with its version

OntologyService gains the ontology runtime's Records API: read_records (joins as field
paths, alternatives, expansions, sort, cursor page, optional run trace), count_records and
aggregate_records (answered as SqlResult, the shape /sql answers), each sync and async with
the ontology binding and tracing the other methods have. get_graph_view reads the compiled
graph as typed views with its ETag and answers None when if_none_match names the current
version. OntologyProblem reads a refusal's code, message and per-field faults
(pointer, didYouMean, fix) from the EnrichedException.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The Ontology runtime's POST /ontology/{id}/records/{object}/aggregate (AggregateReader) reads its
filter and anyOf exactly as a records read does, and a count is an aggregate with no group_by. So
count_records, RecordsCountQuery and RecordsCount are removed: aggregate_records answers how many,
totals and groups with one request shape. The runtime's /count endpoint is unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@venkat202 venkat202 changed the title feat(platform): ontology records read, count and aggregate, and a typed graph with its version feat(platform): ontology records read and aggregate, and a typed graph with its version Nov 29, 2026
@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants