query-dd2783b1a06f82732643ab5f1d2280ff
title:Count of biographical dictionaries connected to a library catalog SELECT ?propItem ?propItemLabel (COUNT(?ids) AS ?ids_count) WHERE { hint:Query hint:optimizer "Runtime". ?item wdt:P5739 ?id . ?item wdt:P31 wd:Q5 . OPTIONAL { ?item ?prop ?ids. ?propItem wikibase:directClaim ?prop. ?propItem wikibase:propertyType wikibase:ExternalId. ?propItem wdt:P31 wd:Q97584729 . } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } } GROUP BY ?propItem ?propItemLabel ORDER BY DESC(?ids_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:Count of biographical dictionaries connected to a library catalog
SELECT ?propItem ?propItemLabel (COUNT(?ids) AS ?ids_count) WHERE {
?item wdt:P5739 ?id .
?item wdt:P31 wd:Q5 .
OPTIONAL {
?item ?prop ?ids.
?propItem wikibase:directClaim ?prop.
?propItem wikibase:propertyType wikibase:ExternalId.
?propItem wdt:P31 wd:Q97584729 .
}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
} GROUP BY ?propItem ?propItemLabel
ORDER BY DESC(?ids_count)
Query found at
- https://www.wikidata.org/wiki/User:Ep%C3%ACdosis/Queries
- https://www.wikidata.org/wiki/User:Ep%C3%ACdosis/sandbox
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?id")
v5("?ids"):::projected
v7("?ids_count")
v2("?item")
v4("?prop")
v6("?propItem"):::projected
c7(["wd:Q97584729"]):::iri
c9(["bd:serviceParam"]):::iri
c3(["wd:Q5"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["wikibase:ExternalId"]):::iri
v2 --"wdt:P5739"--> v3
v2 --"wdt:P31"--> c3
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v2 -->v4--> v5
v6 -."wikibase:directClaim".-> v4
v6 --"wikibase:propertyType"--> c6
v6 --"wdt:P31"--> c7
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end
bind1[/"count(?ids)"/]
v5 --o bind1
bind1 --as--o v7