Commit 96912a6
feat: add optional OWL ontology compiler for Data Fabric writes
Builds the ontology layer from write RFC v2. The OWL ontology is the
authoring/storage format; it is compiled into a CompiledOntology
intermediate representation (NOT injected as raw OWL — research shows
LLMs reason poorly over raw OWL Turtle).
- compiled_ontology.py: CompiledOntology model (entity_access,
measure_fields, state_fields, reference_fields, hitl_operations,
entity_relationships) per RFC §5.2
- ontology_compiler.py: compile_ontology(owl_turtle) via rdflib.
Supports both ontology dialects — the .ttl dialect (rdfs:subClassOf
df:WritableEntity + action-derived ops + df:hasField) and the RFC
dialect (a df:WritableEntity + df:allowsOperation). Resilient to
partial annotations; raises OntologyCompileError only on malformed
Turtle.
- write_validation.py: validate_mutation_intent gains optional
compiled_ontology — rejects operations not in entity_access. State
transition validation deferred to v3 (documented TODO).
- datafabric_tool.py: DataFabricWriteHandler best-effort fetches +
compiles the ontology via get_ontology_file_async. The method is
absent from the current platform package, so this degrades gracefully
to the metadata-only path (compiled_ontology stays None) — the build
does not break.
- rdflib>=7.0.0 added to dependencies.
23 new tests (refund + order-management dialects, RFC dialect, graceful
paths). 109 datafabric_tool tests pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 80886b2 commit 96912a6
8 files changed
Lines changed: 867 additions & 3 deletions
File tree
- src/uipath_langchain/agent/tools/datafabric_tool
- tests/agent/tools/datafabric_tool
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | 30 | | |
| |||
Lines changed: 62 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
Lines changed: 55 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
168 | 169 | | |
169 | 170 | | |
170 | 171 | | |
| 172 | + | |
171 | 173 | | |
172 | 174 | | |
173 | 175 | | |
| |||
203 | 205 | | |
204 | 206 | | |
205 | 207 | | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
206 | 221 | | |
207 | | - | |
| 222 | + | |
| 223 | + | |
208 | 224 | | |
209 | 225 | | |
210 | 226 | | |
211 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
212 | 262 | | |
213 | 263 | | |
214 | 264 | | |
| |||
243 | 293 | | |
244 | 294 | | |
245 | 295 | | |
246 | | - | |
247 | | - | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
248 | 300 | | |
249 | 301 | | |
250 | 302 | | |
| |||
0 commit comments