Template:Infobox settlement/Wikidata: Difference between revisions
Appearance
Content deleted Content added
Convert area total km2 to Wikidata IB Tags: Reverted 2017 wikitext editor |
move to doc page where it belongs |
||
(11 intermediate revisions by 7 users not shown) | |||
Line 1: | Line 1: | ||
<noinclude>{{Improve documentation|date=September 2017}}</noinclude> |
|||
<includeonly>{{Infobox settlement |
<includeonly>{{Infobox settlement |
||
<!-- See Template:Infobox settlement for additional fields and descriptions --> |
<!-- See Template:Infobox settlement for additional fields and descriptions --> |
||
Line 17: | Line 16: | ||
| nickname = {{#property:p1449}} |
| nickname = {{#property:p1449}} |
||
| motto = |
| motto = |
||
| image_map = |
| image_map = {{#if: {{#property:p242}} | {{#property:p242}} | }} |
||
| map_alt = |
| map_alt = |
||
| map_caption = {{#if:{{#property:p242}} | {{#if:{{#Property:P625}}|{{Coord|nosave=1|display=inline,title|format=dms}}{{#ifeq:{{{refs|yes}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P625}} }}{{EditAtWikidata|pid=P625|qid={{{qid|}}} }} }} }} |
|||
⚫ | |||
| pushpin_map = {{#property:P17}} |
| pushpin_map = {{#property:P17}} |
||
| pushpin_label_position = |
| pushpin_label_position = |
||
| pushpin_map_alt = |
| pushpin_map_alt = |
||
| pushpin_map_caption = |
| pushpin_map_caption = |
||
| coordinates = {{#if:{{{coords|}}}{{{coordinates|}}} | {{if empty|{{{coordinates|}}}|{{{coords|}}}}} | {{#if:{{#Property:P625}} | {{Coord|nosave=1|display=inline,title|format=dms}}{{#ifeq:{{{refs|yes}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P625}} }}{{EditAtWikidata|pid=P625|qid={{{qid|}}} }} }} }} |
| coordinates = {{#if: {{#property:p242}} || {{#if:{{{coords|}}}{{{coordinates|}}} | {{if empty|{{{coordinates|}}}|{{{coords|}}}}} | {{#if:{{#Property:P625}} | {{Coord|nosave=1|display=inline,title|format=dms}}{{#ifeq:{{{refs|yes}}}|yes|{{wikidata|references|normal+|{{{qid|}}}|P625}} }}{{EditAtWikidata|pid=P625|qid={{{qid|}}} }} }} }} }} |
||
| coor_pinpoint = |
| coor_pinpoint = |
||
| coordinates_footnotes = |
| coordinates_footnotes = |
||
| subdivision_type = Country |
| subdivision_type = Country |
||
| subdivision_name = {{# |
| subdivision_name = {{#if: {{#property:P17}} | [[{{#property:P17}}]] }} |
||
| subdivision_type1 = Subdivision |
| subdivision_type1 = Subdivision |
||
| subdivision_name1 = {{#invoke:WikidataIB|getValue|qid={{{qid|}}}| |
| subdivision_name1 = {{#invoke:WikidataIB|getValue|rank=best|qid={{{qid|}}}|P131|fetchwikidata=ALL|onlysourced=yes}} |
||
| subdivision_type2 = |
| subdivision_type2 = |
||
| subdivision_name2 = |
| subdivision_name2 = |
||
| subdivision_type3 = |
| subdivision_type3 = |
||
| subdivision_name3 = |
| subdivision_name3 = |
||
| established_title = |
| established_title = |
||
⚫ | |||
| established_date = {{#if: {{{established_date|}}} | {{{established_date}}}{{{established_date_ref|}}} | {{wikidata|property|edit@end|P571}}{{wikidata|reference|P571}} }} |
|||
| founder = |
| founder = |
||
| seat_type = |
| seat_type = |
||
| seat = |
| seat = |
||
Line 43: | Line 42: | ||
| leader_party = |
| leader_party = |
||
| leader_title = |
| leader_title = |
||
| leader_name = {{#invoke:WikidataIB|getValue|qid={{{qid|}}}| |
| leader_name = {{#invoke:WikidataIB|getValue|rank=best|qid={{{qid|}}}|P6|fetchwikidata=ALL|onlysourced=yes}} |
||
| unit_pref = Metric |
| unit_pref = Metric |
||
<!-- ALL fields with measurements have automatic unit conversion --> |
<!-- ALL fields with measurements have automatic unit conversion --> |
||
Line 58: | Line 57: | ||
| area_blank2_title = |
| area_blank2_title = |
||
<!-- square kilometers --> |
<!-- square kilometers --> |
||
| area_total_km2 = {{# |
| area_total_km2 = {{#if: {{{area_km2|}}} | {{{area_km2}}} | {{wikidata|property|raw|P2046}} }} |
||
| area_land_km2 = |
| area_land_km2 = |
||
{{#if: {{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits = false}} | {{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits = false}} | {{#if: {{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q205895 |fwd=ALL |osd=no |noicon=true | showunits = false}} |{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q205895 |fwd=ALL |osd=no |noicon=true | showunits = false}}}}}} |
{{#if: {{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits = false}} | {{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits = false}} | {{#if: {{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q205895 |fwd=ALL |osd=no |noicon=true | showunits = false}} |{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q205895 |fwd=ALL |osd=no |noicon=true | showunits = false}}}}}} |
||
| area_water_km2 = {{#if:{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q15324 |fwd=ALL |osd=no |noicon=true | showunits = false}}|{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q15324 |fwd=ALL |osd=no |noicon=true | showunits = false}}|{{#if:{{both|{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q16868672 |fwd=ALL |osd=no |noicon=true | showunits = false}}| |
| area_water_km2 = {{#if:{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q15324 |fwd=ALL |osd=no |noicon=true | showunits = false}}|{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q15324 |fwd=ALL |osd=no |noicon=true | showunits = false}}|{{#if:{{both|{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q16868672 |fwd=ALL |osd=no |noicon=true | showunits = false}}| |
||
{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits = false}}}}| |
{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits = false}}}}| |
||
{{#expr: {{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q16868672 |fwd=ALL |osd=no |noicon=true | showunits = false}} - {{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits = false}}}}|{{#if:{{both|{{{area_total_km2|}}}|{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits = false}}}}|{{#expr:{{{area_total_km2|}}}-{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits =false}}}}}}}}}} |
{{#expr: {{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q16868672 |fwd=ALL |osd=no |noicon=true | showunits = false}} - {{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits = false}}round2}}|{{#if:{{both|{{{area_total_km2|}}}|{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits = false}}}}|{{#expr:{{{area_total_km2|}}}-{{#invoke:WikidataIB | getValueByQual | rank=best |qid={{{qid|}}} | P2046 | qualID=P518 | qvalue=Q11081619 |fwd=ALL |osd=no |noicon=true | showunits =false}}round2}}}}}}}} |
||
| area_urban_km2 = |
| area_urban_km2 = |
||
| area_rural_km2 = |
| area_rural_km2 = |
||
Line 84: | Line 83: | ||
| elevation_m = |
| elevation_m = |
||
| population_footnotes = {{#if: {{wikidata|property|P1082}} | {{wikidata|references|best|P1082}} }} |
| population_footnotes = {{#if: {{wikidata|property|P1082}} | {{wikidata|references|best|P1082}} }} |
||
| population_total = {{ |
| population_total = {{wikidata|property|best|P1082}} |
||
| population_as_of = {{#if: {{wikidata|property|P1082}} | {{wikidata|qualifier|best|P1082|P585}} }} |
| population_as_of = {{#if: {{wikidata|property|P1082}} | {{wikidata|qualifier|best|P1082|P585}} }} |
||
| population_density_km2 = auto |
| population_density_km2 = auto |
||
Line 94: | Line 93: | ||
| utc_offset1_DST = |
| utc_offset1_DST = |
||
| postal_code_type = Postal code |
| postal_code_type = Postal code |
||
| postal_code = |
| postal_code = |
||
| area_code_type = |
| area_code_type = |
||
| area_code = {{# |
| area_code = {{#property:P473}} |
||
| iso_code = |
| iso_code = |
||
| website = {{# |
| website = {{#if: {{#property:P856}} | {{URL|{{#property:P856}}}} }} |
||
| footnotes = |
| footnotes = |
||
}}</includeonly><noinclude> |
}}</includeonly><noinclude> |
||
Try it on {{Wikidata test|San Francisco|{{PAGENAME}}}}, {{Wikidata test|Vladivostok|{{PAGENAME}}}}, {{Wikidata test|Sapporo|{{PAGENAME}}}} |
Try it on {{Wikidata test|San Francisco|{{PAGENAME}}}}, {{Wikidata test|Vladivostok|{{PAGENAME}}}}, {{Wikidata test|Sapporo|{{PAGENAME}}}} |
||
{{documentation}} |
|||
</noinclude><noinclude> |
|||
{{Documentation}} |
|||
<!--Please add this template's categories to the /doc subpage, not here - thanks!--> |
<!--Please add this template's categories to the /doc subpage, not here - thanks!--> |
||
</noinclude> |
</noinclude> |
Latest revision as of 18:19, 9 August 2023
Try it on San Francisco
, Vladivostok
, Sapporo
This template's documentation is missing, inadequate, or does not accurately describe its functionality or the parameters in its code. Please help to expand and improve it. (September 2017) |
This template is rated as pre-alpha. It is unfinished, and may or may not be in active development. It should not be used from article namespace pages. Templates remain pre-alpha until the original editor (or someone who takes one over if it is abandoned for some time) is satisfied with the basic structure. |
This template uses the Wikidata properties:
- image (P18) (see uses)
- flag image (P41) (see uses)
- seal image (P158) (see uses)
- coat of arms image (P94) (see uses)
- nickname (P1449) (see uses)
- locator map image (P242) (see uses)
- country (P17) (see uses)
- located in the administrative territorial entity (P131) (see uses)
- area (P2046) (see uses)
- population (P1082) (see uses)
- local dialing code (P473) (see uses)
- official website (P856) (see uses)
Usage
This is a test template that uses Wikidata values to populate settlement infoboxes.
Infobox settlement/Wikidata | |
---|---|
Subdivision | New York |
Government |
Per Wikipedia:Wikidata/2018 Infobox RfC#Discussion, which found consensus that all uses of Wikidata in infoboxes must be sourced, this template should not be used in articles until it is updated to use Module:WikidataIB for all Wikidata calls. See Template:Infobox person/Wikidata for examples of how to use the module.