query-10d37b97f9cec5c18ce5483e0c7a3ca9

rq turtle/ttl

Number of a uses of a type of property constraint SELECT ?const ?constLabel ?count ?sample ?sampleLabel WHERE { { SELECT ?const (COUNT(?cst) AS ?count) (SAMPLE(?item) AS ?sample) WHERE { ?item p:P2302 ?cst . ?cst a wikibase:BestRank . ?cst ps:P2302 ?const . } GROUP BY ?const } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . } } ORDER BY DESC(?count)

Use at

PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX ps: <http://www.wikidata.org/prop/statement/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Number of a uses of a type of property constraint
SELECT ?const ?constLabel ?count ?sample ?sampleLabel
WHERE {
  {
    SELECT ?const (COUNT(?cst) AS ?count) (SAMPLE(?item) AS ?sample)
    WHERE {
      ?item p:P2302 ?cst .
      ?cst a wikibase:BestRank .
      ?cst ps:P2302 ?const .
    }
    GROUP BY ?const
  }
  SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" . }
}
ORDER BY DESC(?count)

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v4("?const"):::projected v5("?count"):::projected v3("?cst") v2("?item") v5("?sample"):::projected c6(["bd:serviceParam"]):::iri c3(["wikibase:BestRank"]):::iri c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal v2 --"p:P2302"--> v3 v3 --"a"--> c3 v3 --"p:statement/P2302"--> v4 bind2[/"count(?cst)"/] v3 --o bind2 bind2 --as--o v5 bind3[/"sample(?item)"/] v2 --o bind3 bind3 --as--o v5 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c6 --"wikibase:language"--> c8 end