wikidataQuery[query_] :=
ImportString[
URLRead[
HTTPRequest[<|
"Scheme" -> "https",
"Domain" -> "query.wikidata.org",
"Path" -> "bigdata/namespace/wdq/sparql"
|>, <|
Method -> "POST",
"Body" -> URLQueryEncode[<|"query" -> StringTrim@query|>],
"Headers" -> <|"Accept" -> "text/csv"|>,
"ContentType" -> "application/x-www-form-urlencoded"
|>
],
"Body"],
"CSV", "SkipLines" -> 1]