Wikidata:WikiProject East Asia/China Biographical Database import

The China Biographical Database (CBDB) is a freely accessible scholarly database hosted by Harvard University (Q13371). It holds biographical details of 370,000 people from all eras of Chinese history.

Each person in CBDB has an identifier which is seven digits long. Wikidata items can have this property as CBDB ID (P497). There is a Mix'n'Match effort to reconcile CBDB identifiers with Wikidata. As of February 2018, more than 300,000 records have been matched. Tens of thousands more are still to be matched, or to have new Wikidata items created.

The database is freely available for download. User:MartinPoulter has a copy and is working on extracting basic biographical data (gender, dynasty, English name) to improve the Wikidata records.

Countries edit

CBDB has its own nationality table. Here is a partial mapping of these countries to Wikidata. The English labels are the ones actually used by CBDB: please do not fix typos in them.

English name in CBDB start date end date Wikidata match comments internal ID in CBDB
unknown 0
Koryo Goryeo (Q28208) 14
Minor Liang 37
Qin 43
Korea Korea (Q18097) 58
Xinluo (Korea) ? Could be Silla (Q28456) ? 67
Pre-Han -1100 -206 Could correspond to almost any ancient Chinese state (Q836688) 1
QinHan -221 220 2
Ying Qin -221 -206 Qin dynasty (Q7183) 61
Western Han -206 9 Western Han (Q1072949) We also have Han dynasty (Q7209) 29
Xin (Wang Mang) 9 25 Xin dynasty (Q504769) 46
Eastern Han 25 220 Eastern Han (Q1147037) We also have Han dynasty (Q7209) 25
SanGuo 220 265 Three Kingdoms (Q185043) Not a state but a period 3
SanGuo Wei 220 265 Cao Wei (Q320930) 26
SanGuo Shu 221 263 Shu Han (Q320925) 53
SanGuo Wu 222 280 Eastern Wu (Q274488) 42
Western Jin 265 316 Western Jin dynasty (Q1145470) We also have Jin dynasty (Q7352) 23
Former Zhao (16 states) 304 329 Han Zhao (Q1574107) 69
Cheng Han (16 states) 304 347 Cheng Han (Q1069905) 70
Eastern Jin 317 419 Eastern Jin dynasty (Q306928) We also have Jin dynasty (Q7352) 27
Former Liang (16 states) 317 376 Former Liang (Q943392) 51
Later Zhao (16 states) 319 351 Later Zhao (Q2314907) 64
Former Yan (16 states) 337 370 Former Yan (Q1472004) 39
Former Qin (16 states) 350 394 Former Qin (Q1471995) 65
Later Qin (16 states) 384 417 Later Qin (Q1730130) 45
Later Yan (16 states) 384 407 Later Yan (Q1534482) 63
Western Yan (16 states) 384 394 Western Yan (Q1149230) 76
Western Qin (16 states) 385 431 Western Qin (Q1668970) 72
Northern Wei 386 534 Northern Wei (Q875305) 30
Later Liang (16 states) 386 403 Later Liang (Q2314869) 73
Southern Liang (16 states) 397 414 Southern Liang (Q1330290) 74
Southern Yan (16 states) 398 410 Southern Yan (Q1329439) 50
Western Liang (16 states) 400 421 Western Liang (Q994451) 56
Northern Liang (16 states (sic) 401 439 Northern Liang (Q1539360) 62
Northern Yan (16 states) 407 436 Northern Yan (Q2006864) 60
Xia (16 states) 407 431 Xia (Q546282) 71
NanBei Chao 420 589 Northern and Southern dynasties (Q49696) Not a state but a period 4
Song (Liu) 420 479 Liu Song dynasty (Q49697) 28
Southern Qi 479 502 Southern Qi (Q62456) 32
Southern Liang 502 557 Liang dynasty (Q1069868) 44
Eastern Wei 534 550 Eastern Wei (Q307069) 41
Western Wei 535 557 Western Wei (Q1143164) 40
Northern Qi 550 578 Northern Qi (Q1143524) 35
Later Liang (North. Dy) 555 587 Western Liang dynasty (Q849770) 68
Chen 557 589 Chen dynasty (Q62454) 24
Northern Zhou 557 581 Northern Zhou (Q551067) 31
Sui 581 618 Sui dynasty (Q7405) 5
Tang 618 907 Tang dynasty (Q9683) 6
Zheng (Wang Shichong) 619 621 Zheng (Q49788484) 81
Zhou (Wu Zetian) 684 705 Period of rule of the person Wu Zetian (Q9738) 77
Former Shu (10 states) 903 925 Former Shu (Q571453) 75
Wu 904 937 Wu (Q1323195) 9
Wu (Yang: 10 states) 904 937 Wu (Q1323195) 36
Five Dynasties 907 960 Five Dynasties (Q20716233) Not a state but a period 7
WuYue (10 states) 907 978 Wuyue (Q1193822) 11
Later Liang (5 dynasties) 907 923 Later Liang dynasty (Q783489) 34
Chu (Ma:10 states) 907 951 Chu (Q1192347) 38
Min (10 states) 909 945 Min (Q1192067) 12
Southern Han (10 states) 917 971 Southern Han (Q1198071) 13
Later Tang (5 dynasties) 923 936 Later Tang dynasty (Q1143126) 47
Nanping (10 states) 924 963 Jingnan (Q1325075) 55
Later Shu (10 states) 933 965 Later Shu (Q526507) 8
Later Jin (5 dynasties) 936 947 Later Jin dynasty (Q1154540) 48
Southern Tang (10 states) 937 975 Southern Tang (Q1326742) 10
Liao 947 1115 Liao dynasty (Q4958) 16
Later Han (5 dynasties) 947 951 Later Han dynasty (Q1069829) 52
Later Zhou (5 dynasties) 951 960 Later Zhou dynasty (Q1154556) 49
Northern Han (10 states) 951 979 Northern Han (Q1141471) 66
Song 960 1279 Song dynasty (Q7462) We also have Southern Song dynasty (Q1147043) and Northern Song dynasty (Q319460) 15
Western Xia 1032 1227 Western Xia (Q7427) 78
Jin 1115 1234 Jin dynasty (Q5066) 17
Qi (Wei Qi) 1130 1137 Liu Qi (Q4505481) 57
Qara-Khitay 1132 1218 Qara Khitai (Q862304) 59
Yuan 1234 1367 Yuan dynasty (Q7313) 18
Ming 1368 1644 Ming dynasty (Q9903) 19
Northern Yuan 1371 1387 Northern Yuan dynasty (Q8959) 79
Soutthern Ming (sic) 1644 1661 Southern Ming dynasty (Q1198163) 80
Qing 1644 1911 Qing Dynasty (Q8733) 20
Republic of China 1912 Taiwan (Q865) We also have Republic of China (Q13426199) 21
People's Republic of China 1949 People's Republic of China (Q148) 22

SPARQL queries edit

Count how many items in Wikidata has CBDB id edit

SELECT (COUNT (DISTINCT ?item) as ?count) WHERE {
  ?item wdt:P497 ?id
}
Try it!

6 May 2021: gave 421,159 results

Image gallery of the most notable people with a CBDB ID edit

#defaultView:ImageGrid{"hide": "?sites"}
SELECT ?person ?personLabel ?personDescription (URI(CONCAT("http://db1.ihp.sinica.edu.tw/cbdbc/cbdbkmeng?~~AAA",SAMPLE(?cbdb))) AS ?x_cbdb_url) ?image (COUNT(?site) AS ?sites) WHERE {
?person wdt:P497 ?cbdb;
    wdt:P18 ?image.
?site schema:about ?person.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?person ?personLabel ?personDescription ?image ORDER BY DESC(?sites) LIMIT 200
Try it!

People with a CBDB ID but no country edit

SELECT ?wd ?cbdb WHERE {
?wd wdt:P497 ?cbdb.
MINUS {?wd wdt:P27 ?country. FILTER (?country != wd:Q29520 ) } # no country or country set as China
}
Try it!
  • 24 February 2018: gave 302,902 results
  • 1 March 2018: gave 225,950 results
  • 17 March 2018: 54,387 results
  • 15 April 2018: 17,566 results

People with a CBDB ID but no gender edit

SELECT ?wd (URI(CONCAT("http://db1.ihp.sinica.edu.tw/cbdbc/cbdbkmeng?~~AAA",?cbdb)) AS ?cbdb_url) WHERE {
?wd wdt:P497 ?cbdb.
MINUS {?wd wdt:P21 [] }
}
Try it!

Count of CBDB people by nationality edit

SELECT ?country ?countryLabel (COUNT(?wd) AS ?count) WHERE {
?wd wdt:P497 ?cbdb;
    wdt:P27 ?country
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?country ?countryLabel ORDER BY DESC(?count)
Try it!

Note: people usually shouldn't have country of citizenship (P27) -> China (Q29520) because China (Q29520) represents the region, not sovereign states in that region.

People with nationality: China and another nationality edit

SELECT ?wd WHERE {
?wd wdt:P27 wd:Q29520.
?wd wdt:P27 ?country FILTER (?country != wd:Q29520).
}
Try it!

Count Number of External Identifiers People in CBDB have edit

SELECT ?item (COUNT(DISTINCT ?prop) AS ?count) WHERE {
  hint:Query hint:optimizer "None".
  ?item wdt:P497 ?yp_id;
    ?p ?id.
  ?prop wikibase:directClaim ?p ;wikibase:propertyType wikibase:ExternalId .
}GROUP BY ?item ?count
Try it!

Count the external identifiers People in CBDB has by frequency edit

SELECT ?prop ?propLabel ?count WHERE {
    {
        SELECT ?prop (COUNT(DISTINCT ?item) AS ?count) WHERE {
           
           hint:Query hint:optimizer "None" .
           ?item wdt:P497 ?yp_id .
           ?item ?p ?id .
           ?prop wikibase:directClaim ?p; wikibase:propertyType wikibase:ExternalId.     
        }  GROUP BY ?prop
    }
           
    SERVICE wikibase:label {
        bd:serviceParam wikibase:language "en" .
    }

} ORDER BY DESC (?count)
Try it!

Count the number of external identifiers a person in CBDB has edit

SELECT ?item ?itemLabel ?itemDescription (COUNT(?type) as ?count) WHERE {
SELECT 
  ?item ?itemLabel ?itemDescription ?p ?type
WHERE
{
    hint:Query hint:optimizer "None".
    BIND( wd:Q487042 as ?item)
    { 
        ?item ?wdt [] . 
        ?p wikibase:directClaim ?wdt ; wikibase:propertyType wikibase:ExternalId  ; wikibase:propertyType ?type.
    }
   SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } 
}
GROUP BY ?item ?itemLabel ?itemDescription ?p ?type
} GROUP BY ?item ?itemLabel ?itemDescription ?count
Try it!

Note: Here the example shows wd:Q487042 Choe Chiwon's query result.

People in CBDB who has more than 1 CBDB ID edit

SELECT ?item ?itemLabel (COUNT(?id) as ?count) WHERE {
  ?item wdt:P497 ?id
        SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } 
} GROUP BY ?item ?itemLabel ?count
HAVING (?count >= 2)
ORDER BY DESC (?count)
Try it!

CBDB ID that corresponds to 2 and more items in Wikidata edit

SELECT ?id (COUNT(?item) as ?count) WHERE {
  ?item wdt:P497 ?id
} GROUP BY ?id ?count
HAVING (?count >= 2)
ORDER BY DESC (?count)
Try it!

Items with CBDB ID in Wikidata that have been linked to corresponding Wikipedia articles edit

SELECT ?id ?sitelink
WHERE
{
  # items that have CBDB ID
    { ?item wdt:P497 ?id }
 
  # look for articles (sitelinks) in Chinese ("zh")
    { ?sitelink schema:about ?item . ?sitelink schema:inLanguage "zh" }
  
  # look for articles (sitelinks) in wikipedia in Chinese ("zh")
   FILTER (SUBSTR(str(?sitelink), 1, 25) = "https://zh.wikipedia.org/")
}
Try it!

Countries of External Identifiers for Items with CBDB ID edit

SELECT ?ExternalIdentifierProperty ?ExternalIdentifierPropertyLabel ?countryorregionLabel WHERE {
    {
        SELECT ?ExternalIdentifierProperty (COUNT(DISTINCT ?item) AS ?count) WHERE {
           
           hint:Query hint:optimizer "None" .
           ?item wdt:P497 ?cbdb_id .
           ?item ?p ?id .
           ?ExternalIdentifierProperty wikibase:directClaim ?p; wikibase:propertyType wikibase:ExternalId.     
        }  GROUP BY ?ExternalIdentifierProperty
    }
    OPTIONAL {?ExternalIdentifierProperty wdt:P17 ?countryorregion.}
    SERVICE wikibase:label {
        bd:serviceParam wikibase:language "en" .
    }
}
Try it!