Skip to content

feat(NTO/Medical): 10 BioPortal namespace stubs + 25 MedCare-rs SQL transcodes#3

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

feat(NTO/Medical): 10 BioPortal namespace stubs + 25 MedCare-rs SQL transcodes#3
AdaWorldAPI merged 4 commits into
masterfrom
claude/create-graph-ontology-crate-gkuJG

Conversation

@AdaWorldAPI
Copy link
Copy Markdown
Owner

Summary

OGIT-fork half of the 12-agent palantir-cascade implementation push. Two commits, 35 new TTL files, +620 LOC. Sibling lance-graph PR carries the Rust-side codec cascade column extension that consumes these stubs.

Commit Source Files
c3b6a7b (Wave 2) AdaWorldAPI/MedCare-rs/releases/tag/bioportal-ontologies-2026-05-05 release manifest 10 BioPortal namespace stubs at NTO/Medical/{ICD10CM, RxNorm, LOINC, FMA, RadLex, SNOMED, MONDO, HPO, DRON, CHEBI}/namespace.ttl
3baf5b9 (Wave 3) AdaWorldAPI/MedCare-rs/.MYSQL/Struktur.sql (104 tables; this PR ships top 25) 25 entity stubs at NTO/Medical/sql_mirror/<EntityName>.ttl

Deliverables (2 D-ids)

D-CASCADE-V1-4 — BioPortal namespace stubs (Wave 2, agent-bioportal-stubs)

10 namespace stub TTL files, 170 LOC, under the 200-LOC envelope. Each declares ogit:Namespace + canonical ogit:contextIri + ogit:contextId + dcterms:source (citing the BioPortal release tag) + dcterms:license + ogit:fileSize + ogit:tripleCount + ogit:loaderCrate "lance-graph-rdf" + ogit:loaderStatus "stub".

Namespace contextId source filename size est triples license
ICD10CM 10 ICD10CM.ttl 51.6 MB ~1.8M UMLS-Metathesaurus
RxNorm 11 RXNORM.ttl 218.8 MB ~9M UMLS-Metathesaurus
LOINC 12 LOINC.ttl 739.2 MB ~30M LOINC-License
FMA 13 fma.owl 266.2 MB ~1.5M CC-BY-3.0
RadLex 14 RadLex.owl 64.9 MB ~600K RadLex-Free
SNOMED 15 SCTO.owl 666 KB (partial) ~50K (partial) SNOMED-Affiliate
MONDO 16 mondo-simple.owl 215.5 MB ~1.2M CC-BY-4.0
HPO 17 hp.obo 10.7 MB ~150K HPO-License
DRON 18 dron.owl 701.7 MB ~3M CC-BY-3.0
CHEBI 19 chebi.obo 259.6 MB ~1.5M CC-BY-4.0

ContextId allocations 10..19 byte-aligned with the lance-graph PR's NamespaceRegistry::seed_defaults() (cross-verified: meta-2 confirmed perfect agreement, no runtime negotiation).

D-CASCADE-V1-5 — MedCare-rs MySQL transcode (Wave 3, agent-mysql-transcode)

25 entity stubs, 450 LOC, mirroring the top tables from Struktur.sql (104 total; the remaining 80 are deferred to a follow-up sweep). Each declares rdfs:Class + rdfs:subClassOf ogit:Entity + dcterms:source "AdaWorldAPI/MedCare-rs/.MYSQL/Struktur.sql:<table>" + ogit:scope "NTO" + ogit:loaderStatus "stub" + ogit:columnCount <N> + ogit:primaryKey "<col>" + ogit:mysqlTable "<table>".

Top-25 selection (per medcare-bridge projection relevance):

  • praxis_* (10): praxis_addexamination, praxis_addtreatment, praxis_extpraxis, praxis_grund, praxis_lab_template_main, praxis_lab_template_values, praxis_licence, praxis_mitarbeiter, praxis_patient, praxis_waitingroom
  • pat_* (4): pat_addexamination, pat_addtreatment, pat_medication, pat_specialist
  • pf_* core (8): pf_alcohol, pf_allergy, pf_diagnosis, pf_drugs, pf_form_main, pf_inherit_disease, pf_laboratory_main, pf_laboratory_values
  • glob_* (3): glob_mailsmtp, glob_user_right, glob_vital_mod

