User:Ederporto/Testes

 { "type": "ExternalData", "service": "geoshape", "query": " SELECT ?id ?head (SAMPLE(?img) as ?img)   (min(?partyId) as ?party)   (if(?party = '0', '#0a9102', if(?party = '1', '#3268ba',if(?party = '2', '#2c45a3',if(?party = '3', '#76e83a',if(?party = '4', '#c92520',if(?party = '5', '#f2251f',if(?party = '6', '#f2ee15',if(?party = '7', '#0e136b','#c1c1c1')))))))) as ?fill)  (concat(, ?headLabel, ) as ?title)  (concat(?stateLabel, '\\n', '') as ?description) WHERE {    ?id wdt:P31 wd:Q485258 .  ?id wdt:P6 ?head .  ?head wdt:P102 ?party .  BIND(if(?party = wd:Q1322751, '0', if(?party = wd:Q1322897, '1',if(?party = wd:Q732852, '2',if(?party = wd:Q2054750, '3',if(?party = wd:Q657089, '4',if(?party = wd:Q2054789, '5',if(?party = wd:Q504000, '6','7'))))))) as ?partyId)   SERVICE wikibase:label {    bd:serviceParam wikibase:language 'pt' .    ?head rdfs:label ?headLabel .    ?id rdfs:label ?stateLabel. } OPTIONAL { ?head wdt:P18 ?img. } ?link schema:about ?head. ?link schema:isPartOf . } GROUP BY ?id ?head ?headLabel ?link ?stateLabel "}