query-d59808c355fc439474114378d13b23e8

rq turtle/ttl

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

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("?museum"):::projected v2("?museumLabel"):::projected v1("?sitelinks"):::projected a2((" ")) a3((" ")) a1((" ")) c3(["wd:Q33506"]):::iri c10(["bd:serviceParam"]):::iri c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal 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 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 v3 --"wikibase:sitelinks"--> v1 subgraph s1["http://wikiba.se/ontology#label"] style s1 stroke-width:4px; c10 --"wikibase:language"--> c12 end bind2[/"concat('https://commons.wikimedia.org/wiki/Category:',?commonscat)"/] v5 --o bind2 bind2 --as--o v6