Skip to content

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

Open
sankalp-uipath wants to merge 23 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 23 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.80.dev1017286987",

  # Any version from this PR (uncomment to use a range instead):
  # "uipath-platform>=0.1.80.dev1017280000,<0.1.80.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.15.dev1017286987",

  # Any version from this PR (uncomment to use a range instead):
  # "uipath>=2.11.15.dev1017280000,<2.11.15.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.80.dev1017286987"]

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
# 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?

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.

removed them , my bad, QE already does these validations , so this was redundant.

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

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.

fixed.

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.

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.

Agreed, removed the redundant accept, and moved folder headers to request spec. please review again.

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.

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.

agreed
Among the helpers method validate name and filetype are deleted as per the previous comment, I have moved spec method to _entity_ontology_service and also added fetch logic there
Now get_ontology_file_async is a just thin method calling method from _entity_ontology_service.

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

@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.

fixed

)

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?

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.

Sorry I didn't get you why ontology not being solution aware will cause issue, currently folder id is just for scoping and coming from agent.json

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

@sankalp-uipath sankalp-uipath force-pushed the feat/agent-datafabric-ontology-binding branch from 70606dc to 941a175 Compare June 27, 2026 12:57
@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 →

@sankalp-uipath sankalp-uipath force-pushed the feat/agent-datafabric-ontology-binding branch from 941a175 to 9b6f320 Compare June 27, 2026 20:55
@sankalp-uipath sankalp-uipath force-pushed the feat/agent-datafabric-ontology-binding branch from 9b6f320 to e98f5a1 Compare June 27, 2026 21:22
@sonarqubecloud

Copy link
Copy Markdown

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