資料集品質評鑑社群座談會簡報 v.1 20160705
TRANSCRIPT
好資料壞資料
參考資料:http://hackfoldr.org/OD_ResearchProject/提問:www.slido.com code:#1985
好資料壞資料政府資料的評比+整個政府網站都是我的資料庫
2
研究緣起• 專案名稱: 104 年度國家發展委員會政府資料開放委外專案• 研究項目:
資料品質評鑑機制- 建立資料品質評鑑指標,期能提升國內資料品質- 建立 data schema 範例、提供共通性欄位之標準參照
規劃政府機關網站資料結構化流程- 對照「政府網站版型與內容管理規範」建立政府網站共通性內容的標註性語彙
API 服務水準研析建議- 瞭解目前其他機關介接政府資料開放平臺之 API 所面臨的問題- 分析國內外開放資料平台所提供之 API 標準,提供平臺 API服務改善建議
3資料集品質評鑑機制社群討論會議: 2016.7.9
Agenda
2
一、 Data.gov.tw 資料集現況二、定義好資料三、資料集評鑑機制四、 Data Schema Sample
5
Data.gov.tw 資料集現況連線狀況回傳代碼
連線狀況代碼說明
筆數2016/2/23 2016/3/2 2016/3/15
-1 HTTP 連線失敗 2,075 901 905-2 HTTP 連線成功,但無法判斷檔案格式 6,360 6,363 2,212
200 HTTP 連線成功,且可判斷檔案格式 13,217 14,367 18,514204 No Content 2 2 2400 Bad Request 1 1 1401 Unauthorized 1 1 1403 Forbidden 13 13 13404 Not Found 169 189 189500 Internal Server Error 33 34 34502 Bad Gateway 4 4 4503 Service Unavailable 1 1 1
總計 21,876 21,876 21,876能夠成功連結之資料資源為 19,577 筆,約佔
89%
6
7z cap csv doc docx geojson gif html jpe json kml kmz ksh obj ods odt pdf png rar rss txt wsdl xlb
xls xlsx xml zip 無法判斷
Data.gov.tw 資料集現況
1. CSV :共 5695 筆,佔 31 %
2. xml :共 2290 筆,佔 12 %
3. pdf :共 1655 筆,佔 9 %
7
Data.gov.tw 資料集現況
機關填列與實際之檔案格式比對 筆數符合 10,192
不符合 8,313
其他 (-1, -2, 204, 400, 401, 403, 404, 500, 502, 503) 3,371
總計 21,876
機關所填列之資料資源格式符合實際之資料資源格式有10,192 筆,僅佔所有資料資源的 47 %
8
什麼是好資料?分類 面向
資料品質
本質上的資料品質(Intrinsic Data Quality)
可信度 (Believability)正確性 (Accuracy)客觀性 (Objectivity)聲譽 (Reputation)
資料與使用時機相關性的資料品質(Contextual Data Quality)
具附加價值 (Value-added)相關性 (Relevancy)適時性 (Timeliness)完整性 (Completeness)適當的資料量 (Appropriate amount of data)
資料呈現特性的資料品質(Representational Data Quality)
可解釋性 (Interpretability)易於瞭解 (Ease of understanding)呈現的一致性 (Representational consistency)精簡的呈現 (Concise representation)可取得的資料品質
(Accessibility Data Quality)可取得性 (Accessibility)取得安全性 (Access security)
資料來源: Wang, R. Y., & Strong, D. M. (1996). Beyond Accuracy: What Data Quality Means to Data Consumers. Journal of Management Information Systems, 12(4), pp5-33.
9
評鑑的兩個原則
可行性有效性
10
今年度預設評鑑面向資料品質定義 描述
可取得(Availability) 資料是否能夠於網路上直接取得
可被處理(Processability) 資料為機器可讀,且其內容具結構化及編碼一致。
易於理解(Understandability)
1. 資料是否提供 data schema ,或於 meta data中提供資料欄位說明。
2. Data schema 或 meta data 欄位描述是否完整敘述欄位名稱、欄位資料型態、欄位允許的值、欄位採用何種標準化格式。
11
12
Data Schema
欄位名稱 英文欄位名稱 附註檔案名稱 filename
更新時間 updatetime引用自 ISO 8601 標準。日期格式規定為 YYYY-MM-DD ,如: 2016-03-11 ;若為日期 + 時間則需在時間前面加一大寫字母 T ,如: 2016-03-11T13:33:20
資料編號 index Value type: integer
欄位名稱 columnheading Value type: text
是否必填 required 參考:「限制參照表」是否唯一值 unique 參考:「限制參照表」資料型態 datatype 參考:「限制參照表」值的限制 valueconstraints
標題 / 描述 title/description Value type: text
資料來源: ESD Schema Guidance, Local government data schemas Schema guidance, http://opendata.esd.org.uk/ESDSchemaGuidance.pdf
CSV lint, How to Write a Schema, http://csvlint.io/about
本研究整理
13
限制參照表Constraint Value type Description Example
required boolean 若為真,此欄位中一定要有值If true, there must be a value in this column on every row
yes/no
unique boolean 若為真,此欄位中的值不能重複If true, each row should have a different value in this column
yes/no
minLength integer 值的最小長度Every value must contain at least this number of characters
maxLength integer 值的最大長度No value can have more than this number of characters
pattern regexp 值必須屬於匹配該樣式Values must match this regular expression
Pattern: (Female|Male|Female and Male|Unisex|Male urinal|Children only|None|)
type URL資料型態所參照的 URLA URL for a data type which every value must adhere to (see “data type reference”)
minimum number or date/time
最小值Every value must be at least this value
maximum Number or date/time
最大值No value should be more than this value
datePattern strftime 日期 / 時間的型態The format for date/time values in this column
資料來源: JSON Table Schema
14
Data type reference
• string — http://www.w3.org/2001/XMLSchema#string• integer — http://www.w3.org/2001/XMLSchema#int• float — http://www.w3.org/2001/XMLSchema#float• double — http://www.w3.org/2001/XMLSchema#double• URL — http://www.w3.org/2001/XMLSchema#anyURI• boolean — http://www.w3.org/2001/XMLSchema#boolean• non-positive integer — http://www.w3.org/2001/XMLSchema#nonPositiveInteger• positive integer — http://www.w3.org/2001/XMLSchema#positiveInteger• non-negative integer — http://www.w3.org/2001/XMLSchema#nonNegativeInteger• negative integer — http://www.w3.org/2001/XMLSchema#negativeInteger• date — http://www.w3.org/2001/XMLSchema#date• date & time — http://www.w3.org/2001/XMLSchema#dateTime• year — http://www.w3.org/2001/XMLSchema#gYear• year & month — http://www.w3.org/2001/XMLSchema#gYearMonth• time — http://www.w3.org/2001/XMLSchema#time
資料來源: JSON Table Schema
15
欄位名稱 英文欄位名稱 建議採用規範日期 Date Pattern: (ISO 8601)時間 Time Pattern: (ISO 8601)
日期與時間 DateTime Pattern: (ISO 8601)
地址 AddressPattern: ( 內政部戶政司村里街路門牌系統 | 中華郵政地理資訊系統 )
電話 Telephone pattern: 性別 Gender pattern: 年度 Year Pattern: (民國年 |西元年 |)
統一編號 VatNumber Pattern: (財政部統一編號 ) 縣市代碼 CountyId Pattern: (行政院主計總處中華民國行政區域及村里代碼 )鄉鎮代碼 TownshipId Pattern: (行政院主計總處中華民國行政區域及村里代碼 )經度 GeoX Pattern: (TWD97|WGS84|) 緯度 GeoY Pattern: (TWD97|WGS84|)
常見一般性欄位建議標準
註:剖析約一萬筆資料資源 (CSV、 XML、 JSON)歸納而得常見一般性欄位
16
Sample Data Schema - JSON資料集:行政院所屬中央及地方機關代碼URL : http://data.gov.tw/node/7307
17
Sample Data Schema - CSV資料集:行政院所屬中央及地方機關代碼URL : http://data.gov.tw/node/7307