Skip to content

Commit 0851e26

Browse files
committed
osint/fma: hydrate the bake from the real FMA heart subtree, not a fixture
The /fma render surface was hydrated from a hand-authored fixture (data/fma-heart.fixture.ttl, 4 chambers x 3 wall layers). Replace it with a real subtree extracted from fma.owl (FMA v5.0.0, the 266 MB UW Structural Informatics Group FMA, CC BY 3.0, now mirrored on the q2 fma-ontology-5.0.0 release; SHA-256 59465eb5...79979e44). tools/extract_fma_heart.py streams the OWL (ET.iterparse, memory-bounded — only the label / part / superclass maps are retained, not the ~1.5M-triple graph), walks the regional_part / constitutional_part partonomy from FMA:Heart with a per-parent fan-out cap (root exempt). That keeps the slice a balanced cross-section — all 22 major heart subdivisions (the four chamber cavities, the four valves, the three cardiac septa, both coronary arteries, the wall's endo/epi/myocardium, the fibrous skeleton, ...) with their real sub-parts — instead of draining into FMA's ~40-branch coronary arterial tree. It emits the line-Turtle subset fma_ttl::parse already hydrates; the generic hydrate_fma walk is unchanged (the partonomy IS the key, derived, not hardcoded to "heart"). The fixture's "four myocardia all share one Cardiac-muscle-tissue type" was an invention — real FMA gives region-specific myocardium classes. Rewrite the dual-membership proof to pick the strongest real cross-cutter in the slice (the ceiling type that is the is-a target of the most structures) and its deepest member, instead of a hardcoded label that no longer exists. On the real data it surfaces "Cavity proper of inflow part of right atrium" at a 4-tier-deep part-of address (HEEL[01:01] HIP[02:06] TWIG[03:01] LEAF[04:01]), is-a "Subdivision of cavity of cardiac chamber" — a global type shared by 7 cavity structures across all four chambers. The dual membership is now proven on real anatomy. Verified: - byte-deterministic bake (re-run -> identical fma.soa; 6603 bytes, 125 nodes = 80 part-of + 45 ceiling types, 156 edges) - fma_ttl unit tests pass; clippy clean on the bake (the 3 -D warnings are the pre-existing aiwar-ingest lib dep, not these files) - cockpit FmaGraph.tsx doc updated to the real cross-cutting example; tsc clean - isolated to the osint-bake leaf crate + cockpit vite app; nothing in the quarto-core / pampa / wasm chain is touched The 266 MB OWL is NOT committed; the production hydrator remains the spine's lance_graph_ontology::hydrate_fma over the full fma.owl. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TzqvDqbFRzyx17EkLKBoZF
1 parent aa66ab2 commit 0851e26

6 files changed

Lines changed: 394 additions & 97 deletions

File tree

cockpit/public/fma.soa

5.53 KB
Binary file not shown.

cockpit/src/FmaGraph.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
// same vis-network renderer, and on click shows a node resolving to BOTH:
44
// · its part-of position (basin-local: organ → chamber → wall → structure)
55
// · its leaf-limited global TYPE (the 0xFFFF ceiling pole — cross-cutting,
6-
// the same "Cardiac muscle tissue" shared by every chamber).
6+
// e.g. one "Subdivision of cavity of cardiac chamber" or "Endothelium of
7+
// endocardium" shared by structures in different parts of the heart).
78
//
89
// This is the `Cascade` (ontology / part-of) reading of OGAR PR #116's HhtlMode
910
// FMA tier model: each node is a stack of 8:8 [container:identity] tiers —

crates/osint-bake/data/fma-heart.fixture.ttl

Lines changed: 0 additions & 53 deletions
This file was deleted.
Lines changed: 166 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,166 @@
1+
# fma-heart.ttl — REAL FMA heart subtree, extracted from fma.owl (FMA v5.0.0).
2+
# Source: BioPortal #29 / UW Structural Informatics Group, CC BY 3.0,
3+
# SHA-256 59465eb503c418dbf9216d362b94c7f42bc3b96b297e553ec17c7fee77979e44,
4+
# mirror github.com/AdaWorldAPI/q2/releases/download/fma-ontology-5.0.0/fma.owl
5+
# Generated by tools/extract_fma_heart.py (streaming ET; regional_part +
6+
# constitutional_part partonomy, BFS from FMA:Heart fma7088, depth<=4, <=80 nodes).
7+
# The 266 MB OWL is NOT committed; the production hydrator is the spine's
8+
# lance_graph_ontology::hydrate_fma. This is the real-data heart slice the
9+
# q2 /fma render surface hydrates.
10+
11+
fma:Cavity_of_right_atrium bfo:part_of fma:Heart .
12+
fma:Cardiac_vein bfo:part_of fma:Heart .
13+
fma:Neural_network_of_heart bfo:part_of fma:Heart .
14+
fma:Coronary_sinus bfo:part_of fma:Heart .
15+
fma:Right_coronary_artery bfo:part_of fma:Heart .
16+
fma:Left_coronary_artery bfo:part_of fma:Heart .
17+
fma:Interatrial_septum bfo:part_of fma:Heart .
18+
fma:Interventricular_septum bfo:part_of fma:Heart .
19+
fma:Atrioventricular_septum bfo:part_of fma:Heart .
20+
fma:Right_side_of_heart bfo:part_of fma:Heart .
21+
fma:Left_side_of_heart bfo:part_of fma:Heart .
22+
fma:Tricuspid_valve bfo:part_of fma:Heart .
23+
fma:Mitral_valve bfo:part_of fma:Heart .
24+
fma:Aortic_valve bfo:part_of fma:Heart .
25+
fma:Pulmonary_valve bfo:part_of fma:Heart .
26+
fma:Wall_of_heart bfo:part_of fma:Heart .
27+
fma:Systemic_capillary_bed_of_heart bfo:part_of fma:Heart .
28+
fma:Lymphatic_capillary_bed_of_heart bfo:part_of fma:Heart .
29+
fma:Cavity_of_right_ventricle bfo:part_of fma:Heart .
30+
fma:Cavity_of_left_atrium bfo:part_of fma:Heart .
31+
fma:Cavity_of_left_ventricle bfo:part_of fma:Heart .
32+
fma:Fibrous_skeleton_of_heart bfo:part_of fma:Heart .
33+
fma:Cavity_of_inflow_part_of_right_atrium bfo:part_of fma:Cavity_of_right_atrium .
34+
fma:Ostium_of_superior_vena_cava bfo:part_of fma:Cavity_of_right_atrium .
35+
fma:Ostium_of_inferior_vena_cava bfo:part_of fma:Cavity_of_right_atrium .
36+
fma:Variant_branch_of_right_coronary_arterial_tree bfo:part_of fma:Right_coronary_artery .
37+
fma:Recurrent_atrioventricular_branch_of_right_coronary_artery bfo:part_of fma:Right_coronary_artery .
38+
fma:Lateral_atrial_branch_of_right_coronary_artery bfo:part_of fma:Right_coronary_artery .
39+
fma:Wall_of_left_coronary_artery bfo:part_of fma:Left_coronary_artery .
40+
fma:Lumen_of_left_coronary_artery bfo:part_of fma:Left_coronary_artery .
41+
fma:Trunk_of_left_coronary_artery bfo:part_of fma:Left_coronary_artery .
42+
fma:Membranous_part_of_interatrial_septum bfo:part_of fma:Interatrial_septum .
43+
fma:Fibrocollagenous_connective_tissue_of_interatrial_septum bfo:part_of fma:Interatrial_septum .
44+
fma:Muscular_part_of_interatrial_septum bfo:part_of fma:Interatrial_septum .
45+
fma:Fibrocollagenous_connective_tissue_of_interventricular_septum bfo:part_of fma:Interventricular_septum .
46+
fma:Muscular_part_of_interventricular_septum bfo:part_of fma:Interventricular_septum .
47+
fma:Membranous_part_of_interventricular_septum bfo:part_of fma:Interventricular_septum .
48+
fma:Endothelium_of_atrioventricular_septum bfo:part_of fma:Atrioventricular_septum .
49+
fma:Fibroelastic_connective_tissue_of_endocardium bfo:part_of fma:Atrioventricular_septum .
50+
fma:Neural_network_of_right_side_of_heart bfo:part_of fma:Right_side_of_heart .
51+
fma:Small_cardiac_vein bfo:part_of fma:Right_side_of_heart .
52+
fma:Right_marginal_vein bfo:part_of fma:Right_side_of_heart .
53+
fma:Neural_network_of_left_side_of_heart bfo:part_of fma:Left_side_of_heart .
54+
fma:Great_cardiac_vein bfo:part_of fma:Left_side_of_heart .
55+
fma:Left_atrium bfo:part_of fma:Left_side_of_heart .
56+
fma:Endothelium_of_tricuspid_valve bfo:part_of fma:Tricuspid_valve .
57+
fma:Anterior_leaflet_of_tricuspid_valve bfo:part_of fma:Tricuspid_valve .
58+
fma:Posterior_leaflet_of_tricuspid_valve bfo:part_of fma:Tricuspid_valve .
59+
fma:Endothelium_of_mitral_valve bfo:part_of fma:Mitral_valve .
60+
fma:Anterior_leaflet_of_mitral_valve bfo:part_of fma:Mitral_valve .
61+
fma:Posterior_leaflet_of_mitral_valve bfo:part_of fma:Mitral_valve .
62+
fma:Endothelium_of_aortic_valve bfo:part_of fma:Aortic_valve .
63+
fma:Right_posterior_cusp_of_aortic_valve bfo:part_of fma:Aortic_valve .
64+
fma:Anterior_cusp_of_aortic_valve bfo:part_of fma:Aortic_valve .
65+
fma:Left_anterior_cusp_of_pulmonary_valve bfo:part_of fma:Pulmonary_valve .
66+
fma:Right_anterior_cusp_of_pulmonary_valve bfo:part_of fma:Pulmonary_valve .
67+
fma:Posterior_cusp_of_pulmonary_valve bfo:part_of fma:Pulmonary_valve .
68+
fma:Endocardium bfo:part_of fma:Wall_of_heart .
69+
fma:Epicardium bfo:part_of fma:Wall_of_heart .
70+
fma:Myocardium bfo:part_of fma:Wall_of_heart .
71+
fma:Ostium_of_least_cardiac_vein_of_right_ventricle bfo:part_of fma:Cavity_of_right_ventricle .
72+
fma:Cavity_of_inflow_part_of_right_ventricle bfo:part_of fma:Cavity_of_right_ventricle .
73+
fma:Ostium_of_pulmonary_trunk bfo:part_of fma:Cavity_of_right_ventricle .
74+
fma:Cavity_of_inflow_part_of_left_atrium bfo:part_of fma:Cavity_of_left_atrium .
75+
fma:Cavity_proper_of_left_atrium bfo:part_of fma:Cavity_of_left_atrium .
76+
fma:Ostium_of_right_superior_pulmonary_vein bfo:part_of fma:Cavity_of_left_atrium .
77+
fma:Cavity_of_inflow_part_of_left_ventricle bfo:part_of fma:Cavity_of_left_ventricle .
78+
fma:Ostium_of_aorta bfo:part_of fma:Cavity_of_left_ventricle .
79+
fma:Cavity_of_outflow_part_of_left_ventricle bfo:part_of fma:Cavity_of_left_ventricle .
80+
fma:Connective_tissue_of_fibrous_skeleton_of_heart bfo:part_of fma:Fibrous_skeleton_of_heart .
81+
fma:Fibrocollagenous_connective_tissue_of_fibrous_skeleton_of_heart bfo:part_of fma:Fibrous_skeleton_of_heart .
82+
fma:Central_fibrous_body bfo:part_of fma:Fibrous_skeleton_of_heart .
83+
fma:Cavity_proper_of_inflow_part_of_right_atrium bfo:part_of fma:Cavity_of_inflow_part_of_right_atrium .
84+
fma:Ostium_of_coronary_sinus bfo:part_of fma:Cavity_of_inflow_part_of_right_atrium .
85+
fma:Ostium_of_least_cardiac_vein_of_right_atrium bfo:part_of fma:Cavity_of_inflow_part_of_right_atrium .
86+
fma:Lumen_of_trunk_of_left_coronary_artery bfo:part_of fma:Trunk_of_left_coronary_artery .
87+
fma:Wall_of_trunk_of_left_coronary_artery bfo:part_of fma:Trunk_of_left_coronary_artery .
88+
fma:Endocardium_of_interatrial_septum bfo:part_of fma:Membranous_part_of_interatrial_septum .
89+
fma:Fibrocollagenous_connective_tissue_of_muscular_part_of_interatrial_septum bfo:part_of fma:Muscular_part_of_interatrial_septum .
90+
fma:Heart rdfs:subClassOf fma:Organ_with_cavitated_organ_parts .
91+
fma:Cavity_of_right_atrium rdfs:subClassOf fma:Cavity_of_atrium .
92+
fma:Cardiac_vein rdfs:subClassOf fma:Systemic_vein .
93+
fma:Neural_network_of_heart rdfs:subClassOf fma:Neural_network_of_organ .
94+
fma:Coronary_sinus rdfs:subClassOf fma:Trunk_of_systemic_vein .
95+
fma:Right_coronary_artery rdfs:subClassOf fma:Coronary_artery .
96+
fma:Left_coronary_artery rdfs:subClassOf fma:Coronary_artery .
97+
fma:Interatrial_septum rdfs:subClassOf fma:Cardiac_septum .
98+
fma:Interventricular_septum rdfs:subClassOf fma:Cardiac_septum .
99+
fma:Atrioventricular_septum rdfs:subClassOf fma:Region_of_membranous_part_of_interventricular_septum .
100+
fma:Right_side_of_heart rdfs:subClassOf fma:Zone_of_heart .
101+
fma:Left_side_of_heart rdfs:subClassOf fma:Zone_of_heart .
102+
fma:Tricuspid_valve rdfs:subClassOf fma:Atrioventricular_valve .
103+
fma:Mitral_valve rdfs:subClassOf fma:Atrioventricular_valve .
104+
fma:Aortic_valve rdfs:subClassOf fma:Cardiac_valve .
105+
fma:Pulmonary_valve rdfs:subClassOf fma:Cardiac_valve .
106+
fma:Wall_of_heart rdfs:subClassOf fma:Wall_of_organ .
107+
fma:Systemic_capillary_bed_of_heart rdfs:subClassOf fma:Systemic_capillary_bed .
108+
fma:Lymphatic_capillary_bed_of_heart rdfs:subClassOf fma:Lymphatic_capillary_bed .
109+
fma:Cavity_of_right_ventricle rdfs:subClassOf fma:Cavity_of_ventricle .
110+
fma:Cavity_of_left_atrium rdfs:subClassOf fma:Cavity_of_atrium .
111+
fma:Cavity_of_left_ventricle rdfs:subClassOf fma:Cavity_of_ventricle .
112+
fma:Fibrous_skeleton_of_heart rdfs:subClassOf fma:Fibrous_connective_tissue .
113+
fma:Cavity_of_inflow_part_of_right_atrium rdfs:subClassOf fma:Subdivision_of_cavity_of_cardiac_chamber .
114+
fma:Ostium_of_superior_vena_cava rdfs:subClassOf fma:Orifice_of_vein .
115+
fma:Ostium_of_inferior_vena_cava rdfs:subClassOf fma:Orifice_of_vein .
116+
fma:Variant_branch_of_right_coronary_arterial_tree rdfs:subClassOf fma:Branch_of_right_coronary_artery .
117+
fma:Recurrent_atrioventricular_branch_of_right_coronary_artery rdfs:subClassOf fma:Branch_of_right_coronary_artery .
118+
fma:Lateral_atrial_branch_of_right_coronary_artery rdfs:subClassOf fma:Atrial_branch_of_right_coronary_artery .
119+
fma:Wall_of_left_coronary_artery rdfs:subClassOf fma:Wall_of_coronary_artery .
120+
fma:Lumen_of_left_coronary_artery rdfs:subClassOf fma:Lumen_of_coronary_artery .
121+
fma:Trunk_of_left_coronary_artery rdfs:subClassOf fma:Trunk_of_coronary_artery .
122+
fma:Membranous_part_of_interatrial_septum rdfs:subClassOf fma:Membranous_part_of_cardiac_septum .
123+
fma:Fibrocollagenous_connective_tissue_of_interatrial_septum rdfs:subClassOf fma:Fibrocollagenous_sheath_of_cardiac_muscle_tissue .
124+
fma:Muscular_part_of_interatrial_septum rdfs:subClassOf fma:Muscular_part_of_cardiac_septum .
125+
fma:Fibrocollagenous_connective_tissue_of_interventricular_septum rdfs:subClassOf fma:Fibrocollagenous_sheath_of_cardiac_muscle_tissue .
126+
fma:Muscular_part_of_interventricular_septum rdfs:subClassOf fma:Muscular_part_of_cardiac_septum .
127+
fma:Membranous_part_of_interventricular_septum rdfs:subClassOf fma:Membranous_part_of_cardiac_septum .
128+
fma:Endothelium_of_atrioventricular_septum rdfs:subClassOf fma:Endothelium_of_endocardium .
129+
fma:Fibroelastic_connective_tissue_of_endocardium rdfs:subClassOf fma:Fibroelastic_connective_tissue .
130+
fma:Neural_network_of_right_side_of_heart rdfs:subClassOf fma:Neural_network_of_organ_part .
131+
fma:Neural_network_of_left_side_of_heart rdfs:subClassOf fma:Neural_network_of_organ_part .
132+
fma:Left_atrium rdfs:subClassOf fma:Cardiac_atrium .
133+
fma:Endothelium_of_tricuspid_valve rdfs:subClassOf fma:Endothelium_of_endocardium .
134+
fma:Anterior_leaflet_of_tricuspid_valve rdfs:subClassOf fma:Leaflet_of_tricuspid_valve .
135+
fma:Posterior_leaflet_of_tricuspid_valve rdfs:subClassOf fma:Leaflet_of_tricuspid_valve .
136+
fma:Endothelium_of_mitral_valve rdfs:subClassOf fma:Endothelium_of_endocardium .
137+
fma:Anterior_leaflet_of_mitral_valve rdfs:subClassOf fma:Leaflet_of_mitral_valve .
138+
fma:Posterior_leaflet_of_mitral_valve rdfs:subClassOf fma:Leaflet_of_mitral_valve .
139+
fma:Endothelium_of_aortic_valve rdfs:subClassOf fma:Endothelium_of_endocardium .
140+
fma:Right_posterior_cusp_of_aortic_valve rdfs:subClassOf fma:Cusp_of_aortic_valve .
141+
fma:Anterior_cusp_of_aortic_valve rdfs:subClassOf fma:Cusp_of_aortic_valve .
142+
fma:Left_anterior_cusp_of_pulmonary_valve rdfs:subClassOf fma:Cusp_of_pulmonary_valve .
143+
fma:Right_anterior_cusp_of_pulmonary_valve rdfs:subClassOf fma:Cusp_of_pulmonary_valve .
144+
fma:Posterior_cusp_of_pulmonary_valve rdfs:subClassOf fma:Cusp_of_pulmonary_valve .
145+
fma:Endocardium rdfs:subClassOf fma:Tunica_intima .
146+
fma:Epicardium rdfs:subClassOf fma:Region_of_visceral_serous_pericardium .
147+
fma:Myocardium rdfs:subClassOf fma:Muscle_body .
148+
fma:Ostium_of_least_cardiac_vein_of_right_ventricle rdfs:subClassOf fma:Ostium_of_least_cardiac_vein .
149+
fma:Cavity_of_inflow_part_of_right_ventricle rdfs:subClassOf fma:Subdivision_of_cavity_of_cardiac_chamber .
150+
fma:Ostium_of_pulmonary_trunk rdfs:subClassOf fma:Orifice_of_artery .
151+
fma:Cavity_of_inflow_part_of_left_atrium rdfs:subClassOf fma:Subdivision_of_cavity_of_cardiac_chamber .
152+
fma:Cavity_proper_of_left_atrium rdfs:subClassOf fma:Subdivision_of_cavity_of_cardiac_chamber .
153+
fma:Ostium_of_right_superior_pulmonary_vein rdfs:subClassOf fma:Ostium_of_superior_pulmonary_vein .
154+
fma:Cavity_of_inflow_part_of_left_ventricle rdfs:subClassOf fma:Subdivision_of_cavity_of_cardiac_chamber .
155+
fma:Ostium_of_aorta rdfs:subClassOf fma:Orifice_of_artery .
156+
fma:Cavity_of_outflow_part_of_left_ventricle rdfs:subClassOf fma:Subdivision_of_cavity_of_cardiac_chamber .
157+
fma:Connective_tissue_of_fibrous_skeleton_of_heart rdfs:subClassOf fma:Fibroelastic_connective_tissue .
158+
fma:Fibrocollagenous_connective_tissue_of_fibrous_skeleton_of_heart rdfs:subClassOf fma:Fibrocollagenous_connective_tissue .
159+
fma:Central_fibrous_body rdfs:subClassOf fma:Subdivision_of_fibrous_skeleton_of_heart .
160+
fma:Cavity_proper_of_inflow_part_of_right_atrium rdfs:subClassOf fma:Subdivision_of_cavity_of_cardiac_chamber .
161+
fma:Ostium_of_coronary_sinus rdfs:subClassOf fma:Orifice_of_vein .
162+
fma:Ostium_of_least_cardiac_vein_of_right_atrium rdfs:subClassOf fma:Ostium_of_least_cardiac_vein .
163+
fma:Lumen_of_trunk_of_left_coronary_artery rdfs:subClassOf fma:Lumen_of_trunk_of_coronary_artery .
164+
fma:Wall_of_trunk_of_left_coronary_artery rdfs:subClassOf fma:Wall_of_trunk_of_coronary_artery .
165+
fma:Endocardium_of_interatrial_septum rdfs:subClassOf fma:Endocardium_of_cardiac_septum .
166+
fma:Fibrocollagenous_connective_tissue_of_muscular_part_of_interatrial_septum rdfs:subClassOf fma:Fibrocollagenous_sheath_of_cardiac_muscle_tissue .

0 commit comments

Comments
 (0)