query-46f819174c8db34be5f55ace0aa8793b
"Find all of one thing, with this quality, information, but not these things" Find all paintings on Wikidata, that are Impressionist, and their creators, and their locations, 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 ?locationLabel ?coordsLabel #Added labels up here for coordinates and locations
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
?item wdt:P276 ?location . #show me the location of the items (e.g galleries)
?location wdt:P625 ?coords . #show me the coordinates of those locations
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
v4("?coords")
v1("?item"):::projected
v3("?location")
c4(["wd:Q40415"]):::iri
c2(["wd:Q3305213"]):::iri
c10(["bd:serviceParam"]):::iri
c12(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c8(["wd:Q296"]):::iri
v1 --"wdt:P31"--> c2
v1 --"wdt:P135"--> c4
v1 --"wdt:P170"--> v2
v1 --"wdt:P276"--> v3
v3 --"wdt:P625"--> v4
subgraph minus0["MINUS"]
style minus0 stroke-width:6px,fill:pink,stroke:red;
v1 --"wdt:P170"--> c8
end
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c10 --"wikibase:language"--> c12
end