query-3657d89c2cf34eca6ce7b3084b4a6c36

rq turtle/ttl

Distribution of craters on astronomical bodies SELECT distinct ?planet ?planetLabel (COUNT(distinct ?crater) AS ?cnt) WHERE { ?crater wdt:P31 wd:Q3240715 ; wdt:P376 ?planet . #FILTER(?planet) SERVICE wikibase:label { bd:serviceParam wikibase:language "ru" } } GROUP BY ?planet ?planetLabel ORDER BY DESC(?cnt)

Use at

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#>
# Distribution of craters on astronomical bodies
SELECT distinct ?planet ?planetLabel (COUNT(distinct ?crater) AS ?cnt)
WHERE {
  ?crater wdt:P31 wd:Q3240715 ;
          wdt:P376 ?planet .
  #FILTER(?planet)
  SERVICE wikibase:label { bd:serviceParam wikibase:language "ru" }
} GROUP BY ?planet ?planetLabel ORDER BY DESC(?cnt)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?cnt") v2("?crater"):::projected v3("?planet"):::projected c5(["bd:serviceParam"]):::iri c7(["ru"]):::literal c2(["wd:Q3240715"]):::iri v2 --"wdt:P31"--> c2 v2 --"wdt:P376"--> v3 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c5 --"wikibase:language"--> c7 end bind1[/"count(?crater)"/] v2 --o bind1 bind1 --as--o v4