Skip to content

feat(NTO): WoA predicate fills + Healthcare clinical-workflow bootstrap#2

Merged
AdaWorldAPI merged 2 commits into
masterfrom
claude/create-graph-ontology-crate-gkuJG
May 7, 2026
Merged

feat(NTO): WoA predicate fills + Healthcare clinical-workflow bootstrap#2
AdaWorldAPI merged 2 commits into
masterfrom
claude/create-graph-ontology-crate-gkuJG

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

Summary

Closes the per-attribute property gaps that blocked the woa-bridge and medcare-bridge from migrating to OGIT-O(1) lookup — the architectural anchor of Pillar 3 in lance-graph/.claude/plans/ogit-cascade-supabase-callcenter-v1.md (collapse bridges to 2-line projections over OntologyRegistry::enumerate(ns)).

Two consumer namespaces touched, two atomic commits:

Commit Files Lines Consumer What
74ef035 3 modified under NTO/WorkOrder/entities/ +191 woa-bridge 24 predicate fills across Order.ttl (+14), Customer.ttl (+8), Article.ttl (+2)
38c2788 14 added under NTO/Healthcare/ +846 medcare-bridge Healthcare namespace bootstrap: 7 clinical entities + 7 enumeration class-only stubs

Total: 17 files, +1037 LOC. Pure additions — no existing OGIT triple is mutated.

Scope

Commit 1 — feat(NTO/WorkOrder): expand entity properties for woa-bridge O(1) migration

Source-of-truth: AdaWorldAPI/WoA/models.py. Per the 2026-05-07 OGIT audit, three entities had property-list gaps relative to their Python source:

Order.ttl (+14 predicates): zeitStart, zeitEnde, anfahrten, mitarbeiter, pauseStunden, zusatzStunden, notizen, internNotizen, bezahltAm, mahnstufe, letzteMahnung, unterschrift, createdAt, updatedAt — temporal bounds, on-site labour, payment + dunning workflow, audit timestamps.

Customer.ttl (+8 predicates): anrede, mailAnrede, adresszusatz, fahrtKm, fahrtKosten, notizen, aktiv, createdAt — salutation, billing-address overflow, travel-cost derivation, internal notes, lifecycle.

Article.ttl (+2 predicates): lieferantAnr, aktiv — supplier-side SKU + lifecycle.

Every new predicate carries dcterms:source "AdaWorldAPI/WoA/models.py:<Class>.<field>" — extends the lance-graph-ontology-v5 D-1 (dcterms:source) discipline from entity-level to per-attribute level.

HistoryEntry.ttl was checked but not modified — already declares ogit:relates ogit.WorkOrder:User on line 30; the audit's "+1 missing" was a false positive against the v4-shipped state.

Commit 2 — feat(NTO/Healthcare): bootstrap clinical-workflow namespace for medcare-bridge

Source-of-truth: AdaWorldAPI/MedCare-rs/.MYSQL/Struktur.sql (104 MySQL tables; this PR maps the 7 minimum-viable clinical-workflow tables + 7 enumeration tables).

The medcare-bridge at lance-graph/crates/lance-graph-ontology/src/bridges/medcare_bridge.rs:12 locks NAMESPACE = "Healthcare" and previously failed at hydrate with UnknownNamespace because no NTO/Healthcare/ directory existed. This bootstrap unblocks it.

7 entity TTL files (650 lines) under NTO/Healthcare/entities/:

Entity Source table LOC
Patient.ttl praxis_patient 166
Visit.ttl praxis_patient_waitingroom 86
Diagnosis.ttl pf_diagnosis 95
Treatment.ttl pf_therapy 57
Medication.ttl pat_medication (relates 5 combo_medication_*) 124
VitalSign.ttl pf_vital_bloodpressure (base; pf_vital_* family extensible) 60
LabValue.ttl pf_laboratory_values (carries external loincid for future BioPortal LOINC) 62

7 enumeration TTL files (196 lines) under NTO/Healthcare/enumerations/ — class declarations only; values populated as a follow-on import (deferred):

combo_medication_typ, combo_medication_interval, combo_medication_dailydose, combo_medication_dose_unit, combo_medication_stop_reason, combo_addtreatment, combo_spez.

Relations:

  • Visit belongs Patient (via pid FK)
  • Diagnosis belongs Patient + relates Visit
  • Treatment belongs Patient
  • Medication belongs Patient + relates combo_medication_* enums
  • VitalSign belongs Patient
  • LabValue belongs Patient + carries external loincid
  • Patient belongs Tenant (via global ogit:tenant)

Cross-references

