feat(ddi): skip logic and validation in the codebook (#151) - #156
Merged
Merged
Conversation
DDI Codebook 2.5 has no expression syntax, so each condition goes in twice (convention:logicMapping, ddiEncoding): - readable: `<universe clusion="I">` prose from the expression and the referenced labels, in the base language and each other language with a template (en, de); a simple numeric range also as `<valrng><range>`; - exact: typed notes, last in var/varGrp: `cdl:relevant` and `cdl:constraint` (subject="xlsform-xpath"), `cdl:constraint_message` per xml:lang, `cdl:required`. A select_multiple's logic is on its varGrp (the semi-open pair's on its `other` varGrp), with the prose also on each binary var. Enclosing groups' conditions are ANDed in until groups get a varGrp (#152). The or_other companion gets pyxform's `${q} = 'other'` / `selected(${q}, 'other')`. lstsv2ddi now reverses relevance and constraints; one outside the dialect gets an `em-unsupported` warning and no note instead of failing. The CDL Schematron allows any number of typed notes and one untyped note per language (was: one notes element per var). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This was referenced Sep 27, 2026
Merged
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.
Closes #151. Part 1 of the round-trip plan, #155.
DDI Codebook 2.5 has no expression syntax, so each condition goes in twice (
convention:logicMapping, newddiEncoding):<universe clusion="I">prose, built from the expression and the labels it refers to.. >= 1 and . <= 10,. > 0) on an integer or decimal is also written as<valrng><range min/max/minExclusive/maxExclusive>.varandvarGrp:cdl:relevantandcdl:constraint, both withsubject="xlsform-xpath".cdl:constraint_message, one perxml:lang.cdl:required.The 8 agreed corrections
varGrp.${name}resolves to avaror avarGrpname. A select_multiple's logic sits on itsvarGrp type="multipleResp", and the semi-open multi's on itsvarGrp type="other". Each binary var also gets the universe prose, for readers.qstn, thenvalrng, thenuniverse, thencatgry,concept,varFormat, andnoteslast.expressions: true). An EM expression outside the dialect gets anem-unsupportedwarning and no note; the conversion no longer fails on it.lstsvToDdiXmlgainsonWarning, and the API and CLI pass it through.=,!=, comparisons,selected(),and,or,not(), and comparing with''(answered / not answered).cdl:requiredis written only for required questions, with the textyes.valrngis added as described above.Also
or_otheror LimeSurvey'sother=Ygets pyxform's relevance,${q} = 'other'orselected(${q}, 'other'). This keeps lstsv2ddi's output identical to xlsform2ddi's for the explicit pair.src/pipelines/README.mdno longer say DDI drops logic. They now list what is still missing: defaults, appearances, groups and order (DDI round trips: keep question order, every group, and notes apart from hints #152, DDI round trips: every form field in standard DDI where possible, cdl: notes only for the rest #153).For DDI readers
The change only adds elements and relaxes one Schematron rule; nothing existing moves. qwacback (qwacback#37) stores
<universe>and the typed notes.Checks
tests/ts/unit/ddi/logic.test.ts.KNOWN_INVALID, which fail with the same errors as before.npm run validateand the drift check are clean.🤖 Generated with Claude Code