Jump to content

Manual:MediaWiki 中的数据管理

本頁使用了標題或全文手工轉換
From mediawiki.org
This page is a translated version of the page Manual:Managing data in MediaWiki and the translation is 73% complete.
Outdated translations are marked like this.

MediaWiki 最初的设计是为了管理主要由自由格式的文本和图像构成的内容。 MediaWiki 的结构支持比较有限:命名空间 子页面 分类 可以把相似的页面归在一起,而信息框 画廊 等功能则能帮助整理页面内部的内容。

不过,MediaWiki 本身并没有内建管理结构化数据的功能。这类数据往往需要支持查询、过滤,有时还要能用表格、图表、地图[1]或日历等方式进行可视化展示。 为满足这些需求,人们通常会使用一些专门的扩展

下表展示的是一些扩展,它们可以把用户编辑的数据存进 MediaWiki 数据库,并在之后进行查询。

不过,这并不是所有结构化数据功能的完整列表;在“另请参阅”部分,还列有其他可用于存储或展示结构化数据的扩展和功能。

功能
Semantic MediaWiki

Wikibase

Cargo
VisualData
主要使用情况 使用MediaWiki安装以管理数据,基于语义网标准。 维基数据和其他可编辑的图数据库(graph database)提供支持。 在MediaWiki安装内管理数据。 Managing data within a MediaWiki installation based on JSON-schema.
方法 数据(属性)是在标准的维基文本中或者通过模板来注解的。 若数据类型为“reference”,则属性可以用来使用statements来描述项。[2] 属性是使用statements来定义的并用于描述项。 数据存储在数据库表中,每个表对应一个模板。 Data are stored in a dedicated slot with JSON content model
最早可用时间 2005 2012 2015 2022 (formerly known as PageProperties )
活跃安装数 1000[3] 100[4][5][6] 100[7] n/a (new extension or unknown)
社群 超过190位开发者[8] 超过172位开发者[9] 超过63位开发者[10] (main developer)
存储 MediaWiki数据库、Elasticsearch、5个不同的SPARQL存储[11] MediaWiki数据库、Elasticsearch、SPARQL存储(Blazegraph用于wikidata.org) MediaWiki数据库(或者单独的数据库)[12] MediaWiki database
属性定义 通过输入维基文本。 属性可以自由产生。 这些属性默认为数据类型页面并且可以稍后定义。 Datatypes can be changed any time. 使用属性之前需要先定义,不能随意改变。[13] 不使用属性,数据表是使用每个表的预定义好(但可以重新配置)的字段集合定义的。 Properties are defined through one or more json-schema defined through a SchemaBuilder
值声明 行内([[MyProperty::MyValue]])或使用模板。 带有Page Forms 的基于表格的数据项。 Wikibase默认为类似于表格的输入界面。 使用模板中的解析器函数 带有Page Forms 的基于表格的数据项。 Inline or popup OOUI forms automatically generated from JSON-schemas
预定义的数据类型 18[14] 17[15][16] 18 4 (basic JSON-schema types) + 15 string formats
属性管理 类型定义、约束模式、本体导入 自定义或导入维基数据本体 不使用属性,数据表是使用每个表的预定义好(但可以重新配置)的字段集合定义的。 through a graphical interface (dedicated SchemaBuilder )
Page names and internal linking Pages have normal names and can be linked to with their names. Page names are stored with their Q-numbers (displaying labels in available languages). Internal linking must be done to the Q-number; you cannot link to a label. Pages have normal names and can be linked to with their names. Schemas are stored in a dedicated namespace and JSON-data in a dedicated slot associated to wiki articles. JSON-data can be accessed through an extension of the wiki interface
行内查询 有,有解析器函数 无(外部SPARQL查询); 计划中
由第三方扩展LinkedWiki 支持
有,使用解析器函数 yes, with parser functions
外部查询 是的,使用API或SPARQL查询(可通过特殊扩展获得,例如RDFIOLinkedWiki 有,带有SPARQL查询服务 有,使用API yes, with an API[17]
结果格式[18] ~ 75[19] 无原生的结果显示;数据可以通过以下方式可视化:

查询服务或外部工具 通过Lua在wiki上访问数据(不提供查询)

约25[20] 12+ (Json, Table, Datatable, Template, Calendar, Carousel, Map, pageid, pagetitle, count, raw, Lua ) [21]
开发 GitHub Gerrit Gerrit Gerrit
补充扩展 ~ 40[22], e.g. Semantic Result Formats , Semantic Bundle , Semantic Scribunto ~12[23], e.g. Wikibase Client , WikibaseLexeme , Query Service 2 (Page Forms, Page Schemas). Cargo provides some or all of the functionality of Semantic MediaWiki, Semantic Result Formats, Maps, Semantic Drilldown, Semantic Compound Queries, Semantic Internal Objects and Semantic Scribunto.[24] Extension:ContactManager

可选比较


参考资料

参阅