query-cc2557428c15e3cc0515b547b9bf107a
P31 human 07:24, 8 February 2021 (UTC) 77.13.160.254 https://www.wikidata.org/w/index.php?title=Q2241371&diff=1351282523&oldid=1334354332should not have any other P31, please fix your nonsense edits with a stricter filter:220 errorsMmmm bad request, most results do not even bear P31=Q5 at all. Only 06:13, 9 February 2021 (UTC) 78.54.27.99 19000+ bugs. https://w.wiki/yTxGreat, thank you! 14:14, 8 February 2021 (UTC) ;)chat Lαδδo instead. (Q474968)anonymous master (P2868)subject has role OK, I used
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 distinct ?item ?itemLabel ?type ?typeLabel
{
?item wdt:P31/wdt:P279+ wd:Q5 .
?item wdt:P31 ?type .
FILTER NOT EXISTS { ?item wdt:P279 [] . } . # Discard classes
FILTER EXISTS { ?item wdt:P31 wd:Q5 . } . # Discard non-humans
FILTER (?type != wd:Q5 ) # Skip lines where type is human
SERVICE wikibase:label { bd:serviceParam wikibase:language "en,fr,es,it,de,pl,ca" }
}
ORDER BY ?typeLabel
Query found at
graph TD
classDef projected fill:lightgreen;
classDef literal fill:orange;
classDef iri fill:yellow;
v3("?item"):::projected
v2("?type"):::projected
v1("?typeLabel"):::projected
a1((" "))
a2((" "))
c5(["bd:serviceParam"]):::iri
c7(["en,fr,es,it,de,pl,ca"]):::literal
c1(["wd:Q5"]):::iri
f0[["?type != 'wd:Q5'"]]
f0 --> v2
f1[[" "]]
subgraph f1e0["Exists Clause"]
e0v1 --"wdt:P31"--> e0c2
e0v1("?item"):::projected
e0c2(["wd:Q5"]):::iri
end
f1--EXISTS--> f1e0
f1 --> v3
f1 --> c2
f1 --> c1
v3 --"wdt:P31"--> c1
f2[["not "]]
subgraph f2e1["Exists Clause"]
e1v1 --"wdt:P279"--> e1a1
e1v1("?item"):::projected
e1a1((" ")):::projected
end
f2--EXISTS--> f2e1
f2 --> v3
f2 --> c3
f2 --> a1
v3 --"wdt:P279"--> a1
v3 --"wdt:P31"--> a2
a2 --"wdt:P279"--> c1
v3 --"wdt:P31"--> v2
subgraph s1["http://wikiba.se/ontology#label"]
style s1 stroke-width:4px;
c5 --"wikibase:language"--> c7
end