Out of scope (deferred, NOT punted)

  • docType enum formalization on Order.ttl — currently an unconstrained xsd:string. Formalizing requires a workspace-wide decision on OGIT enumeration shape (no prior art in NTO/ today; no existing ogit:Enumeration instances). Tracked as a v3 follow-on.
  • BioPortal arsenal (D-CASCADE-V1-4): namespace stubs under NTO/Medical/{ICD10CM,RxNorm,LOINC,FMA,RadLex,SNOMED,MONDO,HPO,DRON,CHEBI}/ — 25 ontologies, ~2.4 GB; full ingestion gated on the lance-graph-rdf-fma-snomed-v1 plan.
  • Full SNOMED CT / FMA / RadLex / LOINC import — license + size gated.
  • The remaining ~22 combo_* enumeration tables (pf_allergy_*, combo_operation, combo_vaccination, combo_morbidity, combo_addexamination, etc.) — only the 7 combo_* referenced by the 7 minimum entities are bootstrapped here.
  • Enumeration values for the 7 stubbed combo_* files — class declarations are present, values are a follow-on INSERT INTO ogit:Enumeration pass.
  • SMB namespace (NTO/SMB/): per lance-graph-ontology-v5 ratification Q1 (smb-ontology export-only forever), the SMB consumer keeps its native Rust dictionary in smb-office-rs::smb-ontology. OGIT SMB namespace is NOT created in this PR; on-demand export path is smb-ontology::export_ogit_ttl().

