query-6cdecba4e61ae21de5ddb75ab286556a
FILTER NOT EXISTS for wdt:Pxxxx OR wdt: Pnnnnn?I'm trying to do cleanup for a project my institution is working on by finding records with missing properties. I'd like to do a boolean search for records that are missing X property OR Y property, etc. I saw that the operator for OR is "||", but couldn't figure out exactly how to incorporate it into my query, or find relevant examples of how to use it. In my own experimentation, I stumbled on this:
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 ?itemDescription WHERE {
?item wdt:P5008 wd:Q94124522.
FILTER NOT EXISTS {?item wdt:P18|wdt:P569 ?o}
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],en". }