query-c858a263100587027a8aa2e299d49b2f
Find paintings with "donkey" in the title but no depiction statement for it SELECT ?item ?itemLabel ?title WHERE { ?item wdt:P31 wd:Q3305213 . ?item rdfs:label ?title . FILTER(LANG(?title) = "en"). FILTER(CONTAINS(?title,"Donkey")) FILTER NOT EXISTS { ?item wdt:P180 wd:Q3537778 } SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". } }
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 rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX bd: <http://www.bigdata.com/rdf#>
# Find paintings with "donkey" in the title but no depiction statement for it
SELECT ?item ?itemLabel ?title
WHERE
{
?item wdt:P31 wd:Q3305213 .
?item rdfs:label ?title .
FILTER(LANG(?title) = "en").
FILTER(CONTAINS(?title,"Donkey"))
FILTER NOT EXISTS { ?item wdt:P180 wd:Q3537778 }
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v2("?title"):::projected
c6(["wd:Q3305213"]):::iri
c9(["bd:serviceParam"]):::iri
c11(["#91;AUTO_LANGUAGE#93;,en"]):::literal
c2(["wd:Q3537778"]):::iri
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P180"--> e0c2
e0v1("?item"):::projected
e0c2(["wd:Q3537778"]):::iri
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> c2
v1 --"wdt:P180"--> c2
f1[["contains(?title,'Donkey')"]]
f1 --> v2
f2[["?title = 'en'"]]
f2 --> v2
v1 --"wdt:P31"--> c6
v1 --"rdfs:label"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c9 --"wikibase:language"--> c11
end