获取Wikidata最旧和最新的修订时间戳 [英] get wikidata oldest and latest revision timestamp

查看:110
本文介绍了获取Wikidata最旧和最新的修订时间戳的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

昨天,我问了一个有关如何获取"Kevin Kratz(Q939047)"的Wikidata最旧和最新时间​​戳的问题,有人建议使用API​​沙箱创建这样的查询:

Yesterday, I asked a question about how to get wikidata oldest and latest timestamp for "Kevin Kratz (Q939047)", someone suggested using API sandbox to create the query like this:

最早的时间戳:https://www.wikidata.org/w/api.php?action=query&format=json&list=allrevisions&titles=Kevin%20Kratz&arvprop=ids|timestamp|flags|comment|user&arvlimit=1&arvdir=newer

最新时间戳:https://www.wikidata.org/w/api.php?action=query&format=json&list=allrevisions&titles=Kevin%20Kratz&arvprop=ids|timestamp|flags|comment|user&arvlimit=1&arvdir=older

它返回了以下结果: ->最旧的时间戳 时间戳":"2004-07-16T02:43:38Z".

it returned this results: -> oldest timestamp "timestamp": "2004-07-16T02:43:38Z".

->最新时间戳 时间戳":"2020-03-06T16:33:59Z".

-> latest timestamp "timestamp": "2020-03-06T16:33:59Z".

但是,在仔细查看"Kevin Kratz"的修订历史之后,我找到了这个(最后的图片)

Howerver, after cheking revision history of "Kevin Kratz", I found this (the pic in the end)

在知道wikidata在2012年启动之后,它使API沙箱查询"2004-07-16T02:43:38Z"返回的最旧时间戳值不相关(修订历史记录中的最新时间戳与api-sandbox中的时间戳不相等)查询).

After knowing that wikidata was launched in 2012, it made the oldest timestamp value returned by the API sandbox query "2004-07-16T02:43:38Z", irrelevant (latest timestamp from revision history unequal the one from api-sandbox query).

那么,有没有一种方法可以从Wikidata修订历史记录中获取最新和最旧的时间戳记?

So is there a way to get the latest and oldest timestamp from wikidata revision history?

推荐答案

使用list=allrevision,您将获得所有版本,而不仅仅是"Kevin Kratz"版本. Wikidata中最早的修订版本是2004年,因为Wikidata的开头部分页面是从其他Wikimedia项目中导入的,包括修订历史.

With list=allrevision you are getting all revisions, not only those of "Kevin Kratz". The oldest revision in Wikidata is from 2004 is because at the beginning of Wikidata some pages were imported from other Wikimedia projects including the revision history.

要获取特定Wikidata项目的最早或最新版本,请使用 https://www.wikidata.org/w/api.php?action=query&format=json&prop = revisions& titles = Q939047& rvprop = ids | timestamp | flags | comment | user& rvlimit = 1& rvdir = newer . 对于最新修订版:

To get the oldest or newest revision of a particular Wikidata item use prop=revisions. You will have to use the Q-id of the item (Q939047) and not the label (Kevin Kratz) because only the Q-id is unique. The API request to get the oldest revision then reads: https://www.wikidata.org/w/api.php?action=query&format=json&prop=revisions&titles=Q939047&rvprop=ids|timestamp|flags|comment|user&rvlimit=1&rvdir=newer. And for the newest revision: https://www.wikidata.org/w/api.php?action=query&format=json&prop=revisions&titles=Q939047&rvprop=ids|timestamp|flags|comment|user&rvlimit=1&rvdir=older.

这篇关于获取Wikidata最旧和最新的修订时间戳的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