see also
Examples:
15 Random substances with CAS number
Wikidata SPARQL query showing the 15 random chemical substances with their CAS Number
query
# List of 15 random chemical components with CAS-Number, formula and structure
# see also https://github.com/WolfgangFahl/pyLoDStorage/issues/46
# WF 2021-08-23
SELECT ?substance ?substanceLabel ?formula ?structure ?CAS
WHERE {
?substance wdt:P31 wd:Q11173.
?substance wdt:P231 ?CAS.
?substance wdt:P274 ?formula.
?substance wdt:P117 ?structure.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
LIMIT 15
try it!
result
Ten largest cities of the world
Wikidata SPARQL query showing the 10 most populated cities of the world using the million city class Q1637706 for selection
query
# 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:Q1637706}.
?city wdt:P31 ?cityClass .
?city wdt:P1082 ?population .
?city wdt:P17 ?country .
SERVICE wikibase:label {
bd:serviceParam wikibase:language "en" .
}
}
ORDER BY DESC(?population)
LIMIT 10
try it!
result
| city |
cityLabel |
population |
country |
countryLabel |
| Q1353 |
Delhi |
26495000 |
Q668 |
India |
| Q8686 |
Shanghai |
23390000 |
Q148 |
People's Republic of China |
| Q956 |
Beijing |
21710000 |
Q148 |
People's Republic of China |
| Q1354 |
Dhaka |
16800000 |
Q902 |
Bangladesh |
| Q1156 |
Mumbai |
15414288 |
Q668 |
India |
| Q8660 |
Karachi |
14910352 |
Q843 |
Pakistan |
| Q8673 |
Lagos |
14862000 |
Q1033 |
Nigeria |
| Q406 |
Istanbul |
14657434 |
Q43 |
Turkey |
| Q1490 |
Tokyo |
13942024 |
Q17 |
Japan |
| Q11736 |
Tianjin |
13245000 |
Q148 |
People's Republic of China |
count OpenStreetMap place type instances
This SPARQL query
determines the number of instances available in the OpenStreetMap for the placeTypes city,town and village
query
# count osm place type instances
# WF 2021-08-23
SELECT (count(?instance) as ?count) ?placeType ?placeTypeLabel
WHERE {
VALUES ?placeType {
"city"
"town"
"village"
}
?instance osmt:place ?placeType
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?placeType ?placeTypeLabel
ORDER BY ?count
try it!
result
| count |
placeType |
placeTypeLabel |
| 13614 |
city |
city |
| 23238 |
town |
town |
| 153380 |
village |
village |
see also
Examples:
15 Random substances with CAS number
Wikidata SPARQL query showing the 15 random chemical substances with their CAS Number
query
try it!
result
Ten largest cities of the world
Wikidata SPARQL query showing the 10 most populated cities of the world using the million city class Q1637706 for selection
query
try it!
result
count OpenStreetMap place type instances
This SPARQL query
determines the number of instances available in the OpenStreetMap for the placeTypes city,town and village
query
try it!
result