我想使用Sparql查询来查找排名(特朗普45,奥巴马44...)来自维基数据。对于实体美国总统(Q11696),此属性似乎不存在。有谁知道如何解决这个问题吗?
谢谢!
发布于 2017-06-30 10:08:06
查看现有数据至少是您的friend...at我查看了一下,例如Gerald Ford,发现有一条"position held"语句本身有一个"series ordinal"值:
SELECT ?p ?pLabel ?rank WHERE {
# presidents of US
wd:Q30 (p:P6/ps:P6) ?p.
# get their "position held" statement (to "President of the United States of America" only)
?p p:P39 ?position_held_statement .
?position_held_statement ps:P39 wd:Q11696 .
?position_held_statement pq:P1545 ?rank . # here is the rank (series ordinal)
SERVICE wikibase:label { bd:serviceParam wikibase:language "en". }
}https://stackoverflow.com/questions/44835328
复制相似问题