query-3c458b5da7a4c84bedf4793ab5422b63
Fortifications with a commons category but no image
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 schema: <http://schema.org/>
PREFIX bd: <http://www.bigdata.com/rdf#>
SELECT ?item ?itemLabel ?comm ?p373 ?cat ?image WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "en-gb,en,mul". }
#?item wdt:P17 wd:Q142.
{?comm schema:about ?item ; schema:isPartOf <https://commons.wikimedia.org/> .}
#BIND(replace(wikibase:decodeUri(SUBSTR(STR(?comm), 45)),"_"," ") AS ?comm_decode)
#?item wdt:P373 ?p373 .
#bind(COALESCE(?comm_decode, ?p373) as ?cat) .
VALUES ?trida { wd:Q1785071 wd:Q23413 wd:Q56344492} # fort, castle, battery
?item wdt:P31 ?trida.
MINUS { ?item wdt:P18 ?image } .
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?comm"):::projected
v4("?image"):::projected
v2("?item"):::projected
v3("?trida")
c4(["en-gb,en,mul"]):::literal
c2(["bd:serviceParam"]):::iri
c7([https://commons.wikimedia.org/]):::iri
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
v1 --"schema:about"--> v2
v1 --"schema:isPartOf"--> c7
bind0[/VALUES ?trida/]
bind0-->v3
bind00(["wd:Q1785071"])
bind00 --> bind0
bind01(["wd:Q23413"])
bind01 --> bind0
bind02(["wd:Q56344492"])
bind02 --> bind0
v2 --"wdt:P31"--> v3
subgraph minus1["MINUS"]
style minus1 stroke-width:6px,fill:pink,stroke:red;
v2 --"wdt:P18"--> v4
end