feat(agent): add ontology binding to Data Fabric context config#1728
feat(agent): add ontology binding to Data Fabric context config#1728sankalp-uipath wants to merge 21 commits into
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-ontology-binding # Conflicts: # packages/uipath-platform/src/uipath/platform/entities/_entities_service.py
…older_key_headers
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
🚨 Heads up:
|
…-ontology-binding # Conflicts: # packages/uipath-platform/pyproject.toml # packages/uipath-platform/uv.lock # packages/uipath/pyproject.toml # packages/uipath/uv.lock
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
9ee4757 to
1ce9049
Compare
🚨 Heads up:
|
|
| # with a letter, max 64 chars. The name becomes a URL path segment. | ||
| _ONTOLOGY_NAME_RE = re.compile(r"^[a-z][a-z0-9-]{0,63}$") | ||
| # Allowed ontology component file types (also URL path segments). | ||
| _ONTOLOGY_FILE_TYPES = frozenset({"owl", "r2rml", "shacl", "summary", "context"}) |
There was a problem hiding this comment.
Whats the rationale here?
| This method is currently experimental. Behavior and parameters are | ||
| subject to change in future versions. | ||
|
|
||
| Ontologies are served by the same QueryEngine service as entity SQL |
There was a problem hiding this comment.
Remove this implementation detail from the doc
| self._validate_ontology_name(ontology_name) | ||
| self._validate_file_type(file_type) | ||
| spec = self._ontology_file_spec(ontology_name, file_type) | ||
| headers = {"Accept": "application/json", **header_folder(folder_key, None)} |
There was a problem hiding this comment.
Do you need this? Generally its handled by the spec method through base class.
| return response.json() | ||
|
|
||
| @staticmethod | ||
| def _validate_ontology_name(ontology_name: str) -> None: |
There was a problem hiding this comment.
All these helper methods needs to move away from this file. I would suggest to create entities_ontology_service separately and consume just the ontology methods from this class.
| description: Optional[str] = None | ||
|
|
||
|
|
||
| class DataFabricOntologyItem(BaseModel): |
There was a problem hiding this comment.
Same for this. Move it to entities_ontology_service
| ) | ||
|
|
||
| name: str | ||
| ontology_key: Optional[str] = Field(None, alias="referenceKey") |
There was a problem hiding this comment.
Ontology is not solution aware at this point. Does it make sense for this to come from here?
| None, description="Context settings" | ||
| ) | ||
| entity_set: Optional[List[DataFabricEntityItem]] = Field(None, alias="entitySet") | ||
| ontology_set: Optional[List[DataFabricOntologyItem]] = Field( |
There was a problem hiding this comment.
Is the plan to add set of ontologies or single ontology ? Set doesnt make sense to me , but let me know if that decision has already been settled. cc: @milind-jain-uipath



What
Adds Data Fabric ontology binding to the agent context model: a context can carry one or more ontologies that the runtime fetches to ground Text2SQL.
agent/models/agent.py—AgentContextResourceConfig.ontology_set(aliasontologySet), a list ofDataFabricOntologyItemnested in the context alongsideentitySet.platform/entities/entities.py—DataFabricOntologyItem({name, folderId, referenceKey?, description?}), mirroringDataFabricEntityItem; exported fromplatform.entities.platform/entities/_entities_service.py—get_ontology_file_async(ontology_name, file_type="owl", folder_key=None): validates name and file_type, hitsGET datafabric_/api/ontologies/{name}/files/{type}on the authenticated, folder-scoped client.Why
An ontology is part of a Data Fabric context — domain knowledge over the same entities — so it is configured inline on the context (a sibling of
entitySet), mirroring how entities are bound. Each ontology carries its ownfolderIdso it can live in a different folder from the entities.Notes
ontology_setdefaults toNone.^[a-z][a-z0-9-]{0,63}$) and file_type (owl/r2rml/shacl/summary/context) are allowlisted before entering the URL.ontologySetparse/dump, requiredfolderIdper item, backward-compat default, full-AgentDefinitionnormalization;get_ontology_file_asynccovered for spec, folder header, file types, rejected name/type.uipath→2.11.13,uipath-platform→0.1.77, pinuipath-platform>=0.1.77; lockfiles relocked.Development Packages
uipath-platform
uipath