EntityName mapping: PascalCase preserving prefix grouping (e.g. praxis_patientPraxisPatient, pf_diagnosisPfDiagnosis).

LOC overshoot rationale: 25 files × ~18 LOC each = 450 LOC, against a 150-LOC envelope (3.0×). Cause is structural: per-file Turtle requires @prefix blocks at top of each file (cannot share across files); the 11-predicate spec floor × 25 files = ~18 lines/file = 450 LOC structural minimum. agent-mysql-transcode appended a BLOCKER per the orchestration's META-NUDGE-5 discipline; main-thread arbitration ACCEPTED — consolidating into fewer files would damage per-table addressability (the whole point of Pillar 3 of the v1 cascade plan). The 150 envelope was a discipline target, not a feasibility floor for this many files.

Validation: rdflib parses all 25 cleanly. Spot-check ✓ on 3 tables: PraxisPatient=29, PfDiagnosis=17, GlobVitalMod=42.

Strengths (per meta-3)

  1. 10 BioPortal stubs at contextIds 10..19, byte-aligned with seed_defaults() in the lance-graph sibling PR — cross-verified zero drift.
  2. 25 MySQL transcodes with programmatic columnCount + primaryKey + dcterms:source citing Struktur.sql:<table> — every stub is a verifiable lineage entry.
  3. Pillar 4 lineage preserved — every stub cites the canonical source-of-truth (BioPortal release tag for V1-4; specific table in Struktur.sql for V1-5).

Concerns (per meta-3 — all deferable)

  1. 80 of 104 MedCare-rs tables deferred to follow-up sweep (the long tail of combo_* enum lookups + auxiliary utilities).
  2. 3 BioPortal rdfs:comment quality flags unvalidated against BioPortal metadata: SNOMED (SCTO.owl partial framing), DRON (RxNorm + FDA derivation), RadLex (four-facet framing modalities + anatomy + observations + procedures).
  3. Scope is NTO/Medical/ onlyNTO/WorkOrder/ was previously shipped (feat(NTO/WorkOrder): add WorkOrder namespace from AdaWorldAPI/WoA transcode (15 entities + 12 verbs) #1 + feat(NTO): WoA predicate fills + Healthcare clinical-workflow bootstrap #2); NTO/Healthcare/Network/SDF/SGO not touched in this push.

Test plan

  • All 35 TTL files syntactically valid (@prefix + entity declaration + 11+ predicates per stub).
  • rdflib parses all 25 MySQL stubs cleanly (validated by agent-mysql-transcode).
  • Spot-check ✓ on 3 tables: PraxisPatient=29 cols (matches praxis_patient SQL), PfDiagnosis=17 (matches pf_diagnosis), GlobVitalMod=42 (matches glob_vital_mod).
  • ContextId 10..19 cross-verified byte-aligned with sibling lance-graph NamespaceRegistry::seed_defaults().
  • Reviewer verification needed: 3 BioPortal stub rdfs:comment flags above.
  • Reviewer verification needed: spot-check 3 more MySQL columnCount values from any of the 22 unspot-checked stubs.

Per lance-graph-ontology-v5.md ratification Q4

This PR does not open an upstream PR to almatoai/OGIT. AdaWorldAPI/OGIT is the extension-fork-only target.

Cross-references

  • lance-graph sibling PR: AdaWorldAPI/lance-graph branch claude/create-graph-ontology-crate-gkuJGmain. Carries the Rust-side codec cascade column extension (Wave 3 agent-cascade-cols shipped MappingRow with cascade columns + thinking_style + attribute_sources) and the 9 other deliverables.
  • Prior OGIT PR: feat(NTO): WoA predicate fills + Healthcare clinical-workflow bootstrap #2 (merged earlier — NTO/WorkOrder predicate fills + NTO/Healthcare clinical-workflow bootstrap).
  • Plan: .claude/plans/ogit-cascade-supabase-callcenter-v1.md (in lance-graph) — Pillar 4 (BioPortal arsenal) + the SQL transcode design.

https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq


Generated by Claude Code

claude added 3 commits May 7, 2026 12:29
Records D-OGIT-HEALTHCARE-BOOTSTRAP run: 14 TTL files (846 lines)
under NTO/Healthcare/{entities,enumerations}/, validation result
(rdflib 14/14 ok, 690 triples), out-of-scope deferrals.
…V1-4)

