Introduction

This database contains information on matters discussed in Council meeting since the fifth term of LegCo. Hinting by its name, the database is built upon the PDF hansard files. Relying on the bookmarks and section codes of the hansard files, the data endpoints retrieve data from the files directly.

For more details of the database, see https://www.legco.gov.hk/odata/english/hansard-db.html.

Key Identifiers

Here are the key identifies that is useful for locating the neccessary data from the Hansard database:

  • HansardID is the numerical ID of a hansard file. A hansard file is the Record of Proceedings of a Council meeting. Since there are three versions of hansard—Floor, Chinese and English, each Council meeting has three hansard files, meaning that there are three Hansard IDs corresponding to the same meeting.

  • RundownID is the numerical ID of a rundown in the hansard file. In simple terms, rundowns can be understood as individual paragraphs in the Record of Proceedings.

  • SectionCode is the alphabetical code stipulating the type of business as indicated in the LegCo Rules of Procedures 18(1) that a paragraph text is referring to in the hansard file.

  • BookmarkName is the alphabetical code stipulating details of the rundown. A detailed explanation can be found here.

  • SpeakerID is the numerical ID stipulating the speaker of a paragraph text in the hansard file.

These identifiers essentially indicate the when (HansardID), where (RundownID), what (SectionCode) and who (SpeakerID) of a parapgraph text in the Record of Proceedings.

Total Count

All functions in this database have an option to return only the total count of the records matching the specified parameters instead of returning the data frame containing the result. To activate this option, specify count = TRUE:

# Fetch the total number of questions put on the government in LegCo in April, 2019
v <- questions(from = "2019-04-01", to = "2019-04-30", count = TRUE)
v
## [1] 44

This database is accessible with the following functions/data:

hansard()

hansard() fetches the information of the hansard files.

v <- hansard(from = "2019-02-20", to = "2019-02-20")
v
##   HansardID         MeetingDate          AgendaDate isCEQandA isCEQT
## 1      2691 2019-02-20T00:00:00 2019-02-20T00:00:00         0      1
## 2      2714 2019-02-20T00:00:00 2019-02-20T00:00:00         0      0
##                                                                         HansardFileURL
## 1 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220q-translate-e.pdf
## 2  https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf

If isCEQandA is 1, the hansard file is the Record of Proceedings of a Chief Executive’s Question and Answer Session.

If isCEQT is 1, the hansard file is the Record of Proceedings of a Chief Executive’s Question Time.

legco_section_type

legco_section_type is a data frame containing the meaning of the section code.

v <- legco_section_type
head(v)
##   SectionCode                                            NameEng
## 1         r2r     Remaining proceedings after the Second Reading
## 2         orq                                     Oral Questions
## 3         r2a         Motions for the Adjournment of the Council
## 4         r4a         Motions for the Adjournment of the Council
## 5         cea               The Chief Executive's Policy Address
## 6         ceq The Chief Executive's Question and Answer Session 
##                NameChi
## 1     二讀後的餘下程序
## 2             口頭質詢
## 3   立法會休會待續議案
## 4   立法會休會待續議案
## 5 行政長官發表施政報告
## 6       行政長官答問會

subjects()

subjects() fetches all subjects being discussed in a Council meeting.

# Fetch second reading of bills during the Council meeting on February 20, 2019
v <- subjects(hansard_id = 2714, section_code = "b2r")
head(v)
##           MeetingDate                                       Subject
## 1 2019-02-20T00:00:00            SECOND READING OF GOVERNMENT BILLS
## 2 2019-02-20T00:00:00 Smoking (Public Health) (Amendment) Bill 2019
## 3 2019-02-20T00:00:00             Trade Marks (Amendment) Bill 2019
##   ResumptionOf SectionCode RundownID HansardID
## 1           NA         b2r    899626      2714
## 2           NA         b2r    899628      2714
## 3           NA         b2r    899650      2714

The RundownID indicates the starting RundownID of the subject concerned. For instance, the starting RundownID of Smoking (Public Health) (Amendment) Bill 2019 is 899628, meaning that the paragraph text of this subject is from 899628 to 899649.

If the business is a continuation of a previous meeting, the date of the previous meeting will be shown in the field ResumptionOf.

rundown()

rundown() fetches the paragraph text in hansard files. Note that the result is not in any specific order so it is neccessary to reorder if needed.

# Fetch records of proceedings of the second reading of Smoking (Public Health) (Amendment) Bill 2019
v <- rundown(id = 899628:899649)
v <- v[order(v$RundownID), ]
rownames(v) <- 1:nrow(v)
v[3:5, ]
##   RundownID         MeetingDate
## 3    899630 2019-02-20T00:00:00
## 4    899631 2019-02-20T00:00:00
## 5    899632 2019-02-20T00:00:00
##                                                                                                     Content
## 3 DEPUTY PRESIDENT (in Cantonese): Secretary, please hold on.  Mr SHIU Ka-fai, what is your point of order?
## 4              MR SHIU KA-FAI (in Cantonese): Deputy President, I think a quorum is lacking in the Chamber.
## 5                                          DEPUTY PRESIDENT (in Cantonese): Are you requesting a headcount?
##       BookmarkName SpeakerID HansardID
## 3 SP_LC_DPSD_00206         3      2714
## 4  SP_MB_SKF_00207       140      2714
## 5 SP_LC_DPSD_00208         3      2714
##                                                                                                   HansardFileURL
## 3 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=SP_LC_DPSD_00206
## 4  https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=SP_MB_SKF_00207
## 5 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=SP_LC_DPSD_00208

Though of little use, BookmarkName can be a useful parameter to search for the neccesary data. The BookmarkName of the starting Rundown of a subject is a combination of section code and the sequence number. For instance, the two bills that were under the process of second reading have a BookmarkName of “b2r01” and “b2r02” respectively. Therefore, it is possible to directly fetch the starting RundownID of the first bill under second reading on February 20, 2019, i.e. Smoking (Public Health) (Amendment) Bill 2019, by specifying the BookmarkName:

# Fetch the first bill under second reading on February 20, 2019
v <- rundown(bookmark_name = "b2r01", from = "2019-02-20", to = "2019-02-20")
v
##   RundownID         MeetingDate
## 1    899628 2019-02-20T00:00:00
##                                         Content BookmarkName SpeakerID
## 1 Smoking (Public Health) (Amendment) Bill 2019        b2r01        NA
##   HansardID
## 1      2714
##                                                                                        HansardFileURL
## 1 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=b2r01

Similarly, it can be applicable on other SectionCode as well, such as “pop01” and “pop02”.

questions()

questions() fetches the question put on the government by LegCo members. Note that this function does not take HansardID as a filtering parameter.

# Fetch questions being put on the government during the Council meeting on February 20, 2019
v <- questions(from = "2019-02-20", to = "2019-02-20")
head(v)
##           MeetingDate QuestionType
## 1 2019-02-20T00:00:00         Oral
## 2 2019-02-20T00:00:00         Oral
## 3 2019-02-20T00:00:00         Oral
## 4 2019-02-20T00:00:00         Oral
## 5 2019-02-20T00:00:00         Oral
## 6 2019-02-20T00:00:00         Oral
##                                                            Subject
## 1                                    Following up marine incidents
## 2                         The overloaded public health care system
## 3     Alleviating the pressure on the services of public hospitals
## 4    Medical and nursing manpower in the public health care system
## 5                                    Regulation of e-sports venues
## 6 Construction documentation of the Shatin to Central Link project
##          Speaker SpeakerID RundownID
## 1      STEVEN HO        97    899439
## 2      WILSON OR       143    899457
## 3   CHAN HOI-YAN       161    899479
## 4    HELENA WONG       117    899496
## 5     JEREMY TAM       157    899514
## 6 LAM CHEUK-TING       138    899529
##                                                                                        HansardFileURL
## 1 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=orq01
## 2 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=orq02
## 3 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=orq03
## 4 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=orq04
## 5 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=orq05
## 6 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=orq06

Similar to the output of subjects(), RundownID here refers to the starting RundownID, which can be used to determine the range of the full question text.

bills()

bills() fetches bills being debated in LegCo Countil meetings.

# Fetch bills debated during the Council meeting on February 20, 2019
v <- bills(hansard_id = 2714)
head(v)
##           MeetingDate
## 1 2019-02-20T00:00:00
## 2 2019-02-20T00:00:00
## 3 2019-02-20T00:00:00
## 4 2019-02-20T00:00:00
## 5 2019-02-20T00:00:00
## 6 2019-02-20T00:00:00
##                                                                  Subject
## 1                          Smoking (Public Health) (Amendment) Bill 2019
## 2                                      Trade Marks (Amendment) Bill 2019
## 3 Inland Revenue (Profits Tax Exemption for Funds) (Amendment) Bill 2018
## 4                           Inland Revenue (Amendment) (No. 7) Bill 2018
## 5                          Smoking (Public Health) (Amendment) Bill 2019
## 6                                      Trade Marks (Amendment) Bill 2019
##                                                   Section SectionCode
## 1                       First Reading of Government Bills         b1r
## 2                       First Reading of Government Bills         b1r
## 3 Resumption of Second Reading Debate on Government Bills         b2d
## 4 Resumption of Second Reading Debate on Government Bills         b2d
## 5                      Second Reading of Government Bills         b2r
## 6                      Second Reading of Government Bills         b2r
##   RundownID HansardID
## 1    899623      2714
## 2    899624      2714
## 3    899655      2714
## 4    899698      2714
## 5    899628      2714
## 6    899650      2714
##                                                                                         HansardFileURL
## 1  https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=b1r01
## 2  https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=b1r02
## 3 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=b2d01a
## 4 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=b2d02a
## 5  https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=b2r01
## 6  https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=b2r02

Note that the name of a bill may appear more than once like above, since the bill went through first and second reading in the same meeting. To fetch more detailed information and key dates of a particular bill, use all_bills() instead.

motions()

motions() fetches the motions discussed in Council meetings.

# Fetch motions discussed during the Council meeting on February 20, 2019
v <- motions(hansard_id = 2714)
head(v)
##           MeetingDate
## 1 2019-02-20T00:00:00
## 2 2019-02-20T00:00:00
## 3 2019-02-20T00:00:00
##                                                                                                                                  Subject
## 1                                            Proposed resolution under section 34(4) of the Interpretation and General Clauses Ordinance
## 2 Proposed resolution under Article 75 of the Basic Law of the Hong Kong Special Administrative Region of the People's Republic of China
## 3                                                                 Motion under the Legislative Council (Powers and Privileges) Ordinance
##            Section SectionCode RundownID HansardID
## 1 Members' motions         mbm    899758      2714
## 2 Members' motions         mbm    899768      2714
## 3 Members' motions         mbm    899812      2714
##                                                                                        HansardFileURL
## 1 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=mbm01
## 2 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=mbm02
## 3 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=mbm03

Similar to the output of subjects() and questions(), RundownID here refers to the starting RundownID, which can be used to determine the range of the full question text.

petitions()

petitions() fetches the petitions raised by LegCo members in Council meetings.

# Fetch petition laid during the Council meeting on January 19, 2018
v <- petitions(from = "2018-01-10")
v
##           MeetingDate
## 1 2018-01-10T00:00:00
##                                                                                       Subject
## 1 Mr Charles Peter MOK, with the other three Members, will present a petition to this Council
##            Speakers RundownID HansardID
## 1 CHARLES PETER MOK    781135      2278
##                                                                                        HansardFileURL
## 1 https://www.legco.gov.hk/yr17-18/english/counmtg/hansard/cm20180110-translate-e.pdf#nameddest=pop01

