opendatatrentino / jackan

Java client to access CKAN repositories
http://opendatatrentino.github.io/jackan
Other
19 stars 13 forks source link

Issues with DKAN / dati.gov.it #23

Open AndreAga opened 8 years ago

AndreAga commented 8 years ago

Hi, I'm experiencing some issues with these domains: 1) http://www.dati.piemonte.it (API URL: http://www.dati.piemonte.it/rpapisrv/api/rest/package) In the developer page there's written that their API are compatible with CKAN model, but Jackan doesn't recognize the domain: Couldn't interpret json returned by the server! I saw that if I use as domain "http://www.dati.piemonte.it", it becomes: "http://www.dati.piemonte.it/api/3/action/package_list" and I think this is not correct. Can you do something?

2) http://www.dati.gov.it/ (API URL: http://www.dati.gov.it/api/3/action/package_list) Jackan answer: NullPointerException: Need a valid id or name! I think that for dati.gov the parameter "limit" is mandatory. Same question as above.

Thanks.

DavidLeoni commented 8 years ago

Ciao

dati.piemonte

Sadly, we can't support it. The reason is that Jackan works with api 3, but dati.piemonte is stuck at api 1. This is shown in the Compatibility report of Jackan: http://opendatatrentino.github.io/jackan/reports/latest/ at testApiVersionSupported for dati piemonte: http://opendatatrentino.github.io/jackan/reports/latest/test-result-2.html

Basically in that report if "testApiVersionSupported" fails for a catalog, there is no hope to support it (to scroll catalogs you can find a scrollbar at the bottom of the table)

dati.gov.it

Here we have another problem. Dati.gov.it now works with DKAN platform, not CKAN. So, although DKAN api should be CKAN compatible, sometime aren't. Although workarounds for these incompatibilities would be easy, ideally DKAN/dati.gov.it should be compliant with CKAN, not Jackan compliant with DKAN/dati.gov.it . I would prefer to wait some time so they iron out the differences before changing Jackan.

For now I will write down here the incompatibilities I found on dati.gov.it, probably they extend to any DKAN platoform:

package_list

package_list without limit returns a clearly invalid null within array: [null]

http://www.dati.gov.it/api/3/action/package_list

package_show:

If you try to get single datasets you will get errors because in dati.gov.it results are wrapped in arrays while they shouldn't be.

Compare ie: http://www.dati.gov.it/api/3/action/package_show?id=orario-ferroviario-regionale-stops

against:

https://datahub.io/api/3/action/package_show?id=world-boundaries

The www

Omitting 'www' obliterates any url in dati.gov.it

This address with www prefix works: http://www.dati.gov.it/api/3/action/package_list?limit=1

This without www doesn't, url gets wrongly rewritten to http://www.dati.gov.it/api/3/action/package_list
http://dati.gov.it/api/3/action/package_list?limit=1

AndreAga commented 8 years ago

Thank you so much for your answer. I will ask if the API of dati.piemonte can be updated or not. I will use your API in my application as a wrapper with some italian open data portal. Is there a place where I can report other eventually compatibility issues?

DavidLeoni commented 8 years ago

I will use your API in my application as a wrapper with some italian open data portal.

Gald to hear you're adopting Jackan! When you integrate it in some project if you wish I can put a link to it on Jackan readme as use case.

Is there a place where I can report other eventually compatibility issues?

Here you can report bugs about dati.gov.it: http://www.dati.gov.it/content/scrivi-alla-redazione

As far as I understand they have no public issue tracker, I already reported issues above, so we'll need to wait for a response. I'll keep you posted.

When I find some time I'll update Jackan to have test reports specific for DKAN in the CkanTestReporter

Since there will be more and more dkan installations around I tried to understand a bit how it works:

package_list

Works on dkan demo, so it is a dati.gov.it problem (maybe they have an old version of dkan): http://demo.getdkan.com/api/3/action/package_list At present if you call Jackan's getPackageList(limit, offset) it will work even on dati.gov.it

package_show

The package_show problem above were already noted in DKAN issue tracker: https://github.com/NuCivic/dkan/issues/410

To solve it, in DKAN there is a module called Open Data Schema Map that can provide real ckan compatibility, but as I understand currently it should be specifically enabled by the data portal owner. Which sounds weird.