[ECODP-dev] Validation error of certain strings with comma

Dimitrios Mexis dimitrios.mexis at tenforce.com
Thu Aug 8 14:38:44 UTC 2013


This JSON might help ?

{"resources":[{"description":"ESMS metadata (Euro-SDMX Metadata 
structure) 
HTML","type":"http://ec.europa.eu/open-data/kos/documentation-type/MainDocumentation","url":"http://epp.eurostat.ec.europa.eu/cache/ITY_SDDS/en/ext_esms.htm"},{"description":"ESMS 
metadata (Euro-SDMX Metadata structure) 
SDMX","type":"http://ec.europa.eu/open-data/kos/documentation-type/RelatedWebPage","url":"http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=metadata/en/ext_esms.sdmx.zip"},{"description":"More 
information on Eurostat 
Website","type":"http://ec.europa.eu/open-data/kos/documentation-type/RelatedWebPage","url":"http://ec.europa.eu/eurostat/product?code=tet00053&language=en"},{"description":"Download 
dataset in TSV 
format","format":"application/x-gzip","type":"http://www.w3.org/TR/vocab-dcat#Download","url":"http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=data/tet00053.tsv.gz"},{"description":"Download 
dataset in DFT 
format","format":"application/x-gzip","type":"http://www.w3.org/TR/vocab-dcat#Download","url":"http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=data/tet00053.dft.gz"},{"description":"Download 
dataset in SDMX-ML 
format","format":"application/zip","type":"http://www.w3.org/TR/vocab-dcat#Download","url":"http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=data/tet00053.sdmx.zip"}],"geographical_coverage":[],"status":"http://ec.europa.eu/open-data/kos/dataset-status/Completed","published_by":"estat","keyword_string":["international 
trade,trade 
statistics"],"url":"http://ec.europa.eu/eurostat/product?code=tet00053","type_of_dataset":["http://ec.europa.eu/open-data/kos/dataset-type/Statistical"],"title":"Extra-EU27 
trade of other manufactured goods (SITC 6+8), by Member 
State","interoperability_level":[],"description":"The table shows the 
Member States' contribution to the extra-EU27 trade for that product 
group. Imports are expressed in value terms and measured cif (cost, 
insurance, freight). Exports are expressed in value terms and measured 
fob (free on board). Balance = export - 
import.","name":"d4kBfYgvXM2PWCR5cteFQ","contact_name":"Eurostat, the 
statistical office of the European 
Union","license_id":["http://ec.europa.eu/open-data/kos/licence/EuropeanCommission"],"contact_address":"Joseph 
Bech building, 5 Rue Alphonse Weicker, L-2721 
Luxembourg","language":[],"identifier":"tet00053","contact_telephone":"tel: 
+352 430136789"}


I am trying to use it like this but I can not understand why after 
escaping the apostrophe on terminal script, it fails again :

curl http://localhost:8008/data/api/action/package_create -d 
'{"resources":[{"description":"ESMS metadata (Euro-SDMX Metadata 
structure) 
HTML","type":"http://ec.europa.eu/open-data/kos/documentation-type/MainDocumentation","url":"http://epp.eurostat.ec.europa.eu/cache/ITY_SDDS/en/ext_esms.htm"},{"description":"ESMS 
metadata (Euro-SDMX Metadata structure) 
SDMX","type":"http://ec.europa.eu/open-data/kos/documentation-type/RelatedWebPage","url":"http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=metadata/en/ext_esms.sdmx.zip"},{"description":"More 
information on Eurostat 
Website","type":"http://ec.europa.eu/open-data/kos/documentation-type/RelatedWebPage","url":"http://ec.europa.eu/eurostat/product?code=tet00053&language=en"},{"description":"Download 
dataset in TSV 
format","format":"application/x-gzip","type":"http://www.w3.org/TR/vocab-dcat#Download","url":"http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=data/tet00053.tsv.gz"},{"description":"Download 
dataset in DFT 
format","format":"application/x-gzip","type":"http://www.w3.org/TR/vocab-dcat#Download","url":"http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=data/tet00053.dft.gz"},{"description":"Download 
dataset in SDMX-ML 
format","format":"application/zip","type":"http://www.w3.org/TR/vocab-dcat#Download","url":"http://epp.eurostat.ec.europa.eu/NavTree_prod/everybody/BulkDownloadListing?file=data/tet00053.sdmx.zip"}],"geographical_coverage":[],"status":"http://ec.europa.eu/open-data/kos/dataset-status/Completed","published_by":"estat","keyword_string":["international 
trade,trade 
statistics"],"url":"http://ec.europa.eu/eurostat/product?code=tet00053","type_of_dataset":["http://ec.europa.eu/open-data/kos/dataset-type/Statistical"],"title":"Extra-EU27 
trade of other manufactured goods (SITC 6+8), by Member 
State","interoperability_level":[],"description":"The table shows the 
Member States' contribution to the extra-EU27 trade for that product 
group. Imports are expressed in value terms and measured cif (cost, 
insurance, freight). Exports are expressed in value terms and measured 
fob (free on board). Balance = export - 
import.","name":"d4kBfYgvXM2PWCR5cteFQ","contact_name":"Eurostat, the 
statistical office of the European 
Union","license_id":["http://ec.europa.eu/open-data/kos/licence/EuropeanCommission"],"contact_address":"Joseph 
Bech building, 5 Rue Alphonse Weicker, L-2721 
Luxembourg","language":[],"identifier":"tet00053","contact_telephone":"tel: 
+352 430136789"}'  -H 
"Authorization:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"


On 8/08/2013 16:12, Dimitrios Mexis wrote:
> Hello,
>
> when we encounter comma in a text for posting the JSON this comes as 
> return:
>  ERROR [ckan.controllers.api] Validation error: '{\'keyword_string\': 
> [u\'Tag "international trade,trade statistics" must be alphanumeric 
> characters or symbols: -_.\'], \'__type\': \'Validation Error\'}'
>
> Is it because the comma is used internally for spliting the texts. 
> Could that be the problem ?
>
> What is your suggestion ?
>
> Regards
> Dimitrios

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.okfn.org/mailman/private/ecodp-dev/attachments/20130808/dc8fd9e1/attachment.html>


More information about the ecodp-dev mailing list