query-8b58a43192908cec60d9a15c45284c86
Demonstrates "no value" handling
title: Humans without children (only truthy values)
SELECT ?human ?humanLabel WHERE { ?human wdt:P31 wd:Q5 . #find humans ?human rdf:type wdno:P40 . #with at least one truthy P40 (child) statement defined to be "no value" SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" } }
Use at
- https://query.wikidata.org/sparql
PREFIX wikibase: <http://wikiba.se/ontology#>
PREFIX wdt: <http://www.wikidata.org/prop/direct/>
PREFIX wdno: <http://www.wikidata.org/prop/novalue/>
PREFIX wd: <http://www.wikidata.org/entity/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX bd: <http://www.bigdata.com/rdf#>
#Demonstrates "no value" handling
#title: Humans without children (only truthy values)
SELECT ?human ?humanLabel
WHERE
{
?human wdt:P31 wd:Q5 . #find humans
?human rdf:type wdno:P40 . #with at least one truthy P40 (child) statement defined to be "no value"
SERVICE wikibase:label { bd:serviceParam wikibase:language "[AUTO_LANGUAGE],mul,en" }
}
Query found at
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples
- https://www.wikidata.org/wiki/Wikidata:SPARQL_query_service/queries/examples/en
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v1("?human"):::projected
c6(["bd:serviceParam"]):::iri
c2(["wd:Q5"]):::iri
c4(["wdno:P40"]):::iri
c8(["#91;AUTO_LANGUAGE#93;,mul,en"]):::literal
v1 --"wdt:P31"--> c2
v1 --"a"--> c4
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c6 --"wikibase:language"--> c8
end