query-acb51bf8d5f4d9e1424d0af63eddb854
Taking away criteria from your search using MINUS function"Find all of one thing, with this quality, information, but not these things" Find all paintings on Wikidata, that are Impressionist, and their creators, but not by Monet.
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#>
SELECT ?item ?itemLabel ?artist ?artistLabel #Item label here
WHERE { ?item wdt:P31 wd:Q3305213 . #instance of paintings,
?item wdt:P135 wd:Q40415 . #movement is Impressionism
?item wdt:P170 ?artist #show me the artists
MINUS { ?item wdt:P170 wd:Q296 . } #the "items" (paintings) should be "minus" creator = Monet
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } #added labelservice here
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v2("?artist"):::projected
v1("?item"):::projected
c4(["wd:Q40415"]):::iri
c2(["wd:Q3305213"]):::iri
c8(["bd:serviceParam"]):::iri
c10(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c6(["wd:Q296"]):::iri
v1 --"wdt:P31"--> c2
v1 --"wdt:P135"--> c4
v1 --"wdt:P170"--> v2
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"wdt:P170"--> c6
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c8 --"wikibase:language"--> c10
end