Skip to content

fix(serialization): render concept labels in XBRL/JSON-LD export#733

Merged
jfrench9 merged 2 commits into
mainfrom
fix/xbrl-concept-labels
Jun 6, 2026
Merged

fix(serialization): render concept labels in XBRL/JSON-LD export#733
jfrench9 merged 2 commits into
mainfrom
fix/xbrl-concept-labels

Conversation

@jfrench9
Copy link
Copy Markdown
Member

@jfrench9 jfrench9 commented Jun 6, 2026

Summary

Fundamental concepts (Assets, Cash, Liabilities, Revenues, Goodwill, …) rendered as their QName (rs-gaap:Assets) instead of their label in the XBRL export (arelle) and the JSON-LD skos:prefLabel. Root cause: the serialization bundle sourced the concept label from element.description (NULL for these) rather than the standard label linkbase, and the QName-echo suppression then dropped the element.name fallback for single-word concepts whose name equals the QName localpart. This sources the standard label instead, and backfills standard labels for 5 concepts that genuinely had none.

Changes

Serialization — operations/serialization/bundle.py

  • BundleElement.label is now sourced from element_labels (role=standard, lang=en), falling back to element.description only when no standard label exists. Adds a scoped ElementLabel query in build_report_bundle and a standard_label param on _element_to_bundle.
  • Fixes the 9 affected single-word fundamentals (Assets, Cash, Communication, Depletion, Depreciation, Goodwill, Land, Liabilities, Revenues) in both the XBRL label linkbase and JSON-LD skos:prefLabel (jsonld.py emits prefLabel from BundleElement.label), and broadly improves prefLabel coverage (previously the near-always-null description).
  • 3 regression tests: standard label overrides description; sourced when name == localname; a single-word label equal to the localname is emitted in the label linkbase.

Taxonomy data — frameworks/rs-gaap/packages/rs-gaap/v1/taxonomy.jsonld

  • Added rdfs:label (the standard label) to 5 previously-unlabeled concepts: IncomeTaxExpenseBenefitContinuingOperations, LiabilitiesAndPartnersCapital, NetInterestIncomeLossAfterProvisionForLoanLosses, SecondaryProcessingRevenue, VehicleTollRevenue. All 5 are tenant-excluded verticals, so this affects only the public library / full-taxonomy export (the library-browser view where they showed as QNames); it needs a library reseed to land.

Testing

  • uv run pytest tests/operations/serialization/125 passed (incl. the 3 new).
  • ruff check / ruff format / basedpyright on changed files → clean.
  • Verified the data path: rs-gaap:Assets has element_labels role=standard text="Assets" in the seeded library, so the new query sources it.
  • Not regenerated an actual arelle export this session; the 5 added labels require just reset-local to reach the public library. just test-all not run.

Notes / Follow-ups

  • Tenant exports were already covered by the serialization fix (the 9 fundamentals have standard labels seeded); the 5 JSON-LD additions only affect the public / full-taxonomy export.
  • _concept_label's name == localname suppression is retained as a final fallback for concepts with neither a standard label nor a description (acceptable — truly unlabeled → QName).

jfrench9 added 2 commits June 6, 2026 14:55
…base

The XBRL/JSON-LD bundle set BundleElement.label = element.description, which is
NULL for most concepts; _concept_label then fell back to element.name and
suppressed it when it equalled the QName localpart. So single-word fundamentals
whose name is the bare localname (Assets, Cash, Liabilities, Revenues, Goodwill,
Land, Depreciation, Depletion, Communication) lost their label entirely and
arelle rendered the QName (rs-gaap:Assets) instead of 'Assets'. JSON-LD
skos:prefLabel was affected the same way.

Source BundleElement.label from element_labels (role=standard, lang=en) in
bundle.py, falling back to description only when no standard label exists. Fixes
all 9 affected concepts in both the XBRL label linkbase and JSON-LD prefLabel,
and broadly improves prefLabel coverage. 3 regression tests.
Add rdfs:label (the standard label) to 5 rs-gaap concepts that had none, so they
render a label instead of their QName in the library browser / full-taxonomy
XBRL export: IncomeTaxExpenseBenefitContinuingOperations, LiabilitiesAndPartnersCapital,
NetInterestIncomeLossAfterProvisionForLoanLosses, SecondaryProcessingRevenue,
VehicleTollRevenue. All 5 are tenant-excluded verticals, so this only affects the
public library; needs a library reseed to land. Pairs with the serialization fix
that sources the standard label.
@jfrench9 jfrench9 merged commit 6034214 into main Jun 6, 2026
7 checks passed
@jfrench9 jfrench9 deleted the fix/xbrl-concept-labels branch June 6, 2026 22:38
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.

1 participant