query-6e603ab6efe39b6a262969f24472b1eb
title:Number of statements by property for things (ex. albums) SELECT ?property ?propertyLabel ?count ?type WITH { SELECT ?property (count(?property) as ?count) WHERE { ?item wdt:P31 wd:Q482994. # the thing you're interested in. "albums" (Q482994) in this example hint:Prior hint:runFirst true. ?item ?predicate []. ?property wikibase:directClaim ?predicate . } group by ?property ?propertyLabel } as %i WHERE { INCLUDE %i. ?property wikibase:propertyType ?type. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } ORDER BY DESC(?count)
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#>
#title:Number of statements by property for things (ex. albums)
SELECT ?property ?propertyLabel ?count ?type WHERE
{
{
SELECT ?property (count(?property) as ?count)
WHERE
{
?item wdt:P31 wd:Q482994. # the thing you're interested in. "albums" (Q482994) in this example
?item ?predicate [].
?property wikibase:directClaim ?predicate .
} group by ?property ?propertyLabel }
?property wikibase:propertyType ?type.
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;
v5("?count"):::projected
v2("?item")
v3("?predicate")
v4("?property"):::projected
v5("?type"):::projected
a1((" "))
c6(["bd:serviceParam"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q482994"]):::iri
v2 --"wdt:P31"--> c2
v2 -->v3--> a1
v4 --"wikibase:directClaim"--> v3
bind1[/"count(?property)"/]
v4 --o bind1
bind1 --as--o v5
v4 --"wikibase:propertyType"--> v5
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end