query-e32b194ced4879721f12ea14f671b8b8
Things in Moldova by number of instances SELECT ?claim ?claimLabel (count(?item) as ?ct)
(GROUP_CONCAT(distinct(?item); separator=", ") as ?items)
WHERE { ?item wdt:P17 wd:Q217 . ?item wdt:P31 ?claim . SERVICE wikibase:label { bd:serviceParam wikibase:language "en". } } GROUP by ?claim ?claimLabel Order BY ASC(?class)
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Things in Moldova by number of instances
SELECT ?claim ?claimLabel (count(?item) as ?ct)
# (GROUP_CONCAT(distinct(?item); separator=", ") as ?items)
WHERE {
?item wdt:P17 wd:Q217 .
?item wdt:P31 ?claim .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}
GROUP by ?claim ?claimLabel
Order BY ASC(?class)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?claim"):::projected
v1("?class")
v4("?ct")
v2("?item"):::projected
c5(["bd:serviceParam"]):::iri
c2(["wd:Q217"]):::iri
c7(["en"]):::literal
v2 --"wdt:P17"--> c2
v2 --"wdt:P31"--> v3
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end
bind1[/"count(?item)"/]
v2 --o bind1
bind1 --as--o v4