opendatateam / udata-ods

OpenDataSoft integration for udata
GNU Affero General Public License v3.0
2 stars 1 forks source link

Automatically infer the correct URL #216

Open restuccia opened 2 years ago

restuccia commented 2 years ago

In order to set up the harvester, one has to put the URL of the "root" of the ods portal, for example https://data.iledefrance.fr, and data.gouv.fr looks for the API endpoint by adding /api/datasets/1.0/search/?start=0&rows=50&interopmetas=true right after.

But the main page of ods portails is often on some other URL, such as https://data.iledefrance.fr/pages/home-open-data/ or https://data.economie.gouv.fr/pages/accueil/. If the user tries to paste these URLs in data.gouv.fr, they get an error as data.gouv.fr tries to look for the ods API endpoint in the wrong place, for example https://data.iledefrance.fr/pages/home-open-data/api/datasets/1.0/search/?start=0&rows=50&interopmetas=true

Capture d’écran 2022-05-05 à 10 29 34

A solution could be to try to look for the API endpoint in the right place, i.e. at the root of the domain and not on some sub pages.

maudetes commented 2 years ago

I guess the url should be as canonical as possible, or stored as such in udata DB at least.

We could also mention it with example in the guides, or give a feedback to the user in the form.

restuccia commented 2 years ago

Agree, but maybe a function to clean the url (or return a visible error without the need for the user to click on the previsualisation) could be helpful? The guides are clear, but the form is not helpful IMHO