Skip to content

Describe how to join raw KoboToolbox values with labels stored in __labels table #47

@rudokemper

Description

@rudokemper

Following up on ConservationMetrics/gc-scripts-hub#139.

The KoboToolbox API returns raw data values e.g. "n_o" instead of "não", which is a problem for many languages, and means that we currently show "n_o" instead of "não" on any frontend (like Superset), unless we do a manual SQL rewrite -- neither of which is desirable. See ConservationMetrics/gc-scripts-hub#29 for additional context.

To address this, in ConservationMetrics/gc-scripts-hub#96 we began to store all of the human-legible labels returned by KoboToolbox (via a different endpoint than the raw data itself) in a __labels lookup table, with the intent of being able to reconstruct labels, and indeed also translations, on a given frontend, e.g.

  • n_o -> "não" (Portuguese)
  • n_o -> "uwa" (Tyrio)

To see how this works, see the KoboToolbox connector documentation in gc-scripts-hub here.

However, we have yet to describe how to actually do this; in particular, Superset charts really could benefit from this. In the past we've even written some custom SQL to rewrite raw data values back to their human-legible equivalent!

Let's produce a page for Guardian Connector Toolkit -> Apache Superset that comprehensively describes how to do this.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions