Template:Hansard-item-cargo: Difference between revisions

From PoliticalSG
No edit summary
No edit summary
Line 17: Line 17:
|verified=String
|verified=String
|last_updated=Date
|last_updated=Date
}}</noinclude><includeonly>{{#cargo_store:_table=hansard_items|item_id={{{item_id|}}}|sitting_id={{{sitting_id|}}}|sitting_date={{{sitting_date|}}}|parliament_no={{{parliament_no|}}}|item_type={{{item_type|}}}|item_no={{{item_no|}}}|subject={{{subject|}}}|asking_mp_id={{{asking_mp_id|}}}|answering_mp_id={{{answering_mp_id|}}}|speaker_mp_id={{{speaker_mp_id|}}}|bill_id={{{bill_id|}}}|debate_id={{{debate_id|}}}|grouped_question_nos={{{grouped_question_nos|}}}|topic_tags={{{topic_tags|}}}|summary={{{summary|}}}|verified={{{verified|}}}|last_updated={{{last_updated|}}}}}<span id="{{{item_id|}}}"></span><span class="hansard-item-meta" style="font-size:85%;color:#54595d;">[{{#switch:{{{item_type|}}}|oral_question=Oral Q|written_question=Written Q|bill_first_reading=Bill · 1st Reading|bill_second_reading=Bill · 2nd Reading|motion=Motion|adjournment_speech=Adjournment|ministerial_statement=Ministerial Statement|#default={{{item_type|}}}}}{{#if:{{{item_no|}}}| {{{item_no|}}}}}]</span></includeonly><noinclude>
}}</noinclude><includeonly>{{#cargo_store:_table=hansard_items|item_id={{{item_id|}}}|sitting_id={{{sitting_id|}}}|sitting_date={{{sitting_date|}}}|parliament_no={{{parliament_no|}}}|item_type={{{item_type|}}}|item_no={{{item_no|}}}|subject={{{subject|}}}|asking_mp_id={{{asking_mp_id|}}}|answering_mp_id={{{answering_mp_id|}}}|speaker_mp_id={{{speaker_mp_id|}}}|bill_id={{{bill_id|}}}|debate_id={{{debate_id|}}}|grouped_question_nos={{{grouped_question_nos|}}}|topic_tags={{{topic_tags|}}}|summary={{{summary|}}}|verified={{{verified|}}}|last_updated={{{last_updated|}}}}}<span id="{{{item_id|}}}"></span><span class="hansard-item-meta" style="font-size:85%;color:#54595d;">[{{#switch:{{{item_type|}}}|oral_question=Oral Q|written_question=Written Q|bill_first_reading=Bill · 1st Reading|bill_second_reading=Bill · 2nd Reading|bill_third_reading=Bill · 3rd Reading|motion=Motion|adjournment_speech=Adjournment|ministerial_statement=Ministerial Statement|ministerial_statement_clarification=Clarification|#default={{{item_type|}}}}}{{#if:{{{item_no|}}}| {{{item_no|}}}}}]</span></includeonly><noinclude>
== Usage ==
== Usage ==


Line 63: Line 63:
</pre>
</pre>


Debate-linked example (debate_id set, item_type=adjournment_speech):
Motion-linked example (debate_id holds a motion_id, item_type=motion):
 
<pre>
{{Hansard-item-cargo
|item_id=p15-s32-mot1
|sitting_id=p15-s32
|sitting_date=2026-07-07
|parliament_no=15
|item_type=motion
|subject=Reinforcing Singapore's Position as a Global Transport Hub
|speaker_mp_id=tin-pei-ling
|debate_id=reinforcing-transport-hub-motion-2026
|topic_tags=Transport, Economy
|verified=yes
|last_updated=2026-07-16
}}
</pre>
 
Ministerial statement + clarification example (debate_id holds a statement_id, shared by the statement item and every clarification that follows it):
 
<pre>
{{Hansard-item-cargo
|item_id=p15-s32-stmt1
|sitting_id=p15-s32
|sitting_date=2026-07-07
|parliament_no=15
|item_type=ministerial_statement
|subject=[Statement title]
|speaker_mp_id=[minister]
|debate_id=[statement_id]
|verified=yes
|last_updated=2026-07-16
}}
 
{{Hansard-item-cargo
|item_id=p15-s32-stmt1-c1
|sitting_id=p15-s32
|sitting_date=2026-07-07
|parliament_no=15
|item_type=ministerial_statement_clarification
|subject=[Statement title]
|asking_mp_id=[MP seeking clarification]
|answering_mp_id=[minister]
|debate_id=[statement_id]
|verified=yes
|last_updated=2026-07-16
}}
</pre>
 
Adjournment-speech example (no bill_id, no debate_id — just tagged to the speaking MP, visible on their own Parliamentary Record, no dedicated hub page):


<pre>
<pre>
Line 74: Line 123:
|subject=Integration with the region
|subject=Integration with the region
|speaker_mp_id=kenneth-tiong-boon-kiat
|speaker_mp_id=kenneth-tiong-boon-kiat
|debate_id=reinforcing-transport-hub-motion-2026
|topic_tags=Economy, ASEAN
|topic_tags=Economy, ASEAN
|verified=yes
|verified=yes
Line 94: Line 142:
| parliament_no || String || Yes || Denormalised — lets MP-profile queries group by parliament term cheaply
| parliament_no || String || Yes || Denormalised — lets MP-profile queries group by parliament term cheaply
|-
|-
| item_type || String || Yes || oral_question / written_question / ministerial_statement / bill_first_reading / bill_second_reading / motion / adjournment_speech / other
| item_type || String || Yes || oral_question / written_question / ministerial_statement / ministerial_statement_clarification / bill_first_reading / bill_second_reading / bill_third_reading / motion / adjournment_speech / other
|-
|-
| item_no || String || No || The Hansard question/item number as printed. Blank for unnumbered items
| item_no || String || No || The Hansard question/item number as printed. Blank for unnumbered items
Line 100: Line 148:
| subject || String || Yes || Short title, sentence-cased from the Hansard heading
| subject || String || Yes || Short title, sentence-cased from the Hansard heading
|-
|-
| asking_mp_id || mp slug || No || MP who asked the question or moved the motion
| asking_mp_id || mp slug || No || MP who asked the question, moved the motion, or sought a clarification
|-
|-
| answering_mp_id || mp slug || No || Minister who answered on the record (the one actually speaking, even if answering "for" another minister)
| answering_mp_id || mp slug || No || Minister who answered on the record (the one actually speaking, even if answering "for" another minister)
|-
|-
| speaker_mp_id || mp slug || No || For items with no asker/answerer structure — adjournment-debate speeches, statements, bill presenters
| speaker_mp_id || mp slug || No || For items with no asker/answerer structure — adjournment-debate speeches, statements, bill presenters, motion movers
|-
|-
| bill_id || bill slug || No || Set only if this item is a reading/speech/question directly about a specific bill. Must match bills table
| bill_id || bill slug || No || Set only if this item is a reading/speech/question directly about a specific bill. Must match bills table
|-
|-
| debate_id || debate slug || No || Set only if this item is part of a standalone motion/topic debate not tied to a bill. Must match debates table
| debate_id || motion or statement slug || No || Set to a motion_id (item_type=motion) or a statement_id (item_type=ministerial_statement / ministerial_statement_clarification) — including on the original statement's own item, not just its clarifications, so one query pulls the whole exchange together. Leave blank for adjournment_speech and anything not part of a motion or statement's own record
|-
|-
| grouped_question_nos || String || No || If answered together with other questions, e.g. 3-5
| grouped_question_nos || String || No || If answered together with other questions, e.g. 3-5
Line 121: Line 169:
|}
|}


An item normally sets at most one of bill_id / debate_id — not both, and often neither (a plain oral/written question with no bill or standalone-debate link).
An item normally sets at most one of bill_id / debate_id — not both, and often neither (a plain oral/written question, or an adjournment speech with no dedicated hub page).


Cargo table: '''hansard_items'''. See also {{tl|Hansard-sitting-cargo}}, {{tl|Bill-cargo}}, {{tl|Debate-cargo}}.
Cargo table: '''hansard_items'''. See also {{tl|Hansard-sitting-cargo}}, {{tl|Bill-cargo}}, {{tl|Motion-cargo}}, {{tl|Ministerial-statement-cargo}}.


[[Category:Cargo templates]]
[[Category:Cargo templates]]
[[Category:Hansard templates]]
[[Category:Hansard templates]]
</noinclude>
</noinclude>

Revision as of 17:09, 16 July 2026

This template defines the table "hansard_items". View table.

Usage

Place once per question/speech/bill reading/motion, immediately before (or wrapping) the prose text of that item on the sitting-day page. Renders only an anchor + a small inline type/number tag — the actual Hansard prose (question text, answer, speeches) is written normally around the call, not inside it.

{{Hansard-item-cargo
|item_id=p15-s32-oq1
|sitting_id=p15-s32
|sitting_date=2026-07-07
|parliament_no=15
|item_type=oral_question
|item_no=1
|subject=Probe into social media posts targeting Singapore's Indian community
|asking_mp_id=darryl-david
|answering_mp_id=goh-pei-ming
|speaker_mp_id=
|bill_id=
|debate_id=
|grouped_question_nos=1-2
|topic_tags=Home Affairs, National Security, Social media
|summary=
|verified=yes
|last_updated=2026-07-16
}}
'''Q1.''' [[Darryl David]] asked the Coordinating Minister for National Security and Minister for Home Affairs regarding the 14 online social media posts which seemingly targeted the Indian community... — ''[[Goh Pei Ming]] (for [[K Shanmugam]])''

