i3x: expose Data Access datasets as i3X objects (FPLUS-44) - #730
i3x: expose Data Access datasets as i3X objects (FPLUS-44)#730AlexGodbehere wants to merge 3 commits into
Conversation
Datasets are ConfigDB objects (Dataset class + one structure app per type), so the store builds its object set from three list calls and class membership, re-polled on a timer. Each dataset sits under a synthetic Datasets folder with a shared Dataset ObjectType carrying a real schema. /value returns a descriptor: the dataset type, its structure, and a DCAT-shaped content block with the Data Access export href. Structure configs are read per request so a growing union stays current. HasComponent walks union -> members, session -> source dataset, device stream -> device (via an injected resolver). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MtATkkjtiFF8L6z98NFD8A
Objects, types, list, value, related and history all fall back to the DatasetStore. Dataset history answers 404 pointing at the content href in the value descriptor - the i3X history shape cannot express a multi-metric dataset. related routes become async for the store's per-request ConfigDB reads. I3X_DATA_ACCESS_EXTERNAL_URL configures the public export base; unset means descriptors carry no content block. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MtATkkjtiFF8L6z98NFD8A
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MtATkkjtiFF8L6z98NFD8A
Review walkthroughThree commits, reviewed in order. 1. Start with the header comment in
The ConfigDB UUIDs in 2. The pattern throughout is fallback: Subscriptions intentionally do not know about datasets: registering a dataset elementId reports 404 in the bulk envelope, which is honest — there is no value stream behind it. 3. Docs
What to poke at
|
Exposes Data Access datasets over i3X, closing the cross-server reference gap tracked as FPLUS-44: the mock MES hands consumers a
producedDatasetreference (this i3X server + a dataset UUID), and until now that reference resolved to nothing.What it does
GET /objects/:id/valuereturns a descriptor: the dataset type (SparkplugSrc/SessionLimits/Union), its structure (source device, coverage window, or member list), and a DCAT-shapedcontentblock pointing at the Data Access export (POST /v1/data/:uuid,application/zip,csv-per-device). Structure configs are read per request, so a union that grows while a run is live is always current.GET /objects/:id/related?relationshipType=i3x:rel:has-componentwalks the dataset graph: union → members, session window → its source dataset, device stream → the device object in the main tree.GET /objects/:id/historyon a dataset answers 404 pointing at the content href. The i3X history shape (one metric per object, flat VQT array) cannot express a multi-metric dataset — recorded as TID L5, with the deliberate spec-breaking experiment split out to FPLUS-45.I3X_DATA_ACCESS_EXTERNAL_URL: the public Data Access base URL for content hrefs. Unset → descriptors carry no content block, everything else still works.The store is deliberately separate from ObjectTree — the device pipeline (reactive refresh, UNS preservation, diffing) is untouched; APIv1 consults the store as a fallback on every object route. Dataset membership re-polls on a timer for now, same as devices did before the L1 notify work.
How to test
npx jest— 350 tests, 14 suites (8 new intest/datasets.test.tscovering load/filtering, all three descriptor shapes, fresh union reads, HasComponent walks, and the no-URL case).I3X_DATA_ACCESS_EXTERNAL_URLset, thenGET /v1/objects/bf62a1c3-8afe-4eaa-af79-12ae88a7384c(the demo CNC's machine dataset on fpd-ago) should answer 200 where it 404s today, and its/valuecontent href should download the export.🤖 Generated with Claude Code