-
Notifications
You must be signed in to change notification settings - Fork 28
feat(agent): add ontology binding to Data Fabric context config #1728
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sankalp-uipath
wants to merge
32
commits into
main
Choose a base branch
from
feat/agent-datafabric-ontology-binding
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+339
−7
Open
Changes from all commits
Commits
Show all changes
32 commits
Select commit
Hold shift + click to select a range
8badd70
feat(agent): add ontology binding to Data Fabric context config
sankalp-uipath 906d618
feat(entities): add ontology binding + get_ontology_file to Data Fabr…
sankalp-uipath cd4ff88
feat(agent): allow multiple ontologies per context (ontologySet)
sankalp-uipath 8175316
Merge remote-tracking branch 'origin/main' into feat/agent-datafabric…
sankalp-uipath 2048c56
fix(entities): scope ontology fetch via header_folder, not missing _f…
sankalp-uipath 28d3c0c
feat(entities): validate ontology file_type; require folderId; add co…
sankalp-uipath 33f76f0
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath d4ccd79
chore: bump uipath to 2.11.8 and uipath-platform to 0.1.72
sankalp-uipath f22074c
docs(entities): mark get_ontology_file_async as Preview Feature
sankalp-uipath 74d47bb
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath bcbf2dd
chore: bump uipath to 2.11.9 (main advanced to 2.11.8)
sankalp-uipath 75aaab5
feat(agent): ontology as standalone resource (ontologyRefs)
sankalp-uipath 336bfb3
Merge remote-tracking branch 'origin/main' into feat/agent-datafabric…
sankalp-uipath c231702
test: annotate parsed for mypy (var-annotated)
sankalp-uipath 2fe9114
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath 6877f6a
chore: bump uipath to 2.11.11 (above main)
sankalp-uipath 69d42df
refactor(agent): nest ontology as ontologySet on context
sankalp-uipath 1ce9049
chore: merge main; bump uipath 2.11.13 / platform 0.1.77
sankalp-uipath 9e22841
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath b6f0c9a
refactor(agent): model ontology as a datafabricontology context (bump…
sankalp-uipath 56ac4a4
chore: merge main; bump uipath 2.11.14 / platform 0.1.79 (above main)
sankalp-uipath ee66ada
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath 54e45ef
refactor(entities): extract ontology fetch into EntityOntologyService
sankalp-uipath 372b2ca
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath 43e40b2
refactor(entities): drop unused ontology referenceKey; bump platform …
sankalp-uipath 2d28efb
style: ruff-format ontologySet test fixture
sankalp-uipath 5b134ed
test(entities): assert SDK surfaces API rejection of unsupported onto…
sankalp-uipath 3a15ed4
refactor(platform): rename ontology fetch to get_ontology_bundle_async
sankalp-uipath 8b58314
Merge remote-tracking branch 'origin/main' into feat/agent-datafabric…
sankalp-uipath 78757ee
Revert "refactor(platform): rename ontology fetch to get_ontology_bun…
sankalp-uipath 1bce87e
chore(uipath): bump version 2.12.5 -> 2.12.6 (2.12.5 already on PyPI)
sankalp-uipath 12856fb
Merge branch 'main' into feat/agent-datafabric-ontology-binding
sankalp-uipath File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
packages/uipath-platform/src/uipath/platform/entities/_entity_ontology_service.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,80 @@ | ||
| """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 | ||
| 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), | ||
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.