Skip to content

qwac search now matches bilingual concept tags; results include tags #59

Closed

Description

@jstet

What changed in qwac since formulaid switched to /api/search/questions (#57/#58), and what formulaid could do with it. Nothing is broken; the current code keeps working.

1. Search matches bilingual concept tags (live)

Questions can now carry tags: extra <concept xml:lang="…"> elements in the DDI (CorrelAid/qwacback#21, data in #26). Search matches them like the concept, so a keyword finds items in the other language:

keyword finds
Vertrauen "Interpersonal trust", "Institutional trust" (English prove_it study)
Sicherheit the two community-safety items and "Perceived crime trend"
funding, board, refugees, volunteers the German SVR items (Förderquellen, Vorstand, Geflüchtete, Engagierte)

64 questions are tagged: the English prove_it study has German tags, the German SVR study and the CDL instruments have English tags. The demographic standards already had English concepts, and formulaid excludes them anyway.

Possible follow-ups in formulaid:

  • keyword_agent.ts asks for "every construct in both languages". Keep it for now: tags only cover what's listed per question, and the earlier glossary idea was dropped. It's no longer the only thing that bridges the languages, though, so if the keyword step gets trimmed, fewer keywords are needed.
  • Search results (and /api/questions/{id}) now include tags: [{lang, text}]. RawQuestion in qwacback.ts ignores the field. Adding the tags to renderBankHits would show the generator the other-language label of each bank item, e.g. Interpersonal trust (de: Vertrauen, Nachbarn). That's optional, and costs a few prompt tokens per hit.

2. Bank content comes from qwac's seed files

qwac's production database isn't persisted: every deploy re-seeds it from seed_data/*.xml (CorrelAid/qwacback#27, open). Question IDs are deterministic, so they stay the same across deploys, and formulaid's references to bank IDs keep working. Anything added to the bank at runtime would disappear on the next qwac deploy until #27 is decided.

3. XLSForm export: guidance_hint column (FYI)

qwac's DDI → XLSForm export now writes interviewer instructions as a guidance_hint column instead of parameters: guidance_hint=…, which pyxform rejects when the text has spaces (CorrelAid/qwacback#24). formulaid doesn't use that export today. It matters only if it starts pulling full items from /api/questions/{id}/xlsform.

Related (formtransform, not qwac)

qwac is on formtransform v0.4.0; formulaid is on v0.2.1. v0.4.0 changes DDI varFormat for non-numeric codes and fixes several lstsv2xlsform issues. See the formtransform release notes if formulaid wants to bump.

Activity

  1. jstet commented on Sep 26, 2026

    @jstet
    MemberAuthor

    Update on point 2: decided. qwac stays seed-only (CorrelAid/qwacback#27, documented in #28). seed_data/ in qwacback is the permanent source of the bank. Question IDs stay stable across deploys; content changes go through the seed files. Nothing to do for formulaid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions