Repository navigation
feat(ris): read Austrian RIS legal XML (risdok) - #907
Merged
Merged
Conversation
A RIS document (the Rechtsinformationssystem's open-data `risdok`, namespace http://www.bka.gv.at) had no semantic reading: a bare .xml came out as one `xml` code block of raw markup (before docling-project#671, empty from the JATS reader). docling has no RIS backend, so this is a docling.rs extension. backend/ris.rs reads the markup in source order, one `section` group per `abschnitt` (named `abschnitt {nr}`) so every item keeps where it came from: - `ueberschrift` -> section header (titel/g1 level 1, g2..g4 deeper) - `absatz` -> paragraph, b/i/u/sup/sub runs kept as an inline group, `feld`/`span` read as text, `tab` as a space - a bullet `absatz` (a glyph, Word's Symbol-font U+F0B7 included, or none in a hanging indent, before its first `tab`) -> list item; numbered paragraphs stay paragraphs - `table` -> table, spans honoured, Word's zero-height row dropped - `kzinhalt`/`fzinhalt` -> page_header/page_footer furniture - metadaten, layoutdaten, abstand skipped JSON, HTML and DocLang come from the item tree (DocLang through the tree serializer); docling-core 2.104 loads the JSON and writes the same DocLang from it. The Markdown escapes `*` too: RIS pseudonymizes with stars (`A*** GmbH`, `FN *0*271*h`) that would otherwise become emphasis; the plain-text export now reads `\*` as a star and never closes an emphasis span on one. Routed by the `xml` route's dialect sniff (a `<risdok>` root) and the `xml_ris` format id (CLI, Python, Node). The issue's public decision (DSBT_20250904_2025_0_699_550_00.xml, RIS open data) is the regression fixture. Closes docling-project#902 Signed-off-by: artiz <artem.kustikov@gmail.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DaTwMqag3st8G7PT7cPrLc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A RIS document (the Rechtsinformationssystem's open-data
risdok, namespace http://www.bka.gv.at) had no semantic reading: a bare .xml came out as onexmlcode block of raw markup (before #671, empty from the JATS reader). docling has no RIS backend, so this is a docling.rs extension.backend/ris.rs reads the markup in source order, one
sectiongroup perabschnitt(namedabschnitt {nr}) so every item keeps where it came from:ueberschrift-> section header (titel/g1 level 1, g2..g4 deeper)absatz-> paragraph, b/i/u/sup/sub runs kept as an inline group,feld/spanread as text,tabas a spaceabsatz(a glyph, Word's Symbol-font U+F0B7 included, or none in a hanging indent, before its firsttab) -> list item; numbered paragraphs stay paragraphstable-> table, spans honoured, Word's zero-height row droppedkzinhalt/fzinhalt-> page_header/page_footer furnitureThe Markdown escapes
*too: RIS pseudonymizes with stars (A*** GmbH,FN *0*271*h) that would otherwise become emphasis; the plain-text export now reads\*as a star and never closes an emphasis span on one.Routed by the
xmlroute's dialect sniff (a<risdok>root) and thexml_risformat id (CLI, Python, Node). The issue's public decision (DSBT_20250904_2025_0_699_550_00.xml, RIS open data) is the regression fixture.Closes #902
Claude-Session: https://claude.ai/code/session_01DaTwMqag3st8G7PT7cPrLc