query-0b968c243ca0fd3ba64b9990d46fd759
title:Count of manuscripts by collection SELECT ?collection ?collectionLabel (COUNT(?item) AS ?count) WHERE { ?item wdt:P31/wdt:P279* wd:Q87167. ?q p:P195 ?s. ?s ps:P195 ?collection . MINUS {?s pq:P582 []}. SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?collection ?collectionLabel 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 ps: <http://www.wikidata.org/prop/statement/>
PREFIX pq: <http://www.wikidata.org/prop/qualifier/>
PREFIX p: <http://www.wikidata.org/prop/>
PREFIX bd: <http://www.bigdata.com/rdf#>
#title:Count of manuscripts by collection
SELECT ?collection ?collectionLabel (COUNT(?item) AS ?count) WHERE {
?item wdt:P31/wdt:P279* wd:Q87167.
?q p:P195 ?s. ?s ps:P195 ?collection . MINUS {?s pq:P582 []}.
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?collection ?collectionLabel
ORDER BY DESC(?count)
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v5("?collection"):::projected
v6("?count")
v2("?item"):::projected
v3("?q")
v4("?s")
a2((" "))
a1((" "))
c3(["wd:Q87167"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
v2 --"p:direct/P31"--> a1
a1 --"p:direct/P279"--> c3
v3 --"p:P195"--> v4
v4 --"p:statement/P195"--> v5
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v4 --"p:qualifier/P582"--> a2
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end
bind2[/"count(?item)"/]
v2 --o bind2
bind2 --as--o v6