ogre0403 / ipgod

0 stars 3 forks source link

resource ID 不是正確格式 #21

Open ogre0403 opened 7 years ago

ogre0403 commented 7 years ago

http://data.gov.tw/api/v1/rest/dataset/376580000A-480911

{ "resourceID": "a4df4f39-77ff-4314-85c6-71efcadecb190", "resourceDescription": "新竹市寺廟名冊", "format": "XLS", "resourceModified": "2016-05-04 00:00:00", "downloadURL": "http://opendata.hccg.gov.tw/dataset/480911dd-6eea-4f97-a7e8-334b32cc8f6b/resource/a1f7a23e-d776-4ea5-a5a1-d40085143293/download/20160503142844432.xls", "metadataSourceOfData": "", "characterSetCode": "UTF-8" },

ogre0403 commented 7 years ago

issue 1: od2ckan是用.的格式取檔案,od2ckan不會有問題

issue 2: 資料庫的package_name和file_id長度會超過原本預定的長度,改為unlimited legtn 的 text型態 workaround: ckan_download 與 resource_metadata 的 schema 裡的file_id改為resourceID,長度改為unlimited

CREATE TABLE ckan_download (
    package_name    text  NOT NULL,
    resource_id     text  NOT NULL, 
    download_time   TIMESTAMP WITH TIME ZONE,
    status          SMALLINT,
    processed       boolean, 
    skip            boolean
);

CREATE TABLE resource_metadata(
    package_name    text  NOT NULL,
    resource_id         text  NOT NULL,
    url                       text,             
    format                 text, 
   processed            boolean
);