[ECODP-dev] Question about package_show API command
Dimitrios Mexis
dimitrios.mexis at tenforce.com
Mon Jul 15 13:36:10 UTC 2013
Hi,
when we issue the package_show command like this:
curl http://192.168.33.176/data/api/action/package_show -d
'{"id":"KQ01IktTeGRJWbEv85otA"}'
We get back when it is contact_name, contact_address at least, inside the
string escaped characters.
Is this normal ?
The problem, is that we need to make extra tweaks in order to get rid of
the escaped character and then do the update.
If I don't do that I get the "NO JSON output" which as message is same with
some cases in rdf2ckan we have.
Here is the example of the response check the contact_name :
{"help": "Override package_show to sort the resources by name", "success":
true, "result": {"license_title": "Europa Legal Notice",
"geographical_coverage": [], "contact_name": "\"Eurostat, the statistical
office of the European Union\"", "id":
"7d030d18-5762-44a4-97d7-9a34868b6172", "metadata_created":
"2013-07-11T10:58:24.913385", "capacity": "public", "metadata_modified":
"2013-07-15T13:17:04.990354", "temporal_granularity": [],
"contact_telephone": "\"tel: +352 430136789\"", "type_of_dataset": ["
http://ec.europa.eu/open-data/kos/dataset-type/Statistical"], "license_id":
"http://ec.europa.eu/open-data/kos/licence/EuropeanCommission", "status": ["
http://ec.europa.eu/open-data/kos/dataset-status/Completed"],
"description": "Arrivals at tourist accommodation establishments",
"published_by": "estat", "groups": [{"title": "Eurostat", "capacity":
"public", "id": "04e25c90-a226-4d51-b52b-791580319ac1", "name": "estat"}],
"interoperability_level": [], "name": "KQ01IktTeGRJWbEv85otA", "language":
[], "url": "http://ec.europa.eu/eurostat/product?code=tour_occ_arnat",
"title": "Arrivals at tourist accommodation establishments",
"contact_address": "\"Joseph Bech building, 5 Rue Alphonse Weicker, L-2721
Luxembourg\"", "license_url": "
http://ec.europa.eu/geninfo/legal_notices_en.htm", "identifier":
"\"tour_occ_arnat\""}}
and after the extra manipulation,
curl http://192.168.33.176/data/api/action/package_update -d
'{"id":"7d030d18-5762-44a4-97d7-9a34868b6172", "license_title": "Europa
Legal Notice", "geographical_coverage": [], "contact_name":
"Eurostatistiki, the statistical office of the European Union", "id":
"7d030d18-5762-44a4-97d7-9a34868b6172", "metadata_created":
"2013-07-11T10:58:24.913385", "capacity": "public", "metadata_modified":
"2013-07-11T10:58:24.913385", "temporal_granularity": [],
"contact_telephone": "tel: +352 430136789", "type_of_dataset": ["
http://ec.europa.eu/open-data/kos/dataset-type/Statistical"], "license_id":
"http://ec.europa.eu/open-data/kos/licence/EuropeanCommission",
"resources": [{"hash": "", "description": "Download dataset in DFT format",
"format": "application/x-gzip", "url": "
http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=data/tour_occ_arnat.dft.gz",
"created": "2013-07-11T12:58:24.940004", "position": 4, "revision_id":
"c8d34257-aef8-4477-bf69-a356d3c20671", "id":
"0a7f0ea4-d12a-4850-b23e-f0542142ee1d", "resource_type": "
http://www.w3.org/TR/vocab-dcat#Download"}, {"hash": "", "description":
"Download dataset in SDMX-ML format", "format": "application/zip", "url": "
http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=data/tour_occ_arnat.sdmx.zip",
"created": "2013-07-11T12:58:24.940009", "position": 5, "revision_id":
"c8d34257-aef8-4477-bf69-a356d3c20671", "id":
"e0e3e70b-32bf-4bde-81bf-f16240eb35b3", "resource_type": "
http://www.w3.org/TR/vocab-dcat#Download"}, {"hash": "", "description":
"Download dataset in TSV format", "format": "application/x-gzip", "url": "
http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=data/tour_occ_arnat.tsv.gz",
"created": "2013-07-11T12:58:24.939999", "position": 3, "revision_id":
"c8d34257-aef8-4477-bf69-a356d3c20671", "id":
"362b6a6a-3907-48c6-9ffb-4a177b6c0e23", "resource_type": "
http://www.w3.org/TR/vocab-dcat#Download"}, {"hash": "", "description":
"ESMS metadata (Euro-SDMX Metadata structure) HTML", "format": "", "url": "
http://epp.eurostat.ec.europa.eu/cache/ITY_SDDS/en/tour_occ_esms.htm",
"created": "2013-07-11T12:58:24.939968", "position": 0, "revision_id":
"c8d34257-aef8-4477-bf69-a356d3c20671", "id":
"83e2f417-be30-44d3-abde-86ac1fc58ecc", "resource_type": "
http://ec.europa.eu/open-data/kos/documentation-type/MainDocumentation"},
{"hash": "", "description": "ESMS metadata (Euro-SDMX Metadata structure)
SDMX", "format": "", "url": "
http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=metadata/en/tour_occ_esms.sdmx.zip",
"created": "2013-07-11T12:58:24.939988", "position": 1, "revision_id":
"c8d34257-aef8-4477-bf69-a356d3c20671", "id":
"12a792f2-903b-44b6-ae66-d9077d5f1bd7", "resource_type": "
http://ec.europa.eu/open-data/kos/documentation-type/RelatedWebPage"},
{"hash": "", "description": "More information on Eurostat Website",
"format": "", "url": "
http://ec.europa.eu/eurostat/product?code=tour_occ_arnat&language=en",
"created": "2013-07-11T12:58:24.939994", "position": 2, "revision_id":
"c8d34257-aef8-4477-bf69-a356d3c20671", "id":
"f488cdce-84ee-408d-9635-a9d0abf2477d", "resource_type": "
http://ec.europa.eu/open-data/kos/documentation-type/RelatedWebPage"}],
"status": ["http://ec.europa.eu/open-data/kos/dataset-status/Completed"],
"description": "Arrivals at tourist accommodation establishments",
"published_by": "estat", "groups": [{"title": "Eurostat", "capacity":
"public", "id": "04e25c90-a226-4d51-b52b-791580319ac1", "name": "estat"}],
"interoperability_level": [], "name": "KQ01IktTeGRJWbEv85otA", "language":
[], "url": "http://ec.europa.eu/eurostat/product?code=tour_occ_arnat",
"title": "Arrivals at tourist accommodation establishments",
"contact_address": "Joseph Bech building, 5 Rue Alphonse Weicker, L-2721
Luxembourg", "license_url": "
http://ec.europa.eu/geninfo/legal_notices_en.htm", "identifier":
"tour_occ_arnat"}' -H "Authorization:7d284ce9-XXXXXXXXXXXXXXXX"
Regards
Dimitrios
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ecodp-dev/attachments/20130715/aa0f295d/attachment.html>
More information about the ecodp-dev
mailing list