query-6d1e64032e2f3946240874e48eb23c01
Bare election items, so tend not to come up in many of my searches. (P279)subclass of nor (P31)instance of I've been tidying up a lot of our election items recently, but I've discovered quite a few that neither a Ideally I'd be able to find all of those, and set an appropriate value, but any query I can come up with is timing out. My approaches have generally been along the lines of:
Use at
- https://query.wikidata.org/sparql
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?item ?itemLabel WHERE {
?item rdfs:label ?itemLabel
FILTER(CONTAINS(LCASE(?itemLabel), "election"))
FILTER((LANG(?itemLabel)) = "en") .
FILTER NOT EXISTS { ?item wdt:P31 [] }
FILTER NOT EXISTS { ?item wdt:P279 [] }
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?item"):::projected
v2("?itemLabel"):::projected
a2((" "))
a1((" "))
f0[["not "]]
subgraph f0e0["Exists Clause"]
e0v1 --"wdt:P279"--> e0a1
e0v1("?item"):::projected
e0a1((" ")):::projected
end
f0--EXISTS--> f0e0
f0 --> v1
f0 --> c1
f0 --> a1
v1 --"wdt:P279"--> a1
f1[["not "]]
subgraph f1e1["Exists Clause"]
e1v1 --"wdt:P31"--> e1a1
e1v1("?item"):::projected
e1a1((" ")):::projected
end
f1--EXISTS--> f1e1
f1 --> v1
f1 --> c2
f1 --> a2
v1 --"wdt:P31"--> a2
f2[["?itemLabel = 'en'"]]
f2 --> v2
f3[["contains(lower-case(?itemLabel),'election')"]]
f3 --> v2
v1 --"rdfs:label"--> v2