User:Akbarali/sandbox/senator

{{{{{|safesubst: }}}#invoke:String|replace SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?item_position wdt:P361* wd:Q17813784. ?item_position wdt:P1697 ?valids. ?item_position wdt:P31 wd:Q40231. ?item_position (wdt:P541/wdt:P279*) wd:Q18964326. OPTIONAL {?item_position p:P726 ?statement.} OPTIONAL {?item_position p:P991 ?statement.} OPTIONAL {?statement ps:P726 ?item.} OPTIONAL {?statement ps:P991 ?item.}
 * source={{{{{|safesubst: }}}#invoke:String|replace
 * source={{{{{|safesubst: }}}#invoke:String|replace
 * source={{{{{|safesubst: }}}#invoke:String|replace
 * source={{Wikidata list
 * sparql=SELECT ?item ?party ?acron ?alliance ?item_position ?votes ?valids ?result ?vice WHERE {

OPTIONAL {?statement pq:P1111 ?votes.} OPTIONAL {?statement pq:P102 ?party.} OPTIONAL {?statement pq:P5832 ?alliance.} OPTIONAL {?party wdt:P1813 ?acron.} OPTIONAL {?statement pq:P6149 ?vice.}

BIND(IF (EXISTS {?item_position wdt:P991 ?item}, "9aed9e","f8f9fa") as ?result) } ORDER BY DESC(?votes) }}{{Wikidata list end}} }} SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } ?item_position wdt:P361* wd:Q17813784. ?item_position wdt:P1697 ?valids. ?item_position wdt:P31 wd:Q40231. ?item_position (wdt:P541/wdt:P279*) wd:Q18964326. OPTIONAL {?item_position p:P726 ?statement.} OPTIONAL {?item_position p:P991 ?statement.} OPTIONAL {?statement ps:P726 ?item.} OPTIONAL {?statement ps:P991 ?item.}
 * columns=label:Candidate, ?votes:Votes received,?valids:Percentage, ?result, ?party, ?alliance, ?vice, ?acron
 * section=?item_position
 * sort=
 * min_section=1
 * thumb=128si
 * autolist=fallback
 * wdedit=yes
 * links=red
 * row_template=subst:Template:Mbabel-BSE/Legislative row
 * header_template=subst:Template:Mbabel-BSE/Legislative header
 * pattern={{((}}Wikidata list end{{))}}
 * replace=
 * pattern={{Wikidata list
 * sparql=SELECT ?item ?party ?acron ?alliance ?item_position ?votes ?valids ?result ?vice WHERE {

OPTIONAL {?statement pq:P1111 ?votes.} OPTIONAL {?statement pq:P102 ?party.} OPTIONAL {?statement pq:P5832 ?alliance.} OPTIONAL {?party wdt:P1813 ?acron.} OPTIONAL {?statement pq:P6149 ?vice.}

BIND(IF (EXISTS {?item_position wdt:P991 ?item}, "9aed9e","f8f9fa") as ?result) } ORDER BY DESC(?votes) }} = }} }} {| The election for senator counted on 4 candidates in 2014: Perpétua Almeida (Communist Party of Brazil), Q57460775 (Party of National Mobilization), Gladson Cameli (Progressistas), Fortunato Martins Filho (Socialism and Liberty Party). The result of the elections for this position was for a total of 374,813 valid votes, excluding 12,319 blank votes and 31,640 spoilt votes, according to the counting made by the Superior Electoral Court. Of a total of 506,520 eligible voters, 87,748 ({{percentage|87,748|506,520|2}}) did not attend the ballot in the first round.
 * columns=label:Candidate, ?votes:Votes received,?valids:Percentage, ?result, ?party, ?alliance, ?vice, ?acron
 * section=?item_position
 * sort=
 * min_section=1
 * thumb=128si
 * autolist=fallback
 * wdedit=yes
 * links=red
 * row_template=subst:Template:Mbabel-BSE/Legislative row
 * header_template=subst:Template:Mbabel-BSE/Legislative header
 * replace==
 * pattern===
 * replace====
 * pattern====
 * replace====