This query works on http://dbpedia.org/snorql/.
But it isn't working on http://wikidata.dbpedia.org/sparql.
How do I fix it so that it works in http://wikidata.dbpedia.org/sparql?
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbpedia: <http://dbpedia.org/resource>
PREFIX dbpprop: <http://dbpedia.org/property>
PREFIX geo: <http://www.w3.org/2003/01/geo/wgs84_pos#>
SELECT DISTINCT *
WHERE{
?city rdf:type dbo:PopulatedPlace.
OPTIONAL {?city rdfs:label ?labelEN. FILTER ( lang(?labelEN) = 'en').}
OPTIONAL {?city rdfs:label ?labelES. FILTER ( lang(?labelES) = 'es').}
OPTIONAL {?city dbo:populationTotal ?pop.}
OPTIONAL {?city dbo:country ?country.
OPTIONAL {?country rdfs:label ?countryEN . FILTER ( lang(?countryEN) = 'en').}
OPTIONAL {?country rdfs:label ?countryES . FILTER ( lang(?countryES) = 'es').}
}
OPTIONAL {?city geo:long ?long.}
OPTIONAL {?city geo:lat ?lat.}
FILTER (?pop>1000000).
}
LIMIT 100