「取得 Authority 資料」:修訂間差異
imported>Winxd (→欄位說明) |
imported>Ray 小 (取得Authority資料移動到取得 Authority 資料) |
||
(未顯示由 2 位使用者於中間所作的 12 次修訂) | |||
行 23: | 行 23: | ||
abc123({ | abc123({ | ||
"data1": { | "data1": { | ||
" | "name": "畺良耶舍", | ||
" | "authorityID": "A000004", | ||
" | "projectNo": "B0004", | ||
" | "dynasty": "劉宋 ", | ||
" | "bornDate": "+0391", | ||
" | "diedDate": "+0502", | ||
" | "class": "譯經", | ||
" | "note": "西域人,最後出現在京師道林寺,宋元嘉十九年(442)後卒。(疑年錄:14)卒於江陵。(T50n2059_p0343c22)", | ||
" | "names": " 時稱" | ||
} | } | ||
}) | }) | ||
行 63: | 行 63: | ||
abc123({ | abc123({ | ||
"data1": { | "data1": { | ||
" | "name": "長安", | ||
" | "dynasty": "西漢", | ||
" | "authorityID": "CN610112Z05AA", | ||
" | "lat": "108.8835", | ||
" | "long": "34.3194", | ||
" | "districtHistorical": " 西漢_司隸部", | ||
" | "districtModern": " 陝西省- 西安市- 未央區" | ||
} | } | ||
}) | }) | ||
行 76: | 行 76: | ||
=== 欄位說明 === | === 欄位說明 === | ||
1. | 1.authorityID :地名編碼,地名的唯一碼。<br> | ||
2. | 2.districtModern :行政區。<br> | ||
3. | 3.lat :X座標。<br> | ||
4. | 4.long :Y座標。<br> | ||
5. | 5.dynasty :朝代。<br> | ||
6. | 6.districtHistorical :歷史行政區。<br> | ||
7. | 7.note :註解。<br> | ||
8. | 8.names :別名。<br> | ||
== 取得時間資料 == | == 取得時間資料 == | ||
行 96: | 行 96: | ||
<li><font color=red size=3><b>jsoncallback:</b></font>隨機產生的參數。</li> | <li><font color=red size=3><b>jsoncallback:</b></font>隨機產生的參數。</li> | ||
<li> | |||
format=d,一定要給,不然沒有回傳值 (合作廠商) | |||
</li> | |||
</ul> | </ul> | ||
=== 執行範例 === | === 執行範例 === | ||
1.from-to: | 1.from-to: | ||
http://authority.ddbc.edu.tw/getAuthorityData.php?from=5314240&to=5314476&jsoncallback=abc123&type=time <br> | http://authority.ddbc.edu.tw/getAuthorityData.php?from=5314240&to=5314476&format=d&jsoncallback=abc123&type=time <br> | ||
2.when: | 2.when: | ||
http://authority.ddbc.edu.tw/getAuthorityData.php?when=5314240&jsoncallback=abc123&type=time | http://authority.ddbc.edu.tw/getAuthorityData.php?when=5314240&jsoncallback=abc123&format=d&type=time | ||
=== 執行結果 === | === 執行結果 === | ||
行 112: | 行 115: | ||
"rows": "3", | "rows": "3", | ||
"data1": { | "data1": { | ||
" | "authorityID": "5314240", | ||
" | "JD": "1802675", | ||
" | "ceDate": "+0223-06-16", | ||
" | "dynasty": " 孫吳", | ||
"emperor": "大帝", | |||
"reignYear": "黃武", | "reignYear": "黃武", | ||
" | "yearNumber": "2", | ||
"yearGanzhi": "癸卯", | "yearGanzhi": "癸卯", | ||
" | "month": "五", | ||
" | "dayNumber": "1", | ||
" | "dayGanzhi": "戊子" | ||
}, | }, | ||
"data2": { | "data2": { | ||
" | "authorityID": "5314240", | ||
" | "JD": "1802675", | ||
" | "ceDate": "+0223-06-16", | ||
" | "dynasty": " 曹魏", | ||
"emperor": "文帝", | |||
"reignYear": "黃初", | "reignYear": "黃初", | ||
" | "yearNumber": "4", | ||
"yearGanzhi": "癸卯", | "yearGanzhi": "癸卯", | ||
" | "month": "五", | ||
" | "dayNumber": "1", | ||
" | "dayGanzhi": "戊子" | ||
}, | }, | ||
"data3": { | "data3": { | ||
" | "authorityID": "5314240", | ||
" | "JD": "1802675", | ||
" | "ceDate": "+0223-06-16", | ||
" | "dynasty": " 蜀漢", | ||
"emperor": "後主", | |||
"reignYear": "建興", | "reignYear": "建興", | ||
" | "yearNumber": "1", | ||
"yearGanzhi": "癸卯", | "yearGanzhi": "癸卯", | ||
" | "month": "五", | ||
" | "dayNumber": "1", | ||
" | "dayGanzhi": "戊子" | ||
} | } | ||
}, | }, | ||
行 151: | 行 157: | ||
"rows": "3", | "rows": "3", | ||
"data1": { | "data1": { | ||
" | "authorityID": "5314476", | ||
" | "JD": "1802911", | ||
" | "ceDate": "+0224-02-07", | ||
" | "dynasty": " 孫吳", | ||
"emperor": "大帝", | |||
"reignYear": "黃武", | "reignYear": "黃武", | ||
" | "yearNumber": "3", | ||
"yearGanzhi": "甲辰", | "yearGanzhi": "甲辰", | ||
" | "month": "正", | ||
" | "dayNumber": "1", | ||
" | "dayGanzhi": "甲申" | ||
}, | }, | ||
"data2": { | "data2": { | ||
" | "authorityID": "5314476", | ||
" | "JD": "1802911", | ||
" | "ceDate": "+0224-02-07", | ||
" | "dynasty": " 曹魏", | ||
"emperor": "文帝", | |||
"reignYear": "黃初", | "reignYear": "黃初", | ||
" | "yearNumber": "4", | ||
"yearGanzhi": "癸卯", | "yearGanzhi": "癸卯", | ||
" | "month": " 十二", | ||
" | "dayNumber": "30", | ||
" | "dayGanzhi": " 甲申" | ||
}, | }, | ||
"data3": { | "data3": { | ||
" | "authorityID": "5314476", | ||
" | "JD": "1802911", | ||
" | "ceDate": "+0224-02-07", | ||
" | "dynasty": " 蜀漢", | ||
"emperor": "後主", | |||
"reignYear": "建興", | "reignYear": "建興", | ||
" | "yearNumber": "1", | ||
"yearGanzhi": "癸卯", | "yearGanzhi": "癸卯", | ||
" | "month": " 十二", | ||
" | "dayNumber": "30", | ||
" | "dayGanzhi": " 甲申" | ||
} | } | ||
} | } | ||
行 249: | 行 213: | ||
==== 第三層 ==== | ==== 第三層 ==== | ||
1.dateCode:時間唯一碼。<br> | 1.dateCode:時間唯一碼。<br> | ||
2. | 2.ceDate :西元年。<br> | ||
3. | 3.dynasty :朝代。<br> | ||
4. | 4.emperor :皇帝。<br> | ||
5.reignYear:年號。<br> | 5.reignYear:年號。<br> | ||
6. | 6.yearNumber :第幾年。<br> | ||
7.yearGanzhi:年干支。<br> | 7.yearGanzhi:年干支。<br> | ||
8. | 8.month :月。<br> | ||
9. | 9.dayNumber :日。<br> | ||
10. | 10.dayGanzhi : 日 干支。<br> | ||
11.JD:Julian ID。 | 11.JD:Julian ID。 | ||
== 合作廠商回報 == | |||
1、取得資料時,一定要這麼多參數嗎?因為每台電腦都要計算、分割手上的權威id,每次,每個專案、每個uesr都要執行一次計算,很不經濟也很麻煩。請問可以直接給id就好了嗎? ^^ | |||
tj文esst!!!我!123 這 是中a |
於 2020年6月5日 (五) 11:57 的最新修訂
前言
由於各個專案可能有取得Authority資料的需求,因此這邊提供取得Authority的人名、地名、時間之方法,已方便各專案使用。
程式位置
http://authority.ddbc.edu.tw/getAuthorityData.php
取得人名資料
需要餵給程式的參數
- type:必須指定成「person」。
- id:就是你想要取得人名資料的唯一碼,可接受7碼的Pno(ex-A000004)和5碼的人名PrjNo(ex-B0006)。
- jsoncallback:隨機產生的參數。
執行範例
http://authority.ddbc.edu.tw/getAuthorityData.php?type=person&id=A000004&jsoncallback=abc123
執行結果
abc123({
"data1": {
"name": "畺良耶舍",
"authorityID": "A000004",
"projectNo": "B0004",
"dynasty": "劉宋 ",
"bornDate": "+0391",
"diedDate": "+0502",
"class": "譯經",
"note": "西域人,最後出現在京師道林寺,宋元嘉十九年(442)後卒。(疑年錄:14)卒於江陵。(T50n2059_p0343c22)",
"names": " 時稱"
}
})
欄位說明
1.authorityID:此筆資料於authority資料庫的唯一碼。
2.projectNo:專案碼,即此筆人名資料的專案編號。
3.class:分類。
4.note:註解。
5.bornDate:出生日(datecode)。
6.diedDate:死亡日(datecode)。
7.dynasty:朝代。
8.names:別名。
取得地名資料
需要餵給程式的參數
- type:必須指定成「place」。
- id:地名資料的唯一碼,可接受13碼以上的地名編碼(ex-CN232723Z01AA)或地名的PrjNo(ex-Z0106105)。
- jsoncallback:隨機產生的參數。
執行範例
http://authority.ddbc.edu.tw/getAuthorityData.php?type=place&id=CN610112Z05AA&jsoncallback=abc123
執行結果
abc123({
"data1": {
"name": "長安",
"dynasty": "西漢",
"authorityID": "CN610112Z05AA",
"lat": "108.8835",
"long": "34.3194",
"districtHistorical": " 西漢_司隸部",
"districtModern": " 陝西省- 西安市- 未央區"
}
})
欄位說明
1.authorityID:地名編碼,地名的唯一碼。
2.districtModern:行政區。
3.lat:X座標。
4.long:Y座標。
5.dynasty:朝代。
6.districtHistorical:歷史行政區。
7.note:註解。
8.names:別名。
取得時間資料
需要餵給程式的參數
- type:必須指定成「time」。
- from-to、when:時間的參數值為7碼的datecode(如:5314476)。
- 由於標記可能是一個時期或一個時間,因此這邊分成兩種形式,如果標記是「時期」,需要給的參數就是from和to。
- 如果標記是一個「時間」,參數就給when。
- jsoncallback:隨機產生的參數。
- format=d,一定要給,不然沒有回傳值 (合作廠商)
執行範例
1.from-to:
http://authority.ddbc.edu.tw/getAuthorityData.php?from=5314240&to=5314476&format=d&jsoncallback=abc123&type=time
2.when:
http://authority.ddbc.edu.tw/getAuthorityData.php?when=5314240&jsoncallback=abc123&format=d&type=time
執行結果
1.from-to:
abc123({
"F": {
"rows": "3",
"data1": {
"authorityID": "5314240",
"JD": "1802675",
"ceDate": "+0223-06-16",
"dynasty": " 孫吳",
"emperor": "大帝",
"reignYear": "黃武",
"yearNumber": "2",
"yearGanzhi": "癸卯",
"month": "五",
"dayNumber": "1",
"dayGanzhi": "戊子"
},
"data2": {
"authorityID": "5314240",
"JD": "1802675",
"ceDate": "+0223-06-16",
"dynasty": " 曹魏",
"emperor": "文帝",
"reignYear": "黃初",
"yearNumber": "4",
"yearGanzhi": "癸卯",
"month": "五",
"dayNumber": "1",
"dayGanzhi": "戊子"
},
"data3": {
"authorityID": "5314240",
"JD": "1802675",
"ceDate": "+0223-06-16",
"dynasty": " 蜀漢",
"emperor": "後主",
"reignYear": "建興",
"yearNumber": "1",
"yearGanzhi": "癸卯",
"month": "五",
"dayNumber": "1",
"dayGanzhi": "戊子"
}
},
"T": {
"rows": "3",
"data1": {
"authorityID": "5314476",
"JD": "1802911",
"ceDate": "+0224-02-07",
"dynasty": " 孫吳",
"emperor": "大帝",
"reignYear": "黃武",
"yearNumber": "3",
"yearGanzhi": "甲辰",
"month": "正",
"dayNumber": "1",
"dayGanzhi": "甲申"
},
"data2": {
"authorityID": "5314476",
"JD": "1802911",
"ceDate": "+0224-02-07",
"dynasty": " 曹魏",
"emperor": "文帝",
"reignYear": "黃初",
"yearNumber": "4",
"yearGanzhi": "癸卯",
"month": "十二",
"dayNumber": "30",
"dayGanzhi": "甲申"
},
"data3": {
"authorityID": "5314476",
"JD": "1802911",
"ceDate": "+0224-02-07",
"dynasty": " 蜀漢",
"emperor": "後主",
"reignYear": "建興",
"yearNumber": "1",
"yearGanzhi": "癸卯",
"month": "十二",
"dayNumber": "30",
"dayGanzhi": "甲申"
}
}
})
欄位說明
時間的回傳資料有分成三層陣列,分別說明如下:
第一層
1.F、T:代表from的內容集合和to的內容集合。
2.W:代表when的內容集合。
第二層
1.rows:共有幾個並行年代。
1.data(N):N為數字,代表這是第幾個並行年代,N<=result。
第三層
1.dateCode:時間唯一碼。
2.ceDate:西元年。
3.dynasty:朝代。
4.emperor:皇帝。
5.reignYear:年號。
6.yearNumber:第幾年。
7.yearGanzhi:年干支。
8.month:月。
9.dayNumber:日。
10.dayGanzhi:日干支。
11.JD:Julian ID。
合作廠商回報
1、取得資料時,一定要這麼多參數嗎?因為每台電腦都要計算、分割手上的權威id,每次,每個專案、每個uesr都要執行一次計算,很不經濟也很麻煩。請問可以直接給id就好了嗎? ^^
tj文esst!!!我!123這是中a