I want to retrieve the members of the Wikimedia Category American rock singers
. I must use Wikidata and it tells me to use P31
with Q4167836
. The query below only returns information about the Category page and not about its members.
Is there any other way to retrieve the members of the Wikimedia Category? I also tried using the term dcterms:subject
, which I use successfully with DBpedia, but in Wikidata the query returns empty results.
prefix wdt: <http://www.wikidata.org/prop/direct/>
prefix wd: <http://www.wikidata.org/entity/>
prefix wikibase: <http://wikiba.se/ontology#>
prefix bd: <http://www.bigdata.com/rdf#>
prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>
SELECT DISTINCT ?subject ?predicate ?object ?objectLabel WHERE {
?subject ?predicate ?object ; wdt:P31 wd:Q4167836 ;
rdfs:label "Category:American rock singers"@en
SERVICE wikibase:label { bd:serviceParam wikibase:language "en" .}
}
Try here