addresses()

addresses() fetches fetches addresses made by members or government officials while presenting papers to the Council.

# Fetch addresses given during the Council meeting on February 20, 2019
v <- addresses(hansard_id = 2714)
v
##           MeetingDate
## 1 2019-02-20T00:00:00
##                                                                                                                                                                                                                                                       Subject
## 1 Report of the Public Accounts Committee on the Reports of the Director of Audit on the Accounts of the Government of the Hong Kong Special Administrative Region for the year ended 31 March 2018 and the Results of Value for Money Audits (Report No. 71)
##        Speaker RundownID HansardID
## 1 ABRAHAM SHEK    899435      2714
##                                                                                        HansardFileURL
## 1 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=add01

statements()

statements() fetches statments made by government officials in Council meetings.

# Fetch statements made by government officials during the Council meeting on April 22, 2015
v <- statements(from = "2015-04-22")
v
##           MeetingDate
## 1 2015-04-22T00:00:00
##                                                                                                   Subject
## 1 Consultation Report and Proposals on the Method for Selecting the Chief Executive by Universal Suffrage
##                              Speaker RundownID HansardID
## 1 CHIEF SECRETARY FOR ADMINISTRATION    408564       997
##                                                                                        HansardFileURL
## 1 https://www.legco.gov.hk/yr14-15/english/counmtg/hansard/cm20150422-translate-e.pdf#nameddest=sta01

voting_results()

voting_results() fetches the results of votes conducted in Council meetings.

# Fetch results of votes conducted during the Council meeting on January 19, 2018
v <- voting_results(hansard_id = 2714)
head(v)
##           MeetingDate
## 1 2019-02-20T00:00:00
## 2 2019-02-20T00:00:00
## 3 2019-02-20T00:00:00
## 4 2019-02-20T00:00:00
## 5 2019-02-20T00:00:00
## 6 2019-02-20T00:00:00
##                                                                  Subject
## 1 Inland Revenue (Profits Tax Exemption for Funds) (Amendment) Bill 2018
## 2 Inland Revenue (Profits Tax Exemption for Funds) (Amendment) Bill 2018
## 3 Inland Revenue (Profits Tax Exemption for Funds) (Amendment) Bill 2018
## 4 Inland Revenue (Profits Tax Exemption for Funds) (Amendment) Bill 2018
## 5                           Inland Revenue (Amendment) (No. 7) Bill 2018
## 6                           Inland Revenue (Amendment) (No. 7) Bill 2018
##   VoteResult SectionCode RundownID HansardID
## 1     Passed         b2d    899665      2714
## 2     Passed         cwc    899677      2714
## 3     Passed         cwc    899685      2714
## 4     Passed         b3r    899695      2714
## 5     Passed         b2d    899709      2714
## 6     Passed         cwc    899720      2714
##                                                                                                 HansardFileURL
## 1 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=EV_VOTED_00241
## 2 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=EV_VOTED_00253
## 3 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=EV_VOTED_00261
## 4 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=EV_VOTED_00271
## 5 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=EV_VOTED_00286
## 6 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=EV_VOTED_00298

voting_results() only returns the overall result of the vote. To fetch the voting record of infividual members, use voting_record() instead.

summoning_bells()

summoning_bells() fetches instances in which the summoning bell have been rung in LegCo Council meetings.

# Fetch instances of summoning bell during the Council meeting on January 19, 2018
v <- summoning_bells(hansard_id = 2714)
head(v)
##           MeetingDate SectionCode RundownID HansardID
## 1 2019-02-20T00:00:00         b2r    899635      2714
## 2 2019-02-20T00:00:00         mbm    899775      2714
##                                                                                                HansardFileURL
## 1 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=EV_BELL_00211
## 2 https://www.legco.gov.hk/yr18-19/english/counmtg/hansard/cm20190220-translate-e.pdf#nameddest=EV_BELL_00354