Manual:MediaWiki 中的数据管理
Appearance
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查询(可通过特殊扩展获得,例如RDFIO和LinkedWiki) | 有,带有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 |
可选比较
参考资料
- ↑ 参见 Wikimedia Maps
- ↑ https://www.semantic-mediawiki.org/wiki/Help:Reference_and_provenance_data
- ↑ https://wikiapiary.com/wiki/Extension:Semantic_MediaWiki
- ↑ https://wikiapiary.com/wiki/Extension:WikibaseRepository
- ↑ https://wikibase.world
- ↑ https://addshore.com/2024/10/visualizing-wikibase-connections-using-wikibase-world/
- ↑ https://wikiapiary.com/wiki/Extension:Cargo
- ↑ https://www.openhub.net/p/smw
- ↑ https://github.com/wikimedia/mediawiki-extensions-Wikibase
- ↑ https://github.com/wikimedia/mediawiki-extensions-Cargo
- ↑ https://www.semantic-mediawiki.org/wiki/Help:SPARQLStore
- ↑ 扩展:Cargo/下载与安装
- ↑ d:Help:Data type#Changing datatype
- ↑ https://www.semantic-mediawiki.org/wiki/Help:List_of_datatypes
- ↑ d:Special:ListDatatypes
- ↑ Some datatypes are defined by other extension: Math and Score both define one datatype, JsonConfig defines two, WikibaseLexeme defines three, and Wikibase defines ten.
- ↑ Extension:VisualData/API
- ↑ “结果格式”指的是wiki以多种格式(例如表、日历、地图、时间线等)显示数据(行内查询结果)的能力
- ↑ https://www.semantic-mediawiki.org/wiki/Help:Result_formats
- ↑ Extension:Cargo/Display formats
- ↑ Extension:VisualData/Result_formats
- ↑ 分类:Semantic MediaWiki扩展
- ↑ Category:Wikibase扩展
- ↑ Extension:Cargo/Cargo and Semantic MediaWiki.
参阅
- Multi-Content Revisions – 通过对MediaWiki后端的技术更改,能够在同一wiki页面上管理不同的独立内容对象。
- WikiDB – 提供資料庫功能,有點類似於語義屬性。
- JsonConfig – 在wiki页面中存储JSON(包括表格和地图数据),并允许通过Lua访问数据,没有查询支持
- External Data – 从外部URL、本地文件、SQL或MongoDB数据库(可能包含非MediaWiki网站的数据)访问数据
- Structured data across Wikimedia – 2021-2023 project for improving structured data support in MediaWiki
- Category:Data management extensions