query-654cf036c8533085c81a8bdf93c43c66
Most used properties for Q-items that have a given P31 value SELECT ?property ?propertyLabel (COUNT(?item) AS ?count) WHERE { ?item wdt:P31 wd:Q213924. # Codex -- change it ?item ?p ?statement. ?property wikibase:claim ?p. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?property ?propertyLabel ORDER BY DESC(?count) LIMIT 50
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#>
# Most used properties for Q-items that have a given P31 value
SELECT ?property ?propertyLabel (COUNT(?item) AS ?count) WHERE {
?item wdt:P31 wd:Q213924. # Codex -- change it
?item ?p ?statement.
?property wikibase:claim ?p.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
GROUP BY ?property ?propertyLabel
ORDER BY DESC(?count)
LIMIT 50
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v6("?count")
v2("?item"):::projected
v3("?p")
v5("?property"):::projected
v4("?statement")
c5(["bd:serviceParam"]):::iri
c7(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q213924"]):::iri
v2 --"wdt:P31"--> c2
v2 -->v3--> v4
v5 --"wikibase:claim"--> 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 v6