OxCGRT / covid-policy-tracker

Systematic dataset of Covid-19 policy, from Oxford University
https://www.bsg.ox.ac.uk/covidtracker
Other
763 stars 431 forks source link

API missing date_value and country_code when no stringency data is available #84

Open afduarte opened 3 years ago

afduarte commented 3 years ago

I'm sorry if this is not the right place to report API issues, if that's the case could you point me to where I should log this? Anyway.

In the stringency endpoint of the second version of the API https://covidtrackerapi.bsg.ox.ac.uk/api/v2/stringency/actions/{COUNTRY}/{DATE}

When no data is available in the stringencyData property, the whole object is replaced by a single "msg" property.

{
    "policyActions": ["..."],
    "stringencyData": {
        "msg": "Data unavailable"
    }
}

This makes sense in case there is no data, but we are facing a problem where we use stringencyData.country_code and stringencyData.date_value add this data to a knowledge graph and these 2 properties are used as part of the unique ID for en entity.

It is useful for us in some cases to have the policy data even when there is no stringency. A case where this happens is Lichtenstein for the 14th of March 2021

https://covidtrackerapi.bsg.ox.ac.uk/api/v2/stringency/actions/LIE/2021-03-14

Being that the stringency data is in fact missing but the date and country code could still be provided, could this be achieved by providing for example a meta property that contains date_value and country_code?

Example:

{
    "policyActions": ["..."],
    "stringencyData": {
        "msg": "Data unavailable"
    },
    "metadata":{
        "country_code":"LIE",
        "date_value":"2021-03-14"
    }
}