Skip to main content

Module ccf_resolver

Module ccf_resolver 

Source
Expand description

Discover the CCF/HRA reference-organ GLB assets from the Human Reference Atlas SPARQL endpoint (the scalable, canonical source — no repo clone, no Git-LFS pointers). The HRA Knowledge Graph registers each reference organ as linked data; the GLB lives as a foaf:depiction xsd:anyURI pointing at cdn.humanatlas.io (the real binary). The CDN path encodes organ, sex, and version, so the discovered filename (e.g. 3d-vh-m-liver.glb) feeds straight into body_system_for_organ and compile_body.

This module is pure (query construction + result parsing + model filtering) — no HTTP, so it is unit-tested against captured real endpoint JSON. The live GET + the per-organ binary fetch are a thin transport layer (qualia-client-core’s async HTTP is a separate lane); this owns the semantics.

Structs§

RefOrgan
One discovered reference-organ asset: the GLB filename (the organ key used everywhere downstream), its canonical CDN URL, and which reference model it belongs to.

Enums§

CcfError
A live CCF discovery / fetch error.

Constants§

HRA_SPARQL_ENDPOINT
The HRA Linked Open Data SPARQL endpoint (verified live: returns application/sparql-results+json).

Functions§

discover_ref_organs
Discover the reference-organ manifest live from the HRA SPARQL endpoint (blocking network I/O — call off the async runtime, e.g. via spawn_blocking). The query/parse are pure and unit-tested; this only adds the transport.
fetch_glb
Fetch one organ’s GLB bytes from its CDN URL (blocking).
organs_for_model
The organs of a single model, in discovery order.
parse_ref_organs
Parse the SPARQL-results JSON from ref_organ_glb_query into the reference-organ manifest.
ref_organ_glb_query
The query that lists every reference-organ GLB URL registered in the HRA KG (across named graphs). Bound variable is glb. Deterministic ordering so the manifest is stable/attestable.