Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
8badd70
feat(agent): add ontology binding to Data Fabric context config
sankalp-uipath Jun 17, 2026
906d618
feat(entities): add ontology binding + get_ontology_file to Data Fabr…
sankalp-uipath Jun 17, 2026
cd4ff88
feat(agent): allow multiple ontologies per context (ontologySet)
sankalp-uipath Jun 17, 2026
8175316
Merge remote-tracking branch 'origin/main' into feat/agent-datafabric…
sankalp-uipath Jun 17, 2026
2048c56
fix(entities): scope ontology fetch via header_folder, not missing _f…
sankalp-uipath Jun 22, 2026
28d3c0c
feat(entities): validate ontology file_type; require folderId; add co…
sankalp-uipath Jun 22, 2026
33f76f0
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath Jun 22, 2026
d4ccd79
chore: bump uipath to 2.11.8 and uipath-platform to 0.1.72
sankalp-uipath Jun 22, 2026
f22074c
docs(entities): mark get_ontology_file_async as Preview Feature
sankalp-uipath Jun 23, 2026
74d47bb
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath Jun 23, 2026
bcbf2dd
chore: bump uipath to 2.11.9 (main advanced to 2.11.8)
sankalp-uipath Jun 23, 2026
75aaab5
feat(agent): ontology as standalone resource (ontologyRefs)
sankalp-uipath Jun 23, 2026
336bfb3
Merge remote-tracking branch 'origin/main' into feat/agent-datafabric…
sankalp-uipath Jun 23, 2026
c231702
test: annotate parsed for mypy (var-annotated)
sankalp-uipath Jun 23, 2026
2fe9114
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath Jun 24, 2026
6877f6a
chore: bump uipath to 2.11.11 (above main)
sankalp-uipath Jun 24, 2026
69d42df
refactor(agent): nest ontology as ontologySet on context
sankalp-uipath Jun 25, 2026
1ce9049
chore: merge main; bump uipath 2.11.13 / platform 0.1.77
sankalp-uipath Jun 25, 2026
9e22841
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath Jun 25, 2026
b6f0c9a
refactor(agent): model ontology as a datafabricontology context (bump…
sankalp-uipath Jun 25, 2026
56ac4a4
chore: merge main; bump uipath 2.11.14 / platform 0.1.79 (above main)
sankalp-uipath Jun 25, 2026
ee66ada
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath Jun 27, 2026
54e45ef
refactor(entities): extract ontology fetch into EntityOntologyService
sankalp-uipath Jun 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/uipath-platform/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "uipath-platform"
version = "0.1.78"
version = "0.1.80"
description = "HTTP client library for programmatic access to UiPath Platform"
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"""

from ._entities_service import EntitiesService
from ._entity_ontology_service import DataFabricOntologyItem
from .entities import (
AggregateRow,
ChoiceSetValue,
Expand Down Expand Up @@ -46,6 +47,7 @@
"AggregateRow",
"ChoiceSetValue",
"DataFabricEntityItem",
"DataFabricOntologyItem",
"EntitiesService",
"Entity",
"EntityAggregate",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
from ..common._execution_context import UiPathExecutionContext
from ..orchestrator._folder_service import FolderService
from ._entity_data_service import EntityDataService, FileContent
from ._entity_ontology_service import EntityOntologyService
from ._entity_resolution import (
build_resolution_service,
create_resolution_plan,
Expand Down Expand Up @@ -104,6 +105,11 @@ def __init__(
folders_service=folders_service,
routing_strategy=self._routing_strategy,
)
self._ontology = EntityOntologyService(
config=config,
execution_context=execution_context,
folders_service=folders_service,
)

# ------------------------------------------------------------------
# Schema operations — delegate to EntitySchemaService
Expand Down Expand Up @@ -1100,6 +1106,29 @@ async def delete_record_async(self, entity_key: str, record_id: str) -> None:
"""
await self._data.delete_record_async(entity_key, record_id)

async def get_ontology_file_async(
self,
Comment on lines +1109 to +1110
ontology_name: str,
file_type: str = "owl",
folder_key: Optional[str] = None,
) -> Dict[str, Any]:
Comment thread
sankalp-uipath marked this conversation as resolved.
"""Fetch one file of an ontology from Data Fabric.

!!! warning "Preview Feature"
This method is currently experimental. Behavior and parameters are
subject to change in future versions.

Args:
ontology_name (str): Name of the ontology.
file_type (str): The ontology file to fetch — one of owl, r2rml,
shacl, summary, context.
folder_key (Optional[str]): Key of the folder the ontology lives in.

Returns:
Dict[str, Any]: The file record (e.g. ``content``, ``mediaType``).
"""
return await self._ontology.get_file_async(ontology_name, file_type, folder_key)

@traced(name="entity_record_insert_batch", run_type="uipath")
def insert_records(
self,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
"""Ontology-side operations for the Data Fabric entities surface.

Handles retrieval of ontology component files (OWL schema, R2RML mapping, and
other typed files). Entity schema and record operations are managed by
:class:`EntitySchemaService` / :class:`EntityDataService` and exposed alongside
ontology operations through :class:`EntitiesService`.
"""

from typing import Any, Dict, Optional

from pydantic import BaseModel, ConfigDict, Field

from ..common._base_service import BaseService
from ..common._config import UiPathApiConfig
from ..common._execution_context import UiPathExecutionContext
from ..common._folder_context import header_folder
from ..common._models import Endpoint, RequestSpec
from ..orchestrator._folder_service import FolderService


class DataFabricOntologyItem(BaseModel):
"""A single Data Fabric ontology reference from agent configuration."""

model_config = ConfigDict(
validate_by_name=True, validate_by_alias=True, extra="allow"
)

name: str
ontology_key: Optional[str] = Field(None, alias="referenceKey")
folder_key: str = Field(alias="folderId")
description: Optional[str] = None
id: Optional[str] = None


class EntityOntologyService(BaseService):
"""HTTP service for Data Fabric ontology file retrieval.

Backend target: ``datafabric_/api/ontologies``.

See Also:
https://docs.uipath.com/data-service/automation-cloud/latest/user-guide/introduction

!!! warning "Preview Feature"
This service is currently experimental. Behavior and parameters are
subject to change in future versions.
"""

def __init__(
self,
config: UiPathApiConfig,
execution_context: UiPathExecutionContext,
folders_service: Optional[FolderService] = None,
) -> None:
"""Initialise the ontology service."""
super().__init__(config=config, execution_context=execution_context)
self._folders_service = folders_service

async def get_file_async(
self,
ontology_name: str,
file_type: str = "owl",
folder_key: Optional[str] = None,
) -> Dict[str, Any]:
"""Internal implementation; see :meth:`EntitiesService.get_ontology_file_async`."""
spec = self._ontology_file_spec(ontology_name, file_type, folder_key)
response = await self.request_async(
spec.method, spec.endpoint, headers=spec.headers
)
return response.json()

@staticmethod
def _ontology_file_spec(
ontology_name: str, file_type: str, folder_key: Optional[str] = None
) -> RequestSpec:
return RequestSpec(
method="GET",
endpoint=Endpoint(
f"datafabric_/api/ontologies/{ontology_name}/files/{file_type}"
),
headers=header_folder(folder_key, None),
)
57 changes: 57 additions & 0 deletions packages/uipath-platform/tests/services/test_entities_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -2647,3 +2647,60 @@ def test_5xx_with_batch_shape_still_propagates(
entity_key=str(entity_key),
records=[{"name": "x"}],
)


class TestGetOntologyFileAsync:
"""Tests for EntitiesService.get_ontology_file_async (delegates to
EntityOntologyService). The HTTP call goes through ``service._ontology``,
so the sub-service's ``request_async`` is what gets patched."""

@pytest.mark.anyio
async def test_builds_endpoint_and_folder_header(
self, service: EntitiesService
) -> None:
response = MagicMock()
response.json.return_value = {"content": "OWL", "mediaType": "text/plain"}
service._ontology.request_async = AsyncMock(return_value=response) # type: ignore[method-assign]

result = await service.get_ontology_file_async(
"library", "owl", folder_key="folder-1"
)

assert result == {"content": "OWL", "mediaType": "text/plain"}
service._ontology.request_async.assert_called_once()
call = service._ontology.request_async.call_args
method, endpoint = call.args[0], call.args[1]
headers = call.kwargs["headers"]
assert method == "GET"
assert str(endpoint) == "/datafabric_/api/ontologies/library/files/owl"
# Accept is added centrally by BaseService, not per-call.
assert headers["x-uipath-folderkey"] == "folder-1"

@pytest.mark.anyio
async def test_no_folder_header_when_folder_key_none(
self, service: EntitiesService
) -> None:
response = MagicMock()
response.json.return_value = {"content": "OWL", "mediaType": "text/plain"}
service._ontology.request_async = AsyncMock(return_value=response) # type: ignore[method-assign]

await service.get_ontology_file_async("library")

headers = service._ontology.request_async.call_args.kwargs["headers"]
assert "x-uipath-folderkey" not in headers

@pytest.mark.anyio
@pytest.mark.parametrize(
"file_type", ["owl", "r2rml", "shacl", "summary", "context"]
)
async def test_accepts_allowed_file_types(
self, service: EntitiesService, file_type: str
) -> None:
response = MagicMock()
response.json.return_value = {"content": "x"}
service._ontology.request_async = AsyncMock(return_value=response) # type: ignore[method-assign]

await service.get_ontology_file_async("library", file_type)

endpoint = service._ontology.request_async.call_args.args[1]
assert str(endpoint) == f"/datafabric_/api/ontologies/library/files/{file_type}"
2 changes: 1 addition & 1 deletion packages/uipath-platform/uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions packages/uipath/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
[project]
name = "uipath"
version = "2.11.13"
version = "2.11.15"
description = "Python SDK and CLI for UiPath Platform, enabling programmatic interaction with automation services, process management, and deployment tools."
readme = { file = "README.md", content-type = "text/markdown" }
requires-python = ">=3.11"
dependencies = [
"uipath-core>=0.5.21, <0.6.0",
"uipath-runtime>=0.11.4, <0.12.0",
"uipath-platform>=0.1.78, <0.2.0",
"uipath-platform>=0.1.80, <0.2.0",
"click>=8.3.1",
"httpx>=0.28.1",
"pyjwt>=2.10.1",
Expand Down
11 changes: 10 additions & 1 deletion packages/uipath/src/uipath/agent/models/agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
)
from uipath.eval.mocks import ExampleCall
from uipath.platform.connections import Connection
from uipath.platform.entities import DataFabricEntityItem
from uipath.platform.entities import DataFabricEntityItem, DataFabricOntologyItem
from uipath.platform.guardrails import (
BuiltInValidatorGuardrail,
)
Expand Down Expand Up @@ -169,6 +169,7 @@ class AgentContextType(str, CaseInsensitiveEnum):
INDEX = "index"
ATTACHMENTS = "attachments"
DATA_FABRIC_ENTITY_SET = "datafabricentityset"
DATA_FABRIC_ONTOLOGY = "datafabricontology"


class AgentMessageRole(str, CaseInsensitiveEnum):
Expand Down Expand Up @@ -440,6 +441,9 @@ class AgentContextResourceConfig(BaseAgentResourceConfig):
None, description="Context settings"
)
entity_set: Optional[List[DataFabricEntityItem]] = Field(None, alias="entitySet")
ontology_set: Optional[List[DataFabricOntologyItem]] = Field(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@sankalp-uipath sankalp-uipath Jun 27, 2026

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please correct me if am wrong @milind-jain-uipath
Yes plan is to allow users to add set of ontologies

None, alias="ontologySet"
)
Comment on lines 443 to +446
argument_properties: Dict[str, AgentToolArgumentProperties] = Field(
{}, alias="argumentProperties"
)
Expand All @@ -449,6 +453,11 @@ def is_datafabric(self) -> bool:
"""Check if this context is a Data Fabric entity set resource."""
return self.context_type == AgentContextType.DATA_FABRIC_ENTITY_SET

@property
def is_datafabric_ontology(self) -> bool:
"""Check if this context is a Data Fabric ontology resource."""
return self.context_type == AgentContextType.DATA_FABRIC_ONTOLOGY

@property
def datafabric_entity_identifiers(self) -> list[str]:
"""Extract entity identifiers from entitySet."""
Expand Down
Loading
Loading