Closed WolfgangFahl closed 2 months ago
snapquery -qn "10 Largest Cities Of The World" -f github
Ten Largest cities of the world see also http://wiki.bitplan.com/index.php/PyLoDStorage#Examples
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
# Ten Largest cities of the world
# WF 2021-08-23
# see also http://wiki.bitplan.com/index.php/PyLoDStorage#Examples
SELECT DISTINCT ?city ?cityLabel ?population ?country ?countryLabel
WHERE {
VALUES ?cityClass { wd:Q1549591 }. # big city - million city does not work any more
?city wdt:P31 ?cityClass .
?city wdt:P1082 ?population .
?city wdt:P17 ?country .
?city rdfs:label ?cityLabel.
FILTER(LANG(?cityLabel) = "en").
?country rdfs:label ?countryLabel.
FILTER(LANG(?countryLabel) = "en").
}
ORDER BY DESC(?population)
LIMIT 10
snapquery -d -qn cats -f github
SELECT ?item ?itemLabel
WHERE {
?item wdt:P31 wd:Q146. # Must be a cat
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
improve on
of https://github.com/WolfgangFahl/pyLoDStorage