Jump to content

Template:Infobox settlement/Wikidata: Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
Convert area total km2 to Wikidata IB
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|}}} }} }} }}
| map_caption =
| 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 = {{#invoke:WikidataIB|getValue|qid={{{qid|}}}|ps=1|P17}}
| subdivision_name = {{#if: {{#property:P17}} | [[{{#property:P17}}]] }}
| subdivision_type1 = Subdivision
| subdivision_type1 = Subdivision
| subdivision_name1 = {{#invoke:WikidataIB|getValue|qid={{{qid|}}}|ps=1|P131}}
| 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 = {{#if:{{{established_date|}}}{{wikidata|property|P571}} | Established}}
| established_title =
| established_date =
| established_date = {{#if: {{{established_date|}}} | {{{established_date}}}{{{established_date_ref|}}} | {{wikidata|property|edit@end|P571}}{{wikidata|reference|P571}} }}
| founder = {{#invoke:WikidataIB|getValue|ps=1|P112}}
| 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|}}}|ps=1|P6}}
| 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 = {{#invoke:WikidataIB|getValue|ps=1|P2046}}
| 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 = {{#invoke:WikidataIB|getValue|ps=1|P1082}}
| 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 = {{#invoke:WikidataIB|getValue|ps=1|P281}}
| postal_code =
| area_code_type =
| area_code_type =
| area_code = {{#invoke:WikidataIB|getValue|ps=1|P473}}
| area_code = {{#property:P473}}
| iso_code =
| iso_code =
| website = {{#invoke:WikidataIB|url2|url={{#invoke:WikidataIB|P856|ps=1}}}}
| 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