我想检索 Wikimedia Category 的成员American rock singers
。我必须使用 Wikidata,它告诉我使用P31
with Q4167836
。下面的查询仅返回有关类别页面的信息,而不是有关其成员的信息。
有没有其他方法可以检索维基媒体类别的成员?我也尝试使用术语dcterms:subject
,我在 DBpedia 中成功使用了它,但在 Wikidata 中,查询返回空结果。
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" .}
}
在这里试试