Test plan

  • Every new TTL file declares the canonical @prefix block (ogit:, ogit.<namespace>:, rdfs:, dcterms:, xsd:).
  • Every entity carries rdfs:subClassOf ogit:Entity + ogit:scope "NTO" + ogit:parent ogit:Node.
  • Every new predicate carries a rdfs:Property + rdfs:label + dcterms:description + dcterms:source (per v5 D-1 discipline).
  • Pure additions — no existing predicate or entity is mutated; no existing v4 triple is touched.
  • CI verification needed: Turtle-parse all 17 files via oxttl (lance-graph-ontology's parser dependency) and confirm zero parse errors. Local sandbox can't run cargo against this OGIT repo directly; lance-graph's hydrate_real_ogit example will exercise these on the consumer side.
  • Consumer-side smoke test: lance-graph::woa-rs/tests/ontology_cypher_round_trip.rs --features ontology should resolve ogit.WorkOrder:Order via OntologyRegistry::resolve_uri(...) and now reach the new predicates via enumerate("WorkOrder").

What's NOT in this PR

This PR does not open an upstream PR to almatoai/OGIT. Per lance-graph-ontology-v5 ratification Q4: AdaWorldAPI/OGIT is the extension-fork-only target; the upstream canonical repo never receives PRs from this workspace.

https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq


Generated by Claude Code

claude added 2 commits May 7, 2026 10:47
…ration

Closes the property gaps identified by the 2026-05-07 WoA OGIT audit
(per .claude/plans/lance-graph-ontology-v5.md follow-on work). 24 new
rdfs:Property declarations across three entities so the woa-bridge can
project every Python WoA/models.py field as a 2-line scoped view over
OntologyRegistry::enumerate("WorkOrder") per Pillar 3 of the v1
cascade plan.

- Order.ttl (+112 lines): zeitStart, zeitEnde, anfahrten, mitarbeiter,
  pauseStunden, zusatzStunden, notizen, internNotizen, bezahltAm,
  mahnstufe, letzteMahnung, unterschrift, createdAt, updatedAt — 14
  predicates covering temporal bounds, on-site labour, payment + dunning
  workflow, and audit timestamps.
- Customer.ttl (+64 lines): anrede, mailAnrede, adresszusatz, fahrtKm,
  fahrtKosten, notizen, aktiv, createdAt — 8 predicates covering
  salutation, billing-address overflow, travel-cost derivation,
  internal notes, and lifecycle.
- Article.ttl (+15 lines): lieferantAnr, aktiv — 2 predicates covering
  supplier-side SKU and lifecycle.

Provenance: every new predicate carries dcterms:source pointing at the
exact AdaWorldAPI/WoA/models.py field. Cross-ref: v5 D-1 (dcterms:source
threading already shipped at the entity level; this extends the same
pattern to the per-attribute level).

Out of scope: docType enum formalization. The audit flagged docType as
unconstrained xsd:string; formalizing it requires a workspace-wide
decision on OGIT enumeration shape (no prior art in NTO/ today). Tracked
as a v3 follow-on — does not block woa-bridge migration.

HistoryEntry.ttl unchanged: already declares ogit:relates ogit.WorkOrder:User
on line 30; the audit's "+1 missing" was a false positive against the
v4-shipped state.

https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
…re-bridge

Healthcare namespace did not exist before this commit; medcare-bridge
at lance-graph/crates/lance-graph-ontology/src/bridges/medcare_bridge.rs:12
locks NAMESPACE = "Healthcare" and previously failed at hydrate with
UnknownNamespace. This bootstraps the minimum-viable clinical workflow
so the bridge can be migrated to OGIT O(1) per Pillar 3 of the
ogit-cascade-supabase-callcenter-v1 plan.

7 entity TTL files (650 lines):
- Patient.ttl (166 lines, source: praxis_patient)
- Visit.ttl (86 lines, source: praxis_patient_waitingroom)
- Diagnosis.ttl (95 lines, source: pf_diagnosis)
- Treatment.ttl (57 lines, source: pf_therapy)
- Medication.ttl (124 lines, source: pat_medication; relates 5 combo_medication_*)
- VitalSign.ttl (60 lines, source: pf_vital_bloodpressure as base; pf_vital_*
  family extensible)
- LabValue.ttl (62 lines, source: pf_laboratory_values; loincid carried as
  external reference for future BioPortal LOINC ingestion)

7 enumeration TTL files (196 lines, header + class declaration only —
values populated as a follow-on import):
- combo_medication_typ
- combo_medication_interval
- combo_medication_dailydose
- combo_medication_dose_unit
- combo_medication_stop_reason
- combo_addtreatment
- combo_spez

Relations:
- Visit belongs Patient (pid FK)
- Diagnosis belongs Patient + relates Visit
- Treatment belongs Patient
- Medication belongs Patient + relates combo_medication_* enums
- VitalSign belongs Patient
- LabValue belongs Patient + carries external loincid
- Patient belongs Tenant (via global ogit:tenant predicate)

Out of scope (deferred to lance-graph-rdf-fma-snomed-v1):
- Full SNOMED CT / FMA / RadLex / LOINC import (license + size gated).
- BioPortal namespace stubs under OGIT/NTO/Medical/ (D-CASCADE-V1-4).
- The remaining ~22 combo_* enum tables (pf_allergy_*, combo_operation,
  combo_vaccination, combo_morbidity, etc.).

Provenance: every entity carries dcterms:source pointing at the exact
MedCare-rs/.MYSQL/Struktur.sql table.

https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
@AdaWorldAPI AdaWorldAPI merged commit 6c26164 into master May 7, 2026
AdaWorldAPI pushed a commit that referenced this pull request May 7, 2026
…ch validator

Follow-up to commit 13a8d3f. The codex-recommended flat depth-3
layout (NTO/Medical/<NAME>.ttl) passes single-file validator
invocation (java -jar bin/ogit-validator.jar <one-file>) but FAILS
batch invocation through ./validate.sh.

agent-ogit-validator-fix empirically verified: validate.sh's xargs-
batch pipeline triggers a path.subpath(2, getNameCount-1) extraction
that requires >= 4 path components. Depth-3 fails with "Directory
mismatch: <NAME>.ttl should be under directory Medical". Depth-4
(NTO/Medical/namespaces/<NAME>.ttl) yields "Validation successful".

Moved the 10 BioPortal namespace stubs (git mv preserves history):

  NTO/Medical/ICD10CM.ttl  -> NTO/Medical/namespaces/ICD10CM.ttl
  NTO/Medical/RxNorm.ttl   -> NTO/Medical/namespaces/RxNorm.ttl
  NTO/Medical/LOINC.ttl    -> NTO/Medical/namespaces/LOINC.ttl
  NTO/Medical/FMA.ttl      -> NTO/Medical/namespaces/FMA.ttl
  NTO/Medical/RadLex.ttl   -> NTO/Medical/namespaces/RadLex.ttl
  NTO/Medical/SNOMED.ttl   -> NTO/Medical/namespaces/SNOMED.ttl
  NTO/Medical/MONDO.ttl    -> NTO/Medical/namespaces/MONDO.ttl
  NTO/Medical/HPO.ttl      -> NTO/Medical/namespaces/HPO.ttl
  NTO/Medical/DRON.ttl     -> NTO/Medical/namespaces/DRON.ttl
  NTO/Medical/CHEBI.ttl    -> NTO/Medical/namespaces/CHEBI.ttl

The depth-4 layout still satisfies the codex P1 finding (file basename
== subject IRI local name). The new `namespaces/` parent segment is
canonical OGIT shape (mirrors `entities/`, `verbs/`, `enumerations/`).

SQL stubs at NTO/Medical/sql_mirror/<NAME>.ttl are already at depth-4
(4 components: NTO + Medical + sql_mirror + file) and pass the batch
validator after the metadata enrichment in commit fe551f0.

Verification:
- validate.sh on this checkout: ZERO errors mention Medical/ or sql_mirror/
- Other validate.sh errors (WorkOrder verbs Issued/HasPosition/
  AccessesPortal/OwnsPasswords basename mismatch + Tenant.ttl missing
  dcterms:valid/dcterms:creator/ogit:allowed) are pre-existing in the
  v4-shipped WorkOrder namespace from prior OGIT PR #1 + PR #2 merges.
  Out of scope for this PR; tracked as separate cleanup work.

Together with commits 13a8d3f (initial flat layout) and fe551f0
(SQL stub metadata enrichment), this closes both codex P1 findings
on #3.

https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants