Debug Session Report — DrawIO RDF Export Debugger
Summary
Investigated
python -m debug --scenario aa37-department-of-healthfailing to classify DrawIO cells as individuals.Identified missing prefix expansion in the debugger’s cell classification helper which caused all CURIE tokens to be rejected.
Updated
_extract_cell_classificationsto reuselegacy.draw_io_parsermetadata utilities so the classifier sees the full prefix map (built-ins + diagram metadata + CLI overrides).Normalised the aa37 scenario YAML to reference the repository fixture path so it works cross-platform.
Investigation Notes
Reproduced the issue via
python -m debug --drawio "tests/fixtures/AA37 Department of Health.drawio" --slug aa37-department-of-healthafter bootstrapping dependencies withbun install --force,bun run setup:uv, andbun run setup:pyodide.Observed the debugger reporting 83 cell classifications, but only
LITERAL/ARROW_LABELkinds appeared indebug/map.json.Confirmed that
DrawIOCellClassifierrequires known CURIE prefixes to emitTYPED_INDIVIDUAL/STANDALONE_INDIVIDUAL, yet the debugger only forwarded ad-hoc CLI prefixes (mock1) instead of the parser defaults.Verified the DrawIO parser’s
_extract_drawio_metadataandget_prefixeshelpers merge built-in RiC-O prefixes with metadata-defined ones before parsing.
Fix Implementation
Hooked
_extract_cell_classificationsinto_extract_drawio_metadatato reuse the parser’s XML root and metadata prefixes.Seeded the prefix map with
get_prefixes()and layered metadata + CLI overrides to mimic the runtime pipeline.Removed the redundant local
ElementTreeimport once metadata parsing moved to the parser helper.Updated
debug/scenarios/aa37-department-of-health.ymlto quote the fixture path and keep it relative to the repo.
Verification
CI=1 PRETTIER_LOG_LEVEL=error bun run checkCI=1 bun run test:log:linuxManual inspection of
debug/map.jsonconfirmed 17TYPED_INDIVIDUALentries and preserved literal counts for the aa37 scenario.