django-daiquiri / daiquiri

A framework for the publication of scientific databases
https://escience.aip.de/daiquiri
Apache License 2.0
26 stars 8 forks source link

FEATURE: enriched column metadata with option values #167

Open agy-why opened 1 year ago

agy-why commented 1 year ago

It regularly happen that a flag columns holds more than boolean values: true/false. But a single integer indicating some meaning.

Currently daiquiri do not provide any explanation for the meaning of these values and which ones are accepted/valid.

One workaround is to provide this information in the description of the column, however this can lead to large column description and overload the Web Interface.

IVOA standards of VOTable addresses this aspect with the VALUES element of FIELD/PARAM with the OPTION sub-element:

<FIELD name="col1">
    <VALUES name="col1values">
        <OPTION value=1>
            <DESCRIPTION>this is the flag when the the object is red</DESCRIPTION>
        </OPTION>
        <OPTION value=2>
           <DESCRIPTION>this is the flag when the the object is blue</DESCRIPTION>
        </OPTION>
    </VALUES>
</FIELD>

We could imagine to add a metadata field to store this possible option in form of a dictionary:

{"col1": 
    {"values": 
        {
            "1": "this is the flag when the the object is red", 
            "2": "this is the flag when the the object is blue"
        }
    }
}