Modulo:European and national party data/man

Questa è la pagina di documentazione per Modulo:European and national party data

{{#invoke:European and national party data|main|<party_type>|<data_type>|<party>|<institution>|extra parameters}}

Parameters

modifica
Parameter Description
1 The type of party under consideration; can be either:

This parameter is mandatory.

2 The type of data requested and pulled from Wikidata, from the following list:
  • seats: the number of seats of one or more entities in one or more institutions (P1410);
  • seat share: the share of seats of one or more entities in one or more institutions (based on P1410);
  • seat composition bar: a composition bar showing the seats of one or more entities in one or more institutions (based on P1410);
  • acronym: the short name of the entity (P1813);
  • color: the official colour of the entity as a hex code (P465);
  • country: the country in which the entity is registered (P17);
  • foundation date: the date on which the entity was founded (P571);
  • individual members: the number of individual members of the entity (P2124);
  • individual members date: the reference date for the number of individual members of the entity (based on P2124);
  • label: the name of the entity;
  • official name: the official long-form name of the entity (P1448);
  • parliamentary group: the parliamentary group the entity belongs to (P4100);
  • public funding: the amount of public funding received by the entity (P12919); or
  • website: the official website of the entity (P856), stripped from "https", "http" and "www" prefixes.

This parameter is mandatory.

3 The name of the entity, from the following list:
  • in all cases, the name can be omitted when the module is called from the Wikipedia page of the entity (alternatively, thisparty can be used to refer to the entity in question;
  • for European entities: the acronym of the entity (see list below) or its Wikidata qID; and
  • for national parties: the Wikidata qID of the party.

This parameter is optional when called from the page of the entity in question.

The following acronyms are used for European parties:

In addition, the following European political alliances are covered:

In addition, four special parameters can be used instead of European parties (so not when |party_type=national_party):

  • all: for the seats of all European parties combined;
  • none: for the seats not occupied by members of European parties (not for lower and upper houses); and
  • ind: for independent politicians on the European Council (only).

Notes:

  • the capitalisation of parameters does not matter;
  • given the cost of calling Wikidata when using a specific qID (i.e., not calling Wikidata from a linked Wikipedia page), the special parameter "thisparty" should be used whenever this module is called from the page of a European party; and
  • since the listed European political alliances are not European political parties, they do not count towards to sum of seats occupied by European political parties, nor the seats not occupied by European political parties.
4 The name of the institution, from the following list:

Notes:

  • For lower and upper houses for national parties, the module will automatically determine the relevant body, using this table;
  • For lower and upper houses for European parties, the module will sum the number of seats of their member parties across member states; and
  • For the European Parliament for national parties, the module will automatically use the member state's number of seats in the Parliament.

This parameter is mandatory when data_type is seat, seat share, or seat composition bar.

extra parameters The following extra parameters can also be used, depending on the requested data_type:
  • all data_types:
    • reference will display the reference when |reference=yes (this parameter is ignored for the seats of lower or upper houses of European entities, as many national figures are summed);
  • seat share:
    • constituency will override the institution's number of seats (for instance when the party is part of a special constituency);
  • seat composition bar:
    • constituency will override the institution's number of seats (for instance when the party is part of a special constituency);
    • width will specify the width of the bar and can have the following formats: "80" (default unit is pixel), "80px", "80em", or "80%" (without spaces);
    • percent will display the percentage when |percent=yes;
    • bar-color, background-color, and border will override default colours when provided an hexadecimal value (e.g."#123ABC", including the pound sign) or a recognised colour (e.g. "red").
  • all other data_types:
    • verbose: will display an error message when no value exists on Wikidata, as well as a relevant link, when |verbose=yes (otherwise the field is empty).

These parameters are optional.

modifica

The module is directly implemented by two templates:

Test cases

modifica

The module has two testcase pages:

Updating the module

modifica

The module draws its data from two sources:

Examples

modifica

Data type seats

modifica
Code Result Output
{{#invoke:European and national party data|main|european_entity|seats|EPP|EP}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats of the European People's Party in the European Parliament
{{#invoke:European and national party data|main|european_entity|seats|PES|EC|reference=yes}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats of the Party of European Socialists in the European Commission, with reference
{{#invoke:European and national party data|main|european_entity|seats|ind|EUCO}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats of independent politicians in the European Council
{{#invoke:European and national party data|main|european_entity|seats|ALDE|ms-lower-house}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats of the Alliance of Liberals and Democrats for Europe in member states' lower houses
{{#invoke:European and national party data|main|european_entity|seats|EGP|ms-upper-house|reference=yes}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats of the European Green Party in member states' upper houses, without reference (see table above)
{{#invoke:European and national party data|main|european_entity|seats|Q208242|EC}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats of the European People's Party (called by its Wikidata qID) in the European Commission
{{#invoke:European and national party data|main|european_entity|seats|Q208242|ms-upper-house}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats of the European People's Party (called by its Wikidata qID) in member states' upper houses
{{#invoke:European and national party data|main|national_party|seats|Q13564543|ms-lower-house|reference=yes}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats of Austria's NEOS (called by its Wikidata qID) in the National Council, with reference
{{#invoke:European and national party data|main|national_party|seats|Q138198|ms-upper-house}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats of the Spanish Socialist Workers' Party (called by its Wikidata qID) in the Senate
{{#invoke:European and national party data|main|national_party|seats|Q49768|EP}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats of the Social Democratic Party of Germany (called by its Wikidata qID) in the European Parliament
{{#invoke:European and national party data|main|european_entity|seats|all|EP}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats of all European parties combined in the European Parliament
{{#invoke:European and national party data|main|european_entity|seats|none|EP}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). number of seats not occupied by European parties in the European Parliament

Data type seat share

modifica
Code Result Output
{{#invoke:European and national party data|main|european_entity|seat share|EPP|EP|reference=yes}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). share of seats of the European People's Party in the European Parliament, with reference
{{#invoke:European and national party data|main|european_entity|seat share|ind|EUCO}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). share of seats of independent politicians in the European Council
{{#invoke:European and national party data|main|european_entity|seat share|ALDE|ms-lower-house}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). share of seats of the Alliance of Liberals and Democrats for Europe in member states' lower houses
{{#invoke:European and national party data|main|european_entity|seat share|Q208242|EC}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). share of seats of the European People's Party (called by its Wikidata qID) in the European Commission
{{#invoke:European and national party data|main|national_party|seat share|Q13564543|ms-lower-house}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). share of seats of Austria's NEOS (called by its Wikidata qID) in the National Council
{{#invoke:European and national party data|main|national_party|seat share|Q655611|ms-lower-house|constituency=61}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). share of seats of Belgium's Écolo (called by its Wikidata qID) in the French-speaking seats of the Chamber of Representatives
{{#invoke:European and national party data|main|national_party|seat share|Q49768|EP|reference=yes}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). share of seats of the Social Democratic Party of Germany (called by its Wikidata qID) in the European Parliament, with reference
{{#invoke:European and national party data|main|european_entity|seat share|all|EP}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). share of seats of all European parties combined in the European Parliament

Data type seat composition bar

modifica
Code Result Output
{{#invoke:European and national party data|main|european_entity|seat composition bar|EPP|EP|reference=yes}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). composition bar of seats of the European People's Party in the European Parliament, with reference
{{#invoke:European and national party data|main|european_entity|seat composition bar|ind|EUCO|percent=yes}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). composition bar of seats of independent politicians in the European Council, with reference
{{#invoke:European and national party data|main|european_entity|seat composition bar|ALDE|ms-lower-house}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). composition bar of seats of the Alliance of Liberals and Democrats for Europe in member states' lower houses
{{#invoke:European and national party data|main|european_entity|seat composition bar|Q208242|EC|percent=yes|reference=yes}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). composition bar of seats of the European People's Party (called by its Wikidata qID) in the European Commission, with reference
{{#invoke:European and national party data|main|national_party|seat composition bar|Q655611|ms-lower-house|constituency=61}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). composition bar of seats of Belgium's Écolo (called by its Wikidata qID) in the French-speaking seats of the Chamber of Representatives
{{#invoke:European and national party data|main|national_party|seat composition bar|Q49768|EP|width=80%|background-color=blue|border=green|bar-color=red}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). composition bar of seats of the Social Democratic Party of Germany (called by its Wikidata qID) in the European Parliament, with special parameters
{{#invoke:European and national party data|main|european_entity|seat composition bar|all|EP|width=80%|background-color=#FFFF00|border=#008080|bar-color=#A020F0}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). composition bar of seats of all European parties combined in the European Parliament, with special parameters

Other data types

modifica
Code Result Output
{{#invoke:European and national party data|main|european_entity|acronym|EPP}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). acronym of the European People's Party
{{#invoke:European and national party data|main|european_entity|color|PES}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). colour of the Party of European Socialists
{{#invoke:European and national party data|main|european_entity|color|PES}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). country of Levice (called by its Wikidata qID)
{{#invoke:European and national party data|main|european_entity|foundation date|PES}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). foundation date of the Party of European Socialists
{{#invoke:European and national party data|main|european_entity|individual members|EPP|reference=yes}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). individual members of the European People's Party, with reference
{{#invoke:European and national party data|main|european_entity|label|ALDE}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). label of the Alliance of Liberals and Democrats for Europe
{{#invoke:European and national party data|main|european_entity|official name|EGP}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). official name of the European Green Party
{{#invoke:European and national party data|main|european_entity|parliamentary group|EFA}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). parliamentary group of the European Free Alliance
{{#invoke:European and national party data|main|european_entity|public funding|EGP}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). public funding of the European Green Party, with reference
{{#invoke:European and national party data|main|national_party|website|Q667680}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). website of the Netherlands' GroenLinks
{{#invoke:European and national party data|main|national_party|official name|Q22748|verbose=yes}} Errore Lua in Modulo:European_and_national_party_data alla linea 83: attempt to index field 'xlate_t' (a nil value). official name of Germany Die PARTEI, showing verbose error message