query-038babc6de7ab87a0ce29fff2659d6d8

rq turtle/ttl

Libraries lacking an image in WikicommonsOrdered by decreasing notability

Use at

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#>
SELECT DISTINCT ?library ?libraryLabel ?countryLabel (URI(CONCAT("https://commons.wikimedia.org/wiki/Category:",?commonscat)) AS ?commons) ?sitelinks WHERE {
?library wdt:P31/wdt:P279* wd:Q7075. # library (or subtype)
MINUS {?library wdt:P576 []} # Remove defunct
MINUS {?library wdt:P18 []} # No image
MINUS {?library wdt:P31/wdt:P279* wd:Q212805} # Remove digital libraries
?library wikibase:sitelinks ?sitelinks
OPTIONAL {?library wdt:P17 ?country}
OPTIONAL {?library wdt:P373 ?commonscat}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en" }
} ORDER BY DESC(?sitelinks) ?libraryLabel

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v6("?commons") v5("?commonscat"):::projected v4("?country") v3("?library"):::projected v2("?libraryLabel"):::projected v1("?sitelinks"):::projected a2((" ")) a3((" ")) a1((" ")) a4((" ")) c3(["wd:Q7075"]):::iri c11(["bd:serviceParam"]):::iri c13(["#91;AUTO_LANGUAGE#93;,en"]):::literal c6(["wd:Q212805"]):::iri v3 --"wdt:P31"--> a1 a1 --"wdt:P279"--> c3 subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P576"--> a2 end subgraph minus1["MINUS"] style minus1 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P18"--> a3 end subgraph minus2["MINUS"] style minus2 stroke-width:6px,fill:pink,stroke:red; v3 --"wdt:P31"--> a4 a4 --"wdt:P279"--> c6 end v3 --"wikibase:sitelinks"--> v1 subgraph optional0["(optional)"] style optional0 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P17".-> v4 end subgraph optional1["(optional)"] style optional1 fill:#bbf,stroke-dasharray: 5 5; v3 -."wdt:P373".-> v5 end subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c11 --"wikibase:language"--> c13 end bind3[/"concat('https://commons.wikimedia.org/wiki/Category:',?commonscat)"/] v5 --o bind3 bind3 --as--o v6