Query: select instance of human whose profession is singer/musician
- wd:Q177220 (Singer)
- wd:Q639669 (Musician)
SELECT DISTINCT ?human ?humanLabel ?genre ?genreLabel WHERE {
VALUES ?professions {
wd:Q177220
wd:Q639669
}
?human wdt:P31 wd:Q5;
wdt:P106 ?professions;
wikibase:statements ?statementcount.
FILTER(?statementcount > 50 )
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
OPTIONAL { ?human wdt:P136 ?genre. }
}
ORDER BY (?humanLabel)
LIMIT 50
How to group query by optional param genre so that it will return something like this ["rock", "pop-rock"]