agent-bioportal-stubs (Wave 2 of 12-agent palantir-cascade push) emitted
10 namespace stub TTL files under NTO/Medical/<NAMESPACE>/namespace.ttl.

Source: AdaWorldAPI/MedCare-rs/releases/tag/bioportal-ontologies-2026-05-05
release manifest. Stubs ONLY — no data load. Full ingestion gated on the
lance-graph-rdf-fma-snomed-v1 plan (lance-graph repo); each stub carries
ogit:loaderStatus "stub" + ogit:loaderCrate "lance-graph-rdf" pointers.

Per-stub shape: a ogit:Namespace + rdfs:label + rdfs:comment +
ogit:contextIri (BioPortal canonical form) + ogit:contextId +
dcterms:source + dcterms:license + ogit:fileSize + ogit:tripleCount +
ogit:loaderCrate + ogit:loaderStatus.

ContextId allocations (10..19) align with the lance-graph
NamespaceRegistry::seed_defaults() reservation shipped in lance-graph
commit 8366e70 (Wave 2 sibling agent-context-id):

| Namespace | contextId | source filename | size | est triples |
|---|---|---|---|---|
| ICD10CM | 10 | ICD10CM.ttl | 51.6 MB | ~1.8M |
| RxNorm  | 11 | RXNORM.ttl | 218.8 MB | ~9M |
| LOINC   | 12 | LOINC.ttl | 739.2 MB | ~30M |
| FMA     | 13 | fma.owl | 266.2 MB | ~1.5M |
| RadLex  | 14 | RadLex.owl | 64.9 MB | ~600K |
| SNOMED  | 15 | SCTO.owl | 666 KB (partial) | ~50K |
| MONDO   | 16 | mondo-simple.owl | 215.5 MB | ~1.2M |
| HPO     | 17 | hp.obo | 10.7 MB | ~150K |
| DRON    | 18 | dron.owl | 701.7 MB | ~3M |
| CHEBI   | 19 | chebi.obo | 259.6 MB | ~1.5M |

Directory labels stay human-readable (SNOMED, HPO); contextIri uses
BioPortal canonical form (SNOMEDCT, HP).

10 files × 17 LOC = 170 LOC total. Under the 200-LOC envelope.

Quality flags for downstream meta-2 validation:
- SNOMED: SCTO.owl is 666 KB partial (full SNOMED CT is license-gated;
  the BioPortal release ships only the upper-level concept fragment).
- DRON: derived from RxNorm + FDA per BioPortal metadata.
- RadLex: rdfs:comment uses BioPortal's four-facet framing
  (modalities + anatomy + observations + procedures).

Per AdaWorldAPI/lance-graph .claude/plans/lance-graph-ontology-v5.md
ratification Q4: this OGIT fork never PRs back to almatoai/OGIT.

https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
Wave 3 / agent-mysql-transcode of the 12-agent palantir-cascade push.
Mirrors the top 25 tables from MedCare-rs/.MYSQL/Struktur.sql (104 total)
as OGIT entity stubs. Stubs only — per-column rdfs:Property declarations
deferred to a follow-on Wave-3.5 agent-medical-properties.

Top-25 selection (per medcare-bridge projection relevance):

praxis_* (10): praxis_addexamination, praxis_addtreatment, praxis_extpraxis,
  praxis_grund, praxis_lab_template_main, praxis_lab_template_values,
  praxis_licence, praxis_mitarbeiter, praxis_patient, praxis_waitingroom

pat_* (4): pat_addexamination, pat_addtreatment, pat_medication,
  pat_specialist

pf_* core (8): pf_alcohol, pf_allergy, pf_diagnosis, pf_drugs,
  pf_form_main, pf_inherit_disease, pf_laboratory_main,
  pf_laboratory_values

glob_* (3): glob_mailsmtp, glob_user_right, glob_vital_mod

Per-stub shape: a rdfs:Class + rdfs:subClassOf ogit:Entity + rdfs:label
+ rdfs:comment + dcterms:source "AdaWorldAPI/MedCare-rs/.MYSQL/Struktur.sql:
<table>" + ogit:scope "NTO" + ogit:parent ogit:Node + ogit:loaderStatus
"stub" + ogit:columnCount <N> + ogit:primaryKey "<col>" + ogit:mysqlTable
"<table>".

EntityName mapping: PascalCase of table_name preserving prefix grouping.
praxis_patient -> PraxisPatient. pf_diagnosis -> PfDiagnosis.
pat_medication -> PatMedication. glob_vital_mod -> GlobVitalMod.

