GFDRR / open-risk-data-dashboard

Repository for the Open Data for Resilience Index, a website to track and improve the state of Open Data for Resilience worldwide.
https://index.opendri.org
GNU Lesser General Public License v3.0
23 stars 8 forks source link

BE: new scoring per country #447

Closed nastasi-oq closed 5 years ago

nastasi-oq commented 5 years ago

The new scoring per country is available at: exp.riskopendata.org//api/scoring/AL @oncletom: attribute like perils counters are still needed ? Please let me know what are missing in this view. Possible categories are: open, restricted, closed, unknown. The new scoring per country output is:

{
    "keydatasets_count": 25,
    "scores": [
        {
            "is_open_licence": true,
            "is_digital_form": true,
            "name": "Flood hazard maps",
            "keydataset_id": "HA_6A",
            "title": null,
            "is_bulk_avail": false,
            "is_avail_online_meta": true,
            "is_pub_available": true,
            "institution": "",
            "is_avail_for_free": false,
            "is_machine_read": true,
            "is_prov_timely_last": "",
            "score": 0,
            "modify_time": "",
            "is_avail_online": false,
            "is_existing_txt": "",
            "is_prov_timely": false,
            "is_existing": true,
            "dataset_id": 529,
            "category": "restricted"
        },
        ....
    ],
    "fullscores_count": 2,
    "datasets_count": 37
}
thom4parisot commented 5 years ago

432 is already based on this PR, you can preview the output here: https://deploy-preview-432--index-opendri-preview.netlify.com/dataset_list.html?idcountry=MW

Question: The new API returns data only for existing datasets, is there a way to fetch all KeyDatasets in 1 request so as I can list them as "missing datasets"?

image
nastasi-oq commented 5 years ago

@oncletom about missing dataset let me check.

About new primary fields are you waiting for total number of datasets for each category (datasets_{open,restricted,closed,unknown}_count), or the loop to calculate them is final ?

thom4parisot commented 5 years ago

Well, I'm good with the "counts" (I compute them client-side, I previously implemented the decision tree for #404/#343) but if you provide the counts, I will use them instead. It's up to you.

nastasi-oq commented 5 years ago

@oncletom

Already on exp..

{
    "datasets_closed_count": 4,
    "datasets_count": 37,
    "datasets_restricted_count": 31,
    "datasets_unknown_count": 11,
    "scores": [
        {
            "keydataset_id": "HA_6A",
            "is_open_licence": true,
            "title": null,
            "institution": "",
            "is_avail_online": false,
            "is_machine_read": true,
            "is_existing_txt": "",
            "is_existing": true,
            "modify_time": "",
            "dataset_id": 529,
            "is_bulk_avail": false,
            "name": "Flood hazard maps",
            "category": "restricted",
            "is_digital_form": true,
            "is_avail_for_free": false,
            "is_pub_available": true,
            "is_avail_online_meta": true,
            "score": 0,
            "is_prov_timely_last": "",
            "is_prov_timely": false
        },
....
// for missing keydatasets "dataset_id": null, like:
{ 
            "keydataset_id": "HA_10",
            "is_open_licence": false,
            "title": null,
            "institution": null,
            "is_avail_online": false,
            "is_machine_read": false,
            "is_existing_txt": false,
            "is_existing": false,
            "modify_time": null,
            "dataset_id": null,
            "is_bulk_avail": false,
            "name": "Nearshore tsunami wave height",
            "category": "unknown",
            "is_digital_form": false,
            "is_avail_for_free": false,
            "is_pub_available": false,
            "is_avail_online_meta": false,
            "score": -1,
            "is_prov_timely_last": false,
            "is_prov_timely": false
        },
    ],
    "datasets_open_count": 2,
    "keydatasets_count": 25
}
pzwsk commented 5 years ago

Looks good,

Question: is the score still useful? going to be removed?

thom4parisot commented 5 years ago

We don't use the score field so it can safely be removed.

pzwsk commented 5 years ago

@nastasi-oq can you remove score and then merge?