query-214584dd6dd80795146e2030066dc675
Selecting for only non-null results that are properly sourced, because I completed and referenced these properties. I'm very grateful for any suggestions. (Q86701)Ernst Bader I'm trying to build a query that lists items where these fields are not null and all but image are sourced with a reference that is not imported from a wikiproject. I'm lost. I know that there is an example that should result,
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 ?human ?image ?place_of_birth ?place_of_birthLabel ?date_of_birth ?place_of_death ?place_of_deathLabel ?date_of_death ?occupation ?occupationLabel WHERE {
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,en". }
OPTIONAL { ?human wdt:P18 ?image. }
OPTIONAL { ?human wdt:P19 ?place_of_birth. }
OPTIONAL { ?human wdt:P569 ?date_of_birth. }
OPTIONAL { ?human wdt:P20 ?place_of_death. }
OPTIONAL { ?human wdt:P570 ?date_of_death. }
OPTIONAL { ?human wdt:P106 ?occupation. }
?human wdt:P1559 wd:Q86701.
}
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v4("?date_of_birth"):::projected
v6("?date_of_death"):::projected
v1("?human"):::projected
v2("?image"):::projected
v7("?occupation"):::projected
v3("?place_of_birth"):::projected
v5("?place_of_death"):::projected
c2(["bd:serviceParam"]):::iri
c12(["wd:Q86701"]):::iri
c4(["en,en"]):::literal
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c2 --"wikibase:language"--> c4
end
subgraph optional0["(optional)"]
style optional0 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P18".-> v2
end
subgraph optional1["(optional)"]
style optional1 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P19".-> v3
end
subgraph optional2["(optional)"]
style optional2 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P569".-> v4
end
subgraph optional3["(optional)"]
style optional3 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P20".-> v5
end
subgraph optional4["(optional)"]
style optional4 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P570".-> v6
end
subgraph optional5["(optional)"]
style optional5 fill:#bbf,stroke-dasharray: 5 5;
v1 -."wdt:P106".-> v7
end
v1 --"wdt:P1559"--> c12