I'm trying to load all the subtaxons of Biota/Q2382433 (i.e. entities with P271 "parent taxon" pointing to Q2382433) in Wikidata.
The following query works fine:
SELECT ?item ?itemLabel
(GROUP_CONCAT(DISTINCT ?class; SEPARATOR=", ") AS ?classes)
WHERE {
?class wdt:P171 ?item.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
BIND(wd:Q2382443 AS ?item)
}
GROUP BY ?item ?itemLabel
With FILTER
instead of BIND
, it yields zero results:
SELECT ?item ?itemLabel
(GROUP_CONCAT(DISTINCT ?class; SEPARATOR=", ") AS ?classes)
WHERE {
?class wdt:P171 ?item.
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
FILTER(?item in (wd:Q2382443))
}
GROUP BY ?item ?itemLabel
How can I get the query to work using FILTER
?