Module:European and national party data/doc
This is the documentation page for Module:European and national party data
Usage
[change source]{{#invoke:European and national party data|main|<party_type>|<data_type>|<party>|<institution>|extra parameters}}
Parameters
[change source]| 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:
This parameter is mandatory. |
| 3 | The name of the entity, from the following list:
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
Notes:
|
| 4 | The name of the institution, from the following list:
Notes:
This parameter is mandatory when |
| extra parameters | The following extra parameters can also be used, depending on the requested data_type:
These parameters are optional. |
Related templates
[change source]The module is directly implemented by three templates:
- Template:EUPP data, which presets
|party_type=european_entity; - Template:Political party data, which presets
|party_type=national_party; and - Template:EU institution seats, which only returns the number of seats of EU institutions (including all lower or upper houses combined).
Test cases
[change source]The module has two testcase pages:
- Module:European and national party data/testcases composition bar for the
seat composition bardata type; and - Module:European and national party data/testcases for all other data types.
Updating the module
[change source]The module draws its data from two sources:
- Wikidata for all data points returned by the module; and
- commons:Data:Mapping of national parties members of European parties to lower and upper houses.tab which maps the national member parties of European political parties and also serves to link member states (and, therefore, national parties) to their lower and upper houses.
To update data returned by the module, go to the Wikidata page of the entity in question (the link is often provided as a comment in the infobox of the Wikipedia article), and edit the relevant property, preferably by adding a new value and marking it as preferred (instead of deleting outdated information).
Here are some relevant properties for the module:
- number of seats in assembly: P1410, with the following qualifiers:
- short name/acronym: P1813
- colour/sRGB color hex triplet: P465
- country: P17
- foundation date: P571
- individual members: P2124
- official name: P1448
- parliamentary group: P4100
- chairperson: P488
- public funding: P12919
- official website: P856
Wherever possible, try and add:
- a
start time(P580) qualifier (and a matchingend time(P582) in the outdated entry) or apoint in time(P585) qualifier, and - a reference, including the
reference URL(P854),title(P1476),retrieved(P813), andpublisherqualifiers (P123).
Updating Wikidata ensures that updated and sourced information is available not just to this Wiki, but to all versions of Wikipedia, as well as to other services drawing information from Wikidata.
Translating the module
[change source]To adapt the module to a new Wiki, follow these steps:
- Create two modules to replicate the modules below (the content must remain the same as in the English version):
- Create the following files and translate them as needed (translate only the non-English parts, as indicated):
- Translate the module documentations, and adapt the examples as necessary using the translated terms;
- Create testcases, such as the ones below, and adapt the examples as necessary using the translated terms:
- Create three templates to replicate the ones below:
- Translate the template documentations, based on the module documentations, and adapt the examples as necessary using the translated terms;
- Add the two modules in the "Wikipedia" sections of the two relevant Wikidata pages below:
- Create a topic on the consolidated module talk page to adapt the content of the common module (in particular its function for composition bars) to the new Wiki. After being adapted, the main module will be synchronised to update the modules in all Wiki languages; this helps ensure that the same module is used across Wikis, which is essential to keep its functions updated.
Examples
[change source]Data type seats
[change source]| Code | Result | Output |
|---|---|---|
{{#invoke:European and national party data|main|european_entity|seats|EPP|EP}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | number of seats of independent politicians in the European Council |
{{#invoke:European and national party data|main|european_entity|seats|ALDE|ms-lower-house}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | number of seats of all European parties combined in the European Parliament |
{{#invoke:European and national party data|main|european_entity|seats|none|EP}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | number of seats not occupied by European parties in the European Parliament |
Data type seat share
[change source]| Code | Result | Output |
|---|---|---|
{{#invoke:European and national party data|main|european_entity|seat share|EPP|EP|reference=yes}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | share of seats of all European parties combined in the European Parliament |
Data type seat composition bar
[change source]| Code | Result | Output |
|---|---|---|
{{#invoke:European and national party data|main|european_entity|seat composition bar|EPP|EP|reference=yes}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | 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}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | composition bar of seats of all European parties combined in the European Parliament, with special parameters |
Other data types
[change source]| Code | Result | Output |
|---|---|---|
{{#invoke:European and national party data|main|european_entity|acronym|EPP}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | acronym of the European People's Party |
{{#invoke:European and national party data|main|european_entity|color|PES}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | colour of the Party of European Socialists |
{{#invoke:European and national party data|main|national_party|country|Q1315362}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | country of Levice (called by its Wikidata qID) |
{{#invoke:European and national party data|main|european_entity|foundation date|PES}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | foundation date of the Party of European Socialists |
{{#invoke:European and national party data|main|european_entity|individual members|EPP|reference=yes}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | individual members of the European People's Party, with reference |
{{#invoke:European and national party data|main|european_entity|individual members date|EPP}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | date of reference for individual members of the European People's Party |
{{#invoke:European and national party data|main|european_entity|individual members date|Volt}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | date of reference for individual members of Volt (year only) |
{{#invoke:European and national party data|main|european_entity|individual members year|EPP}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | year of reference for individual members of the European People's Party |
{{#invoke:European and national party data|main|european_entity|individual members year|Volt}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | year of reference for individual members of Volt (year only) |
{{#invoke:European and national party data|main|european_entity|label|ALDE}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | label of the Alliance of Liberals and Democrats for Europe |
{{#invoke:European and national party data|main|european_entity|official name|EGP}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | official name of the European Green Party |
{{#invoke:European and national party data|main|european_entity|parliamentary group|EFA}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | parliamentary group of the European Free Alliance |
{{#invoke:European and national party data|main|european_entity|public funding|EGP}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | public funding of the European Green Party, with reference |
{{#invoke:European and national party data|main|national_party|website|Q667680}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | website of the Netherlands' GroenLinks |
{{#invoke:European and national party data|main|national_party|official name|Q22748|verbose=yes}} |
Lua error in package.lua at line 80: module 'Module:European_and_national_party_data/Wd' not found. | official name of Germany Die PARTEI, showing verbose error message |