首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用Sparql (维基数据)查找美国总统的排名(数量)

使用Sparql (维基数据)查找美国总统的排名(数量)
EN

Stack Overflow用户
提问于 2017-06-30 05:33:20
回答 1查看 177关注 0票数 0

我想使用Sparql查询来查找排名(特朗普45,奥巴马44...)来自维基数据。对于实体美国总统(Q11696),此属性似乎不存在。有谁知道如何解决这个问题吗?

谢谢!

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2017-06-30 10:08:06

查看现有数据至少是您的friend...at我查看了一下,例如Gerald Ford,发现有一条"position held"语句本身有一个"series ordinal"值:

代码语言:javascript
复制
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". }
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/44835328

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档