Bill-linked example (bill_id set, no asking/answering/speaker):

{{Hansard-item-cargo
|item_id=p15-s32-bill1
|sitting_id=p15-s32
|sitting_date=2026-07-07
|parliament_no=15
|item_type=bill_first_reading
|subject=Road Traffic (Miscellaneous Amendments) Bill
|speaker_mp_id=sim-ann
|bill_id=road-traffic-misc-amendments-2026
|topic_tags=Transport, Legislation
|verified=yes
|last_updated=2026-07-16
}}

Motion-linked example (debate_id holds a motion_id, item_type=motion):

{{Hansard-item-cargo
|item_id=p15-s32-mot1
|sitting_id=p15-s32
|sitting_date=2026-07-07
|parliament_no=15
|item_type=motion
|subject=Reinforcing Singapore's Position as a Global Transport Hub
|speaker_mp_id=tin-pei-ling
|debate_id=reinforcing-transport-hub-motion-2026
|topic_tags=Transport, Economy
|verified=yes
|last_updated=2026-07-16
}}

Ministerial statement + clarification example (debate_id holds a statement_id, shared by the statement item and every clarification that follows it):

{{Hansard-item-cargo
|item_id=p15-s32-stmt1
|sitting_id=p15-s32
|sitting_date=2026-07-07
|parliament_no=15
|item_type=ministerial_statement
|subject=[Statement title]
|speaker_mp_id=[minister]
|debate_id=[statement_id]
|verified=yes
|last_updated=2026-07-16
}}

{{Hansard-item-cargo
|item_id=p15-s32-stmt1-c1
|sitting_id=p15-s32
|sitting_date=2026-07-07
|parliament_no=15
|item_type=ministerial_statement_clarification
|subject=[Statement title]
|asking_mp_id=[MP seeking clarification]
|answering_mp_id=[minister]
|debate_id=[statement_id]
|verified=yes
|last_updated=2026-07-16
}}

Adjournment-speech example (no bill_id, no debate_id — just tagged to the speaking MP, visible on their own Parliamentary Record, no dedicated hub page):

{{Hansard-item-cargo
|item_id=p15-s32-adj3
|sitting_id=p15-s32
|sitting_date=2026-07-07
|parliament_no=15
|item_type=adjournment_speech
|subject=Integration with the region
|speaker_mp_id=kenneth-tiong-boon-kiat
|topic_tags=Economy, ASEAN
|verified=yes
|last_updated=2026-07-16
}}

Field reference

Field Type Required Notes
item_id slug Yes Permanent. Format: {sitting_id}-{type_abbr}{item_no or running index}, e.g. p15-s32-oq1, p15-s32-wq21, p15-s32-bill1
sitting_id sitting slug Yes Must match hansard_sittings
sitting_date Date Yes Denormalised from the sitting, for fast per-MP sorting without a join
parliament_no String Yes Denormalised — lets MP-profile queries group by parliament term cheaply
item_type String Yes oral_question / written_question / ministerial_statement / ministerial_statement_clarification / bill_first_reading / bill_second_reading / bill_third_reading / motion / adjournment_speech / other
item_no String No The Hansard question/item number as printed. Blank for unnumbered items
subject String Yes Short title, sentence-cased from the Hansard heading
asking_mp_id mp slug No MP who asked the question, moved the motion, or sought a clarification
answering_mp_id mp slug No Minister who answered on the record (the one actually speaking, even if answering "for" another minister)
speaker_mp_id mp slug No For items with no asker/answerer structure — adjournment-debate speeches, statements, bill presenters, motion movers
bill_id bill slug No Set only if this item is a reading/speech/question directly about a specific bill. Must match bills table
debate_id motion or statement slug No Set to a motion_id (item_type=motion) or a statement_id (item_type=ministerial_statement / ministerial_statement_clarification) — including on the original statement's own item, not just its clarifications, so one query pulls the whole exchange together. Leave blank for adjournment_speech and anything not part of a motion or statement's own record
grouped_question_nos String No If answered together with other questions, e.g. 3-5
topic_tags String No Comma-separated free text for search
summary Text No One or two factual sentences, no editorialising
verified String Yes yes / no
last_updated Date Yes

An item normally sets at most one of bill_id / debate_id — not both, and often neither (a plain oral/written question, or an adjournment speech with no dedicated hub page).

Cargo table: hansard_items. See also {{Hansard-sitting-cargo}}, {{Bill-cargo}}, {{Motion-cargo}}, {{Ministerial-statement-cargo}}.