维基数据:下载数据库

This page is a translated version of the page Wikidata:Database download and the translation is 71% complete.
Outdated translations are marked like this.

维基数据将已有的内容提供给任何人下载。

请注意另有几个其它方法以访问结构化的维基数据内容,这可能不会提供一个完整的数据库转储。

数据库转储

There are several different kinds of data dumps available. Note that while JSON and RDF dumps are considered stable interfaces, XML dumps are not. Changes to the data formats used by stable interfaces are subject to the Stable Interface Policy.

<span id="JSON_dumps_(recommended)_">

JSON 傾印(建議)

包含所有维基数据实体列表于一个JSON数组的JSON转储可在 https://dumps.wikimedia.org/wikidatawiki/entities/ 找到。该数组中的实体并未按某特定顺序排序,例如Q2不一定紧接着Q1。这些会每周一次更新。

This is the recommended dump format. Please refer to the JSON structure documentation for information about how Wikidata entities are represented.

提示:每个实体(数据实体或属性)都在JSON文件中的单独一行,所以文件可以逐行读取,并且每行都能单独解码为独立的JSON对象。

注意这些文件使用并行压缩,这可能导致某些解压缩工具无法可靠解压文件。如果你使用Windows你可以用Bzip2等。在*nix系统中,使用lbzip2可以并行解压缩Bzip2。pbzip2不是一个合适的选择,它不能对不是pbzip2创建的压缩文件并行解压缩。

You can currently download a fairly recent dump using a torrent. wikidata-20220103-all.json.gz (109.04 GiB) on academictorrents.com (  magnet)

  • JsonDumpReader 是一个读取转储文件的PDP库。
  • gitlab.com/tozd/go/mediawiki 是一个处理维基百科和维基数据转储文件的Go库。
  • WDSub 是一个用于处理JSON Wikibase转储文件的Scala库,可以输入实体架构生成数据子集。

RDF 转储

First, canonical RDF dumps using the Turtle and NTriples formats can be found under https://dumps.wikimedia.org/wikidatawiki/entities/. The mapping is described here. These full statements are noted as all.

Secondly, so called truthy dumps are provided. They use the nt format. They are in the same format as the full dumps, but limited to direct, truthy statements. Therefore, they do not contain meta data such as qualifiers and references.

完整的转储在一起包含Wikidata中的所有实体信息,但顺序(别名,语句等)除外,该顺序自然不在RDF中表示。 简化的转储将没有限定符的语句编码为单个RDF三元组(省略了引用)。

The dumps of Wikidata Lexeme namespace in Turtle and NTriples formats can be found in the same place with lexemes suffix.

要想获得RDF转储格式的更多信息请参考 RDF 转储格式

部分RDF转储

WDumper是用于创建自定义wikidata RDF转储的第三方工具。 实体和语句可能会被过滤。

XML 转储

维基数据完整的XML转储文件可以在https://dumps.wikimedia.org/wikidatawiki/找到。

警告:XML转储文件中的JSON数据格式可能在未经通知的情况下更改,且不同版本的格式可能不一致。因此此数据应视为格式未知的二进制数据。强烈建议用JSON或RDF转储来得到标准的数据表示!

维基数据的增量转储(或新增/变更转储)同样可供下载。这些转储包含在过去24小时内新增的内容,以减少下载整个数据库转储的必要。这些转储会显著地小于整个数据库转储。

这些转储在这里可用。

舊的 JSON 與 RDF 轉儲

可以在Internet Archive (Q461)上找到旧的RDF和JSON转储:

数据模型

数据模型可以在此处查阅。该数据模型描述了维基数据的基本结构。

資料庫架構

有关数据库架构的概述,请参见本页。 (这不是Wikidata中数据的架构。)

许可

维基数据已提供可用内容的副本以供下载。这些数据库可以用于个人或商业用途,备份或脱机使用。所有来自“主要”和“属性”命名空间的结构化数据均在知识共享 CC0 协议条款之下可用。其他名字空间的文本在知识共享 署名-相同方式共享协议条款之下可用;附加条款亦可能应用。多媒体项目和其他内容在其他协议之下提供,其详情页面有详细说明。

另请参阅