Spot-check (3 tables) confirms columnCount accuracy:
- PraxisPatient: 29 cols (matches programmatic SQL extraction)
- PfDiagnosis: 17 cols
- GlobVitalMod: 42 cols (1 id + 8 v*_name + 8 v*_unit + 8 v*_mask +
  8 v*_active + 4 chklist_* + 1 office_right + 4 header_* = 42)

Validation: rdflib parses all 25 cleanly.

LOC: 25 files × ~18 lines = 450 total. Above the META-NUDGE-6 tightened
envelope of 150 (3.0×) — agent appended a BLOCKER per META-NUDGE-5
discipline. Main-thread arbitration: ACCEPT. Cause is structural
(per-file Turtle @Prefix blocks cannot be shared across files; the
11-predicate spec floor × 25 files = ~18 lines/file = 450 LOC minimum).
Consolidating into fewer files would damage per-table addressability —
the whole point of Pillar 3 of the v1 cascade plan. The 150 envelope
was a discipline target, not a floor-feasibility target.

rdfs:comment quality flags for downstream meta-3 validation:
- PfDrugs: interpreted as recreational/illicit-drug snapshot (combo_drugs
  references suggest substance lookup). Could alternatively be Rx-listing.
- PraxisGrund: "Grund" translated as German "base/foundation"; 13 columns
  (name/address/contact/customer-id) match a base clinic-profile interpretation.
- GlobMailsmtp: assumed clinic-wide (not per-tenant) SMTP per glob_ prefix.

Per AdaWorldAPI/lance-graph .claude/plans/lance-graph-ontology-v5.md
ratification Q4: never PR back to almatoai/OGIT.

https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 3baf5b99ce

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread NTO/Medical/HPO.ttl
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .

ogit.Medical:HPO
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep namespace stubs in validator-compatible paths

The pull_request validation workflow runs ./validate.sh; with these new namespace stubs it exits before parsing the rest because the validator derives the resource name from this subject and rejects NTO/Medical/HPO/namespace.ttl as File Name mismatch: namespace.ttl does not match with name: HPO and Directory mismatch ... should be under directory Medical. The same namespace.ttl layout is used for all 10 BioPortal stubs, so any PR including them will fail CI unless the files/IRIs are arranged the way the OGIT validator expects.

Useful? React with 👍 / 👎.


ogit.Medical:PraxisPatient
a rdfs:Class ;
rdfs:subClassOf ogit:Entity ;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Add required OGIT entity metadata to SQL stubs

These SQL mirror classes are declared as rdfs:subClassOf ogit:Entity, but they omit the required OGIT entity fields used throughout the repo (dcterms:description, dcterms:valid, dcterms:creator, ogit:mandatory-attributes, ogit:optional-attributes, and ogit:allowed). Running java -jar bin/ogit-validator.jar NTO/Medical/sql_mirror/PraxisPatient.ttl reports exactly those missing properties, so after the namespace path issue is fixed the same CI validation will still reject all of these entity stubs.

Useful? React with 👍 / 👎.

…yout)

OGIT validator rejects namespace.ttl files in subdirectories: the
file basename must match the subject IRI local name. Subject
ogit.Medical:HPO requires file at NTO/Medical/HPO.ttl, not
NTO/Medical/HPO/namespace.ttl.

Renamed 10 BioPortal namespace stubs (git mv preserves history):

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

TTL content unchanged: the subject IRI ogit.Medical:<NAME> was
already correct; only the file location moves. The 10 now-empty
parent directories will be cleaned up alongside the SQL-stub
metadata fix in the follow-up commit.

Sibling codex P1 (SQL stubs missing dcterms:description etc.) is
in flight via agent-ogit-validator-fix and will land separately.

Per AdaWorldAPI/lance-graph .claude/plans/lance-graph-ontology-v5.md
ratification Q4: never PR back to almatoai/OGIT.

https://claude.ai/code/session_01WevBiZ3jzVocu8fBpTY8sq
@AdaWorldAPI AdaWorldAPI merged commit 25c83ce 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
AdaWorldAPI added a commit that referenced this pull request May 7, 2026
…rate-gkuJG

fix(NTO/Medical): codex P1 follow-ups on PR #3 (depth-4 namespaces + SQL entity metadata)
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