Maplink

From Wikipedia, the free encyclopedia
Map

0°0′0″N 0°0′0″E

<maplink latitude="52.16" longitude="-112.15" zoom="3" width="800" height="500" text="Governors of US states with their party affiliation">
{
  "type":"ExternalData",
  "service": "geoshape",
  "query": "SELECT ?id ?head
(SAMPLE(?img) as ?img) 
(SAMPLE(?fill) as ?fill) 
(concat('[[', substr(str(?link),31,100),  ' | ', ?headLabel, ']]') as ?title)
(concat(?stateLabel, '\\n', '[[File:', substr(str(?img), 52, 100), '|200px]]') as ?description)
WHERE {
  
  ?id wdt:P31 wd:Q35657 .
  ?id wdt:P6 ?head .
  ?head wdt:P102 ?party .
  BIND(if(?party = wd:Q29468, '#800000', if(?party = wd:Q29552, '#000080', '#008000')) as ?fill) 
  SERVICE wikibase:label {
    bd:serviceParam wikibase:language 'en' .
    ?head rdfs:label ?headLabel .
    ?id rdfs:label ?stateLabel .
  }
  OPTIONAL {
    ?head wdt:P18 ?img .
  }
  ?link schema:about ?head .
  ?link schema:isPartOf <https://en.wikipedia.org/> .
} GROUP BY ?id ?head ?headLabel ?link ?stateLabel"
}
</maplink>

Produces this link:

<maplink>: Couldn't parse JSON: Control character error, possibly incorrectly encoded