Skip to content

feat(agent): add ontology binding to Data Fabric context config#1728

Open
sankalp-uipath wants to merge 21 commits into
mainfrom
feat/agent-datafabric-ontology-binding
Open

feat(agent): add ontology binding to Data Fabric context config#1728
sankalp-uipath wants to merge 21 commits into
mainfrom
feat/agent-datafabric-ontology-binding

Conversation

@sankalp-uipath

@sankalp-uipath sankalp-uipath commented Jun 17, 2026

Copy link
Copy Markdown

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.pyAgentContextResourceConfig.ontology_set (alias ontologySet), a list of DataFabricOntologyItem nested in the context alongside entitySet.
  • platform/entities/entities.pyDataFabricOntologyItem ({name, folderId, referenceKey?, description?}), mirroring DataFabricEntityItem; exported from platform.entities.
  • platform/entities/_entities_service.pyget_ontology_file_async(ontology_name, file_type="owl", folder_key=None): validates name and file_type, hits GET 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 own folderId so it can live in a different folder from the entities.

Notes

  • Additive + backward compatible: ontology_set defaults to None.
  • Path-injection guard: ontology name (^[a-z][a-z0-9-]{0,63}$) and file_type (owl/r2rml/shacl/summary/context) are allowlisted before entering the URL.
  • Tests: nested ontologySet parse/dump, required folderId per item, backward-compat default, full-AgentDefinition normalization; get_ontology_file_async covered for spec, folder header, file types, rejected name/type.
  • Consumed by uipath-langchain PR feat: add integration service invocation support #911.
  • Release: uipath2.11.13, uipath-platform0.1.77, pin uipath-platform>=0.1.77; lockfiles relocked.

Development Packages

uipath-platform

[project]
dependencies = [
  # Exact version (copy-paste ready):
  "uipath-platform==0.1.79.dev1017286965",

  # Any version from this PR (uncomment to use a range instead):
  # "uipath-platform>=0.1.79.dev1017280000,<0.1.79.dev1017290000",
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath-platform = { index = "testpypi" }

uipath

[project]
dependencies = [
  # Exact version (copy-paste ready):
  "uipath==2.11.14.dev1017286965",

  # Any version from this PR (uncomment to use a range instead):
  # "uipath>=2.11.14.dev1017280000,<2.11.14.dev1017290000",
]

[[tool.uv.index]]
name = "testpypi"
url = "https://test.pypi.org/simple/"
publish-url = "https://test.pypi.org/legacy/"
explicit = true

[tool.uv.sources]
uipath = { index = "testpypi" }
uipath-platform = { index = "testpypi" }

[tool.uv]
override-dependencies = ["uipath-platform==0.1.79.dev1017286965"]

Copilot AI review requested due to automatic review settings June 17, 2026 09:22
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-integrations labels Jun 17, 2026

This comment was marked as outdated.

Comment thread packages/uipath/src/uipath/agent/models/agent.py Outdated
sankalp-uipath and others added 4 commits June 17, 2026 15:22
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

This comment was marked as outdated.

@sankalp-uipath sankalp-uipath added the build:dev Create a dev build from the pr label Jun 22, 2026
@sankalp-uipath sankalp-uipath requested a review from Copilot June 22, 2026 20:15

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

Comment on lines +1112 to +1113
async def get_ontology_file_async(
self,
sankalp-uipath and others added 4 commits June 23, 2026 02:45
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>
@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-integrations cross-tests are FAILING 🚨

Your changes may break one or more integrations in uipath-integrations-python:

  • uipath-openai-agents
  • uipath-google-adk
  • uipath-agent-framework
  • uipath-llamaindex
  • uipath-pydantic-ai

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

sankalp-uipath and others added 3 commits June 23, 2026 18:18
…-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>

Copilot AI left a comment

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.

Pull request overview

Copilot reviewed 6 out of 8 changed files in this pull request and generated no new comments.

@sankalp-uipath sankalp-uipath force-pushed the feat/agent-datafabric-ontology-binding branch from 9ee4757 to 1ce9049 Compare June 25, 2026 08:30
@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@sonarqubecloud

Copy link
Copy Markdown

# 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"})

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.

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

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.

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)}

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.

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:

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.

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):

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.

Same for this. Move it to entities_ontology_service

)

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

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.

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(

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

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

Labels

build:dev Create a dev build from the pr 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.

4 participants