query-edf6fc147f02d8266245f17c2ec813d6

rq turtle/ttl

Commons Query Service - MINUS IssueHi, I create query for viewing Wikidata P18 Statement images don't have depicts statement of WD item in the Wikimedia Commons. If there is MINUS, ?file does not appearing, Looks fine if minus is removed. Please anyone help me! and PING ME. Thanks in advance!

Use at

PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wd: <http://www.wikidata.org/entity/>
SELECT ?item ?file


WHERE {
  {
  SELECT ?item WHERE {
    SERVICE <https://query.wikidata.org/sparql> {
        ?item wdt:P18 ?file;
              wdt:P106 wd:Q4610556.
     } 
  }
}  MINUS { ?file wdt:P180 ?item . }
}

Query found at

graph TD classDef projected fill:lightgreen; classDef literal fill:orange; classDef iri fill:yellow; v2("?file"):::projected v1("?item"):::projected c4(["wd:Q4610556"]):::iri subgraph s1["https://query.wikidata.org/sparql"] style s1 stroke-width:4px; v1 --"wdt:P18"--> v2 v1 --"wdt:P106"--> c4 end subgraph minus0["MINUS"] style minus0 stroke-width:6px,fill:pink,stroke:red; v2 --"wdt:P180"--> v1 end