query-567c8bab2a9f517f3b69465218927744
Stats for a particular property-qualifier combination
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT (COUNT(DISTINCT ?item) as ?countitem) (COUNT(DISTINCT ?asObject) as ?counttarget)
WHERE
{
?prop pq:P31 ?asObject .
?item ?p ?prop .
?property wikibase:claim ?p .
?property wikibase:statementProperty ?ps .
?prop ?ps ?value .
wd:P18 wikibase:claim ?p .
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,bg" }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?asObject"):::projected
v8("?countitem")
v9("?counttarget")
v3("?item"):::projected
v4("?p")
v1("?prop")
v5("?property")
v6("?ps")
v7("?value")
c4(["wd:P18"]):::iri
c6(["bd:serviceParam"]):::iri
c8(["en,bg"]):::literal
v1 --"pq:P31"--> v2
v3 -->v4--> v1
v5 --"wikibase:claim"--> v4
v5 --"wikibase:statementProperty"--> v6
v1 -->v6--> v7
c4 --"wikibase:claim"--> v4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end
bind2[/"count(?item)"/]
v3 --o bind2
bind2 --as--o v8
bind3[/"count(?asObject)"/]
v2 --o bind3
bind3 --as--o v9